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.
 
 
 

87627 lines
3.4 MiB

  1. // Package compute provides access to the Compute Engine API.
  2. //
  3. // See https://developers.google.com/compute/docs/reference/latest/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/compute/v1"
  8. // ...
  9. // computeService, err := compute.New(oauthHttpClient)
  10. package compute // import "google.golang.org/api/compute/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "compute:v1"
  41. const apiName = "compute"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/compute/v1/projects/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View and manage your Google Compute Engine resources
  49. ComputeScope = "https://www.googleapis.com/auth/compute"
  50. // View your Google Compute Engine resources
  51. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  52. // Manage your data and permissions in Google Cloud Storage
  53. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  54. // View your data in Google Cloud Storage
  55. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  56. // Manage your data in Google Cloud Storage
  57. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  58. )
  59. func New(client *http.Client) (*Service, error) {
  60. if client == nil {
  61. return nil, errors.New("client is nil")
  62. }
  63. s := &Service{client: client, BasePath: basePath}
  64. s.AcceleratorTypes = NewAcceleratorTypesService(s)
  65. s.Addresses = NewAddressesService(s)
  66. s.Autoscalers = NewAutoscalersService(s)
  67. s.BackendBuckets = NewBackendBucketsService(s)
  68. s.BackendServices = NewBackendServicesService(s)
  69. s.DiskTypes = NewDiskTypesService(s)
  70. s.Disks = NewDisksService(s)
  71. s.Firewalls = NewFirewallsService(s)
  72. s.ForwardingRules = NewForwardingRulesService(s)
  73. s.GlobalAddresses = NewGlobalAddressesService(s)
  74. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  75. s.GlobalOperations = NewGlobalOperationsService(s)
  76. s.HealthChecks = NewHealthChecksService(s)
  77. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  78. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  79. s.Images = NewImagesService(s)
  80. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  81. s.InstanceGroups = NewInstanceGroupsService(s)
  82. s.InstanceTemplates = NewInstanceTemplatesService(s)
  83. s.Instances = NewInstancesService(s)
  84. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  85. s.InterconnectLocations = NewInterconnectLocationsService(s)
  86. s.Interconnects = NewInterconnectsService(s)
  87. s.LicenseCodes = NewLicenseCodesService(s)
  88. s.Licenses = NewLicensesService(s)
  89. s.MachineTypes = NewMachineTypesService(s)
  90. s.Networks = NewNetworksService(s)
  91. s.Projects = NewProjectsService(s)
  92. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  93. s.RegionBackendServices = NewRegionBackendServicesService(s)
  94. s.RegionCommitments = NewRegionCommitmentsService(s)
  95. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  96. s.RegionDisks = NewRegionDisksService(s)
  97. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  98. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  99. s.RegionOperations = NewRegionOperationsService(s)
  100. s.Regions = NewRegionsService(s)
  101. s.Routers = NewRoutersService(s)
  102. s.Routes = NewRoutesService(s)
  103. s.Snapshots = NewSnapshotsService(s)
  104. s.SslCertificates = NewSslCertificatesService(s)
  105. s.SslPolicies = NewSslPoliciesService(s)
  106. s.Subnetworks = NewSubnetworksService(s)
  107. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  108. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  109. s.TargetInstances = NewTargetInstancesService(s)
  110. s.TargetPools = NewTargetPoolsService(s)
  111. s.TargetSslProxies = NewTargetSslProxiesService(s)
  112. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  113. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  114. s.UrlMaps = NewUrlMapsService(s)
  115. s.VpnTunnels = NewVpnTunnelsService(s)
  116. s.ZoneOperations = NewZoneOperationsService(s)
  117. s.Zones = NewZonesService(s)
  118. return s, nil
  119. }
  120. type Service struct {
  121. client *http.Client
  122. BasePath string // API endpoint base URL
  123. UserAgent string // optional additional User-Agent fragment
  124. AcceleratorTypes *AcceleratorTypesService
  125. Addresses *AddressesService
  126. Autoscalers *AutoscalersService
  127. BackendBuckets *BackendBucketsService
  128. BackendServices *BackendServicesService
  129. DiskTypes *DiskTypesService
  130. Disks *DisksService
  131. Firewalls *FirewallsService
  132. ForwardingRules *ForwardingRulesService
  133. GlobalAddresses *GlobalAddressesService
  134. GlobalForwardingRules *GlobalForwardingRulesService
  135. GlobalOperations *GlobalOperationsService
  136. HealthChecks *HealthChecksService
  137. HttpHealthChecks *HttpHealthChecksService
  138. HttpsHealthChecks *HttpsHealthChecksService
  139. Images *ImagesService
  140. InstanceGroupManagers *InstanceGroupManagersService
  141. InstanceGroups *InstanceGroupsService
  142. InstanceTemplates *InstanceTemplatesService
  143. Instances *InstancesService
  144. InterconnectAttachments *InterconnectAttachmentsService
  145. InterconnectLocations *InterconnectLocationsService
  146. Interconnects *InterconnectsService
  147. LicenseCodes *LicenseCodesService
  148. Licenses *LicensesService
  149. MachineTypes *MachineTypesService
  150. Networks *NetworksService
  151. Projects *ProjectsService
  152. RegionAutoscalers *RegionAutoscalersService
  153. RegionBackendServices *RegionBackendServicesService
  154. RegionCommitments *RegionCommitmentsService
  155. RegionDiskTypes *RegionDiskTypesService
  156. RegionDisks *RegionDisksService
  157. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  158. RegionInstanceGroups *RegionInstanceGroupsService
  159. RegionOperations *RegionOperationsService
  160. Regions *RegionsService
  161. Routers *RoutersService
  162. Routes *RoutesService
  163. Snapshots *SnapshotsService
  164. SslCertificates *SslCertificatesService
  165. SslPolicies *SslPoliciesService
  166. Subnetworks *SubnetworksService
  167. TargetHttpProxies *TargetHttpProxiesService
  168. TargetHttpsProxies *TargetHttpsProxiesService
  169. TargetInstances *TargetInstancesService
  170. TargetPools *TargetPoolsService
  171. TargetSslProxies *TargetSslProxiesService
  172. TargetTcpProxies *TargetTcpProxiesService
  173. TargetVpnGateways *TargetVpnGatewaysService
  174. UrlMaps *UrlMapsService
  175. VpnTunnels *VpnTunnelsService
  176. ZoneOperations *ZoneOperationsService
  177. Zones *ZonesService
  178. }
  179. func (s *Service) userAgent() string {
  180. if s.UserAgent == "" {
  181. return googleapi.UserAgent
  182. }
  183. return googleapi.UserAgent + " " + s.UserAgent
  184. }
  185. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  186. rs := &AcceleratorTypesService{s: s}
  187. return rs
  188. }
  189. type AcceleratorTypesService struct {
  190. s *Service
  191. }
  192. func NewAddressesService(s *Service) *AddressesService {
  193. rs := &AddressesService{s: s}
  194. return rs
  195. }
  196. type AddressesService struct {
  197. s *Service
  198. }
  199. func NewAutoscalersService(s *Service) *AutoscalersService {
  200. rs := &AutoscalersService{s: s}
  201. return rs
  202. }
  203. type AutoscalersService struct {
  204. s *Service
  205. }
  206. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  207. rs := &BackendBucketsService{s: s}
  208. return rs
  209. }
  210. type BackendBucketsService struct {
  211. s *Service
  212. }
  213. func NewBackendServicesService(s *Service) *BackendServicesService {
  214. rs := &BackendServicesService{s: s}
  215. return rs
  216. }
  217. type BackendServicesService struct {
  218. s *Service
  219. }
  220. func NewDiskTypesService(s *Service) *DiskTypesService {
  221. rs := &DiskTypesService{s: s}
  222. return rs
  223. }
  224. type DiskTypesService struct {
  225. s *Service
  226. }
  227. func NewDisksService(s *Service) *DisksService {
  228. rs := &DisksService{s: s}
  229. return rs
  230. }
  231. type DisksService struct {
  232. s *Service
  233. }
  234. func NewFirewallsService(s *Service) *FirewallsService {
  235. rs := &FirewallsService{s: s}
  236. return rs
  237. }
  238. type FirewallsService struct {
  239. s *Service
  240. }
  241. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  242. rs := &ForwardingRulesService{s: s}
  243. return rs
  244. }
  245. type ForwardingRulesService struct {
  246. s *Service
  247. }
  248. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  249. rs := &GlobalAddressesService{s: s}
  250. return rs
  251. }
  252. type GlobalAddressesService struct {
  253. s *Service
  254. }
  255. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  256. rs := &GlobalForwardingRulesService{s: s}
  257. return rs
  258. }
  259. type GlobalForwardingRulesService struct {
  260. s *Service
  261. }
  262. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  263. rs := &GlobalOperationsService{s: s}
  264. return rs
  265. }
  266. type GlobalOperationsService struct {
  267. s *Service
  268. }
  269. func NewHealthChecksService(s *Service) *HealthChecksService {
  270. rs := &HealthChecksService{s: s}
  271. return rs
  272. }
  273. type HealthChecksService struct {
  274. s *Service
  275. }
  276. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  277. rs := &HttpHealthChecksService{s: s}
  278. return rs
  279. }
  280. type HttpHealthChecksService struct {
  281. s *Service
  282. }
  283. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  284. rs := &HttpsHealthChecksService{s: s}
  285. return rs
  286. }
  287. type HttpsHealthChecksService struct {
  288. s *Service
  289. }
  290. func NewImagesService(s *Service) *ImagesService {
  291. rs := &ImagesService{s: s}
  292. return rs
  293. }
  294. type ImagesService struct {
  295. s *Service
  296. }
  297. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  298. rs := &InstanceGroupManagersService{s: s}
  299. return rs
  300. }
  301. type InstanceGroupManagersService struct {
  302. s *Service
  303. }
  304. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  305. rs := &InstanceGroupsService{s: s}
  306. return rs
  307. }
  308. type InstanceGroupsService struct {
  309. s *Service
  310. }
  311. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  312. rs := &InstanceTemplatesService{s: s}
  313. return rs
  314. }
  315. type InstanceTemplatesService struct {
  316. s *Service
  317. }
  318. func NewInstancesService(s *Service) *InstancesService {
  319. rs := &InstancesService{s: s}
  320. return rs
  321. }
  322. type InstancesService struct {
  323. s *Service
  324. }
  325. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  326. rs := &InterconnectAttachmentsService{s: s}
  327. return rs
  328. }
  329. type InterconnectAttachmentsService struct {
  330. s *Service
  331. }
  332. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  333. rs := &InterconnectLocationsService{s: s}
  334. return rs
  335. }
  336. type InterconnectLocationsService struct {
  337. s *Service
  338. }
  339. func NewInterconnectsService(s *Service) *InterconnectsService {
  340. rs := &InterconnectsService{s: s}
  341. return rs
  342. }
  343. type InterconnectsService struct {
  344. s *Service
  345. }
  346. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  347. rs := &LicenseCodesService{s: s}
  348. return rs
  349. }
  350. type LicenseCodesService struct {
  351. s *Service
  352. }
  353. func NewLicensesService(s *Service) *LicensesService {
  354. rs := &LicensesService{s: s}
  355. return rs
  356. }
  357. type LicensesService struct {
  358. s *Service
  359. }
  360. func NewMachineTypesService(s *Service) *MachineTypesService {
  361. rs := &MachineTypesService{s: s}
  362. return rs
  363. }
  364. type MachineTypesService struct {
  365. s *Service
  366. }
  367. func NewNetworksService(s *Service) *NetworksService {
  368. rs := &NetworksService{s: s}
  369. return rs
  370. }
  371. type NetworksService struct {
  372. s *Service
  373. }
  374. func NewProjectsService(s *Service) *ProjectsService {
  375. rs := &ProjectsService{s: s}
  376. return rs
  377. }
  378. type ProjectsService struct {
  379. s *Service
  380. }
  381. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  382. rs := &RegionAutoscalersService{s: s}
  383. return rs
  384. }
  385. type RegionAutoscalersService struct {
  386. s *Service
  387. }
  388. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  389. rs := &RegionBackendServicesService{s: s}
  390. return rs
  391. }
  392. type RegionBackendServicesService struct {
  393. s *Service
  394. }
  395. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  396. rs := &RegionCommitmentsService{s: s}
  397. return rs
  398. }
  399. type RegionCommitmentsService struct {
  400. s *Service
  401. }
  402. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  403. rs := &RegionDiskTypesService{s: s}
  404. return rs
  405. }
  406. type RegionDiskTypesService struct {
  407. s *Service
  408. }
  409. func NewRegionDisksService(s *Service) *RegionDisksService {
  410. rs := &RegionDisksService{s: s}
  411. return rs
  412. }
  413. type RegionDisksService struct {
  414. s *Service
  415. }
  416. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  417. rs := &RegionInstanceGroupManagersService{s: s}
  418. return rs
  419. }
  420. type RegionInstanceGroupManagersService struct {
  421. s *Service
  422. }
  423. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  424. rs := &RegionInstanceGroupsService{s: s}
  425. return rs
  426. }
  427. type RegionInstanceGroupsService struct {
  428. s *Service
  429. }
  430. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  431. rs := &RegionOperationsService{s: s}
  432. return rs
  433. }
  434. type RegionOperationsService struct {
  435. s *Service
  436. }
  437. func NewRegionsService(s *Service) *RegionsService {
  438. rs := &RegionsService{s: s}
  439. return rs
  440. }
  441. type RegionsService struct {
  442. s *Service
  443. }
  444. func NewRoutersService(s *Service) *RoutersService {
  445. rs := &RoutersService{s: s}
  446. return rs
  447. }
  448. type RoutersService struct {
  449. s *Service
  450. }
  451. func NewRoutesService(s *Service) *RoutesService {
  452. rs := &RoutesService{s: s}
  453. return rs
  454. }
  455. type RoutesService struct {
  456. s *Service
  457. }
  458. func NewSnapshotsService(s *Service) *SnapshotsService {
  459. rs := &SnapshotsService{s: s}
  460. return rs
  461. }
  462. type SnapshotsService struct {
  463. s *Service
  464. }
  465. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  466. rs := &SslCertificatesService{s: s}
  467. return rs
  468. }
  469. type SslCertificatesService struct {
  470. s *Service
  471. }
  472. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  473. rs := &SslPoliciesService{s: s}
  474. return rs
  475. }
  476. type SslPoliciesService struct {
  477. s *Service
  478. }
  479. func NewSubnetworksService(s *Service) *SubnetworksService {
  480. rs := &SubnetworksService{s: s}
  481. return rs
  482. }
  483. type SubnetworksService struct {
  484. s *Service
  485. }
  486. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  487. rs := &TargetHttpProxiesService{s: s}
  488. return rs
  489. }
  490. type TargetHttpProxiesService struct {
  491. s *Service
  492. }
  493. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  494. rs := &TargetHttpsProxiesService{s: s}
  495. return rs
  496. }
  497. type TargetHttpsProxiesService struct {
  498. s *Service
  499. }
  500. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  501. rs := &TargetInstancesService{s: s}
  502. return rs
  503. }
  504. type TargetInstancesService struct {
  505. s *Service
  506. }
  507. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  508. rs := &TargetPoolsService{s: s}
  509. return rs
  510. }
  511. type TargetPoolsService struct {
  512. s *Service
  513. }
  514. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  515. rs := &TargetSslProxiesService{s: s}
  516. return rs
  517. }
  518. type TargetSslProxiesService struct {
  519. s *Service
  520. }
  521. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  522. rs := &TargetTcpProxiesService{s: s}
  523. return rs
  524. }
  525. type TargetTcpProxiesService struct {
  526. s *Service
  527. }
  528. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  529. rs := &TargetVpnGatewaysService{s: s}
  530. return rs
  531. }
  532. type TargetVpnGatewaysService struct {
  533. s *Service
  534. }
  535. func NewUrlMapsService(s *Service) *UrlMapsService {
  536. rs := &UrlMapsService{s: s}
  537. return rs
  538. }
  539. type UrlMapsService struct {
  540. s *Service
  541. }
  542. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  543. rs := &VpnTunnelsService{s: s}
  544. return rs
  545. }
  546. type VpnTunnelsService struct {
  547. s *Service
  548. }
  549. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  550. rs := &ZoneOperationsService{s: s}
  551. return rs
  552. }
  553. type ZoneOperationsService struct {
  554. s *Service
  555. }
  556. func NewZonesService(s *Service) *ZonesService {
  557. rs := &ZonesService{s: s}
  558. return rs
  559. }
  560. type ZonesService struct {
  561. s *Service
  562. }
  563. // AcceleratorConfig: A specification of the type and number of
  564. // accelerator cards attached to the instance.
  565. type AcceleratorConfig struct {
  566. // AcceleratorCount: The number of the guest accelerator cards exposed
  567. // to this instance.
  568. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  569. // AcceleratorType: Full or partial URL of the accelerator type resource
  570. // to attach to this instance. If you are creating an instance template,
  571. // specify only the accelerator name.
  572. AcceleratorType string `json:"acceleratorType,omitempty"`
  573. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  574. // unconditionally include in API requests. By default, fields with
  575. // empty values are omitted from API requests. However, any non-pointer,
  576. // non-interface field appearing in ForceSendFields will be sent to the
  577. // server regardless of whether the field is empty or not. This may be
  578. // used to include empty fields in Patch requests.
  579. ForceSendFields []string `json:"-"`
  580. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  581. // include in API requests with the JSON null value. By default, fields
  582. // with empty values are omitted from API requests. However, any field
  583. // with an empty value appearing in NullFields will be sent to the
  584. // server as null. It is an error if a field in this list has a
  585. // non-empty value. This may be used to include null fields in Patch
  586. // requests.
  587. NullFields []string `json:"-"`
  588. }
  589. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  590. type NoMethod AcceleratorConfig
  591. raw := NoMethod(*s)
  592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  593. }
  594. // AcceleratorType: An Accelerator Type resource. (== resource_for
  595. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  596. type AcceleratorType struct {
  597. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  598. // format.
  599. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  600. // Deprecated: [Output Only] The deprecation status associated with this
  601. // accelerator type.
  602. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  603. // Description: [Output Only] An optional textual description of the
  604. // resource.
  605. Description string `json:"description,omitempty"`
  606. // Id: [Output Only] The unique identifier for the resource. This
  607. // identifier is defined by the server.
  608. Id uint64 `json:"id,omitempty,string"`
  609. // Kind: [Output Only] The type of the resource. Always
  610. // compute#acceleratorType for accelerator types.
  611. Kind string `json:"kind,omitempty"`
  612. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  613. // allowed per instance.
  614. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  615. // Name: [Output Only] Name of the resource.
  616. Name string `json:"name,omitempty"`
  617. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  618. // resource.
  619. SelfLink string `json:"selfLink,omitempty"`
  620. // Zone: [Output Only] The name of the zone where the accelerator type
  621. // resides, such as us-central1-a. You must specify this field as part
  622. // of the HTTP request URL. It is not settable as a field in the request
  623. // body.
  624. Zone string `json:"zone,omitempty"`
  625. // ServerResponse contains the HTTP response code and headers from the
  626. // server.
  627. googleapi.ServerResponse `json:"-"`
  628. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  629. // to unconditionally include in API requests. By default, fields with
  630. // empty values are omitted from API requests. However, any non-pointer,
  631. // non-interface field appearing in ForceSendFields will be sent to the
  632. // server regardless of whether the field is empty or not. This may be
  633. // used to include empty fields in Patch requests.
  634. ForceSendFields []string `json:"-"`
  635. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  636. // include in API requests with the JSON null value. By default, fields
  637. // with empty values are omitted from API requests. However, any field
  638. // with an empty value appearing in NullFields will be sent to the
  639. // server as null. It is an error if a field in this list has a
  640. // non-empty value. This may be used to include null fields in Patch
  641. // requests.
  642. NullFields []string `json:"-"`
  643. }
  644. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  645. type NoMethod AcceleratorType
  646. raw := NoMethod(*s)
  647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  648. }
  649. type AcceleratorTypeAggregatedList struct {
  650. // Id: [Output Only] Unique identifier for the resource; defined by the
  651. // server.
  652. Id string `json:"id,omitempty"`
  653. // Items: A list of AcceleratorTypesScopedList resources.
  654. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  655. // Kind: [Output Only] Type of resource. Always
  656. // compute#acceleratorTypeAggregatedList for aggregated lists of
  657. // accelerator types.
  658. Kind string `json:"kind,omitempty"`
  659. // NextPageToken: [Output Only] This token allows you to get the next
  660. // page of results for list requests. If the number of results is larger
  661. // than maxResults, use the nextPageToken as a value for the query
  662. // parameter pageToken in the next list request. Subsequent list
  663. // requests will have their own nextPageToken to continue paging through
  664. // the results.
  665. NextPageToken string `json:"nextPageToken,omitempty"`
  666. // SelfLink: [Output Only] Server-defined URL for this resource.
  667. SelfLink string `json:"selfLink,omitempty"`
  668. // Warning: [Output Only] Informational warning message.
  669. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  670. // ServerResponse contains the HTTP response code and headers from the
  671. // server.
  672. googleapi.ServerResponse `json:"-"`
  673. // ForceSendFields is a list of field names (e.g. "Id") to
  674. // unconditionally include in API requests. By default, fields with
  675. // empty values are omitted from API requests. However, any non-pointer,
  676. // non-interface field appearing in ForceSendFields will be sent to the
  677. // server regardless of whether the field is empty or not. This may be
  678. // used to include empty fields in Patch requests.
  679. ForceSendFields []string `json:"-"`
  680. // NullFields is a list of field names (e.g. "Id") to include in API
  681. // requests with the JSON null value. By default, fields with empty
  682. // values are omitted from API requests. However, any field with an
  683. // empty value appearing in NullFields will be sent to the server as
  684. // null. It is an error if a field in this list has a non-empty value.
  685. // This may be used to include null fields in Patch requests.
  686. NullFields []string `json:"-"`
  687. }
  688. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  689. type NoMethod AcceleratorTypeAggregatedList
  690. raw := NoMethod(*s)
  691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  692. }
  693. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  694. // warning message.
  695. type AcceleratorTypeAggregatedListWarning struct {
  696. // Code: [Output Only] A warning code, if applicable. For example,
  697. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  698. // the response.
  699. //
  700. // Possible values:
  701. // "CLEANUP_FAILED"
  702. // "DEPRECATED_RESOURCE_USED"
  703. // "DEPRECATED_TYPE_USED"
  704. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  705. // "EXPERIMENTAL_TYPE_USED"
  706. // "EXTERNAL_API_WARNING"
  707. // "FIELD_VALUE_OVERRIDEN"
  708. // "INJECTED_KERNELS_DEPRECATED"
  709. // "MISSING_TYPE_DEPENDENCY"
  710. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  711. // "NEXT_HOP_CANNOT_IP_FORWARD"
  712. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  713. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  714. // "NEXT_HOP_NOT_RUNNING"
  715. // "NOT_CRITICAL_ERROR"
  716. // "NO_RESULTS_ON_PAGE"
  717. // "REQUIRED_TOS_AGREEMENT"
  718. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  719. // "RESOURCE_NOT_DELETED"
  720. // "SCHEMA_VALIDATION_IGNORED"
  721. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  722. // "UNDECLARED_PROPERTIES"
  723. // "UNREACHABLE"
  724. Code string `json:"code,omitempty"`
  725. // Data: [Output Only] Metadata about this warning in key: value format.
  726. // For example:
  727. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  728. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  729. // Message: [Output Only] A human-readable description of the warning
  730. // code.
  731. Message string `json:"message,omitempty"`
  732. // ForceSendFields is a list of field names (e.g. "Code") to
  733. // unconditionally include in API requests. By default, fields with
  734. // empty values are omitted from API requests. However, any non-pointer,
  735. // non-interface field appearing in ForceSendFields will be sent to the
  736. // server regardless of whether the field is empty or not. This may be
  737. // used to include empty fields in Patch requests.
  738. ForceSendFields []string `json:"-"`
  739. // NullFields is a list of field names (e.g. "Code") to include in API
  740. // requests with the JSON null value. By default, fields with empty
  741. // values are omitted from API requests. However, any field with an
  742. // empty value appearing in NullFields will be sent to the server as
  743. // null. It is an error if a field in this list has a non-empty value.
  744. // This may be used to include null fields in Patch requests.
  745. NullFields []string `json:"-"`
  746. }
  747. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  748. type NoMethod AcceleratorTypeAggregatedListWarning
  749. raw := NoMethod(*s)
  750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  751. }
  752. type AcceleratorTypeAggregatedListWarningData struct {
  753. // Key: [Output Only] A key that provides more detail on the warning
  754. // being returned. For example, for warnings where there are no results
  755. // in a list request for a particular zone, this key might be scope and
  756. // the key value might be the zone name. Other examples might be a key
  757. // indicating a deprecated resource and a suggested replacement, or a
  758. // warning about invalid network settings (for example, if an instance
  759. // attempts to perform IP forwarding but is not enabled for IP
  760. // forwarding).
  761. Key string `json:"key,omitempty"`
  762. // Value: [Output Only] A warning data value corresponding to the key.
  763. Value string `json:"value,omitempty"`
  764. // ForceSendFields is a list of field names (e.g. "Key") to
  765. // unconditionally include in API requests. By default, fields with
  766. // empty values are omitted from API requests. However, any non-pointer,
  767. // non-interface field appearing in ForceSendFields will be sent to the
  768. // server regardless of whether the field is empty or not. This may be
  769. // used to include empty fields in Patch requests.
  770. ForceSendFields []string `json:"-"`
  771. // NullFields is a list of field names (e.g. "Key") to include in API
  772. // requests with the JSON null value. By default, fields with empty
  773. // values are omitted from API requests. However, any field with an
  774. // empty value appearing in NullFields will be sent to the server as
  775. // null. It is an error if a field in this list has a non-empty value.
  776. // This may be used to include null fields in Patch requests.
  777. NullFields []string `json:"-"`
  778. }
  779. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  780. type NoMethod AcceleratorTypeAggregatedListWarningData
  781. raw := NoMethod(*s)
  782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  783. }
  784. // AcceleratorTypeList: Contains a list of accelerator types.
  785. type AcceleratorTypeList struct {
  786. // Id: [Output Only] Unique identifier for the resource; defined by the
  787. // server.
  788. Id string `json:"id,omitempty"`
  789. // Items: A list of AcceleratorType resources.
  790. Items []*AcceleratorType `json:"items,omitempty"`
  791. // Kind: [Output Only] Type of resource. Always
  792. // compute#acceleratorTypeList for lists of accelerator types.
  793. Kind string `json:"kind,omitempty"`
  794. // NextPageToken: [Output Only] This token allows you to get the next
  795. // page of results for list requests. If the number of results is larger
  796. // than maxResults, use the nextPageToken as a value for the query
  797. // parameter pageToken in the next list request. Subsequent list
  798. // requests will have their own nextPageToken to continue paging through
  799. // the results.
  800. NextPageToken string `json:"nextPageToken,omitempty"`
  801. // SelfLink: [Output Only] Server-defined URL for this resource.
  802. SelfLink string `json:"selfLink,omitempty"`
  803. // Warning: [Output Only] Informational warning message.
  804. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  805. // ServerResponse contains the HTTP response code and headers from the
  806. // server.
  807. googleapi.ServerResponse `json:"-"`
  808. // ForceSendFields is a list of field names (e.g. "Id") to
  809. // unconditionally include in API requests. By default, fields with
  810. // empty values are omitted from API requests. However, any non-pointer,
  811. // non-interface field appearing in ForceSendFields will be sent to the
  812. // server regardless of whether the field is empty or not. This may be
  813. // used to include empty fields in Patch requests.
  814. ForceSendFields []string `json:"-"`
  815. // NullFields is a list of field names (e.g. "Id") to include in API
  816. // requests with the JSON null value. By default, fields with empty
  817. // values are omitted from API requests. However, any field with an
  818. // empty value appearing in NullFields will be sent to the server as
  819. // null. It is an error if a field in this list has a non-empty value.
  820. // This may be used to include null fields in Patch requests.
  821. NullFields []string `json:"-"`
  822. }
  823. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  824. type NoMethod AcceleratorTypeList
  825. raw := NoMethod(*s)
  826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  827. }
  828. // AcceleratorTypeListWarning: [Output Only] Informational warning
  829. // message.
  830. type AcceleratorTypeListWarning struct {
  831. // Code: [Output Only] A warning code, if applicable. For example,
  832. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  833. // the response.
  834. //
  835. // Possible values:
  836. // "CLEANUP_FAILED"
  837. // "DEPRECATED_RESOURCE_USED"
  838. // "DEPRECATED_TYPE_USED"
  839. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  840. // "EXPERIMENTAL_TYPE_USED"
  841. // "EXTERNAL_API_WARNING"
  842. // "FIELD_VALUE_OVERRIDEN"
  843. // "INJECTED_KERNELS_DEPRECATED"
  844. // "MISSING_TYPE_DEPENDENCY"
  845. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  846. // "NEXT_HOP_CANNOT_IP_FORWARD"
  847. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  848. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  849. // "NEXT_HOP_NOT_RUNNING"
  850. // "NOT_CRITICAL_ERROR"
  851. // "NO_RESULTS_ON_PAGE"
  852. // "REQUIRED_TOS_AGREEMENT"
  853. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  854. // "RESOURCE_NOT_DELETED"
  855. // "SCHEMA_VALIDATION_IGNORED"
  856. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  857. // "UNDECLARED_PROPERTIES"
  858. // "UNREACHABLE"
  859. Code string `json:"code,omitempty"`
  860. // Data: [Output Only] Metadata about this warning in key: value format.
  861. // For example:
  862. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  863. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  864. // Message: [Output Only] A human-readable description of the warning
  865. // code.
  866. Message string `json:"message,omitempty"`
  867. // ForceSendFields is a list of field names (e.g. "Code") to
  868. // unconditionally include in API requests. By default, fields with
  869. // empty values are omitted from API requests. However, any non-pointer,
  870. // non-interface field appearing in ForceSendFields will be sent to the
  871. // server regardless of whether the field is empty or not. This may be
  872. // used to include empty fields in Patch requests.
  873. ForceSendFields []string `json:"-"`
  874. // NullFields is a list of field names (e.g. "Code") to include in API
  875. // requests with the JSON null value. By default, fields with empty
  876. // values are omitted from API requests. However, any field with an
  877. // empty value appearing in NullFields will be sent to the server as
  878. // null. It is an error if a field in this list has a non-empty value.
  879. // This may be used to include null fields in Patch requests.
  880. NullFields []string `json:"-"`
  881. }
  882. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  883. type NoMethod AcceleratorTypeListWarning
  884. raw := NoMethod(*s)
  885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  886. }
  887. type AcceleratorTypeListWarningData struct {
  888. // Key: [Output Only] A key that provides more detail on the warning
  889. // being returned. For example, for warnings where there are no results
  890. // in a list request for a particular zone, this key might be scope and
  891. // the key value might be the zone name. Other examples might be a key
  892. // indicating a deprecated resource and a suggested replacement, or a
  893. // warning about invalid network settings (for example, if an instance
  894. // attempts to perform IP forwarding but is not enabled for IP
  895. // forwarding).
  896. Key string `json:"key,omitempty"`
  897. // Value: [Output Only] A warning data value corresponding to the key.
  898. Value string `json:"value,omitempty"`
  899. // ForceSendFields is a list of field names (e.g. "Key") to
  900. // unconditionally include in API requests. By default, fields with
  901. // empty values are omitted from API requests. However, any non-pointer,
  902. // non-interface field appearing in ForceSendFields will be sent to the
  903. // server regardless of whether the field is empty or not. This may be
  904. // used to include empty fields in Patch requests.
  905. ForceSendFields []string `json:"-"`
  906. // NullFields is a list of field names (e.g. "Key") to include in API
  907. // requests with the JSON null value. By default, fields with empty
  908. // values are omitted from API requests. However, any field with an
  909. // empty value appearing in NullFields will be sent to the server as
  910. // null. It is an error if a field in this list has a non-empty value.
  911. // This may be used to include null fields in Patch requests.
  912. NullFields []string `json:"-"`
  913. }
  914. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  915. type NoMethod AcceleratorTypeListWarningData
  916. raw := NoMethod(*s)
  917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  918. }
  919. type AcceleratorTypesScopedList struct {
  920. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  921. // in this scope.
  922. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  923. // Warning: [Output Only] An informational warning that appears when the
  924. // accelerator types list is empty.
  925. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  926. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  927. // unconditionally include in API requests. By default, fields with
  928. // empty values are omitted from API requests. However, any non-pointer,
  929. // non-interface field appearing in ForceSendFields will be sent to the
  930. // server regardless of whether the field is empty or not. This may be
  931. // used to include empty fields in Patch requests.
  932. ForceSendFields []string `json:"-"`
  933. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  934. // include in API requests with the JSON null value. By default, fields
  935. // with empty values are omitted from API requests. However, any field
  936. // with an empty value appearing in NullFields will be sent to the
  937. // server as null. It is an error if a field in this list has a
  938. // non-empty value. This may be used to include null fields in Patch
  939. // requests.
  940. NullFields []string `json:"-"`
  941. }
  942. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  943. type NoMethod AcceleratorTypesScopedList
  944. raw := NoMethod(*s)
  945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  946. }
  947. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  948. // warning that appears when the accelerator types list is empty.
  949. type AcceleratorTypesScopedListWarning struct {
  950. // Code: [Output Only] A warning code, if applicable. For example,
  951. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  952. // the response.
  953. //
  954. // Possible values:
  955. // "CLEANUP_FAILED"
  956. // "DEPRECATED_RESOURCE_USED"
  957. // "DEPRECATED_TYPE_USED"
  958. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  959. // "EXPERIMENTAL_TYPE_USED"
  960. // "EXTERNAL_API_WARNING"
  961. // "FIELD_VALUE_OVERRIDEN"
  962. // "INJECTED_KERNELS_DEPRECATED"
  963. // "MISSING_TYPE_DEPENDENCY"
  964. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  965. // "NEXT_HOP_CANNOT_IP_FORWARD"
  966. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  967. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  968. // "NEXT_HOP_NOT_RUNNING"
  969. // "NOT_CRITICAL_ERROR"
  970. // "NO_RESULTS_ON_PAGE"
  971. // "REQUIRED_TOS_AGREEMENT"
  972. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  973. // "RESOURCE_NOT_DELETED"
  974. // "SCHEMA_VALIDATION_IGNORED"
  975. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  976. // "UNDECLARED_PROPERTIES"
  977. // "UNREACHABLE"
  978. Code string `json:"code,omitempty"`
  979. // Data: [Output Only] Metadata about this warning in key: value format.
  980. // For example:
  981. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  982. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  983. // Message: [Output Only] A human-readable description of the warning
  984. // code.
  985. Message string `json:"message,omitempty"`
  986. // ForceSendFields is a list of field names (e.g. "Code") to
  987. // unconditionally include in API requests. By default, fields with
  988. // empty values are omitted from API requests. However, any non-pointer,
  989. // non-interface field appearing in ForceSendFields will be sent to the
  990. // server regardless of whether the field is empty or not. This may be
  991. // used to include empty fields in Patch requests.
  992. ForceSendFields []string `json:"-"`
  993. // NullFields is a list of field names (e.g. "Code") to include in API
  994. // requests with the JSON null value. By default, fields with empty
  995. // values are omitted from API requests. However, any field with an
  996. // empty value appearing in NullFields will be sent to the server as
  997. // null. It is an error if a field in this list has a non-empty value.
  998. // This may be used to include null fields in Patch requests.
  999. NullFields []string `json:"-"`
  1000. }
  1001. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1002. type NoMethod AcceleratorTypesScopedListWarning
  1003. raw := NoMethod(*s)
  1004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1005. }
  1006. type AcceleratorTypesScopedListWarningData struct {
  1007. // Key: [Output Only] A key that provides more detail on the warning
  1008. // being returned. For example, for warnings where there are no results
  1009. // in a list request for a particular zone, this key might be scope and
  1010. // the key value might be the zone name. Other examples might be a key
  1011. // indicating a deprecated resource and a suggested replacement, or a
  1012. // warning about invalid network settings (for example, if an instance
  1013. // attempts to perform IP forwarding but is not enabled for IP
  1014. // forwarding).
  1015. Key string `json:"key,omitempty"`
  1016. // Value: [Output Only] A warning data value corresponding to the key.
  1017. Value string `json:"value,omitempty"`
  1018. // ForceSendFields is a list of field names (e.g. "Key") to
  1019. // unconditionally include in API requests. By default, fields with
  1020. // empty values are omitted from API requests. However, any non-pointer,
  1021. // non-interface field appearing in ForceSendFields will be sent to the
  1022. // server regardless of whether the field is empty or not. This may be
  1023. // used to include empty fields in Patch requests.
  1024. ForceSendFields []string `json:"-"`
  1025. // NullFields is a list of field names (e.g. "Key") to include in API
  1026. // requests with the JSON null value. By default, fields with empty
  1027. // values are omitted from API requests. However, any field with an
  1028. // empty value appearing in NullFields will be sent to the server as
  1029. // null. It is an error if a field in this list has a non-empty value.
  1030. // This may be used to include null fields in Patch requests.
  1031. NullFields []string `json:"-"`
  1032. }
  1033. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1034. type NoMethod AcceleratorTypesScopedListWarningData
  1035. raw := NoMethod(*s)
  1036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1037. }
  1038. // AccessConfig: An access configuration attached to an instance's
  1039. // network interface. Only one access config per instance is supported.
  1040. type AccessConfig struct {
  1041. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1042. // for access configs.
  1043. Kind string `json:"kind,omitempty"`
  1044. // Name: The name of this access configuration. The default and
  1045. // recommended name is External NAT but you can use any arbitrary string
  1046. // you would like. For example, My external IP or Network Access.
  1047. Name string `json:"name,omitempty"`
  1048. // NatIP: An external IP address associated with this instance. Specify
  1049. // an unused static external IP address available to the project or
  1050. // leave this field undefined to use an IP from a shared ephemeral IP
  1051. // address pool. If you specify a static external IP address, it must
  1052. // live in the same region as the zone of the instance.
  1053. NatIP string `json:"natIP,omitempty"`
  1054. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1055. // This field can only be set when the set_public_ptr field is enabled.
  1056. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1057. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1058. // created to map the external IP address of the instance to a DNS
  1059. // domain name.
  1060. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1061. // Type: The type of configuration. The default and only option is
  1062. // ONE_TO_ONE_NAT.
  1063. //
  1064. // Possible values:
  1065. // "ONE_TO_ONE_NAT" (default)
  1066. Type string `json:"type,omitempty"`
  1067. // ForceSendFields is a list of field names (e.g. "Kind") to
  1068. // unconditionally include in API requests. By default, fields with
  1069. // empty values are omitted from API requests. However, any non-pointer,
  1070. // non-interface field appearing in ForceSendFields will be sent to the
  1071. // server regardless of whether the field is empty or not. This may be
  1072. // used to include empty fields in Patch requests.
  1073. ForceSendFields []string `json:"-"`
  1074. // NullFields is a list of field names (e.g. "Kind") to include in API
  1075. // requests with the JSON null value. By default, fields with empty
  1076. // values are omitted from API requests. However, any field with an
  1077. // empty value appearing in NullFields will be sent to the server as
  1078. // null. It is an error if a field in this list has a non-empty value.
  1079. // This may be used to include null fields in Patch requests.
  1080. NullFields []string `json:"-"`
  1081. }
  1082. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1083. type NoMethod AccessConfig
  1084. raw := NoMethod(*s)
  1085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1086. }
  1087. // Address: A reserved address resource. (== resource_for beta.addresses
  1088. // ==) (== resource_for v1.addresses ==) (== resource_for
  1089. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1090. type Address struct {
  1091. // Address: The static IP address represented by this resource.
  1092. Address string `json:"address,omitempty"`
  1093. // AddressType: The type of address to reserve, either INTERNAL or
  1094. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1095. //
  1096. // Possible values:
  1097. // "EXTERNAL"
  1098. // "INTERNAL"
  1099. // "UNSPECIFIED_TYPE"
  1100. AddressType string `json:"addressType,omitempty"`
  1101. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1102. // format.
  1103. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1104. // Description: An optional description of this resource. Provide this
  1105. // property when you create the resource.
  1106. Description string `json:"description,omitempty"`
  1107. // Id: [Output Only] The unique identifier for the resource. This
  1108. // identifier is defined by the server.
  1109. Id uint64 `json:"id,omitempty,string"`
  1110. // IpVersion: The IP Version that will be used by this address. Valid
  1111. // options are IPV4 or IPV6. This can only be specified for a global
  1112. // address.
  1113. //
  1114. // Possible values:
  1115. // "IPV4"
  1116. // "IPV6"
  1117. // "UNSPECIFIED_VERSION"
  1118. IpVersion string `json:"ipVersion,omitempty"`
  1119. // Kind: [Output Only] Type of the resource. Always compute#address for
  1120. // addresses.
  1121. Kind string `json:"kind,omitempty"`
  1122. // Name: Name of the resource. Provided by the client when the resource
  1123. // is created. The name must be 1-63 characters long, and comply with
  1124. // RFC1035. Specifically, the name must be 1-63 characters long and
  1125. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1126. // the first character must be a lowercase letter, and all following
  1127. // characters must be a dash, lowercase letter, or digit, except the
  1128. // last character, which cannot be a dash.
  1129. Name string `json:"name,omitempty"`
  1130. // Region: [Output Only] URL of the region where the regional address
  1131. // resides. This field is not applicable to global addresses. You must
  1132. // specify this field as part of the HTTP request URL. You cannot set
  1133. // this field in the request body.
  1134. Region string `json:"region,omitempty"`
  1135. // SelfLink: [Output Only] Server-defined URL for the resource.
  1136. SelfLink string `json:"selfLink,omitempty"`
  1137. // Status: [Output Only] The status of the address, which can be one of
  1138. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1139. // currently in the process of being reserved. A RESERVED address is
  1140. // currently reserved and available to use. An IN_USE address is
  1141. // currently being used by another resource and is not available.
  1142. //
  1143. // Possible values:
  1144. // "IN_USE"
  1145. // "RESERVED"
  1146. // "RESERVING"
  1147. Status string `json:"status,omitempty"`
  1148. // Subnetwork: The URL of the subnetwork in which to reserve the
  1149. // address. If an IP address is specified, it must be within the
  1150. // subnetwork's IP range. This field can only be used with INTERNAL type
  1151. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1152. Subnetwork string `json:"subnetwork,omitempty"`
  1153. // Users: [Output Only] The URLs of the resources that are using this
  1154. // address.
  1155. Users []string `json:"users,omitempty"`
  1156. // ServerResponse contains the HTTP response code and headers from the
  1157. // server.
  1158. googleapi.ServerResponse `json:"-"`
  1159. // ForceSendFields is a list of field names (e.g. "Address") to
  1160. // unconditionally include in API requests. By default, fields with
  1161. // empty values are omitted from API requests. However, any non-pointer,
  1162. // non-interface field appearing in ForceSendFields will be sent to the
  1163. // server regardless of whether the field is empty or not. This may be
  1164. // used to include empty fields in Patch requests.
  1165. ForceSendFields []string `json:"-"`
  1166. // NullFields is a list of field names (e.g. "Address") to include in
  1167. // API requests with the JSON null value. By default, fields with empty
  1168. // values are omitted from API requests. However, any field with an
  1169. // empty value appearing in NullFields will be sent to the server as
  1170. // null. It is an error if a field in this list has a non-empty value.
  1171. // This may be used to include null fields in Patch requests.
  1172. NullFields []string `json:"-"`
  1173. }
  1174. func (s *Address) MarshalJSON() ([]byte, error) {
  1175. type NoMethod Address
  1176. raw := NoMethod(*s)
  1177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1178. }
  1179. type AddressAggregatedList struct {
  1180. // Id: [Output Only] Unique identifier for the resource; defined by the
  1181. // server.
  1182. Id string `json:"id,omitempty"`
  1183. // Items: A list of AddressesScopedList resources.
  1184. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1185. // Kind: [Output Only] Type of resource. Always
  1186. // compute#addressAggregatedList for aggregated lists of addresses.
  1187. Kind string `json:"kind,omitempty"`
  1188. // NextPageToken: [Output Only] This token allows you to get the next
  1189. // page of results for list requests. If the number of results is larger
  1190. // than maxResults, use the nextPageToken as a value for the query
  1191. // parameter pageToken in the next list request. Subsequent list
  1192. // requests will have their own nextPageToken to continue paging through
  1193. // the results.
  1194. NextPageToken string `json:"nextPageToken,omitempty"`
  1195. // SelfLink: [Output Only] Server-defined URL for this resource.
  1196. SelfLink string `json:"selfLink,omitempty"`
  1197. // Warning: [Output Only] Informational warning message.
  1198. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1199. // ServerResponse contains the HTTP response code and headers from the
  1200. // server.
  1201. googleapi.ServerResponse `json:"-"`
  1202. // ForceSendFields is a list of field names (e.g. "Id") to
  1203. // unconditionally include in API requests. By default, fields with
  1204. // empty values are omitted from API requests. However, any non-pointer,
  1205. // non-interface field appearing in ForceSendFields will be sent to the
  1206. // server regardless of whether the field is empty or not. This may be
  1207. // used to include empty fields in Patch requests.
  1208. ForceSendFields []string `json:"-"`
  1209. // NullFields is a list of field names (e.g. "Id") to include in API
  1210. // requests with the JSON null value. By default, fields with empty
  1211. // values are omitted from API requests. However, any field with an
  1212. // empty value appearing in NullFields will be sent to the server as
  1213. // null. It is an error if a field in this list has a non-empty value.
  1214. // This may be used to include null fields in Patch requests.
  1215. NullFields []string `json:"-"`
  1216. }
  1217. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1218. type NoMethod AddressAggregatedList
  1219. raw := NoMethod(*s)
  1220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1221. }
  1222. // AddressAggregatedListWarning: [Output Only] Informational warning
  1223. // message.
  1224. type AddressAggregatedListWarning struct {
  1225. // Code: [Output Only] A warning code, if applicable. For example,
  1226. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1227. // the response.
  1228. //
  1229. // Possible values:
  1230. // "CLEANUP_FAILED"
  1231. // "DEPRECATED_RESOURCE_USED"
  1232. // "DEPRECATED_TYPE_USED"
  1233. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1234. // "EXPERIMENTAL_TYPE_USED"
  1235. // "EXTERNAL_API_WARNING"
  1236. // "FIELD_VALUE_OVERRIDEN"
  1237. // "INJECTED_KERNELS_DEPRECATED"
  1238. // "MISSING_TYPE_DEPENDENCY"
  1239. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1240. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1241. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1242. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1243. // "NEXT_HOP_NOT_RUNNING"
  1244. // "NOT_CRITICAL_ERROR"
  1245. // "NO_RESULTS_ON_PAGE"
  1246. // "REQUIRED_TOS_AGREEMENT"
  1247. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1248. // "RESOURCE_NOT_DELETED"
  1249. // "SCHEMA_VALIDATION_IGNORED"
  1250. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1251. // "UNDECLARED_PROPERTIES"
  1252. // "UNREACHABLE"
  1253. Code string `json:"code,omitempty"`
  1254. // Data: [Output Only] Metadata about this warning in key: value format.
  1255. // For example:
  1256. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1257. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1258. // Message: [Output Only] A human-readable description of the warning
  1259. // code.
  1260. Message string `json:"message,omitempty"`
  1261. // ForceSendFields is a list of field names (e.g. "Code") to
  1262. // unconditionally include in API requests. By default, fields with
  1263. // empty values are omitted from API requests. However, any non-pointer,
  1264. // non-interface field appearing in ForceSendFields will be sent to the
  1265. // server regardless of whether the field is empty or not. This may be
  1266. // used to include empty fields in Patch requests.
  1267. ForceSendFields []string `json:"-"`
  1268. // NullFields is a list of field names (e.g. "Code") to include in API
  1269. // requests with the JSON null value. By default, fields with empty
  1270. // values are omitted from API requests. However, any field with an
  1271. // empty value appearing in NullFields will be sent to the server as
  1272. // null. It is an error if a field in this list has a non-empty value.
  1273. // This may be used to include null fields in Patch requests.
  1274. NullFields []string `json:"-"`
  1275. }
  1276. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1277. type NoMethod AddressAggregatedListWarning
  1278. raw := NoMethod(*s)
  1279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1280. }
  1281. type AddressAggregatedListWarningData struct {
  1282. // Key: [Output Only] A key that provides more detail on the warning
  1283. // being returned. For example, for warnings where there are no results
  1284. // in a list request for a particular zone, this key might be scope and
  1285. // the key value might be the zone name. Other examples might be a key
  1286. // indicating a deprecated resource and a suggested replacement, or a
  1287. // warning about invalid network settings (for example, if an instance
  1288. // attempts to perform IP forwarding but is not enabled for IP
  1289. // forwarding).
  1290. Key string `json:"key,omitempty"`
  1291. // Value: [Output Only] A warning data value corresponding to the key.
  1292. Value string `json:"value,omitempty"`
  1293. // ForceSendFields is a list of field names (e.g. "Key") to
  1294. // unconditionally include in API requests. By default, fields with
  1295. // empty values are omitted from API requests. However, any non-pointer,
  1296. // non-interface field appearing in ForceSendFields will be sent to the
  1297. // server regardless of whether the field is empty or not. This may be
  1298. // used to include empty fields in Patch requests.
  1299. ForceSendFields []string `json:"-"`
  1300. // NullFields is a list of field names (e.g. "Key") to include in API
  1301. // requests with the JSON null value. By default, fields with empty
  1302. // values are omitted from API requests. However, any field with an
  1303. // empty value appearing in NullFields will be sent to the server as
  1304. // null. It is an error if a field in this list has a non-empty value.
  1305. // This may be used to include null fields in Patch requests.
  1306. NullFields []string `json:"-"`
  1307. }
  1308. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1309. type NoMethod AddressAggregatedListWarningData
  1310. raw := NoMethod(*s)
  1311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1312. }
  1313. // AddressList: Contains a list of addresses.
  1314. type AddressList struct {
  1315. // Id: [Output Only] Unique identifier for the resource; defined by the
  1316. // server.
  1317. Id string `json:"id,omitempty"`
  1318. // Items: A list of Address resources.
  1319. Items []*Address `json:"items,omitempty"`
  1320. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1321. // lists of addresses.
  1322. Kind string `json:"kind,omitempty"`
  1323. // NextPageToken: [Output Only] This token allows you to get the next
  1324. // page of results for list requests. If the number of results is larger
  1325. // than maxResults, use the nextPageToken as a value for the query
  1326. // parameter pageToken in the next list request. Subsequent list
  1327. // requests will have their own nextPageToken to continue paging through
  1328. // the results.
  1329. NextPageToken string `json:"nextPageToken,omitempty"`
  1330. // SelfLink: [Output Only] Server-defined URL for this resource.
  1331. SelfLink string `json:"selfLink,omitempty"`
  1332. // Warning: [Output Only] Informational warning message.
  1333. Warning *AddressListWarning `json:"warning,omitempty"`
  1334. // ServerResponse contains the HTTP response code and headers from the
  1335. // server.
  1336. googleapi.ServerResponse `json:"-"`
  1337. // ForceSendFields is a list of field names (e.g. "Id") to
  1338. // unconditionally include in API requests. By default, fields with
  1339. // empty values are omitted from API requests. However, any non-pointer,
  1340. // non-interface field appearing in ForceSendFields will be sent to the
  1341. // server regardless of whether the field is empty or not. This may be
  1342. // used to include empty fields in Patch requests.
  1343. ForceSendFields []string `json:"-"`
  1344. // NullFields is a list of field names (e.g. "Id") to include in API
  1345. // requests with the JSON null value. By default, fields with empty
  1346. // values are omitted from API requests. However, any field with an
  1347. // empty value appearing in NullFields will be sent to the server as
  1348. // null. It is an error if a field in this list has a non-empty value.
  1349. // This may be used to include null fields in Patch requests.
  1350. NullFields []string `json:"-"`
  1351. }
  1352. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1353. type NoMethod AddressList
  1354. raw := NoMethod(*s)
  1355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1356. }
  1357. // AddressListWarning: [Output Only] Informational warning message.
  1358. type AddressListWarning struct {
  1359. // Code: [Output Only] A warning code, if applicable. For example,
  1360. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1361. // the response.
  1362. //
  1363. // Possible values:
  1364. // "CLEANUP_FAILED"
  1365. // "DEPRECATED_RESOURCE_USED"
  1366. // "DEPRECATED_TYPE_USED"
  1367. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1368. // "EXPERIMENTAL_TYPE_USED"
  1369. // "EXTERNAL_API_WARNING"
  1370. // "FIELD_VALUE_OVERRIDEN"
  1371. // "INJECTED_KERNELS_DEPRECATED"
  1372. // "MISSING_TYPE_DEPENDENCY"
  1373. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1374. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1375. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1376. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1377. // "NEXT_HOP_NOT_RUNNING"
  1378. // "NOT_CRITICAL_ERROR"
  1379. // "NO_RESULTS_ON_PAGE"
  1380. // "REQUIRED_TOS_AGREEMENT"
  1381. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1382. // "RESOURCE_NOT_DELETED"
  1383. // "SCHEMA_VALIDATION_IGNORED"
  1384. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1385. // "UNDECLARED_PROPERTIES"
  1386. // "UNREACHABLE"
  1387. Code string `json:"code,omitempty"`
  1388. // Data: [Output Only] Metadata about this warning in key: value format.
  1389. // For example:
  1390. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1391. Data []*AddressListWarningData `json:"data,omitempty"`
  1392. // Message: [Output Only] A human-readable description of the warning
  1393. // code.
  1394. Message string `json:"message,omitempty"`
  1395. // ForceSendFields is a list of field names (e.g. "Code") to
  1396. // unconditionally include in API requests. By default, fields with
  1397. // empty values are omitted from API requests. However, any non-pointer,
  1398. // non-interface field appearing in ForceSendFields will be sent to the
  1399. // server regardless of whether the field is empty or not. This may be
  1400. // used to include empty fields in Patch requests.
  1401. ForceSendFields []string `json:"-"`
  1402. // NullFields is a list of field names (e.g. "Code") to include in API
  1403. // requests with the JSON null value. By default, fields with empty
  1404. // values are omitted from API requests. However, any field with an
  1405. // empty value appearing in NullFields will be sent to the server as
  1406. // null. It is an error if a field in this list has a non-empty value.
  1407. // This may be used to include null fields in Patch requests.
  1408. NullFields []string `json:"-"`
  1409. }
  1410. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1411. type NoMethod AddressListWarning
  1412. raw := NoMethod(*s)
  1413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1414. }
  1415. type AddressListWarningData struct {
  1416. // Key: [Output Only] A key that provides more detail on the warning
  1417. // being returned. For example, for warnings where there are no results
  1418. // in a list request for a particular zone, this key might be scope and
  1419. // the key value might be the zone name. Other examples might be a key
  1420. // indicating a deprecated resource and a suggested replacement, or a
  1421. // warning about invalid network settings (for example, if an instance
  1422. // attempts to perform IP forwarding but is not enabled for IP
  1423. // forwarding).
  1424. Key string `json:"key,omitempty"`
  1425. // Value: [Output Only] A warning data value corresponding to the key.
  1426. Value string `json:"value,omitempty"`
  1427. // ForceSendFields is a list of field names (e.g. "Key") to
  1428. // unconditionally include in API requests. By default, fields with
  1429. // empty values are omitted from API requests. However, any non-pointer,
  1430. // non-interface field appearing in ForceSendFields will be sent to the
  1431. // server regardless of whether the field is empty or not. This may be
  1432. // used to include empty fields in Patch requests.
  1433. ForceSendFields []string `json:"-"`
  1434. // NullFields is a list of field names (e.g. "Key") to include in API
  1435. // requests with the JSON null value. By default, fields with empty
  1436. // values are omitted from API requests. However, any field with an
  1437. // empty value appearing in NullFields will be sent to the server as
  1438. // null. It is an error if a field in this list has a non-empty value.
  1439. // This may be used to include null fields in Patch requests.
  1440. NullFields []string `json:"-"`
  1441. }
  1442. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1443. type NoMethod AddressListWarningData
  1444. raw := NoMethod(*s)
  1445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1446. }
  1447. type AddressesScopedList struct {
  1448. // Addresses: [Output Only] A list of addresses contained in this scope.
  1449. Addresses []*Address `json:"addresses,omitempty"`
  1450. // Warning: [Output Only] Informational warning which replaces the list
  1451. // of addresses when the list is empty.
  1452. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1453. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1454. // unconditionally include in API requests. By default, fields with
  1455. // empty values are omitted from API requests. However, any non-pointer,
  1456. // non-interface field appearing in ForceSendFields will be sent to the
  1457. // server regardless of whether the field is empty or not. This may be
  1458. // used to include empty fields in Patch requests.
  1459. ForceSendFields []string `json:"-"`
  1460. // NullFields is a list of field names (e.g. "Addresses") to include in
  1461. // API requests with the JSON null value. By default, fields with empty
  1462. // values are omitted from API requests. However, any field with an
  1463. // empty value appearing in NullFields will be sent to the server as
  1464. // null. It is an error if a field in this list has a non-empty value.
  1465. // This may be used to include null fields in Patch requests.
  1466. NullFields []string `json:"-"`
  1467. }
  1468. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1469. type NoMethod AddressesScopedList
  1470. raw := NoMethod(*s)
  1471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1472. }
  1473. // AddressesScopedListWarning: [Output Only] Informational warning which
  1474. // replaces the list of addresses when the list is empty.
  1475. type AddressesScopedListWarning struct {
  1476. // Code: [Output Only] A warning code, if applicable. For example,
  1477. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1478. // the response.
  1479. //
  1480. // Possible values:
  1481. // "CLEANUP_FAILED"
  1482. // "DEPRECATED_RESOURCE_USED"
  1483. // "DEPRECATED_TYPE_USED"
  1484. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1485. // "EXPERIMENTAL_TYPE_USED"
  1486. // "EXTERNAL_API_WARNING"
  1487. // "FIELD_VALUE_OVERRIDEN"
  1488. // "INJECTED_KERNELS_DEPRECATED"
  1489. // "MISSING_TYPE_DEPENDENCY"
  1490. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1491. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1492. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1493. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1494. // "NEXT_HOP_NOT_RUNNING"
  1495. // "NOT_CRITICAL_ERROR"
  1496. // "NO_RESULTS_ON_PAGE"
  1497. // "REQUIRED_TOS_AGREEMENT"
  1498. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1499. // "RESOURCE_NOT_DELETED"
  1500. // "SCHEMA_VALIDATION_IGNORED"
  1501. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1502. // "UNDECLARED_PROPERTIES"
  1503. // "UNREACHABLE"
  1504. Code string `json:"code,omitempty"`
  1505. // Data: [Output Only] Metadata about this warning in key: value format.
  1506. // For example:
  1507. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1508. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1509. // Message: [Output Only] A human-readable description of the warning
  1510. // code.
  1511. Message string `json:"message,omitempty"`
  1512. // ForceSendFields is a list of field names (e.g. "Code") to
  1513. // unconditionally include in API requests. By default, fields with
  1514. // empty values are omitted from API requests. However, any non-pointer,
  1515. // non-interface field appearing in ForceSendFields will be sent to the
  1516. // server regardless of whether the field is empty or not. This may be
  1517. // used to include empty fields in Patch requests.
  1518. ForceSendFields []string `json:"-"`
  1519. // NullFields is a list of field names (e.g. "Code") to include in API
  1520. // requests with the JSON null value. By default, fields with empty
  1521. // values are omitted from API requests. However, any field with an
  1522. // empty value appearing in NullFields will be sent to the server as
  1523. // null. It is an error if a field in this list has a non-empty value.
  1524. // This may be used to include null fields in Patch requests.
  1525. NullFields []string `json:"-"`
  1526. }
  1527. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1528. type NoMethod AddressesScopedListWarning
  1529. raw := NoMethod(*s)
  1530. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1531. }
  1532. type AddressesScopedListWarningData struct {
  1533. // Key: [Output Only] A key that provides more detail on the warning
  1534. // being returned. For example, for warnings where there are no results
  1535. // in a list request for a particular zone, this key might be scope and
  1536. // the key value might be the zone name. Other examples might be a key
  1537. // indicating a deprecated resource and a suggested replacement, or a
  1538. // warning about invalid network settings (for example, if an instance
  1539. // attempts to perform IP forwarding but is not enabled for IP
  1540. // forwarding).
  1541. Key string `json:"key,omitempty"`
  1542. // Value: [Output Only] A warning data value corresponding to the key.
  1543. Value string `json:"value,omitempty"`
  1544. // ForceSendFields is a list of field names (e.g. "Key") to
  1545. // unconditionally include in API requests. By default, fields with
  1546. // empty values are omitted from API requests. However, any non-pointer,
  1547. // non-interface field appearing in ForceSendFields will be sent to the
  1548. // server regardless of whether the field is empty or not. This may be
  1549. // used to include empty fields in Patch requests.
  1550. ForceSendFields []string `json:"-"`
  1551. // NullFields is a list of field names (e.g. "Key") to include in API
  1552. // requests with the JSON null value. By default, fields with empty
  1553. // values are omitted from API requests. However, any field with an
  1554. // empty value appearing in NullFields will be sent to the server as
  1555. // null. It is an error if a field in this list has a non-empty value.
  1556. // This may be used to include null fields in Patch requests.
  1557. NullFields []string `json:"-"`
  1558. }
  1559. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1560. type NoMethod AddressesScopedListWarningData
  1561. raw := NoMethod(*s)
  1562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1563. }
  1564. // AliasIpRange: An alias IP range attached to an instance's network
  1565. // interface.
  1566. type AliasIpRange struct {
  1567. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1568. // This IP CIDR range must belong to the specified subnetwork and cannot
  1569. // contain IP addresses reserved by system or used by other network
  1570. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1571. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1572. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1573. // SubnetworkRangeName: Optional subnetwork secondary range name
  1574. // specifying the secondary range from which to allocate the IP CIDR
  1575. // range for this alias IP range. If left unspecified, the primary range
  1576. // of the subnetwork will be used.
  1577. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1578. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1579. // unconditionally include in API requests. By default, fields with
  1580. // empty values are omitted from API requests. However, any non-pointer,
  1581. // non-interface field appearing in ForceSendFields will be sent to the
  1582. // server regardless of whether the field is empty or not. This may be
  1583. // used to include empty fields in Patch requests.
  1584. ForceSendFields []string `json:"-"`
  1585. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1586. // in API requests with the JSON null value. By default, fields with
  1587. // empty values are omitted from API requests. However, any field with
  1588. // an empty value appearing in NullFields will be sent to the server as
  1589. // null. It is an error if a field in this list has a non-empty value.
  1590. // This may be used to include null fields in Patch requests.
  1591. NullFields []string `json:"-"`
  1592. }
  1593. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1594. type NoMethod AliasIpRange
  1595. raw := NoMethod(*s)
  1596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1597. }
  1598. // AttachedDisk: An instance-attached disk resource.
  1599. type AttachedDisk struct {
  1600. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  1601. // instance is deleted (but not when the disk is detached from the
  1602. // instance).
  1603. AutoDelete bool `json:"autoDelete,omitempty"`
  1604. // Boot: Indicates that this is a boot disk. The virtual machine will
  1605. // use the first partition of the disk for its root filesystem.
  1606. Boot bool `json:"boot,omitempty"`
  1607. // DeviceName: Specifies a unique device name of your choice that is
  1608. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  1609. // system running within the instance. This name can be used to
  1610. // reference the device for mounting, resizing, and so on, from within
  1611. // the instance.
  1612. //
  1613. // If not specified, the server chooses a default device name to apply
  1614. // to this disk, in the form persistent-disks-x, where x is a number
  1615. // assigned by Google Compute Engine. This field is only applicable for
  1616. // persistent disks.
  1617. DeviceName string `json:"deviceName,omitempty"`
  1618. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  1619. // customer-supplied encryption key.
  1620. //
  1621. // If you are creating a new disk, this field encrypts the new disk
  1622. // using an encryption key that you provide. If you are attaching an
  1623. // existing disk that is already encrypted, this field decrypts the disk
  1624. // using the customer-supplied encryption key.
  1625. //
  1626. // If you encrypt a disk using a customer-supplied key, you must provide
  1627. // the same key again when you attempt to use this resource at a later
  1628. // time. For example, you must provide the key when you create a
  1629. // snapshot or an image from the disk or when you attach the disk to a
  1630. // virtual machine instance.
  1631. //
  1632. // If you do not provide an encryption key, then the disk will be
  1633. // encrypted using an automatically generated key and you do not need to
  1634. // provide a key to use the disk later.
  1635. //
  1636. // Instance templates do not store customer-supplied encryption keys, so
  1637. // you cannot use your own keys to encrypt disks in a managed instance
  1638. // group.
  1639. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  1640. // GuestOsFeatures: A list of features to enable on the guest operating
  1641. // system. Applicable only for bootable images. Read Enabling guest
  1642. // operating system features to see a list of available options.
  1643. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  1644. // Index: [Output Only] A zero-based index to this disk, where 0 is
  1645. // reserved for the boot disk. If you have many disks attached to an
  1646. // instance, each disk would have a unique index number.
  1647. Index int64 `json:"index,omitempty"`
  1648. // InitializeParams: [Input Only] Specifies the parameters for a new
  1649. // disk that will be created alongside the new instance. Use
  1650. // initialization parameters to create boot disks or local SSDs attached
  1651. // to the new instance.
  1652. //
  1653. // This property is mutually exclusive with the source property; you can
  1654. // only define one or the other, but not both.
  1655. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  1656. // Interface: Specifies the disk interface to use for attaching this
  1657. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  1658. // disks must always use SCSI and the request will fail if you attempt
  1659. // to attach a persistent disk in any other format than SCSI. Local SSDs
  1660. // can use either NVME or SCSI. For performance characteristics of SCSI
  1661. // over NVMe, see Local SSD performance.
  1662. //
  1663. // Possible values:
  1664. // "NVME"
  1665. // "SCSI"
  1666. Interface string `json:"interface,omitempty"`
  1667. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  1668. // for attached disks.
  1669. Kind string `json:"kind,omitempty"`
  1670. // Licenses: [Output Only] Any valid publicly visible licenses.
  1671. Licenses []string `json:"licenses,omitempty"`
  1672. // Mode: The mode in which to attach this disk, either READ_WRITE or
  1673. // READ_ONLY. If not specified, the default is to attach the disk in
  1674. // READ_WRITE mode.
  1675. //
  1676. // Possible values:
  1677. // "READ_ONLY"
  1678. // "READ_WRITE"
  1679. Mode string `json:"mode,omitempty"`
  1680. // Source: Specifies a valid partial or full URL to an existing
  1681. // Persistent Disk resource. When creating a new instance, one of
  1682. // initializeParams.sourceImage or disks.source is required except for
  1683. // local SSD.
  1684. //
  1685. // If desired, you can also attach existing non-root persistent disks
  1686. // using this property. This field is only applicable for persistent
  1687. // disks.
  1688. //
  1689. // Note that for InstanceTemplate, specify the disk name, not the URL
  1690. // for the disk.
  1691. Source string `json:"source,omitempty"`
  1692. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  1693. // If not specified, the default is PERSISTENT.
  1694. //
  1695. // Possible values:
  1696. // "PERSISTENT"
  1697. // "SCRATCH"
  1698. Type string `json:"type,omitempty"`
  1699. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  1700. // unconditionally include in API requests. By default, fields with
  1701. // empty values are omitted from API requests. However, any non-pointer,
  1702. // non-interface field appearing in ForceSendFields will be sent to the
  1703. // server regardless of whether the field is empty or not. This may be
  1704. // used to include empty fields in Patch requests.
  1705. ForceSendFields []string `json:"-"`
  1706. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  1707. // API requests with the JSON null value. By default, fields with empty
  1708. // values are omitted from API requests. However, any field with an
  1709. // empty value appearing in NullFields will be sent to the server as
  1710. // null. It is an error if a field in this list has a non-empty value.
  1711. // This may be used to include null fields in Patch requests.
  1712. NullFields []string `json:"-"`
  1713. }
  1714. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  1715. type NoMethod AttachedDisk
  1716. raw := NoMethod(*s)
  1717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1718. }
  1719. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  1720. // for a new disk that will be created alongside the new instance. Use
  1721. // initialization parameters to create boot disks or local SSDs attached
  1722. // to the new instance.
  1723. //
  1724. // This property is mutually exclusive with the source property; you can
  1725. // only define one or the other, but not both.
  1726. type AttachedDiskInitializeParams struct {
  1727. // DiskName: Specifies the disk name. If not specified, the default is
  1728. // to use the name of the instance.
  1729. DiskName string `json:"diskName,omitempty"`
  1730. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  1731. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1732. // DiskType: Specifies the disk type to use to create the instance. If
  1733. // not specified, the default is pd-standard, specified using the full
  1734. // URL. For
  1735. // example:
  1736. // https://www.googleapis.com/compute/v1/projects/project/zones/
  1737. // zone/diskTypes/pd-standard
  1738. //
  1739. //
  1740. // Other values include pd-ssd and local-ssd. If you define this field,
  1741. // you can provide either the full or partial URL. For example, the
  1742. // following are valid values:
  1743. // -
  1744. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  1745. // - projects/project/zones/zone/diskTypes/diskType
  1746. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  1747. // is the name of the disk type, not URL.
  1748. DiskType string `json:"diskType,omitempty"`
  1749. // Labels: Labels to apply to this disk. These can be later modified by
  1750. // the disks.setLabels method. This field is only applicable for
  1751. // persistent disks.
  1752. Labels map[string]string `json:"labels,omitempty"`
  1753. // SourceImage: The source image to create this disk. When creating a
  1754. // new instance, one of initializeParams.sourceImage or disks.source is
  1755. // required except for local SSD.
  1756. //
  1757. // To create a disk with one of the public operating system images,
  1758. // specify the image by its family name. For example, specify
  1759. // family/debian-8 to use the latest Debian 8
  1760. // image:
  1761. // projects/debian-cloud/global/images/family/debian-8
  1762. //
  1763. //
  1764. // Alternati
  1765. // vely, use a specific version of a public operating system
  1766. // image:
  1767. // projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
  1768. //
  1769. //
  1770. //
  1771. // To create a disk with a custom image that you created, specify the
  1772. // image name in the following
  1773. // format:
  1774. // global/images/my-custom-image
  1775. //
  1776. //
  1777. // You can also specify a custom image by its image family, which
  1778. // returns the latest version of the image in that family. Replace the
  1779. // image name with
  1780. // family/family-name:
  1781. // global/images/family/my-image-family
  1782. //
  1783. //
  1784. // If the source image is deleted later, this field will not be set.
  1785. SourceImage string `json:"sourceImage,omitempty"`
  1786. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  1787. // source image. Required if the source image is protected by a
  1788. // customer-supplied encryption key.
  1789. //
  1790. // Instance templates do not store customer-supplied encryption keys, so
  1791. // you cannot create disks for instances in a managed instance group if
  1792. // the source images are encrypted with your own keys.
  1793. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  1794. // ForceSendFields is a list of field names (e.g. "DiskName") to
  1795. // unconditionally include in API requests. By default, fields with
  1796. // empty values are omitted from API requests. However, any non-pointer,
  1797. // non-interface field appearing in ForceSendFields will be sent to the
  1798. // server regardless of whether the field is empty or not. This may be
  1799. // used to include empty fields in Patch requests.
  1800. ForceSendFields []string `json:"-"`
  1801. // NullFields is a list of field names (e.g. "DiskName") to include in
  1802. // API requests with the JSON null value. By default, fields with empty
  1803. // values are omitted from API requests. However, any field with an
  1804. // empty value appearing in NullFields will be sent to the server as
  1805. // null. It is an error if a field in this list has a non-empty value.
  1806. // This may be used to include null fields in Patch requests.
  1807. NullFields []string `json:"-"`
  1808. }
  1809. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  1810. type NoMethod AttachedDiskInitializeParams
  1811. raw := NoMethod(*s)
  1812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1813. }
  1814. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  1815. // to automatically scale virtual machine instances in managed instance
  1816. // groups according to an autoscaling policy that you define. For more
  1817. // information, read Autoscaling Groups of Instances. (== resource_for
  1818. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  1819. // resource_for beta.regionAutoscalers ==) (== resource_for
  1820. // v1.regionAutoscalers ==)
  1821. type Autoscaler struct {
  1822. // AutoscalingPolicy: The configuration parameters for the autoscaling
  1823. // algorithm. You can define one or more of the policies for an
  1824. // autoscaler: cpuUtilization, customMetricUtilizations, and
  1825. // loadBalancingUtilization.
  1826. //
  1827. // If none of these are specified, the default will be to autoscale
  1828. // based on cpuUtilization to 0.6 or 60%.
  1829. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  1830. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1831. // format.
  1832. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1833. // Description: An optional description of this resource. Provide this
  1834. // property when you create the resource.
  1835. Description string `json:"description,omitempty"`
  1836. // Id: [Output Only] The unique identifier for the resource. This
  1837. // identifier is defined by the server.
  1838. Id uint64 `json:"id,omitempty,string"`
  1839. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  1840. // for autoscalers.
  1841. Kind string `json:"kind,omitempty"`
  1842. // Name: Name of the resource. Provided by the client when the resource
  1843. // is created. The name must be 1-63 characters long, and comply with
  1844. // RFC1035. Specifically, the name must be 1-63 characters long and
  1845. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1846. // the first character must be a lowercase letter, and all following
  1847. // characters must be a dash, lowercase letter, or digit, except the
  1848. // last character, which cannot be a dash.
  1849. Name string `json:"name,omitempty"`
  1850. // Region: [Output Only] URL of the region where the instance group
  1851. // resides (for autoscalers living in regional scope).
  1852. Region string `json:"region,omitempty"`
  1853. // SelfLink: [Output Only] Server-defined URL for the resource.
  1854. SelfLink string `json:"selfLink,omitempty"`
  1855. // Status: [Output Only] The status of the autoscaler configuration.
  1856. //
  1857. // Possible values:
  1858. // "ACTIVE"
  1859. // "DELETING"
  1860. // "ERROR"
  1861. // "PENDING"
  1862. Status string `json:"status,omitempty"`
  1863. // StatusDetails: [Output Only] Human-readable details about the current
  1864. // state of the autoscaler. Read the documentation for Commonly returned
  1865. // status messages for examples of status messages you might encounter.
  1866. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  1867. // Target: URL of the managed instance group that this autoscaler will
  1868. // scale.
  1869. Target string `json:"target,omitempty"`
  1870. // Zone: [Output Only] URL of the zone where the instance group resides
  1871. // (for autoscalers living in zonal scope).
  1872. Zone string `json:"zone,omitempty"`
  1873. // ServerResponse contains the HTTP response code and headers from the
  1874. // server.
  1875. googleapi.ServerResponse `json:"-"`
  1876. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  1877. // to unconditionally include in API requests. By default, fields with
  1878. // empty values are omitted from API requests. However, any non-pointer,
  1879. // non-interface field appearing in ForceSendFields will be sent to the
  1880. // server regardless of whether the field is empty or not. This may be
  1881. // used to include empty fields in Patch requests.
  1882. ForceSendFields []string `json:"-"`
  1883. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  1884. // include in API requests with the JSON null value. By default, fields
  1885. // with empty values are omitted from API requests. However, any field
  1886. // with an empty value appearing in NullFields will be sent to the
  1887. // server as null. It is an error if a field in this list has a
  1888. // non-empty value. This may be used to include null fields in Patch
  1889. // requests.
  1890. NullFields []string `json:"-"`
  1891. }
  1892. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  1893. type NoMethod Autoscaler
  1894. raw := NoMethod(*s)
  1895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1896. }
  1897. type AutoscalerAggregatedList struct {
  1898. // Id: [Output Only] Unique identifier for the resource; defined by the
  1899. // server.
  1900. Id string `json:"id,omitempty"`
  1901. // Items: A list of AutoscalersScopedList resources.
  1902. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  1903. // Kind: [Output Only] Type of resource. Always
  1904. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  1905. Kind string `json:"kind,omitempty"`
  1906. // NextPageToken: [Output Only] This token allows you to get the next
  1907. // page of results for list requests. If the number of results is larger
  1908. // than maxResults, use the nextPageToken as a value for the query
  1909. // parameter pageToken in the next list request. Subsequent list
  1910. // requests will have their own nextPageToken to continue paging through
  1911. // the results.
  1912. NextPageToken string `json:"nextPageToken,omitempty"`
  1913. // SelfLink: [Output Only] Server-defined URL for this resource.
  1914. SelfLink string `json:"selfLink,omitempty"`
  1915. // Warning: [Output Only] Informational warning message.
  1916. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  1917. // ServerResponse contains the HTTP response code and headers from the
  1918. // server.
  1919. googleapi.ServerResponse `json:"-"`
  1920. // ForceSendFields is a list of field names (e.g. "Id") to
  1921. // unconditionally include in API requests. By default, fields with
  1922. // empty values are omitted from API requests. However, any non-pointer,
  1923. // non-interface field appearing in ForceSendFields will be sent to the
  1924. // server regardless of whether the field is empty or not. This may be
  1925. // used to include empty fields in Patch requests.
  1926. ForceSendFields []string `json:"-"`
  1927. // NullFields is a list of field names (e.g. "Id") to include in API
  1928. // requests with the JSON null value. By default, fields with empty
  1929. // values are omitted from API requests. However, any field with an
  1930. // empty value appearing in NullFields will be sent to the server as
  1931. // null. It is an error if a field in this list has a non-empty value.
  1932. // This may be used to include null fields in Patch requests.
  1933. NullFields []string `json:"-"`
  1934. }
  1935. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  1936. type NoMethod AutoscalerAggregatedList
  1937. raw := NoMethod(*s)
  1938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1939. }
  1940. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  1941. // message.
  1942. type AutoscalerAggregatedListWarning struct {
  1943. // Code: [Output Only] A warning code, if applicable. For example,
  1944. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1945. // the response.
  1946. //
  1947. // Possible values:
  1948. // "CLEANUP_FAILED"
  1949. // "DEPRECATED_RESOURCE_USED"
  1950. // "DEPRECATED_TYPE_USED"
  1951. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1952. // "EXPERIMENTAL_TYPE_USED"
  1953. // "EXTERNAL_API_WARNING"
  1954. // "FIELD_VALUE_OVERRIDEN"
  1955. // "INJECTED_KERNELS_DEPRECATED"
  1956. // "MISSING_TYPE_DEPENDENCY"
  1957. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1958. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1959. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1960. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1961. // "NEXT_HOP_NOT_RUNNING"
  1962. // "NOT_CRITICAL_ERROR"
  1963. // "NO_RESULTS_ON_PAGE"
  1964. // "REQUIRED_TOS_AGREEMENT"
  1965. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1966. // "RESOURCE_NOT_DELETED"
  1967. // "SCHEMA_VALIDATION_IGNORED"
  1968. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1969. // "UNDECLARED_PROPERTIES"
  1970. // "UNREACHABLE"
  1971. Code string `json:"code,omitempty"`
  1972. // Data: [Output Only] Metadata about this warning in key: value format.
  1973. // For example:
  1974. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1975. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  1976. // Message: [Output Only] A human-readable description of the warning
  1977. // code.
  1978. Message string `json:"message,omitempty"`
  1979. // ForceSendFields is a list of field names (e.g. "Code") to
  1980. // unconditionally include in API requests. By default, fields with
  1981. // empty values are omitted from API requests. However, any non-pointer,
  1982. // non-interface field appearing in ForceSendFields will be sent to the
  1983. // server regardless of whether the field is empty or not. This may be
  1984. // used to include empty fields in Patch requests.
  1985. ForceSendFields []string `json:"-"`
  1986. // NullFields is a list of field names (e.g. "Code") to include in API
  1987. // requests with the JSON null value. By default, fields with empty
  1988. // values are omitted from API requests. However, any field with an
  1989. // empty value appearing in NullFields will be sent to the server as
  1990. // null. It is an error if a field in this list has a non-empty value.
  1991. // This may be used to include null fields in Patch requests.
  1992. NullFields []string `json:"-"`
  1993. }
  1994. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1995. type NoMethod AutoscalerAggregatedListWarning
  1996. raw := NoMethod(*s)
  1997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1998. }
  1999. type AutoscalerAggregatedListWarningData struct {
  2000. // Key: [Output Only] A key that provides more detail on the warning
  2001. // being returned. For example, for warnings where there are no results
  2002. // in a list request for a particular zone, this key might be scope and
  2003. // the key value might be the zone name. Other examples might be a key
  2004. // indicating a deprecated resource and a suggested replacement, or a
  2005. // warning about invalid network settings (for example, if an instance
  2006. // attempts to perform IP forwarding but is not enabled for IP
  2007. // forwarding).
  2008. Key string `json:"key,omitempty"`
  2009. // Value: [Output Only] A warning data value corresponding to the key.
  2010. Value string `json:"value,omitempty"`
  2011. // ForceSendFields is a list of field names (e.g. "Key") to
  2012. // unconditionally include in API requests. By default, fields with
  2013. // empty values are omitted from API requests. However, any non-pointer,
  2014. // non-interface field appearing in ForceSendFields will be sent to the
  2015. // server regardless of whether the field is empty or not. This may be
  2016. // used to include empty fields in Patch requests.
  2017. ForceSendFields []string `json:"-"`
  2018. // NullFields is a list of field names (e.g. "Key") to include in API
  2019. // requests with the JSON null value. By default, fields with empty
  2020. // values are omitted from API requests. However, any field with an
  2021. // empty value appearing in NullFields will be sent to the server as
  2022. // null. It is an error if a field in this list has a non-empty value.
  2023. // This may be used to include null fields in Patch requests.
  2024. NullFields []string `json:"-"`
  2025. }
  2026. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2027. type NoMethod AutoscalerAggregatedListWarningData
  2028. raw := NoMethod(*s)
  2029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2030. }
  2031. // AutoscalerList: Contains a list of Autoscaler resources.
  2032. type AutoscalerList struct {
  2033. // Id: [Output Only] Unique identifier for the resource; defined by the
  2034. // server.
  2035. Id string `json:"id,omitempty"`
  2036. // Items: A list of Autoscaler resources.
  2037. Items []*Autoscaler `json:"items,omitempty"`
  2038. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2039. // for lists of autoscalers.
  2040. Kind string `json:"kind,omitempty"`
  2041. // NextPageToken: [Output Only] This token allows you to get the next
  2042. // page of results for list requests. If the number of results is larger
  2043. // than maxResults, use the nextPageToken as a value for the query
  2044. // parameter pageToken in the next list request. Subsequent list
  2045. // requests will have their own nextPageToken to continue paging through
  2046. // the results.
  2047. NextPageToken string `json:"nextPageToken,omitempty"`
  2048. // SelfLink: [Output Only] Server-defined URL for this resource.
  2049. SelfLink string `json:"selfLink,omitempty"`
  2050. // Warning: [Output Only] Informational warning message.
  2051. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  2052. // ServerResponse contains the HTTP response code and headers from the
  2053. // server.
  2054. googleapi.ServerResponse `json:"-"`
  2055. // ForceSendFields is a list of field names (e.g. "Id") to
  2056. // unconditionally include in API requests. By default, fields with
  2057. // empty values are omitted from API requests. However, any non-pointer,
  2058. // non-interface field appearing in ForceSendFields will be sent to the
  2059. // server regardless of whether the field is empty or not. This may be
  2060. // used to include empty fields in Patch requests.
  2061. ForceSendFields []string `json:"-"`
  2062. // NullFields is a list of field names (e.g. "Id") to include in API
  2063. // requests with the JSON null value. By default, fields with empty
  2064. // values are omitted from API requests. However, any field with an
  2065. // empty value appearing in NullFields will be sent to the server as
  2066. // null. It is an error if a field in this list has a non-empty value.
  2067. // This may be used to include null fields in Patch requests.
  2068. NullFields []string `json:"-"`
  2069. }
  2070. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  2071. type NoMethod AutoscalerList
  2072. raw := NoMethod(*s)
  2073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2074. }
  2075. // AutoscalerListWarning: [Output Only] Informational warning message.
  2076. type AutoscalerListWarning struct {
  2077. // Code: [Output Only] A warning code, if applicable. For example,
  2078. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2079. // the response.
  2080. //
  2081. // Possible values:
  2082. // "CLEANUP_FAILED"
  2083. // "DEPRECATED_RESOURCE_USED"
  2084. // "DEPRECATED_TYPE_USED"
  2085. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2086. // "EXPERIMENTAL_TYPE_USED"
  2087. // "EXTERNAL_API_WARNING"
  2088. // "FIELD_VALUE_OVERRIDEN"
  2089. // "INJECTED_KERNELS_DEPRECATED"
  2090. // "MISSING_TYPE_DEPENDENCY"
  2091. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2092. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2093. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2094. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2095. // "NEXT_HOP_NOT_RUNNING"
  2096. // "NOT_CRITICAL_ERROR"
  2097. // "NO_RESULTS_ON_PAGE"
  2098. // "REQUIRED_TOS_AGREEMENT"
  2099. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2100. // "RESOURCE_NOT_DELETED"
  2101. // "SCHEMA_VALIDATION_IGNORED"
  2102. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2103. // "UNDECLARED_PROPERTIES"
  2104. // "UNREACHABLE"
  2105. Code string `json:"code,omitempty"`
  2106. // Data: [Output Only] Metadata about this warning in key: value format.
  2107. // For example:
  2108. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2109. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  2110. // Message: [Output Only] A human-readable description of the warning
  2111. // code.
  2112. Message string `json:"message,omitempty"`
  2113. // ForceSendFields is a list of field names (e.g. "Code") to
  2114. // unconditionally include in API requests. By default, fields with
  2115. // empty values are omitted from API requests. However, any non-pointer,
  2116. // non-interface field appearing in ForceSendFields will be sent to the
  2117. // server regardless of whether the field is empty or not. This may be
  2118. // used to include empty fields in Patch requests.
  2119. ForceSendFields []string `json:"-"`
  2120. // NullFields is a list of field names (e.g. "Code") to include in API
  2121. // requests with the JSON null value. By default, fields with empty
  2122. // values are omitted from API requests. However, any field with an
  2123. // empty value appearing in NullFields will be sent to the server as
  2124. // null. It is an error if a field in this list has a non-empty value.
  2125. // This may be used to include null fields in Patch requests.
  2126. NullFields []string `json:"-"`
  2127. }
  2128. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  2129. type NoMethod AutoscalerListWarning
  2130. raw := NoMethod(*s)
  2131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2132. }
  2133. type AutoscalerListWarningData struct {
  2134. // Key: [Output Only] A key that provides more detail on the warning
  2135. // being returned. For example, for warnings where there are no results
  2136. // in a list request for a particular zone, this key might be scope and
  2137. // the key value might be the zone name. Other examples might be a key
  2138. // indicating a deprecated resource and a suggested replacement, or a
  2139. // warning about invalid network settings (for example, if an instance
  2140. // attempts to perform IP forwarding but is not enabled for IP
  2141. // forwarding).
  2142. Key string `json:"key,omitempty"`
  2143. // Value: [Output Only] A warning data value corresponding to the key.
  2144. Value string `json:"value,omitempty"`
  2145. // ForceSendFields is a list of field names (e.g. "Key") to
  2146. // unconditionally include in API requests. By default, fields with
  2147. // empty values are omitted from API requests. However, any non-pointer,
  2148. // non-interface field appearing in ForceSendFields will be sent to the
  2149. // server regardless of whether the field is empty or not. This may be
  2150. // used to include empty fields in Patch requests.
  2151. ForceSendFields []string `json:"-"`
  2152. // NullFields is a list of field names (e.g. "Key") to include in API
  2153. // requests with the JSON null value. By default, fields with empty
  2154. // values are omitted from API requests. However, any field with an
  2155. // empty value appearing in NullFields will be sent to the server as
  2156. // null. It is an error if a field in this list has a non-empty value.
  2157. // This may be used to include null fields in Patch requests.
  2158. NullFields []string `json:"-"`
  2159. }
  2160. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  2161. type NoMethod AutoscalerListWarningData
  2162. raw := NoMethod(*s)
  2163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2164. }
  2165. type AutoscalerStatusDetails struct {
  2166. // Message: The status message.
  2167. Message string `json:"message,omitempty"`
  2168. // Type: The type of error returned.
  2169. //
  2170. // Possible values:
  2171. // "ALL_INSTANCES_UNHEALTHY"
  2172. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  2173. // "CAPPED_AT_MAX_NUM_REPLICAS"
  2174. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  2175. // "CUSTOM_METRIC_INVALID"
  2176. // "MIN_EQUALS_MAX"
  2177. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  2178. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  2179. // "MORE_THAN_ONE_BACKEND_SERVICE"
  2180. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  2181. // "REGION_RESOURCE_STOCKOUT"
  2182. // "SCALING_TARGET_DOES_NOT_EXIST"
  2183. // "UNKNOWN"
  2184. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  2185. // "ZONE_RESOURCE_STOCKOUT"
  2186. Type string `json:"type,omitempty"`
  2187. // ForceSendFields is a list of field names (e.g. "Message") to
  2188. // unconditionally include in API requests. By default, fields with
  2189. // empty values are omitted from API requests. However, any non-pointer,
  2190. // non-interface field appearing in ForceSendFields will be sent to the
  2191. // server regardless of whether the field is empty or not. This may be
  2192. // used to include empty fields in Patch requests.
  2193. ForceSendFields []string `json:"-"`
  2194. // NullFields is a list of field names (e.g. "Message") to include in
  2195. // API requests with the JSON null value. By default, fields with empty
  2196. // values are omitted from API requests. However, any field with an
  2197. // empty value appearing in NullFields will be sent to the server as
  2198. // null. It is an error if a field in this list has a non-empty value.
  2199. // This may be used to include null fields in Patch requests.
  2200. NullFields []string `json:"-"`
  2201. }
  2202. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  2203. type NoMethod AutoscalerStatusDetails
  2204. raw := NoMethod(*s)
  2205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2206. }
  2207. type AutoscalersScopedList struct {
  2208. // Autoscalers: [Output Only] A list of autoscalers contained in this
  2209. // scope.
  2210. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  2211. // Warning: [Output Only] Informational warning which replaces the list
  2212. // of autoscalers when the list is empty.
  2213. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  2214. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  2215. // unconditionally include in API requests. By default, fields with
  2216. // empty values are omitted from API requests. However, any non-pointer,
  2217. // non-interface field appearing in ForceSendFields will be sent to the
  2218. // server regardless of whether the field is empty or not. This may be
  2219. // used to include empty fields in Patch requests.
  2220. ForceSendFields []string `json:"-"`
  2221. // NullFields is a list of field names (e.g. "Autoscalers") to include
  2222. // in API requests with the JSON null value. By default, fields with
  2223. // empty values are omitted from API requests. However, any field with
  2224. // an empty value appearing in NullFields will be sent to the server as
  2225. // null. It is an error if a field in this list has a non-empty value.
  2226. // This may be used to include null fields in Patch requests.
  2227. NullFields []string `json:"-"`
  2228. }
  2229. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  2230. type NoMethod AutoscalersScopedList
  2231. raw := NoMethod(*s)
  2232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2233. }
  2234. // AutoscalersScopedListWarning: [Output Only] Informational warning
  2235. // which replaces the list of autoscalers when the list is empty.
  2236. type AutoscalersScopedListWarning struct {
  2237. // Code: [Output Only] A warning code, if applicable. For example,
  2238. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2239. // the response.
  2240. //
  2241. // Possible values:
  2242. // "CLEANUP_FAILED"
  2243. // "DEPRECATED_RESOURCE_USED"
  2244. // "DEPRECATED_TYPE_USED"
  2245. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2246. // "EXPERIMENTAL_TYPE_USED"
  2247. // "EXTERNAL_API_WARNING"
  2248. // "FIELD_VALUE_OVERRIDEN"
  2249. // "INJECTED_KERNELS_DEPRECATED"
  2250. // "MISSING_TYPE_DEPENDENCY"
  2251. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2252. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2253. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2254. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2255. // "NEXT_HOP_NOT_RUNNING"
  2256. // "NOT_CRITICAL_ERROR"
  2257. // "NO_RESULTS_ON_PAGE"
  2258. // "REQUIRED_TOS_AGREEMENT"
  2259. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2260. // "RESOURCE_NOT_DELETED"
  2261. // "SCHEMA_VALIDATION_IGNORED"
  2262. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2263. // "UNDECLARED_PROPERTIES"
  2264. // "UNREACHABLE"
  2265. Code string `json:"code,omitempty"`
  2266. // Data: [Output Only] Metadata about this warning in key: value format.
  2267. // For example:
  2268. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2269. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  2270. // Message: [Output Only] A human-readable description of the warning
  2271. // code.
  2272. Message string `json:"message,omitempty"`
  2273. // ForceSendFields is a list of field names (e.g. "Code") to
  2274. // unconditionally include in API requests. By default, fields with
  2275. // empty values are omitted from API requests. However, any non-pointer,
  2276. // non-interface field appearing in ForceSendFields will be sent to the
  2277. // server regardless of whether the field is empty or not. This may be
  2278. // used to include empty fields in Patch requests.
  2279. ForceSendFields []string `json:"-"`
  2280. // NullFields is a list of field names (e.g. "Code") to include in API
  2281. // requests with the JSON null value. By default, fields with empty
  2282. // values are omitted from API requests. However, any field with an
  2283. // empty value appearing in NullFields will be sent to the server as
  2284. // null. It is an error if a field in this list has a non-empty value.
  2285. // This may be used to include null fields in Patch requests.
  2286. NullFields []string `json:"-"`
  2287. }
  2288. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  2289. type NoMethod AutoscalersScopedListWarning
  2290. raw := NoMethod(*s)
  2291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2292. }
  2293. type AutoscalersScopedListWarningData struct {
  2294. // Key: [Output Only] A key that provides more detail on the warning
  2295. // being returned. For example, for warnings where there are no results
  2296. // in a list request for a particular zone, this key might be scope and
  2297. // the key value might be the zone name. Other examples might be a key
  2298. // indicating a deprecated resource and a suggested replacement, or a
  2299. // warning about invalid network settings (for example, if an instance
  2300. // attempts to perform IP forwarding but is not enabled for IP
  2301. // forwarding).
  2302. Key string `json:"key,omitempty"`
  2303. // Value: [Output Only] A warning data value corresponding to the key.
  2304. Value string `json:"value,omitempty"`
  2305. // ForceSendFields is a list of field names (e.g. "Key") to
  2306. // unconditionally include in API requests. By default, fields with
  2307. // empty values are omitted from API requests. However, any non-pointer,
  2308. // non-interface field appearing in ForceSendFields will be sent to the
  2309. // server regardless of whether the field is empty or not. This may be
  2310. // used to include empty fields in Patch requests.
  2311. ForceSendFields []string `json:"-"`
  2312. // NullFields is a list of field names (e.g. "Key") to include in API
  2313. // requests with the JSON null value. By default, fields with empty
  2314. // values are omitted from API requests. However, any field with an
  2315. // empty value appearing in NullFields will be sent to the server as
  2316. // null. It is an error if a field in this list has a non-empty value.
  2317. // This may be used to include null fields in Patch requests.
  2318. NullFields []string `json:"-"`
  2319. }
  2320. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  2321. type NoMethod AutoscalersScopedListWarningData
  2322. raw := NoMethod(*s)
  2323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2324. }
  2325. // AutoscalingPolicy: Cloud Autoscaler policy.
  2326. type AutoscalingPolicy struct {
  2327. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  2328. // wait before it starts collecting information from a new instance.
  2329. // This prevents the autoscaler from collecting information when the
  2330. // instance is initializing, during which the collected usage would not
  2331. // be reliable. The default time autoscaler waits is 60
  2332. // seconds.
  2333. //
  2334. // Virtual machine initialization times might vary because of numerous
  2335. // factors. We recommend that you test how long an instance may take to
  2336. // initialize. To do this, create an instance and time the startup
  2337. // process.
  2338. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  2339. // CpuUtilization: Defines the CPU utilization policy that allows the
  2340. // autoscaler to scale based on the average CPU utilization of a managed
  2341. // instance group.
  2342. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  2343. // CustomMetricUtilizations: Configuration parameters of autoscaling
  2344. // based on a custom metric.
  2345. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  2346. // LoadBalancingUtilization: Configuration parameters of autoscaling
  2347. // based on load balancer.
  2348. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  2349. // MaxNumReplicas: The maximum number of instances that the autoscaler
  2350. // can scale up to. This is required when creating or updating an
  2351. // autoscaler. The maximum number of replicas should not be lower than
  2352. // minimal number of replicas.
  2353. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  2354. // MinNumReplicas: The minimum number of replicas that the autoscaler
  2355. // can scale down to. This cannot be less than 0. If not provided,
  2356. // autoscaler will choose a default value depending on maximum number of
  2357. // instances allowed.
  2358. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  2359. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  2360. // to unconditionally include in API requests. By default, fields with
  2361. // empty values are omitted from API requests. However, any non-pointer,
  2362. // non-interface field appearing in ForceSendFields will be sent to the
  2363. // server regardless of whether the field is empty or not. This may be
  2364. // used to include empty fields in Patch requests.
  2365. ForceSendFields []string `json:"-"`
  2366. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  2367. // include in API requests with the JSON null value. By default, fields
  2368. // with empty values are omitted from API requests. However, any field
  2369. // with an empty value appearing in NullFields will be sent to the
  2370. // server as null. It is an error if a field in this list has a
  2371. // non-empty value. This may be used to include null fields in Patch
  2372. // requests.
  2373. NullFields []string `json:"-"`
  2374. }
  2375. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  2376. type NoMethod AutoscalingPolicy
  2377. raw := NoMethod(*s)
  2378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2379. }
  2380. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  2381. type AutoscalingPolicyCpuUtilization struct {
  2382. // UtilizationTarget: The target CPU utilization that the autoscaler
  2383. // should maintain. Must be a float value in the range (0, 1]. If not
  2384. // specified, the default is 0.6.
  2385. //
  2386. // If the CPU level is below the target utilization, the autoscaler
  2387. // scales down the number of instances until it reaches the minimum
  2388. // number of instances you specified or until the average CPU of your
  2389. // instances reaches the target utilization.
  2390. //
  2391. // If the average CPU is above the target utilization, the autoscaler
  2392. // scales up until it reaches the maximum number of instances you
  2393. // specified or until the average utilization reaches the target
  2394. // utilization.
  2395. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2396. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2397. // to unconditionally include in API requests. By default, fields with
  2398. // empty values are omitted from API requests. However, any non-pointer,
  2399. // non-interface field appearing in ForceSendFields will be sent to the
  2400. // server regardless of whether the field is empty or not. This may be
  2401. // used to include empty fields in Patch requests.
  2402. ForceSendFields []string `json:"-"`
  2403. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2404. // include in API requests with the JSON null value. By default, fields
  2405. // with empty values are omitted from API requests. However, any field
  2406. // with an empty value appearing in NullFields will be sent to the
  2407. // server as null. It is an error if a field in this list has a
  2408. // non-empty value. This may be used to include null fields in Patch
  2409. // requests.
  2410. NullFields []string `json:"-"`
  2411. }
  2412. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  2413. type NoMethod AutoscalingPolicyCpuUtilization
  2414. raw := NoMethod(*s)
  2415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2416. }
  2417. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  2418. type NoMethod AutoscalingPolicyCpuUtilization
  2419. var s1 struct {
  2420. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2421. *NoMethod
  2422. }
  2423. s1.NoMethod = (*NoMethod)(s)
  2424. if err := json.Unmarshal(data, &s1); err != nil {
  2425. return err
  2426. }
  2427. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2428. return nil
  2429. }
  2430. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  2431. // policy.
  2432. type AutoscalingPolicyCustomMetricUtilization struct {
  2433. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  2434. // The metric cannot have negative values.
  2435. //
  2436. // The metric must have a value type of INT64 or DOUBLE.
  2437. Metric string `json:"metric,omitempty"`
  2438. // UtilizationTarget: The target value of the metric that autoscaler
  2439. // should maintain. This must be a positive value. A utilization metric
  2440. // scales number of virtual machines handling requests to increase or
  2441. // decrease proportionally to the metric.
  2442. //
  2443. // For example, a good metric to use as a utilization_target is
  2444. // compute.googleapis.com/instance/network/received_bytes_count. The
  2445. // autoscaler will work to keep this value constant for each of the
  2446. // instances.
  2447. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2448. // UtilizationTargetType: Defines how target utilization value is
  2449. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  2450. // DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default
  2451. // is GAUGE.
  2452. //
  2453. // Possible values:
  2454. // "DELTA_PER_MINUTE"
  2455. // "DELTA_PER_SECOND"
  2456. // "GAUGE"
  2457. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  2458. // ForceSendFields is a list of field names (e.g. "Metric") to
  2459. // unconditionally include in API requests. By default, fields with
  2460. // empty values are omitted from API requests. However, any non-pointer,
  2461. // non-interface field appearing in ForceSendFields will be sent to the
  2462. // server regardless of whether the field is empty or not. This may be
  2463. // used to include empty fields in Patch requests.
  2464. ForceSendFields []string `json:"-"`
  2465. // NullFields is a list of field names (e.g. "Metric") to include in API
  2466. // requests with the JSON null value. By default, fields with empty
  2467. // values are omitted from API requests. However, any field with an
  2468. // empty value appearing in NullFields will be sent to the server as
  2469. // null. It is an error if a field in this list has a non-empty value.
  2470. // This may be used to include null fields in Patch requests.
  2471. NullFields []string `json:"-"`
  2472. }
  2473. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  2474. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2475. raw := NoMethod(*s)
  2476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2477. }
  2478. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  2479. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2480. var s1 struct {
  2481. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2482. *NoMethod
  2483. }
  2484. s1.NoMethod = (*NoMethod)(s)
  2485. if err := json.Unmarshal(data, &s1); err != nil {
  2486. return err
  2487. }
  2488. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2489. return nil
  2490. }
  2491. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  2492. // of autoscaling based on load balancing.
  2493. type AutoscalingPolicyLoadBalancingUtilization struct {
  2494. // UtilizationTarget: Fraction of backend capacity utilization (set in
  2495. // HTTP(s) load balancing configuration) that autoscaler should
  2496. // maintain. Must be a positive float value. If not defined, the default
  2497. // is 0.8.
  2498. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2499. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2500. // to unconditionally include in API requests. By default, fields with
  2501. // empty values are omitted from API requests. However, any non-pointer,
  2502. // non-interface field appearing in ForceSendFields will be sent to the
  2503. // server regardless of whether the field is empty or not. This may be
  2504. // used to include empty fields in Patch requests.
  2505. ForceSendFields []string `json:"-"`
  2506. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2507. // include in API requests with the JSON null value. By default, fields
  2508. // with empty values are omitted from API requests. However, any field
  2509. // with an empty value appearing in NullFields will be sent to the
  2510. // server as null. It is an error if a field in this list has a
  2511. // non-empty value. This may be used to include null fields in Patch
  2512. // requests.
  2513. NullFields []string `json:"-"`
  2514. }
  2515. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  2516. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2517. raw := NoMethod(*s)
  2518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2519. }
  2520. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  2521. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2522. var s1 struct {
  2523. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2524. *NoMethod
  2525. }
  2526. s1.NoMethod = (*NoMethod)(s)
  2527. if err := json.Unmarshal(data, &s1); err != nil {
  2528. return err
  2529. }
  2530. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2531. return nil
  2532. }
  2533. // Backend: Message containing information of one individual backend.
  2534. type Backend struct {
  2535. // BalancingMode: Specifies the balancing mode for this backend. For
  2536. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  2537. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  2538. // TCP/SSL).
  2539. //
  2540. // For Internal Load Balancing, the default and only supported mode is
  2541. // CONNECTION.
  2542. //
  2543. // Possible values:
  2544. // "CONNECTION"
  2545. // "RATE"
  2546. // "UTILIZATION"
  2547. BalancingMode string `json:"balancingMode,omitempty"`
  2548. // CapacityScaler: A multiplier applied to the group's maximum servicing
  2549. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  2550. // 1, which means the group will serve up to 100% of its configured
  2551. // capacity (depending on balancingMode). A setting of 0 means the group
  2552. // is completely drained, offering 0% of its available Capacity. Valid
  2553. // range is [0.0,1.0].
  2554. //
  2555. // This cannot be used for internal load balancing.
  2556. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  2557. // Description: An optional description of this resource. Provide this
  2558. // property when you create the resource.
  2559. Description string `json:"description,omitempty"`
  2560. // Group: The fully-qualified URL of a Instance Group resource. This
  2561. // instance group defines the list of instances that serve traffic.
  2562. // Member virtual machine instances from each instance group must live
  2563. // in the same zone as the instance group itself. No two backends in a
  2564. // backend service are allowed to use same Instance Group
  2565. // resource.
  2566. //
  2567. // Note that you must specify an Instance Group resource using the
  2568. // fully-qualified URL, rather than a partial URL.
  2569. //
  2570. // When the BackendService has load balancing scheme INTERNAL, the
  2571. // instance group must be within the same region as the BackendService.
  2572. Group string `json:"group,omitempty"`
  2573. // MaxConnections: The max number of simultaneous connections for the
  2574. // group. Can be used with either CONNECTION or UTILIZATION balancing
  2575. // modes. For CONNECTION mode, either maxConnections or
  2576. // maxConnectionsPerInstance must be set.
  2577. //
  2578. // This cannot be used for internal load balancing.
  2579. MaxConnections int64 `json:"maxConnections,omitempty"`
  2580. // MaxConnectionsPerInstance: The max number of simultaneous connections
  2581. // that a single backend instance can handle. This is used to calculate
  2582. // the capacity of the group. Can be used in either CONNECTION or
  2583. // UTILIZATION balancing modes. For CONNECTION mode, either
  2584. // maxConnections or maxConnectionsPerInstance must be set.
  2585. //
  2586. // This cannot be used for internal load balancing.
  2587. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  2588. // MaxRate: The max requests per second (RPS) of the group. Can be used
  2589. // with either RATE or UTILIZATION balancing modes, but required if RATE
  2590. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  2591. // set.
  2592. //
  2593. // This cannot be used for internal load balancing.
  2594. MaxRate int64 `json:"maxRate,omitempty"`
  2595. // MaxRatePerInstance: The max requests per second (RPS) that a single
  2596. // backend instance can handle. This is used to calculate the capacity
  2597. // of the group. Can be used in either balancing mode. For RATE mode,
  2598. // either maxRate or maxRatePerInstance must be set.
  2599. //
  2600. // This cannot be used for internal load balancing.
  2601. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  2602. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  2603. // defines the CPU utilization target for the group. The default is 0.8.
  2604. // Valid range is [0.0, 1.0].
  2605. //
  2606. // This cannot be used for internal load balancing.
  2607. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  2608. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  2609. // unconditionally include in API requests. By default, fields with
  2610. // empty values are omitted from API requests. However, any non-pointer,
  2611. // non-interface field appearing in ForceSendFields will be sent to the
  2612. // server regardless of whether the field is empty or not. This may be
  2613. // used to include empty fields in Patch requests.
  2614. ForceSendFields []string `json:"-"`
  2615. // NullFields is a list of field names (e.g. "BalancingMode") to include
  2616. // in API requests with the JSON null value. By default, fields with
  2617. // empty values are omitted from API requests. However, any field with
  2618. // an empty value appearing in NullFields will be sent to the server as
  2619. // null. It is an error if a field in this list has a non-empty value.
  2620. // This may be used to include null fields in Patch requests.
  2621. NullFields []string `json:"-"`
  2622. }
  2623. func (s *Backend) MarshalJSON() ([]byte, error) {
  2624. type NoMethod Backend
  2625. raw := NoMethod(*s)
  2626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2627. }
  2628. func (s *Backend) UnmarshalJSON(data []byte) error {
  2629. type NoMethod Backend
  2630. var s1 struct {
  2631. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  2632. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  2633. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  2634. *NoMethod
  2635. }
  2636. s1.NoMethod = (*NoMethod)(s)
  2637. if err := json.Unmarshal(data, &s1); err != nil {
  2638. return err
  2639. }
  2640. s.CapacityScaler = float64(s1.CapacityScaler)
  2641. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  2642. s.MaxUtilization = float64(s1.MaxUtilization)
  2643. return nil
  2644. }
  2645. // BackendBucket: A BackendBucket resource. This resource defines a
  2646. // Cloud Storage bucket.
  2647. type BackendBucket struct {
  2648. // BucketName: Cloud Storage bucket name.
  2649. BucketName string `json:"bucketName,omitempty"`
  2650. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2651. // format.
  2652. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2653. // Description: An optional textual description of the resource;
  2654. // provided by the client when the resource is created.
  2655. Description string `json:"description,omitempty"`
  2656. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  2657. EnableCdn bool `json:"enableCdn,omitempty"`
  2658. // Id: [Output Only] Unique identifier for the resource; defined by the
  2659. // server.
  2660. Id uint64 `json:"id,omitempty,string"`
  2661. // Kind: Type of the resource.
  2662. Kind string `json:"kind,omitempty"`
  2663. // Name: Name of the resource. Provided by the client when the resource
  2664. // is created. The name must be 1-63 characters long, and comply with
  2665. // RFC1035. Specifically, the name must be 1-63 characters long and
  2666. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2667. // the first character must be a lowercase letter, and all following
  2668. // characters must be a dash, lowercase letter, or digit, except the
  2669. // last character, which cannot be a dash.
  2670. Name string `json:"name,omitempty"`
  2671. // SelfLink: [Output Only] Server-defined URL for the resource.
  2672. SelfLink string `json:"selfLink,omitempty"`
  2673. // ServerResponse contains the HTTP response code and headers from the
  2674. // server.
  2675. googleapi.ServerResponse `json:"-"`
  2676. // ForceSendFields is a list of field names (e.g. "BucketName") to
  2677. // unconditionally include in API requests. By default, fields with
  2678. // empty values are omitted from API requests. However, any non-pointer,
  2679. // non-interface field appearing in ForceSendFields will be sent to the
  2680. // server regardless of whether the field is empty or not. This may be
  2681. // used to include empty fields in Patch requests.
  2682. ForceSendFields []string `json:"-"`
  2683. // NullFields is a list of field names (e.g. "BucketName") to include in
  2684. // API requests with the JSON null value. By default, fields with empty
  2685. // values are omitted from API requests. However, any field with an
  2686. // empty value appearing in NullFields will be sent to the server as
  2687. // null. It is an error if a field in this list has a non-empty value.
  2688. // This may be used to include null fields in Patch requests.
  2689. NullFields []string `json:"-"`
  2690. }
  2691. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  2692. type NoMethod BackendBucket
  2693. raw := NoMethod(*s)
  2694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2695. }
  2696. // BackendBucketList: Contains a list of BackendBucket resources.
  2697. type BackendBucketList struct {
  2698. // Id: [Output Only] Unique identifier for the resource; defined by the
  2699. // server.
  2700. Id string `json:"id,omitempty"`
  2701. // Items: A list of BackendBucket resources.
  2702. Items []*BackendBucket `json:"items,omitempty"`
  2703. // Kind: Type of resource.
  2704. Kind string `json:"kind,omitempty"`
  2705. // NextPageToken: [Output Only] This token allows you to get the next
  2706. // page of results for list requests. If the number of results is larger
  2707. // than maxResults, use the nextPageToken as a value for the query
  2708. // parameter pageToken in the next list request. Subsequent list
  2709. // requests will have their own nextPageToken to continue paging through
  2710. // the results.
  2711. NextPageToken string `json:"nextPageToken,omitempty"`
  2712. // SelfLink: [Output Only] Server-defined URL for this resource.
  2713. SelfLink string `json:"selfLink,omitempty"`
  2714. // Warning: [Output Only] Informational warning message.
  2715. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  2716. // ServerResponse contains the HTTP response code and headers from the
  2717. // server.
  2718. googleapi.ServerResponse `json:"-"`
  2719. // ForceSendFields is a list of field names (e.g. "Id") to
  2720. // unconditionally include in API requests. By default, fields with
  2721. // empty values are omitted from API requests. However, any non-pointer,
  2722. // non-interface field appearing in ForceSendFields will be sent to the
  2723. // server regardless of whether the field is empty or not. This may be
  2724. // used to include empty fields in Patch requests.
  2725. ForceSendFields []string `json:"-"`
  2726. // NullFields is a list of field names (e.g. "Id") to include in API
  2727. // requests with the JSON null value. By default, fields with empty
  2728. // values are omitted from API requests. However, any field with an
  2729. // empty value appearing in NullFields will be sent to the server as
  2730. // null. It is an error if a field in this list has a non-empty value.
  2731. // This may be used to include null fields in Patch requests.
  2732. NullFields []string `json:"-"`
  2733. }
  2734. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  2735. type NoMethod BackendBucketList
  2736. raw := NoMethod(*s)
  2737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2738. }
  2739. // BackendBucketListWarning: [Output Only] Informational warning
  2740. // message.
  2741. type BackendBucketListWarning struct {
  2742. // Code: [Output Only] A warning code, if applicable. For example,
  2743. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2744. // the response.
  2745. //
  2746. // Possible values:
  2747. // "CLEANUP_FAILED"
  2748. // "DEPRECATED_RESOURCE_USED"
  2749. // "DEPRECATED_TYPE_USED"
  2750. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2751. // "EXPERIMENTAL_TYPE_USED"
  2752. // "EXTERNAL_API_WARNING"
  2753. // "FIELD_VALUE_OVERRIDEN"
  2754. // "INJECTED_KERNELS_DEPRECATED"
  2755. // "MISSING_TYPE_DEPENDENCY"
  2756. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2757. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2758. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2759. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2760. // "NEXT_HOP_NOT_RUNNING"
  2761. // "NOT_CRITICAL_ERROR"
  2762. // "NO_RESULTS_ON_PAGE"
  2763. // "REQUIRED_TOS_AGREEMENT"
  2764. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2765. // "RESOURCE_NOT_DELETED"
  2766. // "SCHEMA_VALIDATION_IGNORED"
  2767. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2768. // "UNDECLARED_PROPERTIES"
  2769. // "UNREACHABLE"
  2770. Code string `json:"code,omitempty"`
  2771. // Data: [Output Only] Metadata about this warning in key: value format.
  2772. // For example:
  2773. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2774. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  2775. // Message: [Output Only] A human-readable description of the warning
  2776. // code.
  2777. Message string `json:"message,omitempty"`
  2778. // ForceSendFields is a list of field names (e.g. "Code") to
  2779. // unconditionally include in API requests. By default, fields with
  2780. // empty values are omitted from API requests. However, any non-pointer,
  2781. // non-interface field appearing in ForceSendFields will be sent to the
  2782. // server regardless of whether the field is empty or not. This may be
  2783. // used to include empty fields in Patch requests.
  2784. ForceSendFields []string `json:"-"`
  2785. // NullFields is a list of field names (e.g. "Code") to include in API
  2786. // requests with the JSON null value. By default, fields with empty
  2787. // values are omitted from API requests. However, any field with an
  2788. // empty value appearing in NullFields will be sent to the server as
  2789. // null. It is an error if a field in this list has a non-empty value.
  2790. // This may be used to include null fields in Patch requests.
  2791. NullFields []string `json:"-"`
  2792. }
  2793. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  2794. type NoMethod BackendBucketListWarning
  2795. raw := NoMethod(*s)
  2796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2797. }
  2798. type BackendBucketListWarningData struct {
  2799. // Key: [Output Only] A key that provides more detail on the warning
  2800. // being returned. For example, for warnings where there are no results
  2801. // in a list request for a particular zone, this key might be scope and
  2802. // the key value might be the zone name. Other examples might be a key
  2803. // indicating a deprecated resource and a suggested replacement, or a
  2804. // warning about invalid network settings (for example, if an instance
  2805. // attempts to perform IP forwarding but is not enabled for IP
  2806. // forwarding).
  2807. Key string `json:"key,omitempty"`
  2808. // Value: [Output Only] A warning data value corresponding to the key.
  2809. Value string `json:"value,omitempty"`
  2810. // ForceSendFields is a list of field names (e.g. "Key") to
  2811. // unconditionally include in API requests. By default, fields with
  2812. // empty values are omitted from API requests. However, any non-pointer,
  2813. // non-interface field appearing in ForceSendFields will be sent to the
  2814. // server regardless of whether the field is empty or not. This may be
  2815. // used to include empty fields in Patch requests.
  2816. ForceSendFields []string `json:"-"`
  2817. // NullFields is a list of field names (e.g. "Key") to include in API
  2818. // requests with the JSON null value. By default, fields with empty
  2819. // values are omitted from API requests. However, any field with an
  2820. // empty value appearing in NullFields will be sent to the server as
  2821. // null. It is an error if a field in this list has a non-empty value.
  2822. // This may be used to include null fields in Patch requests.
  2823. NullFields []string `json:"-"`
  2824. }
  2825. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  2826. type NoMethod BackendBucketListWarningData
  2827. raw := NoMethod(*s)
  2828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2829. }
  2830. // BackendService: A BackendService resource. This resource defines a
  2831. // group of backend virtual machines and their serving capacity. (==
  2832. // resource_for v1.backendService ==) (== resource_for
  2833. // beta.backendService ==)
  2834. type BackendService struct {
  2835. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  2836. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  2837. // non-persistent and lasts only until the end of the browser session
  2838. // (or equivalent). The maximum allowed value for TTL is one day.
  2839. //
  2840. // When the load balancing scheme is INTERNAL, this field is not used.
  2841. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  2842. // Backends: The list of backends that serve this BackendService.
  2843. Backends []*Backend `json:"backends,omitempty"`
  2844. // CdnPolicy: Cloud CDN configuration for this BackendService.
  2845. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  2846. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  2847. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2848. // format.
  2849. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2850. // Description: An optional description of this resource. Provide this
  2851. // property when you create the resource.
  2852. Description string `json:"description,omitempty"`
  2853. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  2854. //
  2855. // When the load balancing scheme is INTERNAL, this field is not used.
  2856. EnableCDN bool `json:"enableCDN,omitempty"`
  2857. // Fingerprint: Fingerprint of this resource. A hash of the contents
  2858. // stored in this object. This field is used in optimistic locking. This
  2859. // field will be ignored when inserting a BackendService. An up-to-date
  2860. // fingerprint must be provided in order to update the BackendService.
  2861. Fingerprint string `json:"fingerprint,omitempty"`
  2862. // HealthChecks: The list of URLs to the HttpHealthCheck or
  2863. // HttpsHealthCheck resource for health checking this BackendService.
  2864. // Currently at most one health check can be specified, and a health
  2865. // check is required for Compute Engine backend services. A health check
  2866. // must not be specified for App Engine backend and Cloud Function
  2867. // backend.
  2868. //
  2869. // For internal load balancing, a URL to a HealthCheck resource must be
  2870. // specified instead.
  2871. HealthChecks []string `json:"healthChecks,omitempty"`
  2872. Iap *BackendServiceIAP `json:"iap,omitempty"`
  2873. // Id: [Output Only] The unique identifier for the resource. This
  2874. // identifier is defined by the server.
  2875. Id uint64 `json:"id,omitempty,string"`
  2876. // Kind: [Output Only] Type of resource. Always compute#backendService
  2877. // for backend services.
  2878. Kind string `json:"kind,omitempty"`
  2879. // LoadBalancingScheme: Indicates whether the backend service will be
  2880. // used with internal or external load balancing. A backend service
  2881. // created for one type of load balancing cannot be used with the other.
  2882. // Possible values are INTERNAL and EXTERNAL.
  2883. //
  2884. // Possible values:
  2885. // "EXTERNAL"
  2886. // "INTERNAL"
  2887. // "INVALID_LOAD_BALANCING_SCHEME"
  2888. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  2889. // Name: Name of the resource. Provided by the client when the resource
  2890. // is created. The name must be 1-63 characters long, and comply with
  2891. // RFC1035. Specifically, the name must be 1-63 characters long and
  2892. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2893. // the first character must be a lowercase letter, and all following
  2894. // characters must be a dash, lowercase letter, or digit, except the
  2895. // last character, which cannot be a dash.
  2896. Name string `json:"name,omitempty"`
  2897. // Port: Deprecated in favor of portName. The TCP port to connect on the
  2898. // backend. The default value is 80.
  2899. //
  2900. // This cannot be used for internal load balancing.
  2901. Port int64 `json:"port,omitempty"`
  2902. // PortName: Name of backend port. The same name should appear in the
  2903. // instance groups referenced by this service. Required when the load
  2904. // balancing scheme is EXTERNAL.
  2905. //
  2906. // When the load balancing scheme is INTERNAL, this field is not used.
  2907. PortName string `json:"portName,omitempty"`
  2908. // Protocol: The protocol this BackendService uses to communicate with
  2909. // backends.
  2910. //
  2911. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  2912. // HTTP.
  2913. //
  2914. // For internal load balancing, the possible values are TCP and UDP, and
  2915. // the default is TCP.
  2916. //
  2917. // Possible values:
  2918. // "HTTP"
  2919. // "HTTPS"
  2920. // "SSL"
  2921. // "TCP"
  2922. // "UDP"
  2923. Protocol string `json:"protocol,omitempty"`
  2924. // Region: [Output Only] URL of the region where the regional backend
  2925. // service resides. This field is not applicable to global backend
  2926. // services. You must specify this field as part of the HTTP request
  2927. // URL. It is not settable as a field in the request body.
  2928. Region string `json:"region,omitempty"`
  2929. // SelfLink: [Output Only] Server-defined URL for the resource.
  2930. SelfLink string `json:"selfLink,omitempty"`
  2931. // SessionAffinity: Type of session affinity to use. The default is
  2932. // NONE.
  2933. //
  2934. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  2935. // or GENERATED_COOKIE.
  2936. //
  2937. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  2938. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  2939. //
  2940. // When the protocol is UDP, this field is not used.
  2941. //
  2942. // Possible values:
  2943. // "CLIENT_IP"
  2944. // "CLIENT_IP_PORT_PROTO"
  2945. // "CLIENT_IP_PROTO"
  2946. // "GENERATED_COOKIE"
  2947. // "NONE"
  2948. SessionAffinity string `json:"sessionAffinity,omitempty"`
  2949. // TimeoutSec: How many seconds to wait for the backend before
  2950. // considering it a failed request. Default is 30 seconds.
  2951. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  2952. // ServerResponse contains the HTTP response code and headers from the
  2953. // server.
  2954. googleapi.ServerResponse `json:"-"`
  2955. // ForceSendFields is a list of field names (e.g.
  2956. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  2957. // By default, fields with empty values are omitted from API requests.
  2958. // However, any non-pointer, non-interface field appearing in
  2959. // ForceSendFields will be sent to the server regardless of whether the
  2960. // field is empty or not. This may be used to include empty fields in
  2961. // Patch requests.
  2962. ForceSendFields []string `json:"-"`
  2963. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  2964. // include in API requests with the JSON null value. By default, fields
  2965. // with empty values are omitted from API requests. However, any field
  2966. // with an empty value appearing in NullFields will be sent to the
  2967. // server as null. It is an error if a field in this list has a
  2968. // non-empty value. This may be used to include null fields in Patch
  2969. // requests.
  2970. NullFields []string `json:"-"`
  2971. }
  2972. func (s *BackendService) MarshalJSON() ([]byte, error) {
  2973. type NoMethod BackendService
  2974. raw := NoMethod(*s)
  2975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2976. }
  2977. // BackendServiceAggregatedList: Contains a list of
  2978. // BackendServicesScopedList.
  2979. type BackendServiceAggregatedList struct {
  2980. // Id: [Output Only] Unique identifier for the resource; defined by the
  2981. // server.
  2982. Id string `json:"id,omitempty"`
  2983. // Items: A list of BackendServicesScopedList resources.
  2984. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  2985. // Kind: Type of resource.
  2986. Kind string `json:"kind,omitempty"`
  2987. // NextPageToken: [Output Only] This token allows you to get the next
  2988. // page of results for list requests. If the number of results is larger
  2989. // than maxResults, use the nextPageToken as a value for the query
  2990. // parameter pageToken in the next list request. Subsequent list
  2991. // requests will have their own nextPageToken to continue paging through
  2992. // the results.
  2993. NextPageToken string `json:"nextPageToken,omitempty"`
  2994. // SelfLink: [Output Only] Server-defined URL for this resource.
  2995. SelfLink string `json:"selfLink,omitempty"`
  2996. // Warning: [Output Only] Informational warning message.
  2997. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  2998. // ServerResponse contains the HTTP response code and headers from the
  2999. // server.
  3000. googleapi.ServerResponse `json:"-"`
  3001. // ForceSendFields is a list of field names (e.g. "Id") to
  3002. // unconditionally include in API requests. By default, fields with
  3003. // empty values are omitted from API requests. However, any non-pointer,
  3004. // non-interface field appearing in ForceSendFields will be sent to the
  3005. // server regardless of whether the field is empty or not. This may be
  3006. // used to include empty fields in Patch requests.
  3007. ForceSendFields []string `json:"-"`
  3008. // NullFields is a list of field names (e.g. "Id") to include in API
  3009. // requests with the JSON null value. By default, fields with empty
  3010. // values are omitted from API requests. However, any field with an
  3011. // empty value appearing in NullFields will be sent to the server as
  3012. // null. It is an error if a field in this list has a non-empty value.
  3013. // This may be used to include null fields in Patch requests.
  3014. NullFields []string `json:"-"`
  3015. }
  3016. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  3017. type NoMethod BackendServiceAggregatedList
  3018. raw := NoMethod(*s)
  3019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3020. }
  3021. // BackendServiceAggregatedListWarning: [Output Only] Informational
  3022. // warning message.
  3023. type BackendServiceAggregatedListWarning struct {
  3024. // Code: [Output Only] A warning code, if applicable. For example,
  3025. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3026. // the response.
  3027. //
  3028. // Possible values:
  3029. // "CLEANUP_FAILED"
  3030. // "DEPRECATED_RESOURCE_USED"
  3031. // "DEPRECATED_TYPE_USED"
  3032. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3033. // "EXPERIMENTAL_TYPE_USED"
  3034. // "EXTERNAL_API_WARNING"
  3035. // "FIELD_VALUE_OVERRIDEN"
  3036. // "INJECTED_KERNELS_DEPRECATED"
  3037. // "MISSING_TYPE_DEPENDENCY"
  3038. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3039. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3040. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3041. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3042. // "NEXT_HOP_NOT_RUNNING"
  3043. // "NOT_CRITICAL_ERROR"
  3044. // "NO_RESULTS_ON_PAGE"
  3045. // "REQUIRED_TOS_AGREEMENT"
  3046. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3047. // "RESOURCE_NOT_DELETED"
  3048. // "SCHEMA_VALIDATION_IGNORED"
  3049. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3050. // "UNDECLARED_PROPERTIES"
  3051. // "UNREACHABLE"
  3052. Code string `json:"code,omitempty"`
  3053. // Data: [Output Only] Metadata about this warning in key: value format.
  3054. // For example:
  3055. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3056. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  3057. // Message: [Output Only] A human-readable description of the warning
  3058. // code.
  3059. Message string `json:"message,omitempty"`
  3060. // ForceSendFields is a list of field names (e.g. "Code") to
  3061. // unconditionally include in API requests. By default, fields with
  3062. // empty values are omitted from API requests. However, any non-pointer,
  3063. // non-interface field appearing in ForceSendFields will be sent to the
  3064. // server regardless of whether the field is empty or not. This may be
  3065. // used to include empty fields in Patch requests.
  3066. ForceSendFields []string `json:"-"`
  3067. // NullFields is a list of field names (e.g. "Code") to include in API
  3068. // requests with the JSON null value. By default, fields with empty
  3069. // values are omitted from API requests. However, any field with an
  3070. // empty value appearing in NullFields will be sent to the server as
  3071. // null. It is an error if a field in this list has a non-empty value.
  3072. // This may be used to include null fields in Patch requests.
  3073. NullFields []string `json:"-"`
  3074. }
  3075. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  3076. type NoMethod BackendServiceAggregatedListWarning
  3077. raw := NoMethod(*s)
  3078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3079. }
  3080. type BackendServiceAggregatedListWarningData struct {
  3081. // Key: [Output Only] A key that provides more detail on the warning
  3082. // being returned. For example, for warnings where there are no results
  3083. // in a list request for a particular zone, this key might be scope and
  3084. // the key value might be the zone name. Other examples might be a key
  3085. // indicating a deprecated resource and a suggested replacement, or a
  3086. // warning about invalid network settings (for example, if an instance
  3087. // attempts to perform IP forwarding but is not enabled for IP
  3088. // forwarding).
  3089. Key string `json:"key,omitempty"`
  3090. // Value: [Output Only] A warning data value corresponding to the key.
  3091. Value string `json:"value,omitempty"`
  3092. // ForceSendFields is a list of field names (e.g. "Key") to
  3093. // unconditionally include in API requests. By default, fields with
  3094. // empty values are omitted from API requests. However, any non-pointer,
  3095. // non-interface field appearing in ForceSendFields will be sent to the
  3096. // server regardless of whether the field is empty or not. This may be
  3097. // used to include empty fields in Patch requests.
  3098. ForceSendFields []string `json:"-"`
  3099. // NullFields is a list of field names (e.g. "Key") to include in API
  3100. // requests with the JSON null value. By default, fields with empty
  3101. // values are omitted from API requests. However, any field with an
  3102. // empty value appearing in NullFields will be sent to the server as
  3103. // null. It is an error if a field in this list has a non-empty value.
  3104. // This may be used to include null fields in Patch requests.
  3105. NullFields []string `json:"-"`
  3106. }
  3107. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3108. type NoMethod BackendServiceAggregatedListWarningData
  3109. raw := NoMethod(*s)
  3110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3111. }
  3112. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  3113. // for a backend service.
  3114. type BackendServiceCdnPolicy struct {
  3115. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  3116. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  3117. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  3118. // unconditionally include in API requests. By default, fields with
  3119. // empty values are omitted from API requests. However, any non-pointer,
  3120. // non-interface field appearing in ForceSendFields will be sent to the
  3121. // server regardless of whether the field is empty or not. This may be
  3122. // used to include empty fields in Patch requests.
  3123. ForceSendFields []string `json:"-"`
  3124. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  3125. // include in API requests with the JSON null value. By default, fields
  3126. // with empty values are omitted from API requests. However, any field
  3127. // with an empty value appearing in NullFields will be sent to the
  3128. // server as null. It is an error if a field in this list has a
  3129. // non-empty value. This may be used to include null fields in Patch
  3130. // requests.
  3131. NullFields []string `json:"-"`
  3132. }
  3133. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  3134. type NoMethod BackendServiceCdnPolicy
  3135. raw := NoMethod(*s)
  3136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3137. }
  3138. type BackendServiceGroupHealth struct {
  3139. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  3140. // Kind: [Output Only] Type of resource. Always
  3141. // compute#backendServiceGroupHealth for the health of backend services.
  3142. Kind string `json:"kind,omitempty"`
  3143. // ServerResponse contains the HTTP response code and headers from the
  3144. // server.
  3145. googleapi.ServerResponse `json:"-"`
  3146. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  3147. // unconditionally include in API requests. By default, fields with
  3148. // empty values are omitted from API requests. However, any non-pointer,
  3149. // non-interface field appearing in ForceSendFields will be sent to the
  3150. // server regardless of whether the field is empty or not. This may be
  3151. // used to include empty fields in Patch requests.
  3152. ForceSendFields []string `json:"-"`
  3153. // NullFields is a list of field names (e.g. "HealthStatus") to include
  3154. // in API requests with the JSON null value. By default, fields with
  3155. // empty values are omitted from API requests. However, any field with
  3156. // an empty value appearing in NullFields will be sent to the server as
  3157. // null. It is an error if a field in this list has a non-empty value.
  3158. // This may be used to include null fields in Patch requests.
  3159. NullFields []string `json:"-"`
  3160. }
  3161. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  3162. type NoMethod BackendServiceGroupHealth
  3163. raw := NoMethod(*s)
  3164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3165. }
  3166. // BackendServiceIAP: Identity-Aware Proxy
  3167. type BackendServiceIAP struct {
  3168. Enabled bool `json:"enabled,omitempty"`
  3169. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  3170. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  3171. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  3172. // field oauth2_client_secret above.
  3173. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  3174. // ForceSendFields is a list of field names (e.g. "Enabled") to
  3175. // unconditionally include in API requests. By default, fields with
  3176. // empty values are omitted from API requests. However, any non-pointer,
  3177. // non-interface field appearing in ForceSendFields will be sent to the
  3178. // server regardless of whether the field is empty or not. This may be
  3179. // used to include empty fields in Patch requests.
  3180. ForceSendFields []string `json:"-"`
  3181. // NullFields is a list of field names (e.g. "Enabled") to include in
  3182. // API requests with the JSON null value. By default, fields with empty
  3183. // values are omitted from API requests. However, any field with an
  3184. // empty value appearing in NullFields will be sent to the server as
  3185. // null. It is an error if a field in this list has a non-empty value.
  3186. // This may be used to include null fields in Patch requests.
  3187. NullFields []string `json:"-"`
  3188. }
  3189. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  3190. type NoMethod BackendServiceIAP
  3191. raw := NoMethod(*s)
  3192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3193. }
  3194. // BackendServiceList: Contains a list of BackendService resources.
  3195. type BackendServiceList struct {
  3196. // Id: [Output Only] Unique identifier for the resource; defined by the
  3197. // server.
  3198. Id string `json:"id,omitempty"`
  3199. // Items: A list of BackendService resources.
  3200. Items []*BackendService `json:"items,omitempty"`
  3201. // Kind: [Output Only] Type of resource. Always
  3202. // compute#backendServiceList for lists of backend services.
  3203. Kind string `json:"kind,omitempty"`
  3204. // NextPageToken: [Output Only] This token allows you to get the next
  3205. // page of results for list requests. If the number of results is larger
  3206. // than maxResults, use the nextPageToken as a value for the query
  3207. // parameter pageToken in the next list request. Subsequent list
  3208. // requests will have their own nextPageToken to continue paging through
  3209. // the results.
  3210. NextPageToken string `json:"nextPageToken,omitempty"`
  3211. // SelfLink: [Output Only] Server-defined URL for this resource.
  3212. SelfLink string `json:"selfLink,omitempty"`
  3213. // Warning: [Output Only] Informational warning message.
  3214. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  3215. // ServerResponse contains the HTTP response code and headers from the
  3216. // server.
  3217. googleapi.ServerResponse `json:"-"`
  3218. // ForceSendFields is a list of field names (e.g. "Id") to
  3219. // unconditionally include in API requests. By default, fields with
  3220. // empty values are omitted from API requests. However, any non-pointer,
  3221. // non-interface field appearing in ForceSendFields will be sent to the
  3222. // server regardless of whether the field is empty or not. This may be
  3223. // used to include empty fields in Patch requests.
  3224. ForceSendFields []string `json:"-"`
  3225. // NullFields is a list of field names (e.g. "Id") to include in API
  3226. // requests with the JSON null value. By default, fields with empty
  3227. // values are omitted from API requests. However, any field with an
  3228. // empty value appearing in NullFields will be sent to the server as
  3229. // null. It is an error if a field in this list has a non-empty value.
  3230. // This may be used to include null fields in Patch requests.
  3231. NullFields []string `json:"-"`
  3232. }
  3233. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  3234. type NoMethod BackendServiceList
  3235. raw := NoMethod(*s)
  3236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3237. }
  3238. // BackendServiceListWarning: [Output Only] Informational warning
  3239. // message.
  3240. type BackendServiceListWarning struct {
  3241. // Code: [Output Only] A warning code, if applicable. For example,
  3242. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3243. // the response.
  3244. //
  3245. // Possible values:
  3246. // "CLEANUP_FAILED"
  3247. // "DEPRECATED_RESOURCE_USED"
  3248. // "DEPRECATED_TYPE_USED"
  3249. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3250. // "EXPERIMENTAL_TYPE_USED"
  3251. // "EXTERNAL_API_WARNING"
  3252. // "FIELD_VALUE_OVERRIDEN"
  3253. // "INJECTED_KERNELS_DEPRECATED"
  3254. // "MISSING_TYPE_DEPENDENCY"
  3255. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3256. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3257. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3258. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3259. // "NEXT_HOP_NOT_RUNNING"
  3260. // "NOT_CRITICAL_ERROR"
  3261. // "NO_RESULTS_ON_PAGE"
  3262. // "REQUIRED_TOS_AGREEMENT"
  3263. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3264. // "RESOURCE_NOT_DELETED"
  3265. // "SCHEMA_VALIDATION_IGNORED"
  3266. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3267. // "UNDECLARED_PROPERTIES"
  3268. // "UNREACHABLE"
  3269. Code string `json:"code,omitempty"`
  3270. // Data: [Output Only] Metadata about this warning in key: value format.
  3271. // For example:
  3272. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3273. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  3274. // Message: [Output Only] A human-readable description of the warning
  3275. // code.
  3276. Message string `json:"message,omitempty"`
  3277. // ForceSendFields is a list of field names (e.g. "Code") to
  3278. // unconditionally include in API requests. By default, fields with
  3279. // empty values are omitted from API requests. However, any non-pointer,
  3280. // non-interface field appearing in ForceSendFields will be sent to the
  3281. // server regardless of whether the field is empty or not. This may be
  3282. // used to include empty fields in Patch requests.
  3283. ForceSendFields []string `json:"-"`
  3284. // NullFields is a list of field names (e.g. "Code") to include in API
  3285. // requests with the JSON null value. By default, fields with empty
  3286. // values are omitted from API requests. However, any field with an
  3287. // empty value appearing in NullFields will be sent to the server as
  3288. // null. It is an error if a field in this list has a non-empty value.
  3289. // This may be used to include null fields in Patch requests.
  3290. NullFields []string `json:"-"`
  3291. }
  3292. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  3293. type NoMethod BackendServiceListWarning
  3294. raw := NoMethod(*s)
  3295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3296. }
  3297. type BackendServiceListWarningData struct {
  3298. // Key: [Output Only] A key that provides more detail on the warning
  3299. // being returned. For example, for warnings where there are no results
  3300. // in a list request for a particular zone, this key might be scope and
  3301. // the key value might be the zone name. Other examples might be a key
  3302. // indicating a deprecated resource and a suggested replacement, or a
  3303. // warning about invalid network settings (for example, if an instance
  3304. // attempts to perform IP forwarding but is not enabled for IP
  3305. // forwarding).
  3306. Key string `json:"key,omitempty"`
  3307. // Value: [Output Only] A warning data value corresponding to the key.
  3308. Value string `json:"value,omitempty"`
  3309. // ForceSendFields is a list of field names (e.g. "Key") to
  3310. // unconditionally include in API requests. By default, fields with
  3311. // empty values are omitted from API requests. However, any non-pointer,
  3312. // non-interface field appearing in ForceSendFields will be sent to the
  3313. // server regardless of whether the field is empty or not. This may be
  3314. // used to include empty fields in Patch requests.
  3315. ForceSendFields []string `json:"-"`
  3316. // NullFields is a list of field names (e.g. "Key") to include in API
  3317. // requests with the JSON null value. By default, fields with empty
  3318. // values are omitted from API requests. However, any field with an
  3319. // empty value appearing in NullFields will be sent to the server as
  3320. // null. It is an error if a field in this list has a non-empty value.
  3321. // This may be used to include null fields in Patch requests.
  3322. NullFields []string `json:"-"`
  3323. }
  3324. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  3325. type NoMethod BackendServiceListWarningData
  3326. raw := NoMethod(*s)
  3327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3328. }
  3329. type BackendServicesScopedList struct {
  3330. // BackendServices: A list of BackendServices contained in this scope.
  3331. BackendServices []*BackendService `json:"backendServices,omitempty"`
  3332. // Warning: Informational warning which replaces the list of backend
  3333. // services when the list is empty.
  3334. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  3335. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  3336. // unconditionally include in API requests. By default, fields with
  3337. // empty values are omitted from API requests. However, any non-pointer,
  3338. // non-interface field appearing in ForceSendFields will be sent to the
  3339. // server regardless of whether the field is empty or not. This may be
  3340. // used to include empty fields in Patch requests.
  3341. ForceSendFields []string `json:"-"`
  3342. // NullFields is a list of field names (e.g. "BackendServices") to
  3343. // include in API requests with the JSON null value. By default, fields
  3344. // with empty values are omitted from API requests. However, any field
  3345. // with an empty value appearing in NullFields will be sent to the
  3346. // server as null. It is an error if a field in this list has a
  3347. // non-empty value. This may be used to include null fields in Patch
  3348. // requests.
  3349. NullFields []string `json:"-"`
  3350. }
  3351. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  3352. type NoMethod BackendServicesScopedList
  3353. raw := NoMethod(*s)
  3354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3355. }
  3356. // BackendServicesScopedListWarning: Informational warning which
  3357. // replaces the list of backend services when the list is empty.
  3358. type BackendServicesScopedListWarning 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 []*BackendServicesScopedListWarningData `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 *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  3411. type NoMethod BackendServicesScopedListWarning
  3412. raw := NoMethod(*s)
  3413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3414. }
  3415. type BackendServicesScopedListWarningData 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 *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  3443. type NoMethod BackendServicesScopedListWarningData
  3444. raw := NoMethod(*s)
  3445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3446. }
  3447. type CacheInvalidationRule struct {
  3448. // Host: If set, this invalidation rule will only apply to requests with
  3449. // a Host header matching host.
  3450. Host string `json:"host,omitempty"`
  3451. Path string `json:"path,omitempty"`
  3452. // ForceSendFields is a list of field names (e.g. "Host") to
  3453. // unconditionally include in API requests. By default, fields with
  3454. // empty values are omitted from API requests. However, any non-pointer,
  3455. // non-interface field appearing in ForceSendFields will be sent to the
  3456. // server regardless of whether the field is empty or not. This may be
  3457. // used to include empty fields in Patch requests.
  3458. ForceSendFields []string `json:"-"`
  3459. // NullFields is a list of field names (e.g. "Host") to include in API
  3460. // requests with the JSON null value. By default, fields with empty
  3461. // values are omitted from API requests. However, any field with an
  3462. // empty value appearing in NullFields will be sent to the server as
  3463. // null. It is an error if a field in this list has a non-empty value.
  3464. // This may be used to include null fields in Patch requests.
  3465. NullFields []string `json:"-"`
  3466. }
  3467. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  3468. type NoMethod CacheInvalidationRule
  3469. raw := NoMethod(*s)
  3470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3471. }
  3472. // CacheKeyPolicy: Message containing what to include in the cache key
  3473. // for a request for Cloud CDN.
  3474. type CacheKeyPolicy struct {
  3475. // IncludeHost: If true, requests to different hosts will be cached
  3476. // separately.
  3477. IncludeHost bool `json:"includeHost,omitempty"`
  3478. // IncludeProtocol: If true, http and https requests will be cached
  3479. // separately.
  3480. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  3481. // IncludeQueryString: If true, include query string parameters in the
  3482. // cache key according to query_string_whitelist and
  3483. // query_string_blacklist. If neither is set, the entire query string
  3484. // will be included. If false, the query string will be excluded from
  3485. // the cache key entirely.
  3486. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  3487. // QueryStringBlacklist: Names of query string parameters to exclude in
  3488. // cache keys. All other parameters will be included. Either specify
  3489. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3490. // '=' will be percent encoded and not treated as delimiters.
  3491. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  3492. // QueryStringWhitelist: Names of query string parameters to include in
  3493. // cache keys. All other parameters will be excluded. Either specify
  3494. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3495. // '=' will be percent encoded and not treated as delimiters.
  3496. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  3497. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  3498. // unconditionally include in API requests. By default, fields with
  3499. // empty values are omitted from API requests. However, any non-pointer,
  3500. // non-interface field appearing in ForceSendFields will be sent to the
  3501. // server regardless of whether the field is empty or not. This may be
  3502. // used to include empty fields in Patch requests.
  3503. ForceSendFields []string `json:"-"`
  3504. // NullFields is a list of field names (e.g. "IncludeHost") to include
  3505. // in API requests with the JSON null value. By default, fields with
  3506. // empty values are omitted from API requests. However, any field with
  3507. // an empty value appearing in NullFields will be sent to the server as
  3508. // null. It is an error if a field in this list has a non-empty value.
  3509. // This may be used to include null fields in Patch requests.
  3510. NullFields []string `json:"-"`
  3511. }
  3512. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  3513. type NoMethod CacheKeyPolicy
  3514. raw := NoMethod(*s)
  3515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3516. }
  3517. // Commitment: Represents a Commitment resource. Creating a Commitment
  3518. // resource means that you are purchasing a committed use contract with
  3519. // an explicit start and end time. You can create commitments based on
  3520. // vCPUs and memory usage and receive discounted rates. For full
  3521. // details, read Signing Up for Committed Use Discounts.
  3522. //
  3523. // Committed use discounts are subject to Google Cloud Platform's
  3524. // Service Specific Terms. By purchasing a committed use discount, you
  3525. // agree to these terms. Committed use discounts will not renew, so you
  3526. // must purchase a new commitment to continue receiving discounts. (==
  3527. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  3528. type Commitment struct {
  3529. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3530. // format.
  3531. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3532. // Description: An optional description of this resource. Provide this
  3533. // property when you create the resource.
  3534. Description string `json:"description,omitempty"`
  3535. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  3536. // format.
  3537. EndTimestamp string `json:"endTimestamp,omitempty"`
  3538. // Id: [Output Only] The unique identifier for the resource. This
  3539. // identifier is defined by the server.
  3540. Id uint64 `json:"id,omitempty,string"`
  3541. // Kind: [Output Only] Type of the resource. Always compute#commitment
  3542. // for commitments.
  3543. Kind string `json:"kind,omitempty"`
  3544. // Name: Name of the resource. Provided by the client when the resource
  3545. // is created. The name must be 1-63 characters long, and comply with
  3546. // RFC1035. Specifically, the name must be 1-63 characters long and
  3547. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3548. // the first character must be a lowercase letter, and all following
  3549. // characters must be a dash, lowercase letter, or digit, except the
  3550. // last character, which cannot be a dash.
  3551. Name string `json:"name,omitempty"`
  3552. // Plan: The plan for this commitment, which determines duration and
  3553. // discount rate. The currently supported plans are TWELVE_MONTH (1
  3554. // year), and THIRTY_SIX_MONTH (3 years).
  3555. //
  3556. // Possible values:
  3557. // "INVALID"
  3558. // "THIRTY_SIX_MONTH"
  3559. // "TWELVE_MONTH"
  3560. Plan string `json:"plan,omitempty"`
  3561. // Region: [Output Only] URL of the region where this commitment may be
  3562. // used.
  3563. Region string `json:"region,omitempty"`
  3564. // Resources: A list of commitment amounts for particular resources.
  3565. // Note that VCPU and MEMORY resource commitments must occur together.
  3566. Resources []*ResourceCommitment `json:"resources,omitempty"`
  3567. // SelfLink: [Output Only] Server-defined URL for the resource.
  3568. SelfLink string `json:"selfLink,omitempty"`
  3569. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  3570. // format.
  3571. StartTimestamp string `json:"startTimestamp,omitempty"`
  3572. // Status: [Output Only] Status of the commitment with regards to
  3573. // eventual expiration (each commitment has an end date defined). One of
  3574. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  3575. //
  3576. // Possible values:
  3577. // "ACTIVE"
  3578. // "CREATING"
  3579. // "EXPIRED"
  3580. // "NOT_YET_ACTIVE"
  3581. Status string `json:"status,omitempty"`
  3582. // StatusMessage: [Output Only] An optional, human-readable explanation
  3583. // of the status.
  3584. StatusMessage string `json:"statusMessage,omitempty"`
  3585. // ServerResponse contains the HTTP response code and headers from the
  3586. // server.
  3587. googleapi.ServerResponse `json:"-"`
  3588. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  3589. // to unconditionally include in API requests. By default, fields with
  3590. // empty values are omitted from API requests. However, any non-pointer,
  3591. // non-interface field appearing in ForceSendFields will be sent to the
  3592. // server regardless of whether the field is empty or not. This may be
  3593. // used to include empty fields in Patch requests.
  3594. ForceSendFields []string `json:"-"`
  3595. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  3596. // include in API requests with the JSON null value. By default, fields
  3597. // with empty values are omitted from API requests. However, any field
  3598. // with an empty value appearing in NullFields will be sent to the
  3599. // server as null. It is an error if a field in this list has a
  3600. // non-empty value. This may be used to include null fields in Patch
  3601. // requests.
  3602. NullFields []string `json:"-"`
  3603. }
  3604. func (s *Commitment) MarshalJSON() ([]byte, error) {
  3605. type NoMethod Commitment
  3606. raw := NoMethod(*s)
  3607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3608. }
  3609. type CommitmentAggregatedList struct {
  3610. // Id: [Output Only] Unique identifier for the resource; defined by the
  3611. // server.
  3612. Id string `json:"id,omitempty"`
  3613. // Items: A list of CommitmentsScopedList resources.
  3614. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  3615. // Kind: [Output Only] Type of resource. Always
  3616. // compute#commitmentAggregatedList for aggregated lists of commitments.
  3617. Kind string `json:"kind,omitempty"`
  3618. // NextPageToken: [Output Only] This token allows you to get the next
  3619. // page of results for list requests. If the number of results is larger
  3620. // than maxResults, use the nextPageToken as a value for the query
  3621. // parameter pageToken in the next list request. Subsequent list
  3622. // requests will have their own nextPageToken to continue paging through
  3623. // the results.
  3624. NextPageToken string `json:"nextPageToken,omitempty"`
  3625. // SelfLink: [Output Only] Server-defined URL for this resource.
  3626. SelfLink string `json:"selfLink,omitempty"`
  3627. // Warning: [Output Only] Informational warning message.
  3628. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  3629. // ServerResponse contains the HTTP response code and headers from the
  3630. // server.
  3631. googleapi.ServerResponse `json:"-"`
  3632. // ForceSendFields is a list of field names (e.g. "Id") to
  3633. // unconditionally include in API requests. By default, fields with
  3634. // empty values are omitted from API requests. However, any non-pointer,
  3635. // non-interface field appearing in ForceSendFields will be sent to the
  3636. // server regardless of whether the field is empty or not. This may be
  3637. // used to include empty fields in Patch requests.
  3638. ForceSendFields []string `json:"-"`
  3639. // NullFields is a list of field names (e.g. "Id") to include in API
  3640. // requests with the JSON null value. By default, fields with empty
  3641. // values are omitted from API requests. However, any field with an
  3642. // empty value appearing in NullFields will be sent to the server as
  3643. // null. It is an error if a field in this list has a non-empty value.
  3644. // This may be used to include null fields in Patch requests.
  3645. NullFields []string `json:"-"`
  3646. }
  3647. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  3648. type NoMethod CommitmentAggregatedList
  3649. raw := NoMethod(*s)
  3650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3651. }
  3652. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  3653. // message.
  3654. type CommitmentAggregatedListWarning struct {
  3655. // Code: [Output Only] A warning code, if applicable. For example,
  3656. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3657. // the response.
  3658. //
  3659. // Possible values:
  3660. // "CLEANUP_FAILED"
  3661. // "DEPRECATED_RESOURCE_USED"
  3662. // "DEPRECATED_TYPE_USED"
  3663. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3664. // "EXPERIMENTAL_TYPE_USED"
  3665. // "EXTERNAL_API_WARNING"
  3666. // "FIELD_VALUE_OVERRIDEN"
  3667. // "INJECTED_KERNELS_DEPRECATED"
  3668. // "MISSING_TYPE_DEPENDENCY"
  3669. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3670. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3671. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3672. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3673. // "NEXT_HOP_NOT_RUNNING"
  3674. // "NOT_CRITICAL_ERROR"
  3675. // "NO_RESULTS_ON_PAGE"
  3676. // "REQUIRED_TOS_AGREEMENT"
  3677. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3678. // "RESOURCE_NOT_DELETED"
  3679. // "SCHEMA_VALIDATION_IGNORED"
  3680. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3681. // "UNDECLARED_PROPERTIES"
  3682. // "UNREACHABLE"
  3683. Code string `json:"code,omitempty"`
  3684. // Data: [Output Only] Metadata about this warning in key: value format.
  3685. // For example:
  3686. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3687. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  3688. // Message: [Output Only] A human-readable description of the warning
  3689. // code.
  3690. Message string `json:"message,omitempty"`
  3691. // ForceSendFields is a list of field names (e.g. "Code") to
  3692. // unconditionally include in API requests. By default, fields with
  3693. // empty values are omitted from API requests. However, any non-pointer,
  3694. // non-interface field appearing in ForceSendFields will be sent to the
  3695. // server regardless of whether the field is empty or not. This may be
  3696. // used to include empty fields in Patch requests.
  3697. ForceSendFields []string `json:"-"`
  3698. // NullFields is a list of field names (e.g. "Code") to include in API
  3699. // requests with the JSON null value. By default, fields with empty
  3700. // values are omitted from API requests. However, any field with an
  3701. // empty value appearing in NullFields will be sent to the server as
  3702. // null. It is an error if a field in this list has a non-empty value.
  3703. // This may be used to include null fields in Patch requests.
  3704. NullFields []string `json:"-"`
  3705. }
  3706. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  3707. type NoMethod CommitmentAggregatedListWarning
  3708. raw := NoMethod(*s)
  3709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3710. }
  3711. type CommitmentAggregatedListWarningData struct {
  3712. // Key: [Output Only] A key that provides more detail on the warning
  3713. // being returned. For example, for warnings where there are no results
  3714. // in a list request for a particular zone, this key might be scope and
  3715. // the key value might be the zone name. Other examples might be a key
  3716. // indicating a deprecated resource and a suggested replacement, or a
  3717. // warning about invalid network settings (for example, if an instance
  3718. // attempts to perform IP forwarding but is not enabled for IP
  3719. // forwarding).
  3720. Key string `json:"key,omitempty"`
  3721. // Value: [Output Only] A warning data value corresponding to the key.
  3722. Value string `json:"value,omitempty"`
  3723. // ForceSendFields is a list of field names (e.g. "Key") to
  3724. // unconditionally include in API requests. By default, fields with
  3725. // empty values are omitted from API requests. However, any non-pointer,
  3726. // non-interface field appearing in ForceSendFields will be sent to the
  3727. // server regardless of whether the field is empty or not. This may be
  3728. // used to include empty fields in Patch requests.
  3729. ForceSendFields []string `json:"-"`
  3730. // NullFields is a list of field names (e.g. "Key") to include in API
  3731. // requests with the JSON null value. By default, fields with empty
  3732. // values are omitted from API requests. However, any field with an
  3733. // empty value appearing in NullFields will be sent to the server as
  3734. // null. It is an error if a field in this list has a non-empty value.
  3735. // This may be used to include null fields in Patch requests.
  3736. NullFields []string `json:"-"`
  3737. }
  3738. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3739. type NoMethod CommitmentAggregatedListWarningData
  3740. raw := NoMethod(*s)
  3741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3742. }
  3743. // CommitmentList: Contains a list of Commitment resources.
  3744. type CommitmentList struct {
  3745. // Id: [Output Only] Unique identifier for the resource; defined by the
  3746. // server.
  3747. Id string `json:"id,omitempty"`
  3748. // Items: A list of Commitment resources.
  3749. Items []*Commitment `json:"items,omitempty"`
  3750. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  3751. // for lists of commitments.
  3752. Kind string `json:"kind,omitempty"`
  3753. // NextPageToken: [Output Only] This token allows you to get the next
  3754. // page of results for list requests. If the number of results is larger
  3755. // than maxResults, use the nextPageToken as a value for the query
  3756. // parameter pageToken in the next list request. Subsequent list
  3757. // requests will have their own nextPageToken to continue paging through
  3758. // the results.
  3759. NextPageToken string `json:"nextPageToken,omitempty"`
  3760. // SelfLink: [Output Only] Server-defined URL for this resource.
  3761. SelfLink string `json:"selfLink,omitempty"`
  3762. // Warning: [Output Only] Informational warning message.
  3763. Warning *CommitmentListWarning `json:"warning,omitempty"`
  3764. // ServerResponse contains the HTTP response code and headers from the
  3765. // server.
  3766. googleapi.ServerResponse `json:"-"`
  3767. // ForceSendFields is a list of field names (e.g. "Id") to
  3768. // unconditionally include in API requests. By default, fields with
  3769. // empty values are omitted from API requests. However, any non-pointer,
  3770. // non-interface field appearing in ForceSendFields will be sent to the
  3771. // server regardless of whether the field is empty or not. This may be
  3772. // used to include empty fields in Patch requests.
  3773. ForceSendFields []string `json:"-"`
  3774. // NullFields is a list of field names (e.g. "Id") to include in API
  3775. // requests with the JSON null value. By default, fields with empty
  3776. // values are omitted from API requests. However, any field with an
  3777. // empty value appearing in NullFields will be sent to the server as
  3778. // null. It is an error if a field in this list has a non-empty value.
  3779. // This may be used to include null fields in Patch requests.
  3780. NullFields []string `json:"-"`
  3781. }
  3782. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  3783. type NoMethod CommitmentList
  3784. raw := NoMethod(*s)
  3785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3786. }
  3787. // CommitmentListWarning: [Output Only] Informational warning message.
  3788. type CommitmentListWarning struct {
  3789. // Code: [Output Only] A warning code, if applicable. For example,
  3790. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3791. // the response.
  3792. //
  3793. // Possible values:
  3794. // "CLEANUP_FAILED"
  3795. // "DEPRECATED_RESOURCE_USED"
  3796. // "DEPRECATED_TYPE_USED"
  3797. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3798. // "EXPERIMENTAL_TYPE_USED"
  3799. // "EXTERNAL_API_WARNING"
  3800. // "FIELD_VALUE_OVERRIDEN"
  3801. // "INJECTED_KERNELS_DEPRECATED"
  3802. // "MISSING_TYPE_DEPENDENCY"
  3803. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3804. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3805. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3806. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3807. // "NEXT_HOP_NOT_RUNNING"
  3808. // "NOT_CRITICAL_ERROR"
  3809. // "NO_RESULTS_ON_PAGE"
  3810. // "REQUIRED_TOS_AGREEMENT"
  3811. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3812. // "RESOURCE_NOT_DELETED"
  3813. // "SCHEMA_VALIDATION_IGNORED"
  3814. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3815. // "UNDECLARED_PROPERTIES"
  3816. // "UNREACHABLE"
  3817. Code string `json:"code,omitempty"`
  3818. // Data: [Output Only] Metadata about this warning in key: value format.
  3819. // For example:
  3820. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3821. Data []*CommitmentListWarningData `json:"data,omitempty"`
  3822. // Message: [Output Only] A human-readable description of the warning
  3823. // code.
  3824. Message string `json:"message,omitempty"`
  3825. // ForceSendFields is a list of field names (e.g. "Code") to
  3826. // unconditionally include in API requests. By default, fields with
  3827. // empty values are omitted from API requests. However, any non-pointer,
  3828. // non-interface field appearing in ForceSendFields will be sent to the
  3829. // server regardless of whether the field is empty or not. This may be
  3830. // used to include empty fields in Patch requests.
  3831. ForceSendFields []string `json:"-"`
  3832. // NullFields is a list of field names (e.g. "Code") to include in API
  3833. // requests with the JSON null value. By default, fields with empty
  3834. // values are omitted from API requests. However, any field with an
  3835. // empty value appearing in NullFields will be sent to the server as
  3836. // null. It is an error if a field in this list has a non-empty value.
  3837. // This may be used to include null fields in Patch requests.
  3838. NullFields []string `json:"-"`
  3839. }
  3840. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  3841. type NoMethod CommitmentListWarning
  3842. raw := NoMethod(*s)
  3843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3844. }
  3845. type CommitmentListWarningData struct {
  3846. // Key: [Output Only] A key that provides more detail on the warning
  3847. // being returned. For example, for warnings where there are no results
  3848. // in a list request for a particular zone, this key might be scope and
  3849. // the key value might be the zone name. Other examples might be a key
  3850. // indicating a deprecated resource and a suggested replacement, or a
  3851. // warning about invalid network settings (for example, if an instance
  3852. // attempts to perform IP forwarding but is not enabled for IP
  3853. // forwarding).
  3854. Key string `json:"key,omitempty"`
  3855. // Value: [Output Only] A warning data value corresponding to the key.
  3856. Value string `json:"value,omitempty"`
  3857. // ForceSendFields is a list of field names (e.g. "Key") to
  3858. // unconditionally include in API requests. By default, fields with
  3859. // empty values are omitted from API requests. However, any non-pointer,
  3860. // non-interface field appearing in ForceSendFields will be sent to the
  3861. // server regardless of whether the field is empty or not. This may be
  3862. // used to include empty fields in Patch requests.
  3863. ForceSendFields []string `json:"-"`
  3864. // NullFields is a list of field names (e.g. "Key") to include in API
  3865. // requests with the JSON null value. By default, fields with empty
  3866. // values are omitted from API requests. However, any field with an
  3867. // empty value appearing in NullFields will be sent to the server as
  3868. // null. It is an error if a field in this list has a non-empty value.
  3869. // This may be used to include null fields in Patch requests.
  3870. NullFields []string `json:"-"`
  3871. }
  3872. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  3873. type NoMethod CommitmentListWarningData
  3874. raw := NoMethod(*s)
  3875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3876. }
  3877. type CommitmentsScopedList struct {
  3878. // Commitments: [Output Only] A list of commitments contained in this
  3879. // scope.
  3880. Commitments []*Commitment `json:"commitments,omitempty"`
  3881. // Warning: [Output Only] Informational warning which replaces the list
  3882. // of commitments when the list is empty.
  3883. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  3884. // ForceSendFields is a list of field names (e.g. "Commitments") to
  3885. // unconditionally include in API requests. By default, fields with
  3886. // empty values are omitted from API requests. However, any non-pointer,
  3887. // non-interface field appearing in ForceSendFields will be sent to the
  3888. // server regardless of whether the field is empty or not. This may be
  3889. // used to include empty fields in Patch requests.
  3890. ForceSendFields []string `json:"-"`
  3891. // NullFields is a list of field names (e.g. "Commitments") to include
  3892. // in API requests with the JSON null value. By default, fields with
  3893. // empty values are omitted from API requests. However, any field with
  3894. // an empty value appearing in NullFields will be sent to the server as
  3895. // null. It is an error if a field in this list has a non-empty value.
  3896. // This may be used to include null fields in Patch requests.
  3897. NullFields []string `json:"-"`
  3898. }
  3899. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  3900. type NoMethod CommitmentsScopedList
  3901. raw := NoMethod(*s)
  3902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3903. }
  3904. // CommitmentsScopedListWarning: [Output Only] Informational warning
  3905. // which replaces the list of commitments when the list is empty.
  3906. type CommitmentsScopedListWarning struct {
  3907. // Code: [Output Only] A warning code, if applicable. For example,
  3908. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3909. // the response.
  3910. //
  3911. // Possible values:
  3912. // "CLEANUP_FAILED"
  3913. // "DEPRECATED_RESOURCE_USED"
  3914. // "DEPRECATED_TYPE_USED"
  3915. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3916. // "EXPERIMENTAL_TYPE_USED"
  3917. // "EXTERNAL_API_WARNING"
  3918. // "FIELD_VALUE_OVERRIDEN"
  3919. // "INJECTED_KERNELS_DEPRECATED"
  3920. // "MISSING_TYPE_DEPENDENCY"
  3921. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3922. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3923. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3924. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3925. // "NEXT_HOP_NOT_RUNNING"
  3926. // "NOT_CRITICAL_ERROR"
  3927. // "NO_RESULTS_ON_PAGE"
  3928. // "REQUIRED_TOS_AGREEMENT"
  3929. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3930. // "RESOURCE_NOT_DELETED"
  3931. // "SCHEMA_VALIDATION_IGNORED"
  3932. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3933. // "UNDECLARED_PROPERTIES"
  3934. // "UNREACHABLE"
  3935. Code string `json:"code,omitempty"`
  3936. // Data: [Output Only] Metadata about this warning in key: value format.
  3937. // For example:
  3938. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3939. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  3940. // Message: [Output Only] A human-readable description of the warning
  3941. // code.
  3942. Message string `json:"message,omitempty"`
  3943. // ForceSendFields is a list of field names (e.g. "Code") to
  3944. // unconditionally include in API requests. By default, fields with
  3945. // empty values are omitted from API requests. However, any non-pointer,
  3946. // non-interface field appearing in ForceSendFields will be sent to the
  3947. // server regardless of whether the field is empty or not. This may be
  3948. // used to include empty fields in Patch requests.
  3949. ForceSendFields []string `json:"-"`
  3950. // NullFields is a list of field names (e.g. "Code") to include in API
  3951. // requests with the JSON null value. By default, fields with empty
  3952. // values are omitted from API requests. However, any field with an
  3953. // empty value appearing in NullFields will be sent to the server as
  3954. // null. It is an error if a field in this list has a non-empty value.
  3955. // This may be used to include null fields in Patch requests.
  3956. NullFields []string `json:"-"`
  3957. }
  3958. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  3959. type NoMethod CommitmentsScopedListWarning
  3960. raw := NoMethod(*s)
  3961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3962. }
  3963. type CommitmentsScopedListWarningData struct {
  3964. // Key: [Output Only] A key that provides more detail on the warning
  3965. // being returned. For example, for warnings where there are no results
  3966. // in a list request for a particular zone, this key might be scope and
  3967. // the key value might be the zone name. Other examples might be a key
  3968. // indicating a deprecated resource and a suggested replacement, or a
  3969. // warning about invalid network settings (for example, if an instance
  3970. // attempts to perform IP forwarding but is not enabled for IP
  3971. // forwarding).
  3972. Key string `json:"key,omitempty"`
  3973. // Value: [Output Only] A warning data value corresponding to the key.
  3974. Value string `json:"value,omitempty"`
  3975. // ForceSendFields is a list of field names (e.g. "Key") to
  3976. // unconditionally include in API requests. By default, fields with
  3977. // empty values are omitted from API requests. However, any non-pointer,
  3978. // non-interface field appearing in ForceSendFields will be sent to the
  3979. // server regardless of whether the field is empty or not. This may be
  3980. // used to include empty fields in Patch requests.
  3981. ForceSendFields []string `json:"-"`
  3982. // NullFields is a list of field names (e.g. "Key") to include in API
  3983. // requests with the JSON null value. By default, fields with empty
  3984. // values are omitted from API requests. However, any field with an
  3985. // empty value appearing in NullFields will be sent to the server as
  3986. // null. It is an error if a field in this list has a non-empty value.
  3987. // This may be used to include null fields in Patch requests.
  3988. NullFields []string `json:"-"`
  3989. }
  3990. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  3991. type NoMethod CommitmentsScopedListWarningData
  3992. raw := NoMethod(*s)
  3993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3994. }
  3995. // ConnectionDraining: Message containing connection draining
  3996. // configuration.
  3997. type ConnectionDraining struct {
  3998. // DrainingTimeoutSec: Time for which instance will be drained (not
  3999. // accept new connections, but still work to finish started).
  4000. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  4001. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  4002. // to unconditionally include in API requests. By default, fields with
  4003. // empty values are omitted from API requests. However, any non-pointer,
  4004. // non-interface field appearing in ForceSendFields will be sent to the
  4005. // server regardless of whether the field is empty or not. This may be
  4006. // used to include empty fields in Patch requests.
  4007. ForceSendFields []string `json:"-"`
  4008. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  4009. // include in API requests with the JSON null value. By default, fields
  4010. // with empty values are omitted from API requests. However, any field
  4011. // with an empty value appearing in NullFields will be sent to the
  4012. // server as null. It is an error if a field in this list has a
  4013. // non-empty value. This may be used to include null fields in Patch
  4014. // requests.
  4015. NullFields []string `json:"-"`
  4016. }
  4017. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  4018. type NoMethod ConnectionDraining
  4019. raw := NoMethod(*s)
  4020. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4021. }
  4022. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  4023. type CustomerEncryptionKey struct {
  4024. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  4025. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  4026. RawKey string `json:"rawKey,omitempty"`
  4027. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  4028. // customer-supplied encryption key that protects this resource.
  4029. Sha256 string `json:"sha256,omitempty"`
  4030. // ForceSendFields is a list of field names (e.g. "RawKey") to
  4031. // unconditionally include in API requests. By default, fields with
  4032. // empty values are omitted from API requests. However, any non-pointer,
  4033. // non-interface field appearing in ForceSendFields will be sent to the
  4034. // server regardless of whether the field is empty or not. This may be
  4035. // used to include empty fields in Patch requests.
  4036. ForceSendFields []string `json:"-"`
  4037. // NullFields is a list of field names (e.g. "RawKey") to include in API
  4038. // requests with the JSON null value. By default, fields with empty
  4039. // values are omitted from API requests. However, any field with an
  4040. // empty value appearing in NullFields will be sent to the server as
  4041. // null. It is an error if a field in this list has a non-empty value.
  4042. // This may be used to include null fields in Patch requests.
  4043. NullFields []string `json:"-"`
  4044. }
  4045. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  4046. type NoMethod CustomerEncryptionKey
  4047. raw := NoMethod(*s)
  4048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4049. }
  4050. type CustomerEncryptionKeyProtectedDisk struct {
  4051. // DiskEncryptionKey: Decrypts data associated with the disk with a
  4052. // customer-supplied encryption key.
  4053. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4054. // Source: Specifies a valid partial or full URL to an existing
  4055. // Persistent Disk resource. This field is only applicable for
  4056. // persistent disks.
  4057. Source string `json:"source,omitempty"`
  4058. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  4059. // to unconditionally include in API requests. By default, fields with
  4060. // empty values are omitted from API requests. However, any non-pointer,
  4061. // non-interface field appearing in ForceSendFields will be sent to the
  4062. // server regardless of whether the field is empty or not. This may be
  4063. // used to include empty fields in Patch requests.
  4064. ForceSendFields []string `json:"-"`
  4065. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  4066. // include in API requests with the JSON null value. By default, fields
  4067. // with empty values are omitted from API requests. However, any field
  4068. // with an empty value appearing in NullFields will be sent to the
  4069. // server as null. It is an error if a field in this list has a
  4070. // non-empty value. This may be used to include null fields in Patch
  4071. // requests.
  4072. NullFields []string `json:"-"`
  4073. }
  4074. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  4075. type NoMethod CustomerEncryptionKeyProtectedDisk
  4076. raw := NoMethod(*s)
  4077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4078. }
  4079. // DeprecationStatus: Deprecation status for a public resource.
  4080. type DeprecationStatus struct {
  4081. // Deleted: An optional RFC3339 timestamp on or after which the state of
  4082. // this resource is intended to change to DELETED. This is only
  4083. // informational and the status will not change unless the client
  4084. // explicitly changes it.
  4085. Deleted string `json:"deleted,omitempty"`
  4086. // Deprecated: An optional RFC3339 timestamp on or after which the state
  4087. // of this resource is intended to change to DEPRECATED. This is only
  4088. // informational and the status will not change unless the client
  4089. // explicitly changes it.
  4090. Deprecated string `json:"deprecated,omitempty"`
  4091. // Obsolete: An optional RFC3339 timestamp on or after which the state
  4092. // of this resource is intended to change to OBSOLETE. This is only
  4093. // informational and the status will not change unless the client
  4094. // explicitly changes it.
  4095. Obsolete string `json:"obsolete,omitempty"`
  4096. // Replacement: The URL of the suggested replacement for a deprecated
  4097. // resource. The suggested replacement resource must be the same kind of
  4098. // resource as the deprecated resource.
  4099. Replacement string `json:"replacement,omitempty"`
  4100. // State: The deprecation state of this resource. This can be
  4101. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  4102. // resource using a DEPRECATED resource will return successfully, but
  4103. // with a warning indicating the deprecated resource and recommending
  4104. // its replacement. Operations which use OBSOLETE or DELETED resources
  4105. // will be rejected and result in an error.
  4106. //
  4107. // Possible values:
  4108. // "DELETED"
  4109. // "DEPRECATED"
  4110. // "OBSOLETE"
  4111. State string `json:"state,omitempty"`
  4112. // ForceSendFields is a list of field names (e.g. "Deleted") to
  4113. // unconditionally include in API requests. By default, fields with
  4114. // empty values are omitted from API requests. However, any non-pointer,
  4115. // non-interface field appearing in ForceSendFields will be sent to the
  4116. // server regardless of whether the field is empty or not. This may be
  4117. // used to include empty fields in Patch requests.
  4118. ForceSendFields []string `json:"-"`
  4119. // NullFields is a list of field names (e.g. "Deleted") to include in
  4120. // API requests with the JSON null value. By default, fields with empty
  4121. // values are omitted from API requests. However, any field with an
  4122. // empty value appearing in NullFields will be sent to the server as
  4123. // null. It is an error if a field in this list has a non-empty value.
  4124. // This may be used to include null fields in Patch requests.
  4125. NullFields []string `json:"-"`
  4126. }
  4127. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  4128. type NoMethod DeprecationStatus
  4129. raw := NoMethod(*s)
  4130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4131. }
  4132. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  4133. // resource_for v1.disks ==)
  4134. type Disk struct {
  4135. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4136. // format.
  4137. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4138. // Description: An optional description of this resource. Provide this
  4139. // property when you create the resource.
  4140. Description string `json:"description,omitempty"`
  4141. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  4142. // encryption key.
  4143. //
  4144. // After you encrypt a disk with a customer-supplied key, you must
  4145. // provide the same key if you use the disk later (e.g. to create a disk
  4146. // snapshot or an image, or to attach the disk to a virtual
  4147. // machine).
  4148. //
  4149. // Customer-supplied encryption keys do not protect access to metadata
  4150. // of the disk.
  4151. //
  4152. // If you do not provide an encryption key when creating the disk, then
  4153. // the disk will be encrypted using an automatically generated key and
  4154. // you do not need to provide a key to use the disk later.
  4155. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4156. // GuestOsFeatures: A list of features to enable on the guest operating
  4157. // system. Applicable only for bootable images. Read Enabling guest
  4158. // operating system features to see a list of available options.
  4159. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  4160. // Id: [Output Only] The unique identifier for the resource. This
  4161. // identifier is defined by the server.
  4162. Id uint64 `json:"id,omitempty,string"`
  4163. // Kind: [Output Only] Type of the resource. Always compute#disk for
  4164. // disks.
  4165. Kind string `json:"kind,omitempty"`
  4166. // LabelFingerprint: A fingerprint for the labels being applied to this
  4167. // disk, which is essentially a hash of the labels set used for
  4168. // optimistic locking. The fingerprint is initially generated by Compute
  4169. // Engine and changes after every request to modify or update labels.
  4170. // You must always provide an up-to-date fingerprint hash in order to
  4171. // update or change labels.
  4172. //
  4173. // To see the latest fingerprint, make a get() request to retrieve a
  4174. // disk.
  4175. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  4176. // Labels: Labels to apply to this disk. These can be later modified by
  4177. // the setLabels method.
  4178. Labels map[string]string `json:"labels,omitempty"`
  4179. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  4180. // text format.
  4181. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  4182. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  4183. // text format.
  4184. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  4185. // LicenseCodes: Integer license codes indicating which licenses are
  4186. // attached to this disk.
  4187. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  4188. // Licenses: Any applicable publicly visible licenses.
  4189. Licenses []string `json:"licenses,omitempty"`
  4190. // Name: Name of the resource. Provided by the client when the resource
  4191. // is created. The name must be 1-63 characters long, and comply with
  4192. // RFC1035. Specifically, the name must be 1-63 characters long and
  4193. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4194. // the first character must be a lowercase letter, and all following
  4195. // characters must be a dash, lowercase letter, or digit, except the
  4196. // last character, which cannot be a dash.
  4197. Name string `json:"name,omitempty"`
  4198. // Options: Internal use only.
  4199. Options string `json:"options,omitempty"`
  4200. // Region: [Output Only] URL of the region where the disk resides. Only
  4201. // applicable for regional resources. You must specify this field as
  4202. // part of the HTTP request URL. It is not settable as a field in the
  4203. // request body.
  4204. Region string `json:"region,omitempty"`
  4205. // ReplicaZones: URLs of the zones where the disk should be replicated
  4206. // to. Only applicable for regional resources.
  4207. ReplicaZones []string `json:"replicaZones,omitempty"`
  4208. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  4209. // resource.
  4210. SelfLink string `json:"selfLink,omitempty"`
  4211. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  4212. // this field when creating a persistent disk using the sourceImage or
  4213. // sourceSnapshot parameter, or specify it alone to create an empty
  4214. // persistent disk.
  4215. //
  4216. // If you specify this field along with sourceImage or sourceSnapshot,
  4217. // the value of sizeGb must not be less than the size of the sourceImage
  4218. // or the size of the snapshot. Acceptable values are 1 to 65536,
  4219. // inclusive.
  4220. SizeGb int64 `json:"sizeGb,omitempty,string"`
  4221. // SourceImage: The source image used to create this disk. If the source
  4222. // image is deleted, this field will not be set.
  4223. //
  4224. // To create a disk with one of the public operating system images,
  4225. // specify the image by its family name. For example, specify
  4226. // family/debian-8 to use the latest Debian 8
  4227. // image:
  4228. // projects/debian-cloud/global/images/family/debian-8
  4229. //
  4230. //
  4231. // Alternati
  4232. // vely, use a specific version of a public operating system
  4233. // image:
  4234. // projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
  4235. //
  4236. //
  4237. //
  4238. // To create a disk with a custom image that you created, specify the
  4239. // image name in the following
  4240. // format:
  4241. // global/images/my-custom-image
  4242. //
  4243. //
  4244. // You can also specify a custom image by its image family, which
  4245. // returns the latest version of the image in that family. Replace the
  4246. // image name with
  4247. // family/family-name:
  4248. // global/images/family/my-image-family
  4249. SourceImage string `json:"sourceImage,omitempty"`
  4250. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  4251. // source image. Required if the source image is protected by a
  4252. // customer-supplied encryption key.
  4253. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  4254. // SourceImageId: [Output Only] The ID value of the image used to create
  4255. // this disk. This value identifies the exact image that was used to
  4256. // create this persistent disk. For example, if you created the
  4257. // persistent disk from an image that was later deleted and recreated
  4258. // under the same name, the source image ID would identify the exact
  4259. // version of the image that was used.
  4260. SourceImageId string `json:"sourceImageId,omitempty"`
  4261. // SourceSnapshot: The source snapshot used to create this disk. You can
  4262. // provide this as a partial or full URL to the resource. For example,
  4263. // the following are valid values:
  4264. // -
  4265. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  4266. // - projects/project/global/snapshots/snapshot
  4267. // - global/snapshots/snapshot
  4268. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  4269. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  4270. // the source snapshot. Required if the source snapshot is protected by
  4271. // a customer-supplied encryption key.
  4272. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  4273. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  4274. // create this disk. This value identifies the exact snapshot that was
  4275. // used to create this persistent disk. For example, if you created the
  4276. // persistent disk from a snapshot that was later deleted and recreated
  4277. // under the same name, the source snapshot ID would identify the exact
  4278. // version of the snapshot that was used.
  4279. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  4280. // Status: [Output Only] The status of disk creation.
  4281. //
  4282. // Possible values:
  4283. // "CREATING"
  4284. // "FAILED"
  4285. // "READY"
  4286. // "RESTORING"
  4287. Status string `json:"status,omitempty"`
  4288. // Type: URL of the disk type resource describing which disk type to use
  4289. // to create the disk. Provide this when creating the disk. For example:
  4290. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  4291. Type string `json:"type,omitempty"`
  4292. // Users: [Output Only] Links to the users of the disk (attached
  4293. // instances) in form: project/zones/zone/instances/instance
  4294. Users []string `json:"users,omitempty"`
  4295. // Zone: [Output Only] URL of the zone where the disk resides. You must
  4296. // specify this field as part of the HTTP request URL. It is not
  4297. // settable as a field in the request body.
  4298. Zone string `json:"zone,omitempty"`
  4299. // ServerResponse contains the HTTP response code and headers from the
  4300. // server.
  4301. googleapi.ServerResponse `json:"-"`
  4302. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4303. // to unconditionally include in API requests. By default, fields with
  4304. // empty values are omitted from API requests. However, any non-pointer,
  4305. // non-interface field appearing in ForceSendFields will be sent to the
  4306. // server regardless of whether the field is empty or not. This may be
  4307. // used to include empty fields in Patch requests.
  4308. ForceSendFields []string `json:"-"`
  4309. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4310. // include in API requests with the JSON null value. By default, fields
  4311. // with empty values are omitted from API requests. However, any field
  4312. // with an empty value appearing in NullFields will be sent to the
  4313. // server as null. It is an error if a field in this list has a
  4314. // non-empty value. This may be used to include null fields in Patch
  4315. // requests.
  4316. NullFields []string `json:"-"`
  4317. }
  4318. func (s *Disk) MarshalJSON() ([]byte, error) {
  4319. type NoMethod Disk
  4320. raw := NoMethod(*s)
  4321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4322. }
  4323. type DiskAggregatedList struct {
  4324. // Id: [Output Only] Unique identifier for the resource; defined by the
  4325. // server.
  4326. Id string `json:"id,omitempty"`
  4327. // Items: A list of DisksScopedList resources.
  4328. Items map[string]DisksScopedList `json:"items,omitempty"`
  4329. // Kind: [Output Only] Type of resource. Always
  4330. // compute#diskAggregatedList for aggregated lists of persistent disks.
  4331. Kind string `json:"kind,omitempty"`
  4332. // NextPageToken: [Output Only] This token allows you to get the next
  4333. // page of results for list requests. If the number of results is larger
  4334. // than maxResults, use the nextPageToken as a value for the query
  4335. // parameter pageToken in the next list request. Subsequent list
  4336. // requests will have their own nextPageToken to continue paging through
  4337. // the results.
  4338. NextPageToken string `json:"nextPageToken,omitempty"`
  4339. // SelfLink: [Output Only] Server-defined URL for this resource.
  4340. SelfLink string `json:"selfLink,omitempty"`
  4341. // Warning: [Output Only] Informational warning message.
  4342. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  4343. // ServerResponse contains the HTTP response code and headers from the
  4344. // server.
  4345. googleapi.ServerResponse `json:"-"`
  4346. // ForceSendFields is a list of field names (e.g. "Id") to
  4347. // unconditionally include in API requests. By default, fields with
  4348. // empty values are omitted from API requests. However, any non-pointer,
  4349. // non-interface field appearing in ForceSendFields will be sent to the
  4350. // server regardless of whether the field is empty or not. This may be
  4351. // used to include empty fields in Patch requests.
  4352. ForceSendFields []string `json:"-"`
  4353. // NullFields is a list of field names (e.g. "Id") to include in API
  4354. // requests with the JSON null value. By default, fields with empty
  4355. // values are omitted from API requests. However, any field with an
  4356. // empty value appearing in NullFields will be sent to the server as
  4357. // null. It is an error if a field in this list has a non-empty value.
  4358. // This may be used to include null fields in Patch requests.
  4359. NullFields []string `json:"-"`
  4360. }
  4361. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  4362. type NoMethod DiskAggregatedList
  4363. raw := NoMethod(*s)
  4364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4365. }
  4366. // DiskAggregatedListWarning: [Output Only] Informational warning
  4367. // message.
  4368. type DiskAggregatedListWarning struct {
  4369. // Code: [Output Only] A warning code, if applicable. For example,
  4370. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4371. // the response.
  4372. //
  4373. // Possible values:
  4374. // "CLEANUP_FAILED"
  4375. // "DEPRECATED_RESOURCE_USED"
  4376. // "DEPRECATED_TYPE_USED"
  4377. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4378. // "EXPERIMENTAL_TYPE_USED"
  4379. // "EXTERNAL_API_WARNING"
  4380. // "FIELD_VALUE_OVERRIDEN"
  4381. // "INJECTED_KERNELS_DEPRECATED"
  4382. // "MISSING_TYPE_DEPENDENCY"
  4383. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4384. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4385. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4386. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4387. // "NEXT_HOP_NOT_RUNNING"
  4388. // "NOT_CRITICAL_ERROR"
  4389. // "NO_RESULTS_ON_PAGE"
  4390. // "REQUIRED_TOS_AGREEMENT"
  4391. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4392. // "RESOURCE_NOT_DELETED"
  4393. // "SCHEMA_VALIDATION_IGNORED"
  4394. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4395. // "UNDECLARED_PROPERTIES"
  4396. // "UNREACHABLE"
  4397. Code string `json:"code,omitempty"`
  4398. // Data: [Output Only] Metadata about this warning in key: value format.
  4399. // For example:
  4400. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4401. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  4402. // Message: [Output Only] A human-readable description of the warning
  4403. // code.
  4404. Message string `json:"message,omitempty"`
  4405. // ForceSendFields is a list of field names (e.g. "Code") to
  4406. // unconditionally include in API requests. By default, fields with
  4407. // empty values are omitted from API requests. However, any non-pointer,
  4408. // non-interface field appearing in ForceSendFields will be sent to the
  4409. // server regardless of whether the field is empty or not. This may be
  4410. // used to include empty fields in Patch requests.
  4411. ForceSendFields []string `json:"-"`
  4412. // NullFields is a list of field names (e.g. "Code") to include in API
  4413. // requests with the JSON null value. By default, fields with empty
  4414. // values are omitted from API requests. However, any field with an
  4415. // empty value appearing in NullFields will be sent to the server as
  4416. // null. It is an error if a field in this list has a non-empty value.
  4417. // This may be used to include null fields in Patch requests.
  4418. NullFields []string `json:"-"`
  4419. }
  4420. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4421. type NoMethod DiskAggregatedListWarning
  4422. raw := NoMethod(*s)
  4423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4424. }
  4425. type DiskAggregatedListWarningData struct {
  4426. // Key: [Output Only] A key that provides more detail on the warning
  4427. // being returned. For example, for warnings where there are no results
  4428. // in a list request for a particular zone, this key might be scope and
  4429. // the key value might be the zone name. Other examples might be a key
  4430. // indicating a deprecated resource and a suggested replacement, or a
  4431. // warning about invalid network settings (for example, if an instance
  4432. // attempts to perform IP forwarding but is not enabled for IP
  4433. // forwarding).
  4434. Key string `json:"key,omitempty"`
  4435. // Value: [Output Only] A warning data value corresponding to the key.
  4436. Value string `json:"value,omitempty"`
  4437. // ForceSendFields is a list of field names (e.g. "Key") to
  4438. // unconditionally include in API requests. By default, fields with
  4439. // empty values are omitted from API requests. However, any non-pointer,
  4440. // non-interface field appearing in ForceSendFields will be sent to the
  4441. // server regardless of whether the field is empty or not. This may be
  4442. // used to include empty fields in Patch requests.
  4443. ForceSendFields []string `json:"-"`
  4444. // NullFields is a list of field names (e.g. "Key") to include in API
  4445. // requests with the JSON null value. By default, fields with empty
  4446. // values are omitted from API requests. However, any field with an
  4447. // empty value appearing in NullFields will be sent to the server as
  4448. // null. It is an error if a field in this list has a non-empty value.
  4449. // This may be used to include null fields in Patch requests.
  4450. NullFields []string `json:"-"`
  4451. }
  4452. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4453. type NoMethod DiskAggregatedListWarningData
  4454. raw := NoMethod(*s)
  4455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4456. }
  4457. // DiskInstantiationConfig: A specification of the desired way to
  4458. // instantiate a disk in the instance template when its created from a
  4459. // source instance.
  4460. type DiskInstantiationConfig struct {
  4461. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  4462. // instance is deleted (but not when the disk is detached from the
  4463. // instance).
  4464. AutoDelete bool `json:"autoDelete,omitempty"`
  4465. // CustomImage: The custom source image to be used to restore this disk
  4466. // when instantiating this instance template.
  4467. CustomImage string `json:"customImage,omitempty"`
  4468. // DeviceName: Specifies the device name of the disk to which the
  4469. // configurations apply to.
  4470. DeviceName string `json:"deviceName,omitempty"`
  4471. // InstantiateFrom: Specifies whether to include the disk and what image
  4472. // to use. Possible values are:
  4473. // - source-image: to use the same image that was used to create the
  4474. // source instance's corresponding disk. Applicable to the boot disk and
  4475. // additional read-write disks.
  4476. // - source-image-family: to use the same image family that was used to
  4477. // create the source instance's corresponding disk. Applicable to the
  4478. // boot disk and additional read-write disks.
  4479. // - custom-image: to use a user-provided image url for disk creation.
  4480. // Applicable to the boot disk and additional read-write disks.
  4481. // - attach-read-only: to attach a read-only disk. Applicable to
  4482. // read-only disks.
  4483. // - do-not-include: to exclude a disk from the template. Applicable to
  4484. // additional read-write disks, local SSDs, and read-only disks.
  4485. //
  4486. // Possible values:
  4487. // "ATTACH_READ_ONLY"
  4488. // "BLANK"
  4489. // "CUSTOM_IMAGE"
  4490. // "DEFAULT"
  4491. // "DO_NOT_INCLUDE"
  4492. // "SOURCE_IMAGE"
  4493. // "SOURCE_IMAGE_FAMILY"
  4494. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  4495. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  4496. // unconditionally include in API requests. By default, fields with
  4497. // empty values are omitted from API requests. However, any non-pointer,
  4498. // non-interface field appearing in ForceSendFields will be sent to the
  4499. // server regardless of whether the field is empty or not. This may be
  4500. // used to include empty fields in Patch requests.
  4501. ForceSendFields []string `json:"-"`
  4502. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  4503. // API requests with the JSON null value. By default, fields with empty
  4504. // values are omitted from API requests. However, any field with an
  4505. // empty value appearing in NullFields will be sent to the server as
  4506. // null. It is an error if a field in this list has a non-empty value.
  4507. // This may be used to include null fields in Patch requests.
  4508. NullFields []string `json:"-"`
  4509. }
  4510. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  4511. type NoMethod DiskInstantiationConfig
  4512. raw := NoMethod(*s)
  4513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4514. }
  4515. // DiskList: A list of Disk resources.
  4516. type DiskList struct {
  4517. // Id: [Output Only] Unique identifier for the resource; defined by the
  4518. // server.
  4519. Id string `json:"id,omitempty"`
  4520. // Items: A list of Disk resources.
  4521. Items []*Disk `json:"items,omitempty"`
  4522. // Kind: [Output Only] Type of resource. Always compute#diskList for
  4523. // lists of disks.
  4524. Kind string `json:"kind,omitempty"`
  4525. // NextPageToken: [Output Only] This token allows you to get the next
  4526. // page of results for list requests. If the number of results is larger
  4527. // than maxResults, use the nextPageToken as a value for the query
  4528. // parameter pageToken in the next list request. Subsequent list
  4529. // requests will have their own nextPageToken to continue paging through
  4530. // the results.
  4531. NextPageToken string `json:"nextPageToken,omitempty"`
  4532. // SelfLink: [Output Only] Server-defined URL for this resource.
  4533. SelfLink string `json:"selfLink,omitempty"`
  4534. // Warning: [Output Only] Informational warning message.
  4535. Warning *DiskListWarning `json:"warning,omitempty"`
  4536. // ServerResponse contains the HTTP response code and headers from the
  4537. // server.
  4538. googleapi.ServerResponse `json:"-"`
  4539. // ForceSendFields is a list of field names (e.g. "Id") to
  4540. // unconditionally include in API requests. By default, fields with
  4541. // empty values are omitted from API requests. However, any non-pointer,
  4542. // non-interface field appearing in ForceSendFields will be sent to the
  4543. // server regardless of whether the field is empty or not. This may be
  4544. // used to include empty fields in Patch requests.
  4545. ForceSendFields []string `json:"-"`
  4546. // NullFields is a list of field names (e.g. "Id") to include in API
  4547. // requests with the JSON null value. By default, fields with empty
  4548. // values are omitted from API requests. However, any field with an
  4549. // empty value appearing in NullFields will be sent to the server as
  4550. // null. It is an error if a field in this list has a non-empty value.
  4551. // This may be used to include null fields in Patch requests.
  4552. NullFields []string `json:"-"`
  4553. }
  4554. func (s *DiskList) MarshalJSON() ([]byte, error) {
  4555. type NoMethod DiskList
  4556. raw := NoMethod(*s)
  4557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4558. }
  4559. // DiskListWarning: [Output Only] Informational warning message.
  4560. type DiskListWarning struct {
  4561. // Code: [Output Only] A warning code, if applicable. For example,
  4562. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4563. // the response.
  4564. //
  4565. // Possible values:
  4566. // "CLEANUP_FAILED"
  4567. // "DEPRECATED_RESOURCE_USED"
  4568. // "DEPRECATED_TYPE_USED"
  4569. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4570. // "EXPERIMENTAL_TYPE_USED"
  4571. // "EXTERNAL_API_WARNING"
  4572. // "FIELD_VALUE_OVERRIDEN"
  4573. // "INJECTED_KERNELS_DEPRECATED"
  4574. // "MISSING_TYPE_DEPENDENCY"
  4575. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4576. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4577. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4578. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4579. // "NEXT_HOP_NOT_RUNNING"
  4580. // "NOT_CRITICAL_ERROR"
  4581. // "NO_RESULTS_ON_PAGE"
  4582. // "REQUIRED_TOS_AGREEMENT"
  4583. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4584. // "RESOURCE_NOT_DELETED"
  4585. // "SCHEMA_VALIDATION_IGNORED"
  4586. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4587. // "UNDECLARED_PROPERTIES"
  4588. // "UNREACHABLE"
  4589. Code string `json:"code,omitempty"`
  4590. // Data: [Output Only] Metadata about this warning in key: value format.
  4591. // For example:
  4592. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4593. Data []*DiskListWarningData `json:"data,omitempty"`
  4594. // Message: [Output Only] A human-readable description of the warning
  4595. // code.
  4596. Message string `json:"message,omitempty"`
  4597. // ForceSendFields is a list of field names (e.g. "Code") to
  4598. // unconditionally include in API requests. By default, fields with
  4599. // empty values are omitted from API requests. However, any non-pointer,
  4600. // non-interface field appearing in ForceSendFields will be sent to the
  4601. // server regardless of whether the field is empty or not. This may be
  4602. // used to include empty fields in Patch requests.
  4603. ForceSendFields []string `json:"-"`
  4604. // NullFields is a list of field names (e.g. "Code") to include in API
  4605. // requests with the JSON null value. By default, fields with empty
  4606. // values are omitted from API requests. However, any field with an
  4607. // empty value appearing in NullFields will be sent to the server as
  4608. // null. It is an error if a field in this list has a non-empty value.
  4609. // This may be used to include null fields in Patch requests.
  4610. NullFields []string `json:"-"`
  4611. }
  4612. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  4613. type NoMethod DiskListWarning
  4614. raw := NoMethod(*s)
  4615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4616. }
  4617. type DiskListWarningData struct {
  4618. // Key: [Output Only] A key that provides more detail on the warning
  4619. // being returned. For example, for warnings where there are no results
  4620. // in a list request for a particular zone, this key might be scope and
  4621. // the key value might be the zone name. Other examples might be a key
  4622. // indicating a deprecated resource and a suggested replacement, or a
  4623. // warning about invalid network settings (for example, if an instance
  4624. // attempts to perform IP forwarding but is not enabled for IP
  4625. // forwarding).
  4626. Key string `json:"key,omitempty"`
  4627. // Value: [Output Only] A warning data value corresponding to the key.
  4628. Value string `json:"value,omitempty"`
  4629. // ForceSendFields is a list of field names (e.g. "Key") to
  4630. // unconditionally include in API requests. By default, fields with
  4631. // empty values are omitted from API requests. However, any non-pointer,
  4632. // non-interface field appearing in ForceSendFields will be sent to the
  4633. // server regardless of whether the field is empty or not. This may be
  4634. // used to include empty fields in Patch requests.
  4635. ForceSendFields []string `json:"-"`
  4636. // NullFields is a list of field names (e.g. "Key") to include in API
  4637. // requests with the JSON null value. By default, fields with empty
  4638. // values are omitted from API requests. However, any field with an
  4639. // empty value appearing in NullFields will be sent to the server as
  4640. // null. It is an error if a field in this list has a non-empty value.
  4641. // This may be used to include null fields in Patch requests.
  4642. NullFields []string `json:"-"`
  4643. }
  4644. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  4645. type NoMethod DiskListWarningData
  4646. raw := NoMethod(*s)
  4647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4648. }
  4649. type DiskMoveRequest struct {
  4650. // DestinationZone: The URL of the destination zone to move the disk.
  4651. // This can be a full or partial URL. For example, the following are all
  4652. // valid URLs to a zone:
  4653. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  4654. //
  4655. // - projects/project/zones/zone
  4656. // - zones/zone
  4657. DestinationZone string `json:"destinationZone,omitempty"`
  4658. // TargetDisk: The URL of the target disk to move. This can be a full or
  4659. // partial URL. For example, the following are all valid URLs to a disk:
  4660. //
  4661. // -
  4662. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  4663. // - projects/project/zones/zone/disks/disk
  4664. // - zones/zone/disks/disk
  4665. TargetDisk string `json:"targetDisk,omitempty"`
  4666. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  4667. // unconditionally include in API requests. By default, fields with
  4668. // empty values are omitted from API requests. However, any non-pointer,
  4669. // non-interface field appearing in ForceSendFields will be sent to the
  4670. // server regardless of whether the field is empty or not. This may be
  4671. // used to include empty fields in Patch requests.
  4672. ForceSendFields []string `json:"-"`
  4673. // NullFields is a list of field names (e.g. "DestinationZone") to
  4674. // include in API requests with the JSON null value. By default, fields
  4675. // with empty values are omitted from API requests. However, any field
  4676. // with an empty value appearing in NullFields will be sent to the
  4677. // server as null. It is an error if a field in this list has a
  4678. // non-empty value. This may be used to include null fields in Patch
  4679. // requests.
  4680. NullFields []string `json:"-"`
  4681. }
  4682. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  4683. type NoMethod DiskMoveRequest
  4684. raw := NoMethod(*s)
  4685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4686. }
  4687. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  4688. // (== resource_for v1.diskTypes ==)
  4689. type DiskType struct {
  4690. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4691. // format.
  4692. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4693. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  4694. // GB.
  4695. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  4696. // Deprecated: [Output Only] The deprecation status associated with this
  4697. // disk type.
  4698. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  4699. // Description: [Output Only] An optional description of this resource.
  4700. Description string `json:"description,omitempty"`
  4701. // Id: [Output Only] The unique identifier for the resource. This
  4702. // identifier is defined by the server.
  4703. Id uint64 `json:"id,omitempty,string"`
  4704. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  4705. // disk types.
  4706. Kind string `json:"kind,omitempty"`
  4707. // Name: [Output Only] Name of the resource.
  4708. Name string `json:"name,omitempty"`
  4709. // Region: [Output Only] URL of the region where the disk type resides.
  4710. // Only applicable for regional resources. You must specify this field
  4711. // as part of the HTTP request URL. It is not settable as a field in the
  4712. // request body.
  4713. Region string `json:"region,omitempty"`
  4714. // SelfLink: [Output Only] Server-defined URL for the resource.
  4715. SelfLink string `json:"selfLink,omitempty"`
  4716. // ValidDiskSize: [Output Only] An optional textual description of the
  4717. // valid disk size, such as "10GB-10TB".
  4718. ValidDiskSize string `json:"validDiskSize,omitempty"`
  4719. // Zone: [Output Only] URL of the zone where the disk type resides. You
  4720. // must specify this field as part of the HTTP request URL. It is not
  4721. // settable as a field in the request body.
  4722. Zone string `json:"zone,omitempty"`
  4723. // ServerResponse contains the HTTP response code and headers from the
  4724. // server.
  4725. googleapi.ServerResponse `json:"-"`
  4726. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4727. // to unconditionally include in API requests. By default, fields with
  4728. // empty values are omitted from API requests. However, any non-pointer,
  4729. // non-interface field appearing in ForceSendFields will be sent to the
  4730. // server regardless of whether the field is empty or not. This may be
  4731. // used to include empty fields in Patch requests.
  4732. ForceSendFields []string `json:"-"`
  4733. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4734. // include in API requests with the JSON null value. By default, fields
  4735. // with empty values are omitted from API requests. However, any field
  4736. // with an empty value appearing in NullFields will be sent to the
  4737. // server as null. It is an error if a field in this list has a
  4738. // non-empty value. This may be used to include null fields in Patch
  4739. // requests.
  4740. NullFields []string `json:"-"`
  4741. }
  4742. func (s *DiskType) MarshalJSON() ([]byte, error) {
  4743. type NoMethod DiskType
  4744. raw := NoMethod(*s)
  4745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4746. }
  4747. type DiskTypeAggregatedList struct {
  4748. // Id: [Output Only] Unique identifier for the resource; defined by the
  4749. // server.
  4750. Id string `json:"id,omitempty"`
  4751. // Items: A list of DiskTypesScopedList resources.
  4752. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  4753. // Kind: [Output Only] Type of resource. Always
  4754. // compute#diskTypeAggregatedList.
  4755. Kind string `json:"kind,omitempty"`
  4756. // NextPageToken: [Output Only] This token allows you to get the next
  4757. // page of results for list requests. If the number of results is larger
  4758. // than maxResults, use the nextPageToken as a value for the query
  4759. // parameter pageToken in the next list request. Subsequent list
  4760. // requests will have their own nextPageToken to continue paging through
  4761. // the results.
  4762. NextPageToken string `json:"nextPageToken,omitempty"`
  4763. // SelfLink: [Output Only] Server-defined URL for this resource.
  4764. SelfLink string `json:"selfLink,omitempty"`
  4765. // Warning: [Output Only] Informational warning message.
  4766. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  4767. // ServerResponse contains the HTTP response code and headers from the
  4768. // server.
  4769. googleapi.ServerResponse `json:"-"`
  4770. // ForceSendFields is a list of field names (e.g. "Id") to
  4771. // unconditionally include in API requests. By default, fields with
  4772. // empty values are omitted from API requests. However, any non-pointer,
  4773. // non-interface field appearing in ForceSendFields will be sent to the
  4774. // server regardless of whether the field is empty or not. This may be
  4775. // used to include empty fields in Patch requests.
  4776. ForceSendFields []string `json:"-"`
  4777. // NullFields is a list of field names (e.g. "Id") to include in API
  4778. // requests with the JSON null value. By default, fields with empty
  4779. // values are omitted from API requests. However, any field with an
  4780. // empty value appearing in NullFields will be sent to the server as
  4781. // null. It is an error if a field in this list has a non-empty value.
  4782. // This may be used to include null fields in Patch requests.
  4783. NullFields []string `json:"-"`
  4784. }
  4785. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  4786. type NoMethod DiskTypeAggregatedList
  4787. raw := NoMethod(*s)
  4788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4789. }
  4790. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  4791. // message.
  4792. type DiskTypeAggregatedListWarning struct {
  4793. // Code: [Output Only] A warning code, if applicable. For example,
  4794. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4795. // the response.
  4796. //
  4797. // Possible values:
  4798. // "CLEANUP_FAILED"
  4799. // "DEPRECATED_RESOURCE_USED"
  4800. // "DEPRECATED_TYPE_USED"
  4801. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4802. // "EXPERIMENTAL_TYPE_USED"
  4803. // "EXTERNAL_API_WARNING"
  4804. // "FIELD_VALUE_OVERRIDEN"
  4805. // "INJECTED_KERNELS_DEPRECATED"
  4806. // "MISSING_TYPE_DEPENDENCY"
  4807. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4808. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4809. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4810. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4811. // "NEXT_HOP_NOT_RUNNING"
  4812. // "NOT_CRITICAL_ERROR"
  4813. // "NO_RESULTS_ON_PAGE"
  4814. // "REQUIRED_TOS_AGREEMENT"
  4815. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4816. // "RESOURCE_NOT_DELETED"
  4817. // "SCHEMA_VALIDATION_IGNORED"
  4818. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4819. // "UNDECLARED_PROPERTIES"
  4820. // "UNREACHABLE"
  4821. Code string `json:"code,omitempty"`
  4822. // Data: [Output Only] Metadata about this warning in key: value format.
  4823. // For example:
  4824. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4825. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  4826. // Message: [Output Only] A human-readable description of the warning
  4827. // code.
  4828. Message string `json:"message,omitempty"`
  4829. // ForceSendFields is a list of field names (e.g. "Code") to
  4830. // unconditionally include in API requests. By default, fields with
  4831. // empty values are omitted from API requests. However, any non-pointer,
  4832. // non-interface field appearing in ForceSendFields will be sent to the
  4833. // server regardless of whether the field is empty or not. This may be
  4834. // used to include empty fields in Patch requests.
  4835. ForceSendFields []string `json:"-"`
  4836. // NullFields is a list of field names (e.g. "Code") to include in API
  4837. // requests with the JSON null value. By default, fields with empty
  4838. // values are omitted from API requests. However, any field with an
  4839. // empty value appearing in NullFields will be sent to the server as
  4840. // null. It is an error if a field in this list has a non-empty value.
  4841. // This may be used to include null fields in Patch requests.
  4842. NullFields []string `json:"-"`
  4843. }
  4844. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4845. type NoMethod DiskTypeAggregatedListWarning
  4846. raw := NoMethod(*s)
  4847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4848. }
  4849. type DiskTypeAggregatedListWarningData struct {
  4850. // Key: [Output Only] A key that provides more detail on the warning
  4851. // being returned. For example, for warnings where there are no results
  4852. // in a list request for a particular zone, this key might be scope and
  4853. // the key value might be the zone name. Other examples might be a key
  4854. // indicating a deprecated resource and a suggested replacement, or a
  4855. // warning about invalid network settings (for example, if an instance
  4856. // attempts to perform IP forwarding but is not enabled for IP
  4857. // forwarding).
  4858. Key string `json:"key,omitempty"`
  4859. // Value: [Output Only] A warning data value corresponding to the key.
  4860. Value string `json:"value,omitempty"`
  4861. // ForceSendFields is a list of field names (e.g. "Key") to
  4862. // unconditionally include in API requests. By default, fields with
  4863. // empty values are omitted from API requests. However, any non-pointer,
  4864. // non-interface field appearing in ForceSendFields will be sent to the
  4865. // server regardless of whether the field is empty or not. This may be
  4866. // used to include empty fields in Patch requests.
  4867. ForceSendFields []string `json:"-"`
  4868. // NullFields is a list of field names (e.g. "Key") to include in API
  4869. // requests with the JSON null value. By default, fields with empty
  4870. // values are omitted from API requests. However, any field with an
  4871. // empty value appearing in NullFields will be sent to the server as
  4872. // null. It is an error if a field in this list has a non-empty value.
  4873. // This may be used to include null fields in Patch requests.
  4874. NullFields []string `json:"-"`
  4875. }
  4876. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4877. type NoMethod DiskTypeAggregatedListWarningData
  4878. raw := NoMethod(*s)
  4879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4880. }
  4881. // DiskTypeList: Contains a list of disk types.
  4882. type DiskTypeList struct {
  4883. // Id: [Output Only] Unique identifier for the resource; defined by the
  4884. // server.
  4885. Id string `json:"id,omitempty"`
  4886. // Items: A list of DiskType resources.
  4887. Items []*DiskType `json:"items,omitempty"`
  4888. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  4889. // disk types.
  4890. Kind string `json:"kind,omitempty"`
  4891. // NextPageToken: [Output Only] This token allows you to get the next
  4892. // page of results for list requests. If the number of results is larger
  4893. // than maxResults, use the nextPageToken as a value for the query
  4894. // parameter pageToken in the next list request. Subsequent list
  4895. // requests will have their own nextPageToken to continue paging through
  4896. // the results.
  4897. NextPageToken string `json:"nextPageToken,omitempty"`
  4898. // SelfLink: [Output Only] Server-defined URL for this resource.
  4899. SelfLink string `json:"selfLink,omitempty"`
  4900. // Warning: [Output Only] Informational warning message.
  4901. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  4902. // ServerResponse contains the HTTP response code and headers from the
  4903. // server.
  4904. googleapi.ServerResponse `json:"-"`
  4905. // ForceSendFields is a list of field names (e.g. "Id") to
  4906. // unconditionally include in API requests. By default, fields with
  4907. // empty values are omitted from API requests. However, any non-pointer,
  4908. // non-interface field appearing in ForceSendFields will be sent to the
  4909. // server regardless of whether the field is empty or not. This may be
  4910. // used to include empty fields in Patch requests.
  4911. ForceSendFields []string `json:"-"`
  4912. // NullFields is a list of field names (e.g. "Id") to include in API
  4913. // requests with the JSON null value. By default, fields with empty
  4914. // values are omitted from API requests. However, any field with an
  4915. // empty value appearing in NullFields will be sent to the server as
  4916. // null. It is an error if a field in this list has a non-empty value.
  4917. // This may be used to include null fields in Patch requests.
  4918. NullFields []string `json:"-"`
  4919. }
  4920. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  4921. type NoMethod DiskTypeList
  4922. raw := NoMethod(*s)
  4923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4924. }
  4925. // DiskTypeListWarning: [Output Only] Informational warning message.
  4926. type DiskTypeListWarning struct {
  4927. // Code: [Output Only] A warning code, if applicable. For example,
  4928. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4929. // the response.
  4930. //
  4931. // Possible values:
  4932. // "CLEANUP_FAILED"
  4933. // "DEPRECATED_RESOURCE_USED"
  4934. // "DEPRECATED_TYPE_USED"
  4935. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4936. // "EXPERIMENTAL_TYPE_USED"
  4937. // "EXTERNAL_API_WARNING"
  4938. // "FIELD_VALUE_OVERRIDEN"
  4939. // "INJECTED_KERNELS_DEPRECATED"
  4940. // "MISSING_TYPE_DEPENDENCY"
  4941. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4942. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4943. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4944. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4945. // "NEXT_HOP_NOT_RUNNING"
  4946. // "NOT_CRITICAL_ERROR"
  4947. // "NO_RESULTS_ON_PAGE"
  4948. // "REQUIRED_TOS_AGREEMENT"
  4949. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4950. // "RESOURCE_NOT_DELETED"
  4951. // "SCHEMA_VALIDATION_IGNORED"
  4952. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4953. // "UNDECLARED_PROPERTIES"
  4954. // "UNREACHABLE"
  4955. Code string `json:"code,omitempty"`
  4956. // Data: [Output Only] Metadata about this warning in key: value format.
  4957. // For example:
  4958. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4959. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  4960. // Message: [Output Only] A human-readable description of the warning
  4961. // code.
  4962. Message string `json:"message,omitempty"`
  4963. // ForceSendFields is a list of field names (e.g. "Code") to
  4964. // unconditionally include in API requests. By default, fields with
  4965. // empty values are omitted from API requests. However, any non-pointer,
  4966. // non-interface field appearing in ForceSendFields will be sent to the
  4967. // server regardless of whether the field is empty or not. This may be
  4968. // used to include empty fields in Patch requests.
  4969. ForceSendFields []string `json:"-"`
  4970. // NullFields is a list of field names (e.g. "Code") to include in API
  4971. // requests with the JSON null value. By default, fields with empty
  4972. // values are omitted from API requests. However, any field with an
  4973. // empty value appearing in NullFields will be sent to the server as
  4974. // null. It is an error if a field in this list has a non-empty value.
  4975. // This may be used to include null fields in Patch requests.
  4976. NullFields []string `json:"-"`
  4977. }
  4978. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  4979. type NoMethod DiskTypeListWarning
  4980. raw := NoMethod(*s)
  4981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4982. }
  4983. type DiskTypeListWarningData struct {
  4984. // Key: [Output Only] A key that provides more detail on the warning
  4985. // being returned. For example, for warnings where there are no results
  4986. // in a list request for a particular zone, this key might be scope and
  4987. // the key value might be the zone name. Other examples might be a key
  4988. // indicating a deprecated resource and a suggested replacement, or a
  4989. // warning about invalid network settings (for example, if an instance
  4990. // attempts to perform IP forwarding but is not enabled for IP
  4991. // forwarding).
  4992. Key string `json:"key,omitempty"`
  4993. // Value: [Output Only] A warning data value corresponding to the key.
  4994. Value string `json:"value,omitempty"`
  4995. // ForceSendFields is a list of field names (e.g. "Key") to
  4996. // unconditionally include in API requests. By default, fields with
  4997. // empty values are omitted from API requests. However, any non-pointer,
  4998. // non-interface field appearing in ForceSendFields will be sent to the
  4999. // server regardless of whether the field is empty or not. This may be
  5000. // used to include empty fields in Patch requests.
  5001. ForceSendFields []string `json:"-"`
  5002. // NullFields is a list of field names (e.g. "Key") to include in API
  5003. // requests with the JSON null value. By default, fields with empty
  5004. // values are omitted from API requests. However, any field with an
  5005. // empty value appearing in NullFields will be sent to the server as
  5006. // null. It is an error if a field in this list has a non-empty value.
  5007. // This may be used to include null fields in Patch requests.
  5008. NullFields []string `json:"-"`
  5009. }
  5010. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  5011. type NoMethod DiskTypeListWarningData
  5012. raw := NoMethod(*s)
  5013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5014. }
  5015. type DiskTypesScopedList struct {
  5016. // DiskTypes: [Output Only] A list of disk types contained in this
  5017. // scope.
  5018. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  5019. // Warning: [Output Only] Informational warning which replaces the list
  5020. // of disk types when the list is empty.
  5021. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  5022. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  5023. // unconditionally include in API requests. By default, fields with
  5024. // empty values are omitted from API requests. However, any non-pointer,
  5025. // non-interface field appearing in ForceSendFields will be sent to the
  5026. // server regardless of whether the field is empty or not. This may be
  5027. // used to include empty fields in Patch requests.
  5028. ForceSendFields []string `json:"-"`
  5029. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  5030. // API requests with the JSON null value. By default, fields with empty
  5031. // values are omitted from API requests. However, any field with an
  5032. // empty value appearing in NullFields will be sent to the server as
  5033. // null. It is an error if a field in this list has a non-empty value.
  5034. // This may be used to include null fields in Patch requests.
  5035. NullFields []string `json:"-"`
  5036. }
  5037. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  5038. type NoMethod DiskTypesScopedList
  5039. raw := NoMethod(*s)
  5040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5041. }
  5042. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  5043. // replaces the list of disk types when the list is empty.
  5044. type DiskTypesScopedListWarning struct {
  5045. // Code: [Output Only] A warning code, if applicable. For example,
  5046. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5047. // the response.
  5048. //
  5049. // Possible values:
  5050. // "CLEANUP_FAILED"
  5051. // "DEPRECATED_RESOURCE_USED"
  5052. // "DEPRECATED_TYPE_USED"
  5053. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5054. // "EXPERIMENTAL_TYPE_USED"
  5055. // "EXTERNAL_API_WARNING"
  5056. // "FIELD_VALUE_OVERRIDEN"
  5057. // "INJECTED_KERNELS_DEPRECATED"
  5058. // "MISSING_TYPE_DEPENDENCY"
  5059. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5060. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5061. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5062. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5063. // "NEXT_HOP_NOT_RUNNING"
  5064. // "NOT_CRITICAL_ERROR"
  5065. // "NO_RESULTS_ON_PAGE"
  5066. // "REQUIRED_TOS_AGREEMENT"
  5067. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5068. // "RESOURCE_NOT_DELETED"
  5069. // "SCHEMA_VALIDATION_IGNORED"
  5070. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5071. // "UNDECLARED_PROPERTIES"
  5072. // "UNREACHABLE"
  5073. Code string `json:"code,omitempty"`
  5074. // Data: [Output Only] Metadata about this warning in key: value format.
  5075. // For example:
  5076. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5077. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  5078. // Message: [Output Only] A human-readable description of the warning
  5079. // code.
  5080. Message string `json:"message,omitempty"`
  5081. // ForceSendFields is a list of field names (e.g. "Code") to
  5082. // unconditionally include in API requests. By default, fields with
  5083. // empty values are omitted from API requests. However, any non-pointer,
  5084. // non-interface field appearing in ForceSendFields will be sent to the
  5085. // server regardless of whether the field is empty or not. This may be
  5086. // used to include empty fields in Patch requests.
  5087. ForceSendFields []string `json:"-"`
  5088. // NullFields is a list of field names (e.g. "Code") to include in API
  5089. // requests with the JSON null value. By default, fields with empty
  5090. // values are omitted from API requests. However, any field with an
  5091. // empty value appearing in NullFields will be sent to the server as
  5092. // null. It is an error if a field in this list has a non-empty value.
  5093. // This may be used to include null fields in Patch requests.
  5094. NullFields []string `json:"-"`
  5095. }
  5096. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  5097. type NoMethod DiskTypesScopedListWarning
  5098. raw := NoMethod(*s)
  5099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5100. }
  5101. type DiskTypesScopedListWarningData struct {
  5102. // Key: [Output Only] A key that provides more detail on the warning
  5103. // being returned. For example, for warnings where there are no results
  5104. // in a list request for a particular zone, this key might be scope and
  5105. // the key value might be the zone name. Other examples might be a key
  5106. // indicating a deprecated resource and a suggested replacement, or a
  5107. // warning about invalid network settings (for example, if an instance
  5108. // attempts to perform IP forwarding but is not enabled for IP
  5109. // forwarding).
  5110. Key string `json:"key,omitempty"`
  5111. // Value: [Output Only] A warning data value corresponding to the key.
  5112. Value string `json:"value,omitempty"`
  5113. // ForceSendFields is a list of field names (e.g. "Key") to
  5114. // unconditionally include in API requests. By default, fields with
  5115. // empty values are omitted from API requests. However, any non-pointer,
  5116. // non-interface field appearing in ForceSendFields will be sent to the
  5117. // server regardless of whether the field is empty or not. This may be
  5118. // used to include empty fields in Patch requests.
  5119. ForceSendFields []string `json:"-"`
  5120. // NullFields is a list of field names (e.g. "Key") to include in API
  5121. // requests with the JSON null value. By default, fields with empty
  5122. // values are omitted from API requests. However, any field with an
  5123. // empty value appearing in NullFields will be sent to the server as
  5124. // null. It is an error if a field in this list has a non-empty value.
  5125. // This may be used to include null fields in Patch requests.
  5126. NullFields []string `json:"-"`
  5127. }
  5128. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  5129. type NoMethod DiskTypesScopedListWarningData
  5130. raw := NoMethod(*s)
  5131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5132. }
  5133. type DisksResizeRequest struct {
  5134. // SizeGb: The new size of the persistent disk, which is specified in
  5135. // GB.
  5136. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5137. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  5138. // unconditionally include in API requests. By default, fields with
  5139. // empty values are omitted from API requests. However, any non-pointer,
  5140. // non-interface field appearing in ForceSendFields will be sent to the
  5141. // server regardless of whether the field is empty or not. This may be
  5142. // used to include empty fields in Patch requests.
  5143. ForceSendFields []string `json:"-"`
  5144. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  5145. // requests with the JSON null value. By default, fields with empty
  5146. // values are omitted from API requests. However, any field with an
  5147. // empty value appearing in NullFields will be sent to the server as
  5148. // null. It is an error if a field in this list has a non-empty value.
  5149. // This may be used to include null fields in Patch requests.
  5150. NullFields []string `json:"-"`
  5151. }
  5152. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  5153. type NoMethod DisksResizeRequest
  5154. raw := NoMethod(*s)
  5155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5156. }
  5157. type DisksScopedList struct {
  5158. // Disks: [Output Only] A list of disks contained in this scope.
  5159. Disks []*Disk `json:"disks,omitempty"`
  5160. // Warning: [Output Only] Informational warning which replaces the list
  5161. // of disks when the list is empty.
  5162. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  5163. // ForceSendFields is a list of field names (e.g. "Disks") to
  5164. // unconditionally include in API requests. By default, fields with
  5165. // empty values are omitted from API requests. However, any non-pointer,
  5166. // non-interface field appearing in ForceSendFields will be sent to the
  5167. // server regardless of whether the field is empty or not. This may be
  5168. // used to include empty fields in Patch requests.
  5169. ForceSendFields []string `json:"-"`
  5170. // NullFields is a list of field names (e.g. "Disks") to include in API
  5171. // requests with the JSON null value. By default, fields with empty
  5172. // values are omitted from API requests. However, any field with an
  5173. // empty value appearing in NullFields will be sent to the server as
  5174. // null. It is an error if a field in this list has a non-empty value.
  5175. // This may be used to include null fields in Patch requests.
  5176. NullFields []string `json:"-"`
  5177. }
  5178. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  5179. type NoMethod DisksScopedList
  5180. raw := NoMethod(*s)
  5181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5182. }
  5183. // DisksScopedListWarning: [Output Only] Informational warning which
  5184. // replaces the list of disks when the list is empty.
  5185. type DisksScopedListWarning struct {
  5186. // Code: [Output Only] A warning code, if applicable. For example,
  5187. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5188. // the response.
  5189. //
  5190. // Possible values:
  5191. // "CLEANUP_FAILED"
  5192. // "DEPRECATED_RESOURCE_USED"
  5193. // "DEPRECATED_TYPE_USED"
  5194. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5195. // "EXPERIMENTAL_TYPE_USED"
  5196. // "EXTERNAL_API_WARNING"
  5197. // "FIELD_VALUE_OVERRIDEN"
  5198. // "INJECTED_KERNELS_DEPRECATED"
  5199. // "MISSING_TYPE_DEPENDENCY"
  5200. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5201. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5202. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5203. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5204. // "NEXT_HOP_NOT_RUNNING"
  5205. // "NOT_CRITICAL_ERROR"
  5206. // "NO_RESULTS_ON_PAGE"
  5207. // "REQUIRED_TOS_AGREEMENT"
  5208. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5209. // "RESOURCE_NOT_DELETED"
  5210. // "SCHEMA_VALIDATION_IGNORED"
  5211. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5212. // "UNDECLARED_PROPERTIES"
  5213. // "UNREACHABLE"
  5214. Code string `json:"code,omitempty"`
  5215. // Data: [Output Only] Metadata about this warning in key: value format.
  5216. // For example:
  5217. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5218. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  5219. // Message: [Output Only] A human-readable description of the warning
  5220. // code.
  5221. Message string `json:"message,omitempty"`
  5222. // ForceSendFields is a list of field names (e.g. "Code") to
  5223. // unconditionally include in API requests. By default, fields with
  5224. // empty values are omitted from API requests. However, any non-pointer,
  5225. // non-interface field appearing in ForceSendFields will be sent to the
  5226. // server regardless of whether the field is empty or not. This may be
  5227. // used to include empty fields in Patch requests.
  5228. ForceSendFields []string `json:"-"`
  5229. // NullFields is a list of field names (e.g. "Code") to include in API
  5230. // requests with the JSON null value. By default, fields with empty
  5231. // values are omitted from API requests. However, any field with an
  5232. // empty value appearing in NullFields will be sent to the server as
  5233. // null. It is an error if a field in this list has a non-empty value.
  5234. // This may be used to include null fields in Patch requests.
  5235. NullFields []string `json:"-"`
  5236. }
  5237. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  5238. type NoMethod DisksScopedListWarning
  5239. raw := NoMethod(*s)
  5240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5241. }
  5242. type DisksScopedListWarningData struct {
  5243. // Key: [Output Only] A key that provides more detail on the warning
  5244. // being returned. For example, for warnings where there are no results
  5245. // in a list request for a particular zone, this key might be scope and
  5246. // the key value might be the zone name. Other examples might be a key
  5247. // indicating a deprecated resource and a suggested replacement, or a
  5248. // warning about invalid network settings (for example, if an instance
  5249. // attempts to perform IP forwarding but is not enabled for IP
  5250. // forwarding).
  5251. Key string `json:"key,omitempty"`
  5252. // Value: [Output Only] A warning data value corresponding to the key.
  5253. Value string `json:"value,omitempty"`
  5254. // ForceSendFields is a list of field names (e.g. "Key") to
  5255. // unconditionally include in API requests. By default, fields with
  5256. // empty values are omitted from API requests. However, any non-pointer,
  5257. // non-interface field appearing in ForceSendFields will be sent to the
  5258. // server regardless of whether the field is empty or not. This may be
  5259. // used to include empty fields in Patch requests.
  5260. ForceSendFields []string `json:"-"`
  5261. // NullFields is a list of field names (e.g. "Key") to include in API
  5262. // requests with the JSON null value. By default, fields with empty
  5263. // values are omitted from API requests. However, any field with an
  5264. // empty value appearing in NullFields will be sent to the server as
  5265. // null. It is an error if a field in this list has a non-empty value.
  5266. // This may be used to include null fields in Patch requests.
  5267. NullFields []string `json:"-"`
  5268. }
  5269. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  5270. type NoMethod DisksScopedListWarningData
  5271. raw := NoMethod(*s)
  5272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5273. }
  5274. // Firewall: Represents a Firewall resource.
  5275. type Firewall struct {
  5276. // Allowed: The list of ALLOW rules specified by this firewall. Each
  5277. // rule specifies a protocol and port-range tuple that describes a
  5278. // permitted connection.
  5279. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  5280. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5281. // format.
  5282. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5283. // Denied: The list of DENY rules specified by this firewall. Each rule
  5284. // specifies a protocol and port-range tuple that describes a denied
  5285. // connection.
  5286. Denied []*FirewallDenied `json:"denied,omitempty"`
  5287. // Description: An optional description of this resource. Provide this
  5288. // property when you create the resource.
  5289. Description string `json:"description,omitempty"`
  5290. // DestinationRanges: If destination ranges are specified, the firewall
  5291. // will apply only to traffic that has destination IP address in these
  5292. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  5293. // supported.
  5294. DestinationRanges []string `json:"destinationRanges,omitempty"`
  5295. // Direction: Direction of traffic to which this firewall applies;
  5296. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  5297. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  5298. // specify sourceRanges OR sourceTags.
  5299. //
  5300. // Possible values:
  5301. // "EGRESS"
  5302. // "INGRESS"
  5303. Direction string `json:"direction,omitempty"`
  5304. // Id: [Output Only] The unique identifier for the resource. This
  5305. // identifier is defined by the server.
  5306. Id uint64 `json:"id,omitempty,string"`
  5307. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  5308. // firewall rules.
  5309. Kind string `json:"kind,omitempty"`
  5310. // Name: Name of the resource; provided by the client when the resource
  5311. // is created. The name must be 1-63 characters long, and comply with
  5312. // RFC1035. Specifically, the name must be 1-63 characters long and
  5313. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5314. // the first character must be a lowercase letter, and all following
  5315. // characters must be a dash, lowercase letter, or digit, except the
  5316. // last character, which cannot be a dash.
  5317. Name string `json:"name,omitempty"`
  5318. // Network: URL of the network resource for this firewall rule. If not
  5319. // specified when creating a firewall rule, the default network is
  5320. // used:
  5321. // global/networks/default
  5322. // If you choose to specify this property, you can specify the network
  5323. // as a full or partial URL. For example, the following are all valid
  5324. // URLs:
  5325. // -
  5326. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  5327. // - projects/myproject/global/networks/my-network
  5328. // - global/networks/default
  5329. Network string `json:"network,omitempty"`
  5330. // Priority: Priority for this rule. This is an integer between 0 and
  5331. // 65535, both inclusive. When not specified, the value assumed is 1000.
  5332. // Relative priorities determine precedence of conflicting rules. Lower
  5333. // value of priority implies higher precedence (eg, a rule with priority
  5334. // 0 has higher precedence than a rule with priority 1). DENY rules take
  5335. // precedence over ALLOW rules having equal priority.
  5336. Priority int64 `json:"priority,omitempty"`
  5337. // SelfLink: [Output Only] Server-defined URL for the resource.
  5338. SelfLink string `json:"selfLink,omitempty"`
  5339. // SourceRanges: If source ranges are specified, the firewall will apply
  5340. // only to traffic that has source IP address in these ranges. These
  5341. // ranges must be expressed in CIDR format. One or both of sourceRanges
  5342. // and sourceTags may be set. If both properties are set, the firewall
  5343. // will apply to traffic that has source IP address within sourceRanges
  5344. // OR the source IP that belongs to a tag listed in the sourceTags
  5345. // property. The connection does not need to match both properties for
  5346. // the firewall to apply. Only IPv4 is supported.
  5347. SourceRanges []string `json:"sourceRanges,omitempty"`
  5348. // SourceServiceAccounts: If source service accounts are specified, the
  5349. // firewall will apply only to traffic originating from an instance with
  5350. // a service account in this list. Source service accounts cannot be
  5351. // used to control traffic to an instance's external IP address because
  5352. // service accounts are associated with an instance, not an IP address.
  5353. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  5354. // both are set, the firewall will apply to traffic that has source IP
  5355. // address within sourceRanges OR the source IP belongs to an instance
  5356. // with service account listed in sourceServiceAccount. The connection
  5357. // does not need to match both properties for the firewall to apply.
  5358. // sourceServiceAccounts cannot be used at the same time as sourceTags
  5359. // or targetTags.
  5360. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  5361. // SourceTags: If source tags are specified, the firewall rule applies
  5362. // only to traffic with source IPs that match the primary network
  5363. // interfaces of VM instances that have the tag and are in the same VPC
  5364. // network. Source tags cannot be used to control traffic to an
  5365. // instance's external IP address, it only applies to traffic between
  5366. // instances in the same virtual network. Because tags are associated
  5367. // with instances, not IP addresses. One or both of sourceRanges and
  5368. // sourceTags may be set. If both properties are set, the firewall will
  5369. // apply to traffic that has source IP address within sourceRanges OR
  5370. // the source IP that belongs to a tag listed in the sourceTags
  5371. // property. The connection does not need to match both properties for
  5372. // the firewall to apply.
  5373. SourceTags []string `json:"sourceTags,omitempty"`
  5374. // TargetServiceAccounts: A list of service accounts indicating sets of
  5375. // instances located in the network that may make network connections as
  5376. // specified in allowed[]. targetServiceAccounts cannot be used at the
  5377. // same time as targetTags or sourceTags. If neither
  5378. // targetServiceAccounts nor targetTags are specified, the firewall rule
  5379. // applies to all instances on the specified network.
  5380. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  5381. // TargetTags: A list of tags that controls which instances the firewall
  5382. // rule applies to. If targetTags are specified, then the firewall rule
  5383. // applies only to instances in the VPC network that have one of those
  5384. // tags. If no targetTags are specified, the firewall rule applies to
  5385. // all instances on the specified network.
  5386. TargetTags []string `json:"targetTags,omitempty"`
  5387. // ServerResponse contains the HTTP response code and headers from the
  5388. // server.
  5389. googleapi.ServerResponse `json:"-"`
  5390. // ForceSendFields is a list of field names (e.g. "Allowed") to
  5391. // unconditionally include in API requests. By default, fields with
  5392. // empty values are omitted from API requests. However, any non-pointer,
  5393. // non-interface field appearing in ForceSendFields will be sent to the
  5394. // server regardless of whether the field is empty or not. This may be
  5395. // used to include empty fields in Patch requests.
  5396. ForceSendFields []string `json:"-"`
  5397. // NullFields is a list of field names (e.g. "Allowed") to include in
  5398. // API requests with the JSON null value. By default, fields with empty
  5399. // values are omitted from API requests. However, any field with an
  5400. // empty value appearing in NullFields will be sent to the server as
  5401. // null. It is an error if a field in this list has a non-empty value.
  5402. // This may be used to include null fields in Patch requests.
  5403. NullFields []string `json:"-"`
  5404. }
  5405. func (s *Firewall) MarshalJSON() ([]byte, error) {
  5406. type NoMethod Firewall
  5407. raw := NoMethod(*s)
  5408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5409. }
  5410. type FirewallAllowed struct {
  5411. // IPProtocol: The IP protocol to which this rule applies. The protocol
  5412. // type is required when creating a firewall rule. This value can either
  5413. // be one of the following well known protocol strings (tcp, udp, icmp,
  5414. // esp, ah, ipip, sctp), or the IP protocol number.
  5415. IPProtocol string `json:"IPProtocol,omitempty"`
  5416. // Ports: An optional list of ports to which this rule applies. This
  5417. // field is only applicable for UDP or TCP protocol. Each entry must be
  5418. // either an integer or a range. If not specified, this rule applies to
  5419. // connections through any port.
  5420. //
  5421. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  5422. Ports []string `json:"ports,omitempty"`
  5423. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  5424. // unconditionally include in API requests. By default, fields with
  5425. // empty values are omitted from API requests. However, any non-pointer,
  5426. // non-interface field appearing in ForceSendFields will be sent to the
  5427. // server regardless of whether the field is empty or not. This may be
  5428. // used to include empty fields in Patch requests.
  5429. ForceSendFields []string `json:"-"`
  5430. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  5431. // API requests with the JSON null value. By default, fields with empty
  5432. // values are omitted from API requests. However, any field with an
  5433. // empty value appearing in NullFields will be sent to the server as
  5434. // null. It is an error if a field in this list has a non-empty value.
  5435. // This may be used to include null fields in Patch requests.
  5436. NullFields []string `json:"-"`
  5437. }
  5438. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  5439. type NoMethod FirewallAllowed
  5440. raw := NoMethod(*s)
  5441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5442. }
  5443. type FirewallDenied struct {
  5444. // IPProtocol: The IP protocol to which this rule applies. The protocol
  5445. // type is required when creating a firewall rule. This value can either
  5446. // be one of the following well known protocol strings (tcp, udp, icmp,
  5447. // esp, ah, ipip, sctp), or the IP protocol number.
  5448. IPProtocol string `json:"IPProtocol,omitempty"`
  5449. // Ports: An optional list of ports to which this rule applies. This
  5450. // field is only applicable for UDP or TCP protocol. Each entry must be
  5451. // either an integer or a range. If not specified, this rule applies to
  5452. // connections through any port.
  5453. //
  5454. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  5455. Ports []string `json:"ports,omitempty"`
  5456. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  5457. // unconditionally include in API requests. By default, fields with
  5458. // empty values are omitted from API requests. However, any non-pointer,
  5459. // non-interface field appearing in ForceSendFields will be sent to the
  5460. // server regardless of whether the field is empty or not. This may be
  5461. // used to include empty fields in Patch requests.
  5462. ForceSendFields []string `json:"-"`
  5463. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  5464. // API requests with the JSON null value. By default, fields with empty
  5465. // values are omitted from API requests. However, any field with an
  5466. // empty value appearing in NullFields will be sent to the server as
  5467. // null. It is an error if a field in this list has a non-empty value.
  5468. // This may be used to include null fields in Patch requests.
  5469. NullFields []string `json:"-"`
  5470. }
  5471. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  5472. type NoMethod FirewallDenied
  5473. raw := NoMethod(*s)
  5474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5475. }
  5476. // FirewallList: Contains a list of firewalls.
  5477. type FirewallList struct {
  5478. // Id: [Output Only] Unique identifier for the resource; defined by the
  5479. // server.
  5480. Id string `json:"id,omitempty"`
  5481. // Items: A list of Firewall resources.
  5482. Items []*Firewall `json:"items,omitempty"`
  5483. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  5484. // lists of firewalls.
  5485. Kind string `json:"kind,omitempty"`
  5486. // NextPageToken: [Output Only] This token allows you to get the next
  5487. // page of results for list requests. If the number of results is larger
  5488. // than maxResults, use the nextPageToken as a value for the query
  5489. // parameter pageToken in the next list request. Subsequent list
  5490. // requests will have their own nextPageToken to continue paging through
  5491. // the results.
  5492. NextPageToken string `json:"nextPageToken,omitempty"`
  5493. // SelfLink: [Output Only] Server-defined URL for this resource.
  5494. SelfLink string `json:"selfLink,omitempty"`
  5495. // Warning: [Output Only] Informational warning message.
  5496. Warning *FirewallListWarning `json:"warning,omitempty"`
  5497. // ServerResponse contains the HTTP response code and headers from the
  5498. // server.
  5499. googleapi.ServerResponse `json:"-"`
  5500. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") to include in API
  5508. // 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 *FirewallList) MarshalJSON() ([]byte, error) {
  5516. type NoMethod FirewallList
  5517. raw := NoMethod(*s)
  5518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5519. }
  5520. // FirewallListWarning: [Output Only] Informational warning message.
  5521. type FirewallListWarning struct {
  5522. // Code: [Output Only] A warning code, if applicable. For example,
  5523. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5524. // the response.
  5525. //
  5526. // Possible values:
  5527. // "CLEANUP_FAILED"
  5528. // "DEPRECATED_RESOURCE_USED"
  5529. // "DEPRECATED_TYPE_USED"
  5530. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5531. // "EXPERIMENTAL_TYPE_USED"
  5532. // "EXTERNAL_API_WARNING"
  5533. // "FIELD_VALUE_OVERRIDEN"
  5534. // "INJECTED_KERNELS_DEPRECATED"
  5535. // "MISSING_TYPE_DEPENDENCY"
  5536. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5537. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5538. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5539. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5540. // "NEXT_HOP_NOT_RUNNING"
  5541. // "NOT_CRITICAL_ERROR"
  5542. // "NO_RESULTS_ON_PAGE"
  5543. // "REQUIRED_TOS_AGREEMENT"
  5544. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5545. // "RESOURCE_NOT_DELETED"
  5546. // "SCHEMA_VALIDATION_IGNORED"
  5547. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5548. // "UNDECLARED_PROPERTIES"
  5549. // "UNREACHABLE"
  5550. Code string `json:"code,omitempty"`
  5551. // Data: [Output Only] Metadata about this warning in key: value format.
  5552. // For example:
  5553. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5554. Data []*FirewallListWarningData `json:"data,omitempty"`
  5555. // Message: [Output Only] A human-readable description of the warning
  5556. // code.
  5557. Message string `json:"message,omitempty"`
  5558. // ForceSendFields is a list of field names (e.g. "Code") to
  5559. // unconditionally include in API requests. By default, fields with
  5560. // empty values are omitted from API requests. However, any non-pointer,
  5561. // non-interface field appearing in ForceSendFields will be sent to the
  5562. // server regardless of whether the field is empty or not. This may be
  5563. // used to include empty fields in Patch requests.
  5564. ForceSendFields []string `json:"-"`
  5565. // NullFields is a list of field names (e.g. "Code") to include in API
  5566. // requests with the JSON null value. By default, fields with empty
  5567. // values are omitted from API requests. However, any field with an
  5568. // empty value appearing in NullFields will be sent to the server as
  5569. // null. It is an error if a field in this list has a non-empty value.
  5570. // This may be used to include null fields in Patch requests.
  5571. NullFields []string `json:"-"`
  5572. }
  5573. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  5574. type NoMethod FirewallListWarning
  5575. raw := NoMethod(*s)
  5576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5577. }
  5578. type FirewallListWarningData struct {
  5579. // Key: [Output Only] A key that provides more detail on the warning
  5580. // being returned. For example, for warnings where there are no results
  5581. // in a list request for a particular zone, this key might be scope and
  5582. // the key value might be the zone name. Other examples might be a key
  5583. // indicating a deprecated resource and a suggested replacement, or a
  5584. // warning about invalid network settings (for example, if an instance
  5585. // attempts to perform IP forwarding but is not enabled for IP
  5586. // forwarding).
  5587. Key string `json:"key,omitempty"`
  5588. // Value: [Output Only] A warning data value corresponding to the key.
  5589. Value string `json:"value,omitempty"`
  5590. // ForceSendFields is a list of field names (e.g. "Key") to
  5591. // unconditionally include in API requests. By default, fields with
  5592. // empty values are omitted from API requests. However, any non-pointer,
  5593. // non-interface field appearing in ForceSendFields will be sent to the
  5594. // server regardless of whether the field is empty or not. This may be
  5595. // used to include empty fields in Patch requests.
  5596. ForceSendFields []string `json:"-"`
  5597. // NullFields is a list of field names (e.g. "Key") to include in API
  5598. // requests with the JSON null value. By default, fields with empty
  5599. // values are omitted from API requests. However, any field with an
  5600. // empty value appearing in NullFields will be sent to the server as
  5601. // null. It is an error if a field in this list has a non-empty value.
  5602. // This may be used to include null fields in Patch requests.
  5603. NullFields []string `json:"-"`
  5604. }
  5605. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  5606. type NoMethod FirewallListWarningData
  5607. raw := NoMethod(*s)
  5608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5609. }
  5610. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  5611. // specifies which pool of target virtual machines to forward a packet
  5612. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  5613. // resource_for beta.forwardingRules ==) (== resource_for
  5614. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  5615. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  5616. // beta.regionForwardingRules ==) (== resource_for
  5617. // v1.regionForwardingRules ==)
  5618. type ForwardingRule struct {
  5619. // IPAddress: The IP address that this forwarding rule is serving on
  5620. // behalf of.
  5621. //
  5622. // Addresses are restricted based on the forwarding rule's load
  5623. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  5624. // regional).
  5625. //
  5626. // When the load balancing scheme is EXTERNAL, for global forwarding
  5627. // rules, the address must be a global IP, and for regional forwarding
  5628. // rules, the address must live in the same region as the forwarding
  5629. // rule. If this field is empty, an ephemeral IPv4 address from the same
  5630. // scope (global or regional) will be assigned. A regional forwarding
  5631. // rule supports IPv4 only. A global forwarding rule supports either
  5632. // IPv4 or IPv6.
  5633. //
  5634. // When the load balancing scheme is INTERNAL, this can only be an RFC
  5635. // 1918 IP address belonging to the network/subnet configured for the
  5636. // forwarding rule. By default, if this field is empty, an ephemeral
  5637. // internal IP address will be automatically allocated from the IP range
  5638. // of the subnet or network configured for this forwarding rule.
  5639. //
  5640. // An address can be specified either by a literal IP address or a URL
  5641. // reference to an existing Address resource. The following examples are
  5642. // all valid:
  5643. // - 100.1.2.3
  5644. // -
  5645. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  5646. // - projects/project/regions/region/addresses/address
  5647. // - regions/region/addresses/address
  5648. // - global/addresses/address
  5649. // - address
  5650. IPAddress string `json:"IPAddress,omitempty"`
  5651. // IPProtocol: The IP protocol to which this rule applies. Valid options
  5652. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  5653. //
  5654. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  5655. // valid.
  5656. //
  5657. // Possible values:
  5658. // "AH"
  5659. // "ESP"
  5660. // "ICMP"
  5661. // "SCTP"
  5662. // "TCP"
  5663. // "UDP"
  5664. IPProtocol string `json:"IPProtocol,omitempty"`
  5665. // BackendService: This field is not used for external load
  5666. // balancing.
  5667. //
  5668. // For internal load balancing, this field identifies the BackendService
  5669. // resource to receive the matched traffic.
  5670. BackendService string `json:"backendService,omitempty"`
  5671. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5672. // format.
  5673. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5674. // Description: An optional description of this resource. Provide this
  5675. // property when you create the resource.
  5676. Description string `json:"description,omitempty"`
  5677. // Id: [Output Only] The unique identifier for the resource. This
  5678. // identifier is defined by the server.
  5679. Id uint64 `json:"id,omitempty,string"`
  5680. // IpVersion: The IP Version that will be used by this forwarding rule.
  5681. // Valid options are IPV4 or IPV6. This can only be specified for a
  5682. // global forwarding rule.
  5683. //
  5684. // Possible values:
  5685. // "IPV4"
  5686. // "IPV6"
  5687. // "UNSPECIFIED_VERSION"
  5688. IpVersion string `json:"ipVersion,omitempty"`
  5689. // Kind: [Output Only] Type of the resource. Always
  5690. // compute#forwardingRule for Forwarding Rule resources.
  5691. Kind string `json:"kind,omitempty"`
  5692. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  5693. // used for and can only take the following values: INTERNAL, EXTERNAL
  5694. // The value of INTERNAL means that this will be used for Internal
  5695. // Network Load Balancing (TCP, UDP). The value of EXTERNAL means that
  5696. // this will be used for External Load Balancing (HTTP(S) LB, External
  5697. // TCP/UDP LB, SSL Proxy)
  5698. //
  5699. // Possible values:
  5700. // "EXTERNAL"
  5701. // "INTERNAL"
  5702. // "INVALID"
  5703. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  5704. // Name: Name of the resource; provided by the client when the resource
  5705. // is created. The name must be 1-63 characters long, and comply with
  5706. // RFC1035. Specifically, the name must be 1-63 characters long and
  5707. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5708. // the first character must be a lowercase letter, and all following
  5709. // characters must be a dash, lowercase letter, or digit, except the
  5710. // last character, which cannot be a dash.
  5711. Name string `json:"name,omitempty"`
  5712. // Network: This field is not used for external load balancing.
  5713. //
  5714. // For internal load balancing, this field identifies the network that
  5715. // the load balanced IP should belong to for this Forwarding Rule. If
  5716. // this field is not specified, the default network will be used.
  5717. Network string `json:"network,omitempty"`
  5718. // PortRange: This field is used along with the target field for
  5719. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  5720. // TargetVpnGateway, TargetPool, TargetInstance.
  5721. //
  5722. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  5723. // addressed to ports in the specified range will be forwarded to
  5724. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  5725. // must have disjoint port ranges.
  5726. //
  5727. // Some types of forwarding target have constraints on the acceptable
  5728. // ports:
  5729. // - TargetHttpProxy: 80, 8080
  5730. // - TargetHttpsProxy: 443
  5731. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  5732. // 995, 1688, 1883, 5222
  5733. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  5734. // 995, 1688, 1883, 5222
  5735. // - TargetVpnGateway: 500, 4500
  5736. PortRange string `json:"portRange,omitempty"`
  5737. // Ports: This field is used along with the backend_service field for
  5738. // internal load balancing.
  5739. //
  5740. // When the load balancing scheme is INTERNAL, a single port or a comma
  5741. // separated list of ports can be configured. Only packets addressed to
  5742. // these ports will be forwarded to the backends configured with this
  5743. // forwarding rule.
  5744. //
  5745. // You may specify a maximum of up to 5 ports.
  5746. Ports []string `json:"ports,omitempty"`
  5747. // Region: [Output Only] URL of the region where the regional forwarding
  5748. // rule resides. This field is not applicable to global forwarding
  5749. // rules. You must specify this field as part of the HTTP request URL.
  5750. // It is not settable as a field in the request body.
  5751. Region string `json:"region,omitempty"`
  5752. // SelfLink: [Output Only] Server-defined URL for the resource.
  5753. SelfLink string `json:"selfLink,omitempty"`
  5754. // Subnetwork: This field is not used for external load balancing.
  5755. //
  5756. // For internal load balancing, this field identifies the subnetwork
  5757. // that the load balanced IP should belong to for this Forwarding
  5758. // Rule.
  5759. //
  5760. // If the network specified is in auto subnet mode, this field is
  5761. // optional. However, if the network is in custom subnet mode, a
  5762. // subnetwork must be specified.
  5763. Subnetwork string `json:"subnetwork,omitempty"`
  5764. // Target: The URL of the target resource to receive the matched
  5765. // traffic. For regional forwarding rules, this target must live in the
  5766. // same region as the forwarding rule. For global forwarding rules, this
  5767. // target must be a global load balancing resource. The forwarded
  5768. // traffic must be of a type appropriate to the target object.
  5769. Target string `json:"target,omitempty"`
  5770. // ServerResponse contains the HTTP response code and headers from the
  5771. // server.
  5772. googleapi.ServerResponse `json:"-"`
  5773. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  5774. // unconditionally include in API requests. By default, fields with
  5775. // empty values are omitted from API requests. However, any non-pointer,
  5776. // non-interface field appearing in ForceSendFields will be sent to the
  5777. // server regardless of whether the field is empty or not. This may be
  5778. // used to include empty fields in Patch requests.
  5779. ForceSendFields []string `json:"-"`
  5780. // NullFields is a list of field names (e.g. "IPAddress") to include in
  5781. // API requests with the JSON null value. By default, fields with empty
  5782. // values are omitted from API requests. However, any field with an
  5783. // empty value appearing in NullFields will be sent to the server as
  5784. // null. It is an error if a field in this list has a non-empty value.
  5785. // This may be used to include null fields in Patch requests.
  5786. NullFields []string `json:"-"`
  5787. }
  5788. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  5789. type NoMethod ForwardingRule
  5790. raw := NoMethod(*s)
  5791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5792. }
  5793. type ForwardingRuleAggregatedList struct {
  5794. // Id: [Output Only] Unique identifier for the resource; defined by the
  5795. // server.
  5796. Id string `json:"id,omitempty"`
  5797. // Items: A list of ForwardingRulesScopedList resources.
  5798. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  5799. // Kind: [Output Only] Type of resource. Always
  5800. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  5801. Kind string `json:"kind,omitempty"`
  5802. // NextPageToken: [Output Only] This token allows you to get the next
  5803. // page of results for list requests. If the number of results is larger
  5804. // than maxResults, use the nextPageToken as a value for the query
  5805. // parameter pageToken in the next list request. Subsequent list
  5806. // requests will have their own nextPageToken to continue paging through
  5807. // the results.
  5808. NextPageToken string `json:"nextPageToken,omitempty"`
  5809. // SelfLink: [Output Only] Server-defined URL for this resource.
  5810. SelfLink string `json:"selfLink,omitempty"`
  5811. // Warning: [Output Only] Informational warning message.
  5812. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  5813. // ServerResponse contains the HTTP response code and headers from the
  5814. // server.
  5815. googleapi.ServerResponse `json:"-"`
  5816. // ForceSendFields is a list of field names (e.g. "Id") to
  5817. // unconditionally include in API requests. By default, fields with
  5818. // empty values are omitted from API requests. However, any non-pointer,
  5819. // non-interface field appearing in ForceSendFields will be sent to the
  5820. // server regardless of whether the field is empty or not. This may be
  5821. // used to include empty fields in Patch requests.
  5822. ForceSendFields []string `json:"-"`
  5823. // NullFields is a list of field names (e.g. "Id") to include in API
  5824. // requests with the JSON null value. By default, fields with empty
  5825. // values are omitted from API requests. However, any field with an
  5826. // empty value appearing in NullFields will be sent to the server as
  5827. // null. It is an error if a field in this list has a non-empty value.
  5828. // This may be used to include null fields in Patch requests.
  5829. NullFields []string `json:"-"`
  5830. }
  5831. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  5832. type NoMethod ForwardingRuleAggregatedList
  5833. raw := NoMethod(*s)
  5834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5835. }
  5836. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  5837. // warning message.
  5838. type ForwardingRuleAggregatedListWarning struct {
  5839. // Code: [Output Only] A warning code, if applicable. For example,
  5840. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5841. // the response.
  5842. //
  5843. // Possible values:
  5844. // "CLEANUP_FAILED"
  5845. // "DEPRECATED_RESOURCE_USED"
  5846. // "DEPRECATED_TYPE_USED"
  5847. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5848. // "EXPERIMENTAL_TYPE_USED"
  5849. // "EXTERNAL_API_WARNING"
  5850. // "FIELD_VALUE_OVERRIDEN"
  5851. // "INJECTED_KERNELS_DEPRECATED"
  5852. // "MISSING_TYPE_DEPENDENCY"
  5853. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5854. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5855. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5856. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5857. // "NEXT_HOP_NOT_RUNNING"
  5858. // "NOT_CRITICAL_ERROR"
  5859. // "NO_RESULTS_ON_PAGE"
  5860. // "REQUIRED_TOS_AGREEMENT"
  5861. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5862. // "RESOURCE_NOT_DELETED"
  5863. // "SCHEMA_VALIDATION_IGNORED"
  5864. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5865. // "UNDECLARED_PROPERTIES"
  5866. // "UNREACHABLE"
  5867. Code string `json:"code,omitempty"`
  5868. // Data: [Output Only] Metadata about this warning in key: value format.
  5869. // For example:
  5870. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5871. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  5872. // Message: [Output Only] A human-readable description of the warning
  5873. // code.
  5874. Message string `json:"message,omitempty"`
  5875. // ForceSendFields is a list of field names (e.g. "Code") to
  5876. // unconditionally include in API requests. By default, fields with
  5877. // empty values are omitted from API requests. However, any non-pointer,
  5878. // non-interface field appearing in ForceSendFields will be sent to the
  5879. // server regardless of whether the field is empty or not. This may be
  5880. // used to include empty fields in Patch requests.
  5881. ForceSendFields []string `json:"-"`
  5882. // NullFields is a list of field names (e.g. "Code") to include in API
  5883. // requests with the JSON null value. By default, fields with empty
  5884. // values are omitted from API requests. However, any field with an
  5885. // empty value appearing in NullFields will be sent to the server as
  5886. // null. It is an error if a field in this list has a non-empty value.
  5887. // This may be used to include null fields in Patch requests.
  5888. NullFields []string `json:"-"`
  5889. }
  5890. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5891. type NoMethod ForwardingRuleAggregatedListWarning
  5892. raw := NoMethod(*s)
  5893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5894. }
  5895. type ForwardingRuleAggregatedListWarningData struct {
  5896. // Key: [Output Only] A key that provides more detail on the warning
  5897. // being returned. For example, for warnings where there are no results
  5898. // in a list request for a particular zone, this key might be scope and
  5899. // the key value might be the zone name. Other examples might be a key
  5900. // indicating a deprecated resource and a suggested replacement, or a
  5901. // warning about invalid network settings (for example, if an instance
  5902. // attempts to perform IP forwarding but is not enabled for IP
  5903. // forwarding).
  5904. Key string `json:"key,omitempty"`
  5905. // Value: [Output Only] A warning data value corresponding to the key.
  5906. Value string `json:"value,omitempty"`
  5907. // ForceSendFields is a list of field names (e.g. "Key") to
  5908. // unconditionally include in API requests. By default, fields with
  5909. // empty values are omitted from API requests. However, any non-pointer,
  5910. // non-interface field appearing in ForceSendFields will be sent to the
  5911. // server regardless of whether the field is empty or not. This may be
  5912. // used to include empty fields in Patch requests.
  5913. ForceSendFields []string `json:"-"`
  5914. // NullFields is a list of field names (e.g. "Key") to include in API
  5915. // requests with the JSON null value. By default, fields with empty
  5916. // values are omitted from API requests. However, any field with an
  5917. // empty value appearing in NullFields will be sent to the server as
  5918. // null. It is an error if a field in this list has a non-empty value.
  5919. // This may be used to include null fields in Patch requests.
  5920. NullFields []string `json:"-"`
  5921. }
  5922. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5923. type NoMethod ForwardingRuleAggregatedListWarningData
  5924. raw := NoMethod(*s)
  5925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5926. }
  5927. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  5928. type ForwardingRuleList struct {
  5929. // Id: [Output Only] Unique identifier for the resource; defined by the
  5930. // server.
  5931. Id string `json:"id,omitempty"`
  5932. // Items: A list of ForwardingRule resources.
  5933. Items []*ForwardingRule `json:"items,omitempty"`
  5934. // Kind: Type of resource.
  5935. Kind string `json:"kind,omitempty"`
  5936. // NextPageToken: [Output Only] This token allows you to get the next
  5937. // page of results for list requests. If the number of results is larger
  5938. // than maxResults, use the nextPageToken as a value for the query
  5939. // parameter pageToken in the next list request. Subsequent list
  5940. // requests will have their own nextPageToken to continue paging through
  5941. // the results.
  5942. NextPageToken string `json:"nextPageToken,omitempty"`
  5943. // SelfLink: [Output Only] Server-defined URL for this resource.
  5944. SelfLink string `json:"selfLink,omitempty"`
  5945. // Warning: [Output Only] Informational warning message.
  5946. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  5947. // ServerResponse contains the HTTP response code and headers from the
  5948. // server.
  5949. googleapi.ServerResponse `json:"-"`
  5950. // ForceSendFields is a list of field names (e.g. "Id") to
  5951. // unconditionally include in API requests. By default, fields with
  5952. // empty values are omitted from API requests. However, any non-pointer,
  5953. // non-interface field appearing in ForceSendFields will be sent to the
  5954. // server regardless of whether the field is empty or not. This may be
  5955. // used to include empty fields in Patch requests.
  5956. ForceSendFields []string `json:"-"`
  5957. // NullFields is a list of field names (e.g. "Id") to include in API
  5958. // requests with the JSON null value. By default, fields with empty
  5959. // values are omitted from API requests. However, any field with an
  5960. // empty value appearing in NullFields will be sent to the server as
  5961. // null. It is an error if a field in this list has a non-empty value.
  5962. // This may be used to include null fields in Patch requests.
  5963. NullFields []string `json:"-"`
  5964. }
  5965. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  5966. type NoMethod ForwardingRuleList
  5967. raw := NoMethod(*s)
  5968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5969. }
  5970. // ForwardingRuleListWarning: [Output Only] Informational warning
  5971. // message.
  5972. type ForwardingRuleListWarning struct {
  5973. // Code: [Output Only] A warning code, if applicable. For example,
  5974. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5975. // the response.
  5976. //
  5977. // Possible values:
  5978. // "CLEANUP_FAILED"
  5979. // "DEPRECATED_RESOURCE_USED"
  5980. // "DEPRECATED_TYPE_USED"
  5981. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5982. // "EXPERIMENTAL_TYPE_USED"
  5983. // "EXTERNAL_API_WARNING"
  5984. // "FIELD_VALUE_OVERRIDEN"
  5985. // "INJECTED_KERNELS_DEPRECATED"
  5986. // "MISSING_TYPE_DEPENDENCY"
  5987. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5988. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5989. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5990. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5991. // "NEXT_HOP_NOT_RUNNING"
  5992. // "NOT_CRITICAL_ERROR"
  5993. // "NO_RESULTS_ON_PAGE"
  5994. // "REQUIRED_TOS_AGREEMENT"
  5995. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5996. // "RESOURCE_NOT_DELETED"
  5997. // "SCHEMA_VALIDATION_IGNORED"
  5998. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5999. // "UNDECLARED_PROPERTIES"
  6000. // "UNREACHABLE"
  6001. Code string `json:"code,omitempty"`
  6002. // Data: [Output Only] Metadata about this warning in key: value format.
  6003. // For example:
  6004. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6005. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  6006. // Message: [Output Only] A human-readable description of the warning
  6007. // code.
  6008. Message string `json:"message,omitempty"`
  6009. // ForceSendFields is a list of field names (e.g. "Code") to
  6010. // unconditionally include in API requests. By default, fields with
  6011. // empty values are omitted from API requests. However, any non-pointer,
  6012. // non-interface field appearing in ForceSendFields will be sent to the
  6013. // server regardless of whether the field is empty or not. This may be
  6014. // used to include empty fields in Patch requests.
  6015. ForceSendFields []string `json:"-"`
  6016. // NullFields is a list of field names (e.g. "Code") to include in API
  6017. // requests with the JSON null value. By default, fields with empty
  6018. // values are omitted from API requests. However, any field with an
  6019. // empty value appearing in NullFields will be sent to the server as
  6020. // null. It is an error if a field in this list has a non-empty value.
  6021. // This may be used to include null fields in Patch requests.
  6022. NullFields []string `json:"-"`
  6023. }
  6024. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  6025. type NoMethod ForwardingRuleListWarning
  6026. raw := NoMethod(*s)
  6027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6028. }
  6029. type ForwardingRuleListWarningData struct {
  6030. // Key: [Output Only] A key that provides more detail on the warning
  6031. // being returned. For example, for warnings where there are no results
  6032. // in a list request for a particular zone, this key might be scope and
  6033. // the key value might be the zone name. Other examples might be a key
  6034. // indicating a deprecated resource and a suggested replacement, or a
  6035. // warning about invalid network settings (for example, if an instance
  6036. // attempts to perform IP forwarding but is not enabled for IP
  6037. // forwarding).
  6038. Key string `json:"key,omitempty"`
  6039. // Value: [Output Only] A warning data value corresponding to the key.
  6040. Value string `json:"value,omitempty"`
  6041. // ForceSendFields is a list of field names (e.g. "Key") to
  6042. // unconditionally include in API requests. By default, fields with
  6043. // empty values are omitted from API requests. However, any non-pointer,
  6044. // non-interface field appearing in ForceSendFields will be sent to the
  6045. // server regardless of whether the field is empty or not. This may be
  6046. // used to include empty fields in Patch requests.
  6047. ForceSendFields []string `json:"-"`
  6048. // NullFields is a list of field names (e.g. "Key") to include in API
  6049. // requests with the JSON null value. By default, fields with empty
  6050. // values are omitted from API requests. However, any field with an
  6051. // empty value appearing in NullFields will be sent to the server as
  6052. // null. It is an error if a field in this list has a non-empty value.
  6053. // This may be used to include null fields in Patch requests.
  6054. NullFields []string `json:"-"`
  6055. }
  6056. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  6057. type NoMethod ForwardingRuleListWarningData
  6058. raw := NoMethod(*s)
  6059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6060. }
  6061. type ForwardingRulesScopedList struct {
  6062. // ForwardingRules: A list of forwarding rules contained in this scope.
  6063. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  6064. // Warning: Informational warning which replaces the list of forwarding
  6065. // rules when the list is empty.
  6066. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  6067. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  6068. // unconditionally include in API requests. By default, fields with
  6069. // empty values are omitted from API requests. However, any non-pointer,
  6070. // non-interface field appearing in ForceSendFields will be sent to the
  6071. // server regardless of whether the field is empty or not. This may be
  6072. // used to include empty fields in Patch requests.
  6073. ForceSendFields []string `json:"-"`
  6074. // NullFields is a list of field names (e.g. "ForwardingRules") to
  6075. // include in API requests with the JSON null value. By default, fields
  6076. // with empty values are omitted from API requests. However, any field
  6077. // with an empty value appearing in NullFields will be sent to the
  6078. // server as null. It is an error if a field in this list has a
  6079. // non-empty value. This may be used to include null fields in Patch
  6080. // requests.
  6081. NullFields []string `json:"-"`
  6082. }
  6083. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  6084. type NoMethod ForwardingRulesScopedList
  6085. raw := NoMethod(*s)
  6086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6087. }
  6088. // ForwardingRulesScopedListWarning: Informational warning which
  6089. // replaces the list of forwarding rules when the list is empty.
  6090. type ForwardingRulesScopedListWarning struct {
  6091. // Code: [Output Only] A warning code, if applicable. For example,
  6092. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6093. // the response.
  6094. //
  6095. // Possible values:
  6096. // "CLEANUP_FAILED"
  6097. // "DEPRECATED_RESOURCE_USED"
  6098. // "DEPRECATED_TYPE_USED"
  6099. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6100. // "EXPERIMENTAL_TYPE_USED"
  6101. // "EXTERNAL_API_WARNING"
  6102. // "FIELD_VALUE_OVERRIDEN"
  6103. // "INJECTED_KERNELS_DEPRECATED"
  6104. // "MISSING_TYPE_DEPENDENCY"
  6105. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6106. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6107. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6108. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6109. // "NEXT_HOP_NOT_RUNNING"
  6110. // "NOT_CRITICAL_ERROR"
  6111. // "NO_RESULTS_ON_PAGE"
  6112. // "REQUIRED_TOS_AGREEMENT"
  6113. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6114. // "RESOURCE_NOT_DELETED"
  6115. // "SCHEMA_VALIDATION_IGNORED"
  6116. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6117. // "UNDECLARED_PROPERTIES"
  6118. // "UNREACHABLE"
  6119. Code string `json:"code,omitempty"`
  6120. // Data: [Output Only] Metadata about this warning in key: value format.
  6121. // For example:
  6122. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6123. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  6124. // Message: [Output Only] A human-readable description of the warning
  6125. // code.
  6126. Message string `json:"message,omitempty"`
  6127. // ForceSendFields is a list of field names (e.g. "Code") to
  6128. // unconditionally include in API requests. By default, fields with
  6129. // empty values are omitted from API requests. However, any non-pointer,
  6130. // non-interface field appearing in ForceSendFields will be sent to the
  6131. // server regardless of whether the field is empty or not. This may be
  6132. // used to include empty fields in Patch requests.
  6133. ForceSendFields []string `json:"-"`
  6134. // NullFields is a list of field names (e.g. "Code") to include in API
  6135. // requests with the JSON null value. By default, fields with empty
  6136. // values are omitted from API requests. However, any field with an
  6137. // empty value appearing in NullFields will be sent to the server as
  6138. // null. It is an error if a field in this list has a non-empty value.
  6139. // This may be used to include null fields in Patch requests.
  6140. NullFields []string `json:"-"`
  6141. }
  6142. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  6143. type NoMethod ForwardingRulesScopedListWarning
  6144. raw := NoMethod(*s)
  6145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6146. }
  6147. type ForwardingRulesScopedListWarningData struct {
  6148. // Key: [Output Only] A key that provides more detail on the warning
  6149. // being returned. For example, for warnings where there are no results
  6150. // in a list request for a particular zone, this key might be scope and
  6151. // the key value might be the zone name. Other examples might be a key
  6152. // indicating a deprecated resource and a suggested replacement, or a
  6153. // warning about invalid network settings (for example, if an instance
  6154. // attempts to perform IP forwarding but is not enabled for IP
  6155. // forwarding).
  6156. Key string `json:"key,omitempty"`
  6157. // Value: [Output Only] A warning data value corresponding to the key.
  6158. Value string `json:"value,omitempty"`
  6159. // ForceSendFields is a list of field names (e.g. "Key") to
  6160. // unconditionally include in API requests. By default, fields with
  6161. // empty values are omitted from API requests. However, any non-pointer,
  6162. // non-interface field appearing in ForceSendFields will be sent to the
  6163. // server regardless of whether the field is empty or not. This may be
  6164. // used to include empty fields in Patch requests.
  6165. ForceSendFields []string `json:"-"`
  6166. // NullFields is a list of field names (e.g. "Key") to include in API
  6167. // requests with the JSON null value. By default, fields with empty
  6168. // values are omitted from API requests. However, any field with an
  6169. // empty value appearing in NullFields will be sent to the server as
  6170. // null. It is an error if a field in this list has a non-empty value.
  6171. // This may be used to include null fields in Patch requests.
  6172. NullFields []string `json:"-"`
  6173. }
  6174. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6175. type NoMethod ForwardingRulesScopedListWarningData
  6176. raw := NoMethod(*s)
  6177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6178. }
  6179. type GlobalSetLabelsRequest struct {
  6180. // LabelFingerprint: The fingerprint of the previous set of labels for
  6181. // this resource, used to detect conflicts. The fingerprint is initially
  6182. // generated by Compute Engine and changes after every request to modify
  6183. // or update labels. You must always provide an up-to-date fingerprint
  6184. // hash when updating or changing labels. Make a get() request to the
  6185. // resource to get the latest fingerprint.
  6186. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6187. // Labels: A list of labels to apply for this resource. Each label key &
  6188. // value must comply with RFC1035. Specifically, the name must be 1-63
  6189. // characters long and match the regular expression
  6190. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  6191. // a lowercase letter, and all following characters must be a dash,
  6192. // lowercase letter, or digit, except the last character, which cannot
  6193. // be a dash. For example, "webserver-frontend": "images". A label value
  6194. // can also be empty (e.g. "my-label": "").
  6195. Labels map[string]string `json:"labels,omitempty"`
  6196. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  6197. // unconditionally include in API requests. By default, fields with
  6198. // empty values are omitted from API requests. However, any non-pointer,
  6199. // non-interface field appearing in ForceSendFields will be sent to the
  6200. // server regardless of whether the field is empty or not. This may be
  6201. // used to include empty fields in Patch requests.
  6202. ForceSendFields []string `json:"-"`
  6203. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  6204. // include in API requests with the JSON null value. By default, fields
  6205. // with empty values are omitted from API requests. However, any field
  6206. // with an empty value appearing in NullFields will be sent to the
  6207. // server as null. It is an error if a field in this list has a
  6208. // non-empty value. This may be used to include null fields in Patch
  6209. // requests.
  6210. NullFields []string `json:"-"`
  6211. }
  6212. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  6213. type NoMethod GlobalSetLabelsRequest
  6214. raw := NoMethod(*s)
  6215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6216. }
  6217. // GuestOsFeature: Guest OS features.
  6218. type GuestOsFeature struct {
  6219. // Type: The ID of a supported feature. Read Enabling guest operating
  6220. // system features to see a list of available options.
  6221. //
  6222. // Possible values:
  6223. // "FEATURE_TYPE_UNSPECIFIED"
  6224. // "MULTI_IP_SUBNET"
  6225. // "SECURE_BOOT"
  6226. // "UEFI_COMPATIBLE"
  6227. // "VIRTIO_SCSI_MULTIQUEUE"
  6228. // "WINDOWS"
  6229. Type string `json:"type,omitempty"`
  6230. // ForceSendFields is a list of field names (e.g. "Type") to
  6231. // unconditionally include in API requests. By default, fields with
  6232. // empty values are omitted from API requests. However, any non-pointer,
  6233. // non-interface field appearing in ForceSendFields will be sent to the
  6234. // server regardless of whether the field is empty or not. This may be
  6235. // used to include empty fields in Patch requests.
  6236. ForceSendFields []string `json:"-"`
  6237. // NullFields is a list of field names (e.g. "Type") to include in API
  6238. // requests with the JSON null value. By default, fields with empty
  6239. // values are omitted from API requests. However, any field with an
  6240. // empty value appearing in NullFields will be sent to the server as
  6241. // null. It is an error if a field in this list has a non-empty value.
  6242. // This may be used to include null fields in Patch requests.
  6243. NullFields []string `json:"-"`
  6244. }
  6245. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  6246. type NoMethod GuestOsFeature
  6247. raw := NoMethod(*s)
  6248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6249. }
  6250. type HTTPHealthCheck struct {
  6251. // Host: The value of the host header in the HTTP health check request.
  6252. // If left empty (default value), the IP on behalf of which this health
  6253. // check is performed will be used.
  6254. Host string `json:"host,omitempty"`
  6255. // Port: The TCP port number for the health check request. The default
  6256. // value is 80. Valid values are 1 through 65535.
  6257. Port int64 `json:"port,omitempty"`
  6258. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  6259. // both port and port_name are defined, port takes precedence.
  6260. PortName string `json:"portName,omitempty"`
  6261. // ProxyHeader: Specifies the type of proxy header to append before
  6262. // sending data to the backend, either NONE or PROXY_V1. The default is
  6263. // NONE.
  6264. //
  6265. // Possible values:
  6266. // "NONE"
  6267. // "PROXY_V1"
  6268. ProxyHeader string `json:"proxyHeader,omitempty"`
  6269. // RequestPath: The request path of the HTTP health check request. The
  6270. // default value is /.
  6271. RequestPath string `json:"requestPath,omitempty"`
  6272. // ForceSendFields is a list of field names (e.g. "Host") to
  6273. // unconditionally include in API requests. By default, fields with
  6274. // empty values are omitted from API requests. However, any non-pointer,
  6275. // non-interface field appearing in ForceSendFields will be sent to the
  6276. // server regardless of whether the field is empty or not. This may be
  6277. // used to include empty fields in Patch requests.
  6278. ForceSendFields []string `json:"-"`
  6279. // NullFields is a list of field names (e.g. "Host") to include in API
  6280. // requests with the JSON null value. By default, fields with empty
  6281. // values are omitted from API requests. However, any field with an
  6282. // empty value appearing in NullFields will be sent to the server as
  6283. // null. It is an error if a field in this list has a non-empty value.
  6284. // This may be used to include null fields in Patch requests.
  6285. NullFields []string `json:"-"`
  6286. }
  6287. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  6288. type NoMethod HTTPHealthCheck
  6289. raw := NoMethod(*s)
  6290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6291. }
  6292. type HTTPSHealthCheck struct {
  6293. // Host: The value of the host header in the HTTPS health check request.
  6294. // If left empty (default value), the IP on behalf of which this health
  6295. // check is performed will be used.
  6296. Host string `json:"host,omitempty"`
  6297. // Port: The TCP port number for the health check request. The default
  6298. // value is 443. Valid values are 1 through 65535.
  6299. Port int64 `json:"port,omitempty"`
  6300. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  6301. // both port and port_name are defined, port takes precedence.
  6302. PortName string `json:"portName,omitempty"`
  6303. // ProxyHeader: Specifies the type of proxy header to append before
  6304. // sending data to the backend, either NONE or PROXY_V1. The default is
  6305. // NONE.
  6306. //
  6307. // Possible values:
  6308. // "NONE"
  6309. // "PROXY_V1"
  6310. ProxyHeader string `json:"proxyHeader,omitempty"`
  6311. // RequestPath: The request path of the HTTPS health check request. The
  6312. // default value is /.
  6313. RequestPath string `json:"requestPath,omitempty"`
  6314. // ForceSendFields is a list of field names (e.g. "Host") to
  6315. // unconditionally include in API requests. By default, fields with
  6316. // empty values are omitted from API requests. However, any non-pointer,
  6317. // non-interface field appearing in ForceSendFields will be sent to the
  6318. // server regardless of whether the field is empty or not. This may be
  6319. // used to include empty fields in Patch requests.
  6320. ForceSendFields []string `json:"-"`
  6321. // NullFields is a list of field names (e.g. "Host") to include in API
  6322. // requests with the JSON null value. By default, fields with empty
  6323. // values are omitted from API requests. However, any field with an
  6324. // empty value appearing in NullFields will be sent to the server as
  6325. // null. It is an error if a field in this list has a non-empty value.
  6326. // This may be used to include null fields in Patch requests.
  6327. NullFields []string `json:"-"`
  6328. }
  6329. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  6330. type NoMethod HTTPSHealthCheck
  6331. raw := NoMethod(*s)
  6332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6333. }
  6334. // HealthCheck: An HealthCheck resource. This resource defines a
  6335. // template for how individual virtual machines should be checked for
  6336. // health, via one of the supported protocols.
  6337. type HealthCheck struct {
  6338. // CheckIntervalSec: How often (in seconds) to send a health check. The
  6339. // default value is 5 seconds.
  6340. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  6341. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  6342. // format.
  6343. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6344. // Description: An optional description of this resource. Provide this
  6345. // property when you create the resource.
  6346. Description string `json:"description,omitempty"`
  6347. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  6348. // after this many consecutive successes. The default value is 2.
  6349. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  6350. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  6351. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  6352. // Id: [Output Only] The unique identifier for the resource. This
  6353. // identifier is defined by the server.
  6354. Id uint64 `json:"id,omitempty,string"`
  6355. // Kind: Type of the resource.
  6356. Kind string `json:"kind,omitempty"`
  6357. // Name: Name of the resource. Provided by the client when the resource
  6358. // is created. The name must be 1-63 characters long, and comply with
  6359. // RFC1035. Specifically, the name must be 1-63 characters long and
  6360. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6361. // the first character must be a lowercase letter, and all following
  6362. // characters must be a dash, lowercase letter, or digit, except the
  6363. // last character, which cannot be a dash.
  6364. Name string `json:"name,omitempty"`
  6365. // SelfLink: [Output Only] Server-defined URL for the resource.
  6366. SelfLink string `json:"selfLink,omitempty"`
  6367. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  6368. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  6369. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  6370. // The default value is 5 seconds. It is invalid for timeoutSec to have
  6371. // greater value than checkIntervalSec.
  6372. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  6373. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  6374. // HTTPS. If not specified, the default is TCP. Exactly one of the
  6375. // protocol-specific health check field must be specified, which must
  6376. // match type field.
  6377. //
  6378. // Possible values:
  6379. // "HTTP"
  6380. // "HTTPS"
  6381. // "INVALID"
  6382. // "SSL"
  6383. // "TCP"
  6384. Type string `json:"type,omitempty"`
  6385. // UnhealthyThreshold: A so-far healthy instance will be marked
  6386. // unhealthy after this many consecutive failures. The default value is
  6387. // 2.
  6388. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  6389. // ServerResponse contains the HTTP response code and headers from the
  6390. // server.
  6391. googleapi.ServerResponse `json:"-"`
  6392. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  6393. // unconditionally include in API requests. By default, fields with
  6394. // empty values are omitted from API requests. However, any non-pointer,
  6395. // non-interface field appearing in ForceSendFields will be sent to the
  6396. // server regardless of whether the field is empty or not. This may be
  6397. // used to include empty fields in Patch requests.
  6398. ForceSendFields []string `json:"-"`
  6399. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  6400. // include in API requests with the JSON null value. By default, fields
  6401. // with empty values are omitted from API requests. However, any field
  6402. // with an empty value appearing in NullFields will be sent to the
  6403. // server as null. It is an error if a field in this list has a
  6404. // non-empty value. This may be used to include null fields in Patch
  6405. // requests.
  6406. NullFields []string `json:"-"`
  6407. }
  6408. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  6409. type NoMethod HealthCheck
  6410. raw := NoMethod(*s)
  6411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6412. }
  6413. // HealthCheckList: Contains a list of HealthCheck resources.
  6414. type HealthCheckList struct {
  6415. // Id: [Output Only] Unique identifier for the resource; defined by the
  6416. // server.
  6417. Id string `json:"id,omitempty"`
  6418. // Items: A list of HealthCheck resources.
  6419. Items []*HealthCheck `json:"items,omitempty"`
  6420. // Kind: Type of resource.
  6421. Kind string `json:"kind,omitempty"`
  6422. // NextPageToken: [Output Only] This token allows you to get the next
  6423. // page of results for list requests. If the number of results is larger
  6424. // than maxResults, use the nextPageToken as a value for the query
  6425. // parameter pageToken in the next list request. Subsequent list
  6426. // requests will have their own nextPageToken to continue paging through
  6427. // the results.
  6428. NextPageToken string `json:"nextPageToken,omitempty"`
  6429. // SelfLink: [Output Only] Server-defined URL for this resource.
  6430. SelfLink string `json:"selfLink,omitempty"`
  6431. // Warning: [Output Only] Informational warning message.
  6432. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  6433. // ServerResponse contains the HTTP response code and headers from the
  6434. // server.
  6435. googleapi.ServerResponse `json:"-"`
  6436. // ForceSendFields is a list of field names (e.g. "Id") to
  6437. // unconditionally include in API requests. By default, fields with
  6438. // empty values are omitted from API requests. However, any non-pointer,
  6439. // non-interface field appearing in ForceSendFields will be sent to the
  6440. // server regardless of whether the field is empty or not. This may be
  6441. // used to include empty fields in Patch requests.
  6442. ForceSendFields []string `json:"-"`
  6443. // NullFields is a list of field names (e.g. "Id") to include in API
  6444. // requests with the JSON null value. By default, fields with empty
  6445. // values are omitted from API requests. However, any field with an
  6446. // empty value appearing in NullFields will be sent to the server as
  6447. // null. It is an error if a field in this list has a non-empty value.
  6448. // This may be used to include null fields in Patch requests.
  6449. NullFields []string `json:"-"`
  6450. }
  6451. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  6452. type NoMethod HealthCheckList
  6453. raw := NoMethod(*s)
  6454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6455. }
  6456. // HealthCheckListWarning: [Output Only] Informational warning message.
  6457. type HealthCheckListWarning struct {
  6458. // Code: [Output Only] A warning code, if applicable. For example,
  6459. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6460. // the response.
  6461. //
  6462. // Possible values:
  6463. // "CLEANUP_FAILED"
  6464. // "DEPRECATED_RESOURCE_USED"
  6465. // "DEPRECATED_TYPE_USED"
  6466. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6467. // "EXPERIMENTAL_TYPE_USED"
  6468. // "EXTERNAL_API_WARNING"
  6469. // "FIELD_VALUE_OVERRIDEN"
  6470. // "INJECTED_KERNELS_DEPRECATED"
  6471. // "MISSING_TYPE_DEPENDENCY"
  6472. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6473. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6474. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6475. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6476. // "NEXT_HOP_NOT_RUNNING"
  6477. // "NOT_CRITICAL_ERROR"
  6478. // "NO_RESULTS_ON_PAGE"
  6479. // "REQUIRED_TOS_AGREEMENT"
  6480. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6481. // "RESOURCE_NOT_DELETED"
  6482. // "SCHEMA_VALIDATION_IGNORED"
  6483. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6484. // "UNDECLARED_PROPERTIES"
  6485. // "UNREACHABLE"
  6486. Code string `json:"code,omitempty"`
  6487. // Data: [Output Only] Metadata about this warning in key: value format.
  6488. // For example:
  6489. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6490. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  6491. // Message: [Output Only] A human-readable description of the warning
  6492. // code.
  6493. Message string `json:"message,omitempty"`
  6494. // ForceSendFields is a list of field names (e.g. "Code") to
  6495. // unconditionally include in API requests. By default, fields with
  6496. // empty values are omitted from API requests. However, any non-pointer,
  6497. // non-interface field appearing in ForceSendFields will be sent to the
  6498. // server regardless of whether the field is empty or not. This may be
  6499. // used to include empty fields in Patch requests.
  6500. ForceSendFields []string `json:"-"`
  6501. // NullFields is a list of field names (e.g. "Code") to include in API
  6502. // requests with the JSON null value. By default, fields with empty
  6503. // values are omitted from API requests. However, any field with an
  6504. // empty value appearing in NullFields will be sent to the server as
  6505. // null. It is an error if a field in this list has a non-empty value.
  6506. // This may be used to include null fields in Patch requests.
  6507. NullFields []string `json:"-"`
  6508. }
  6509. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  6510. type NoMethod HealthCheckListWarning
  6511. raw := NoMethod(*s)
  6512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6513. }
  6514. type HealthCheckListWarningData struct {
  6515. // Key: [Output Only] A key that provides more detail on the warning
  6516. // being returned. For example, for warnings where there are no results
  6517. // in a list request for a particular zone, this key might be scope and
  6518. // the key value might be the zone name. Other examples might be a key
  6519. // indicating a deprecated resource and a suggested replacement, or a
  6520. // warning about invalid network settings (for example, if an instance
  6521. // attempts to perform IP forwarding but is not enabled for IP
  6522. // forwarding).
  6523. Key string `json:"key,omitempty"`
  6524. // Value: [Output Only] A warning data value corresponding to the key.
  6525. Value string `json:"value,omitempty"`
  6526. // ForceSendFields is a list of field names (e.g. "Key") to
  6527. // unconditionally include in API requests. By default, fields with
  6528. // empty values are omitted from API requests. However, any non-pointer,
  6529. // non-interface field appearing in ForceSendFields will be sent to the
  6530. // server regardless of whether the field is empty or not. This may be
  6531. // used to include empty fields in Patch requests.
  6532. ForceSendFields []string `json:"-"`
  6533. // NullFields is a list of field names (e.g. "Key") to include in API
  6534. // requests with the JSON null value. By default, fields with empty
  6535. // values are omitted from API requests. However, any field with an
  6536. // empty value appearing in NullFields will be sent to the server as
  6537. // null. It is an error if a field in this list has a non-empty value.
  6538. // This may be used to include null fields in Patch requests.
  6539. NullFields []string `json:"-"`
  6540. }
  6541. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  6542. type NoMethod HealthCheckListWarningData
  6543. raw := NoMethod(*s)
  6544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6545. }
  6546. // HealthCheckReference: A full or valid partial URL to a health check.
  6547. // For example, the following are valid URLs:
  6548. // -
  6549. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  6550. // - projects/project-id/global/httpHealthChecks/health-check
  6551. // - global/httpHealthChecks/health-check
  6552. type HealthCheckReference struct {
  6553. HealthCheck string `json:"healthCheck,omitempty"`
  6554. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  6555. // unconditionally include in API requests. By default, fields with
  6556. // empty values are omitted from API requests. However, any non-pointer,
  6557. // non-interface field appearing in ForceSendFields will be sent to the
  6558. // server regardless of whether the field is empty or not. This may be
  6559. // used to include empty fields in Patch requests.
  6560. ForceSendFields []string `json:"-"`
  6561. // NullFields is a list of field names (e.g. "HealthCheck") to include
  6562. // in API requests with the JSON null value. By default, fields with
  6563. // empty values are omitted from API requests. However, any field with
  6564. // an empty value appearing in NullFields will be sent to the server as
  6565. // null. It is an error if a field in this list has a non-empty value.
  6566. // This may be used to include null fields in Patch requests.
  6567. NullFields []string `json:"-"`
  6568. }
  6569. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  6570. type NoMethod HealthCheckReference
  6571. raw := NoMethod(*s)
  6572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6573. }
  6574. type HealthStatus struct {
  6575. // HealthState: Health state of the instance.
  6576. //
  6577. // Possible values:
  6578. // "HEALTHY"
  6579. // "UNHEALTHY"
  6580. HealthState string `json:"healthState,omitempty"`
  6581. // Instance: URL of the instance resource.
  6582. Instance string `json:"instance,omitempty"`
  6583. // IpAddress: The IP address represented by this resource.
  6584. IpAddress string `json:"ipAddress,omitempty"`
  6585. // Port: The port on the instance.
  6586. Port int64 `json:"port,omitempty"`
  6587. // ForceSendFields is a list of field names (e.g. "HealthState") to
  6588. // unconditionally include in API requests. By default, fields with
  6589. // empty values are omitted from API requests. However, any non-pointer,
  6590. // non-interface field appearing in ForceSendFields will be sent to the
  6591. // server regardless of whether the field is empty or not. This may be
  6592. // used to include empty fields in Patch requests.
  6593. ForceSendFields []string `json:"-"`
  6594. // NullFields is a list of field names (e.g. "HealthState") to include
  6595. // in API requests with the JSON null value. By default, fields with
  6596. // empty values are omitted from API requests. However, any field with
  6597. // an empty value appearing in NullFields will be sent to the server as
  6598. // null. It is an error if a field in this list has a non-empty value.
  6599. // This may be used to include null fields in Patch requests.
  6600. NullFields []string `json:"-"`
  6601. }
  6602. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  6603. type NoMethod HealthStatus
  6604. raw := NoMethod(*s)
  6605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6606. }
  6607. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  6608. // use the named PathMatcher to select the BackendService.
  6609. type HostRule struct {
  6610. // Description: An optional description of this resource. Provide this
  6611. // property when you create the resource.
  6612. Description string `json:"description,omitempty"`
  6613. // Hosts: The list of host patterns to match. They must be valid
  6614. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  6615. // case, * must be the first character and must be followed in the
  6616. // pattern by either - or ..
  6617. Hosts []string `json:"hosts,omitempty"`
  6618. // PathMatcher: The name of the PathMatcher to use to match the path
  6619. // portion of the URL if the hostRule matches the URL's host portion.
  6620. PathMatcher string `json:"pathMatcher,omitempty"`
  6621. // ForceSendFields is a list of field names (e.g. "Description") to
  6622. // unconditionally include in API requests. By default, fields with
  6623. // empty values are omitted from API requests. However, any non-pointer,
  6624. // non-interface field appearing in ForceSendFields will be sent to the
  6625. // server regardless of whether the field is empty or not. This may be
  6626. // used to include empty fields in Patch requests.
  6627. ForceSendFields []string `json:"-"`
  6628. // NullFields is a list of field names (e.g. "Description") to include
  6629. // in API requests with the JSON null value. By default, fields with
  6630. // empty values are omitted from API requests. However, any field with
  6631. // an empty value appearing in NullFields will be sent to the server as
  6632. // null. It is an error if a field in this list has a non-empty value.
  6633. // This may be used to include null fields in Patch requests.
  6634. NullFields []string `json:"-"`
  6635. }
  6636. func (s *HostRule) MarshalJSON() ([]byte, error) {
  6637. type NoMethod HostRule
  6638. raw := NoMethod(*s)
  6639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6640. }
  6641. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  6642. // template for how individual instances should be checked for health,
  6643. // via HTTP.
  6644. type HttpHealthCheck struct {
  6645. // CheckIntervalSec: How often (in seconds) to send a health check. The
  6646. // default value is 5 seconds.
  6647. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  6648. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6649. // format.
  6650. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6651. // Description: An optional description of this resource. Provide this
  6652. // property when you create the resource.
  6653. Description string `json:"description,omitempty"`
  6654. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  6655. // after this many consecutive successes. The default value is 2.
  6656. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  6657. // Host: The value of the host header in the HTTP health check request.
  6658. // If left empty (default value), the public IP on behalf of which this
  6659. // health check is performed will be used.
  6660. Host string `json:"host,omitempty"`
  6661. // Id: [Output Only] The unique identifier for the resource. This
  6662. // identifier is defined by the server.
  6663. Id uint64 `json:"id,omitempty,string"`
  6664. // Kind: [Output Only] Type of the resource. Always
  6665. // compute#httpHealthCheck for HTTP health checks.
  6666. Kind string `json:"kind,omitempty"`
  6667. // Name: Name of the resource. Provided by the client when the resource
  6668. // is created. The name must be 1-63 characters long, and comply with
  6669. // RFC1035. Specifically, the name must be 1-63 characters long and
  6670. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6671. // the first character must be a lowercase letter, and all following
  6672. // characters must be a dash, lowercase letter, or digit, except the
  6673. // last character, which cannot be a dash.
  6674. Name string `json:"name,omitempty"`
  6675. // Port: The TCP port number for the HTTP health check request. The
  6676. // default value is 80.
  6677. Port int64 `json:"port,omitempty"`
  6678. // RequestPath: The request path of the HTTP health check request. The
  6679. // default value is /.
  6680. RequestPath string `json:"requestPath,omitempty"`
  6681. // SelfLink: [Output Only] Server-defined URL for the resource.
  6682. SelfLink string `json:"selfLink,omitempty"`
  6683. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  6684. // The default value is 5 seconds. It is invalid for timeoutSec to have
  6685. // greater value than checkIntervalSec.
  6686. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  6687. // UnhealthyThreshold: A so-far healthy instance will be marked
  6688. // unhealthy after this many consecutive failures. The default value is
  6689. // 2.
  6690. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  6691. // ServerResponse contains the HTTP response code and headers from the
  6692. // server.
  6693. googleapi.ServerResponse `json:"-"`
  6694. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  6695. // unconditionally include in API requests. By default, fields with
  6696. // empty values are omitted from API requests. However, any non-pointer,
  6697. // non-interface field appearing in ForceSendFields will be sent to the
  6698. // server regardless of whether the field is empty or not. This may be
  6699. // used to include empty fields in Patch requests.
  6700. ForceSendFields []string `json:"-"`
  6701. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  6702. // include in API requests with the JSON null value. By default, fields
  6703. // with empty values are omitted from API requests. However, any field
  6704. // with an empty value appearing in NullFields will be sent to the
  6705. // server as null. It is an error if a field in this list has a
  6706. // non-empty value. This may be used to include null fields in Patch
  6707. // requests.
  6708. NullFields []string `json:"-"`
  6709. }
  6710. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  6711. type NoMethod HttpHealthCheck
  6712. raw := NoMethod(*s)
  6713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6714. }
  6715. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  6716. type HttpHealthCheckList struct {
  6717. // Id: [Output Only] Unique identifier for the resource; defined by the
  6718. // server.
  6719. Id string `json:"id,omitempty"`
  6720. // Items: A list of HttpHealthCheck resources.
  6721. Items []*HttpHealthCheck `json:"items,omitempty"`
  6722. // Kind: Type of resource.
  6723. Kind string `json:"kind,omitempty"`
  6724. // NextPageToken: [Output Only] This token allows you to get the next
  6725. // page of results for list requests. If the number of results is larger
  6726. // than maxResults, use the nextPageToken as a value for the query
  6727. // parameter pageToken in the next list request. Subsequent list
  6728. // requests will have their own nextPageToken to continue paging through
  6729. // the results.
  6730. NextPageToken string `json:"nextPageToken,omitempty"`
  6731. // SelfLink: [Output Only] Server-defined URL for this resource.
  6732. SelfLink string `json:"selfLink,omitempty"`
  6733. // Warning: [Output Only] Informational warning message.
  6734. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  6735. // ServerResponse contains the HTTP response code and headers from the
  6736. // server.
  6737. googleapi.ServerResponse `json:"-"`
  6738. // ForceSendFields is a list of field names (e.g. "Id") to
  6739. // unconditionally include in API requests. By default, fields with
  6740. // empty values are omitted from API requests. However, any non-pointer,
  6741. // non-interface field appearing in ForceSendFields will be sent to the
  6742. // server regardless of whether the field is empty or not. This may be
  6743. // used to include empty fields in Patch requests.
  6744. ForceSendFields []string `json:"-"`
  6745. // NullFields is a list of field names (e.g. "Id") to include in API
  6746. // requests with the JSON null value. By default, fields with empty
  6747. // values are omitted from API requests. However, any field with an
  6748. // empty value appearing in NullFields will be sent to the server as
  6749. // null. It is an error if a field in this list has a non-empty value.
  6750. // This may be used to include null fields in Patch requests.
  6751. NullFields []string `json:"-"`
  6752. }
  6753. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  6754. type NoMethod HttpHealthCheckList
  6755. raw := NoMethod(*s)
  6756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6757. }
  6758. // HttpHealthCheckListWarning: [Output Only] Informational warning
  6759. // message.
  6760. type HttpHealthCheckListWarning struct {
  6761. // Code: [Output Only] A warning code, if applicable. For example,
  6762. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6763. // the response.
  6764. //
  6765. // Possible values:
  6766. // "CLEANUP_FAILED"
  6767. // "DEPRECATED_RESOURCE_USED"
  6768. // "DEPRECATED_TYPE_USED"
  6769. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6770. // "EXPERIMENTAL_TYPE_USED"
  6771. // "EXTERNAL_API_WARNING"
  6772. // "FIELD_VALUE_OVERRIDEN"
  6773. // "INJECTED_KERNELS_DEPRECATED"
  6774. // "MISSING_TYPE_DEPENDENCY"
  6775. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6776. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6777. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6778. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6779. // "NEXT_HOP_NOT_RUNNING"
  6780. // "NOT_CRITICAL_ERROR"
  6781. // "NO_RESULTS_ON_PAGE"
  6782. // "REQUIRED_TOS_AGREEMENT"
  6783. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6784. // "RESOURCE_NOT_DELETED"
  6785. // "SCHEMA_VALIDATION_IGNORED"
  6786. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6787. // "UNDECLARED_PROPERTIES"
  6788. // "UNREACHABLE"
  6789. Code string `json:"code,omitempty"`
  6790. // Data: [Output Only] Metadata about this warning in key: value format.
  6791. // For example:
  6792. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6793. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  6794. // Message: [Output Only] A human-readable description of the warning
  6795. // code.
  6796. Message string `json:"message,omitempty"`
  6797. // ForceSendFields is a list of field names (e.g. "Code") to
  6798. // unconditionally include in API requests. By default, fields with
  6799. // empty values are omitted from API requests. However, any non-pointer,
  6800. // non-interface field appearing in ForceSendFields will be sent to the
  6801. // server regardless of whether the field is empty or not. This may be
  6802. // used to include empty fields in Patch requests.
  6803. ForceSendFields []string `json:"-"`
  6804. // NullFields is a list of field names (e.g. "Code") to include in API
  6805. // requests with the JSON null value. By default, fields with empty
  6806. // values are omitted from API requests. However, any field with an
  6807. // empty value appearing in NullFields will be sent to the server as
  6808. // null. It is an error if a field in this list has a non-empty value.
  6809. // This may be used to include null fields in Patch requests.
  6810. NullFields []string `json:"-"`
  6811. }
  6812. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  6813. type NoMethod HttpHealthCheckListWarning
  6814. raw := NoMethod(*s)
  6815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6816. }
  6817. type HttpHealthCheckListWarningData struct {
  6818. // Key: [Output Only] A key that provides more detail on the warning
  6819. // being returned. For example, for warnings where there are no results
  6820. // in a list request for a particular zone, this key might be scope and
  6821. // the key value might be the zone name. Other examples might be a key
  6822. // indicating a deprecated resource and a suggested replacement, or a
  6823. // warning about invalid network settings (for example, if an instance
  6824. // attempts to perform IP forwarding but is not enabled for IP
  6825. // forwarding).
  6826. Key string `json:"key,omitempty"`
  6827. // Value: [Output Only] A warning data value corresponding to the key.
  6828. Value string `json:"value,omitempty"`
  6829. // ForceSendFields is a list of field names (e.g. "Key") to
  6830. // unconditionally include in API requests. By default, fields with
  6831. // empty values are omitted from API requests. However, any non-pointer,
  6832. // non-interface field appearing in ForceSendFields will be sent to the
  6833. // server regardless of whether the field is empty or not. This may be
  6834. // used to include empty fields in Patch requests.
  6835. ForceSendFields []string `json:"-"`
  6836. // NullFields is a list of field names (e.g. "Key") to include in API
  6837. // requests with the JSON null value. By default, fields with empty
  6838. // values are omitted from API requests. However, any field with an
  6839. // empty value appearing in NullFields will be sent to the server as
  6840. // null. It is an error if a field in this list has a non-empty value.
  6841. // This may be used to include null fields in Patch requests.
  6842. NullFields []string `json:"-"`
  6843. }
  6844. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  6845. type NoMethod HttpHealthCheckListWarningData
  6846. raw := NoMethod(*s)
  6847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6848. }
  6849. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  6850. // a template for how individual instances should be checked for health,
  6851. // via HTTPS.
  6852. type HttpsHealthCheck struct {
  6853. // CheckIntervalSec: How often (in seconds) to send a health check. The
  6854. // default value is 5 seconds.
  6855. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  6856. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6857. // format.
  6858. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6859. // Description: An optional description of this resource. Provide this
  6860. // property when you create the resource.
  6861. Description string `json:"description,omitempty"`
  6862. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  6863. // after this many consecutive successes. The default value is 2.
  6864. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  6865. // Host: The value of the host header in the HTTPS health check request.
  6866. // If left empty (default value), the public IP on behalf of which this
  6867. // health check is performed will be used.
  6868. Host string `json:"host,omitempty"`
  6869. // Id: [Output Only] The unique identifier for the resource. This
  6870. // identifier is defined by the server.
  6871. Id uint64 `json:"id,omitempty,string"`
  6872. // Kind: Type of the resource.
  6873. Kind string `json:"kind,omitempty"`
  6874. // Name: Name of the resource. Provided by the client when the resource
  6875. // is created. The name must be 1-63 characters long, and comply with
  6876. // RFC1035. Specifically, the name must be 1-63 characters long and
  6877. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6878. // the first character must be a lowercase letter, and all following
  6879. // characters must be a dash, lowercase letter, or digit, except the
  6880. // last character, which cannot be a dash.
  6881. Name string `json:"name,omitempty"`
  6882. // Port: The TCP port number for the HTTPS health check request. The
  6883. // default value is 443.
  6884. Port int64 `json:"port,omitempty"`
  6885. // RequestPath: The request path of the HTTPS health check request. The
  6886. // default value is "/".
  6887. RequestPath string `json:"requestPath,omitempty"`
  6888. // SelfLink: [Output Only] Server-defined URL for the resource.
  6889. SelfLink string `json:"selfLink,omitempty"`
  6890. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  6891. // The default value is 5 seconds. It is invalid for timeoutSec to have
  6892. // a greater value than checkIntervalSec.
  6893. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  6894. // UnhealthyThreshold: A so-far healthy instance will be marked
  6895. // unhealthy after this many consecutive failures. The default value is
  6896. // 2.
  6897. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  6898. // ServerResponse contains the HTTP response code and headers from the
  6899. // server.
  6900. googleapi.ServerResponse `json:"-"`
  6901. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  6902. // unconditionally include in API requests. By default, fields with
  6903. // empty values are omitted from API requests. However, any non-pointer,
  6904. // non-interface field appearing in ForceSendFields will be sent to the
  6905. // server regardless of whether the field is empty or not. This may be
  6906. // used to include empty fields in Patch requests.
  6907. ForceSendFields []string `json:"-"`
  6908. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  6909. // include in API requests with the JSON null value. By default, fields
  6910. // with empty values are omitted from API requests. However, any field
  6911. // with an empty value appearing in NullFields will be sent to the
  6912. // server as null. It is an error if a field in this list has a
  6913. // non-empty value. This may be used to include null fields in Patch
  6914. // requests.
  6915. NullFields []string `json:"-"`
  6916. }
  6917. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  6918. type NoMethod HttpsHealthCheck
  6919. raw := NoMethod(*s)
  6920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6921. }
  6922. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  6923. type HttpsHealthCheckList struct {
  6924. // Id: [Output Only] Unique identifier for the resource; defined by the
  6925. // server.
  6926. Id string `json:"id,omitempty"`
  6927. // Items: A list of HttpsHealthCheck resources.
  6928. Items []*HttpsHealthCheck `json:"items,omitempty"`
  6929. // Kind: Type of resource.
  6930. Kind string `json:"kind,omitempty"`
  6931. // NextPageToken: [Output Only] This token allows you to get the next
  6932. // page of results for list requests. If the number of results is larger
  6933. // than maxResults, use the nextPageToken as a value for the query
  6934. // parameter pageToken in the next list request. Subsequent list
  6935. // requests will have their own nextPageToken to continue paging through
  6936. // the results.
  6937. NextPageToken string `json:"nextPageToken,omitempty"`
  6938. // SelfLink: [Output Only] Server-defined URL for this resource.
  6939. SelfLink string `json:"selfLink,omitempty"`
  6940. // Warning: [Output Only] Informational warning message.
  6941. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  6942. // ServerResponse contains the HTTP response code and headers from the
  6943. // server.
  6944. googleapi.ServerResponse `json:"-"`
  6945. // ForceSendFields is a list of field names (e.g. "Id") to
  6946. // unconditionally include in API requests. By default, fields with
  6947. // empty values are omitted from API requests. However, any non-pointer,
  6948. // non-interface field appearing in ForceSendFields will be sent to the
  6949. // server regardless of whether the field is empty or not. This may be
  6950. // used to include empty fields in Patch requests.
  6951. ForceSendFields []string `json:"-"`
  6952. // NullFields is a list of field names (e.g. "Id") to include in API
  6953. // requests with the JSON null value. By default, fields with empty
  6954. // values are omitted from API requests. However, any field with an
  6955. // empty value appearing in NullFields will be sent to the server as
  6956. // null. It is an error if a field in this list has a non-empty value.
  6957. // This may be used to include null fields in Patch requests.
  6958. NullFields []string `json:"-"`
  6959. }
  6960. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  6961. type NoMethod HttpsHealthCheckList
  6962. raw := NoMethod(*s)
  6963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6964. }
  6965. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  6966. // message.
  6967. type HttpsHealthCheckListWarning struct {
  6968. // Code: [Output Only] A warning code, if applicable. For example,
  6969. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6970. // the response.
  6971. //
  6972. // Possible values:
  6973. // "CLEANUP_FAILED"
  6974. // "DEPRECATED_RESOURCE_USED"
  6975. // "DEPRECATED_TYPE_USED"
  6976. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6977. // "EXPERIMENTAL_TYPE_USED"
  6978. // "EXTERNAL_API_WARNING"
  6979. // "FIELD_VALUE_OVERRIDEN"
  6980. // "INJECTED_KERNELS_DEPRECATED"
  6981. // "MISSING_TYPE_DEPENDENCY"
  6982. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6983. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6984. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6985. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6986. // "NEXT_HOP_NOT_RUNNING"
  6987. // "NOT_CRITICAL_ERROR"
  6988. // "NO_RESULTS_ON_PAGE"
  6989. // "REQUIRED_TOS_AGREEMENT"
  6990. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6991. // "RESOURCE_NOT_DELETED"
  6992. // "SCHEMA_VALIDATION_IGNORED"
  6993. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6994. // "UNDECLARED_PROPERTIES"
  6995. // "UNREACHABLE"
  6996. Code string `json:"code,omitempty"`
  6997. // Data: [Output Only] Metadata about this warning in key: value format.
  6998. // For example:
  6999. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7000. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  7001. // Message: [Output Only] A human-readable description of the warning
  7002. // code.
  7003. Message string `json:"message,omitempty"`
  7004. // ForceSendFields is a list of field names (e.g. "Code") to
  7005. // unconditionally include in API requests. By default, fields with
  7006. // empty values are omitted from API requests. However, any non-pointer,
  7007. // non-interface field appearing in ForceSendFields will be sent to the
  7008. // server regardless of whether the field is empty or not. This may be
  7009. // used to include empty fields in Patch requests.
  7010. ForceSendFields []string `json:"-"`
  7011. // NullFields is a list of field names (e.g. "Code") to include in API
  7012. // requests with the JSON null value. By default, fields with empty
  7013. // values are omitted from API requests. However, any field with an
  7014. // empty value appearing in NullFields will be sent to the server as
  7015. // null. It is an error if a field in this list has a non-empty value.
  7016. // This may be used to include null fields in Patch requests.
  7017. NullFields []string `json:"-"`
  7018. }
  7019. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7020. type NoMethod HttpsHealthCheckListWarning
  7021. raw := NoMethod(*s)
  7022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7023. }
  7024. type HttpsHealthCheckListWarningData struct {
  7025. // Key: [Output Only] A key that provides more detail on the warning
  7026. // being returned. For example, for warnings where there are no results
  7027. // in a list request for a particular zone, this key might be scope and
  7028. // the key value might be the zone name. Other examples might be a key
  7029. // indicating a deprecated resource and a suggested replacement, or a
  7030. // warning about invalid network settings (for example, if an instance
  7031. // attempts to perform IP forwarding but is not enabled for IP
  7032. // forwarding).
  7033. Key string `json:"key,omitempty"`
  7034. // Value: [Output Only] A warning data value corresponding to the key.
  7035. Value string `json:"value,omitempty"`
  7036. // ForceSendFields is a list of field names (e.g. "Key") to
  7037. // unconditionally include in API requests. By default, fields with
  7038. // empty values are omitted from API requests. However, any non-pointer,
  7039. // non-interface field appearing in ForceSendFields will be sent to the
  7040. // server regardless of whether the field is empty or not. This may be
  7041. // used to include empty fields in Patch requests.
  7042. ForceSendFields []string `json:"-"`
  7043. // NullFields is a list of field names (e.g. "Key") to include in API
  7044. // requests with the JSON null value. By default, fields with empty
  7045. // values are omitted from API requests. However, any field with an
  7046. // empty value appearing in NullFields will be sent to the server as
  7047. // null. It is an error if a field in this list has a non-empty value.
  7048. // This may be used to include null fields in Patch requests.
  7049. NullFields []string `json:"-"`
  7050. }
  7051. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7052. type NoMethod HttpsHealthCheckListWarningData
  7053. raw := NoMethod(*s)
  7054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7055. }
  7056. // Image: An Image resource. (== resource_for beta.images ==) (==
  7057. // resource_for v1.images ==)
  7058. type Image struct {
  7059. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  7060. // Cloud Storage (in bytes).
  7061. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  7062. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7063. // format.
  7064. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7065. // Deprecated: The deprecation status associated with this image.
  7066. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  7067. // Description: An optional description of this resource. Provide this
  7068. // property when you create the resource.
  7069. Description string `json:"description,omitempty"`
  7070. // DiskSizeGb: Size of the image when restored onto a persistent disk
  7071. // (in GB).
  7072. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  7073. // Family: The name of the image family to which this image belongs. You
  7074. // can create disks by specifying an image family instead of a specific
  7075. // image name. The image family always returns its latest image that is
  7076. // not deprecated. The name of the image family must comply with
  7077. // RFC1035.
  7078. Family string `json:"family,omitempty"`
  7079. // GuestOsFeatures: A list of features to enable on the guest operating
  7080. // system. Applicable only for bootable images. Read Enabling guest
  7081. // operating system features to see a list of available options.
  7082. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  7083. // Id: [Output Only] The unique identifier for the resource. This
  7084. // identifier is defined by the server.
  7085. Id uint64 `json:"id,omitempty,string"`
  7086. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  7087. // encryption key.
  7088. //
  7089. // After you encrypt an image with a customer-supplied key, you must
  7090. // provide the same key if you use the image later (e.g. to create a
  7091. // disk from the image).
  7092. //
  7093. // Customer-supplied encryption keys do not protect access to metadata
  7094. // of the disk.
  7095. //
  7096. // If you do not provide an encryption key when creating the image, then
  7097. // the disk will be encrypted using an automatically generated key and
  7098. // you do not need to provide a key to use the image later.
  7099. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  7100. // Kind: [Output Only] Type of the resource. Always compute#image for
  7101. // images.
  7102. Kind string `json:"kind,omitempty"`
  7103. // LabelFingerprint: A fingerprint for the labels being applied to this
  7104. // image, which is essentially a hash of the labels used for optimistic
  7105. // locking. The fingerprint is initially generated by Compute Engine and
  7106. // changes after every request to modify or update labels. You must
  7107. // always provide an up-to-date fingerprint hash in order to update or
  7108. // change labels.
  7109. //
  7110. // To see the latest fingerprint, make a get() request to retrieve an
  7111. // image.
  7112. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7113. // Labels: Labels to apply to this image. These can be later modified by
  7114. // the setLabels method.
  7115. Labels map[string]string `json:"labels,omitempty"`
  7116. // LicenseCodes: Integer license codes indicating which licenses are
  7117. // attached to this image.
  7118. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  7119. // Licenses: Any applicable license URI.
  7120. Licenses []string `json:"licenses,omitempty"`
  7121. // Name: Name of the resource; provided by the client when the resource
  7122. // is created. The name must be 1-63 characters long, and comply with
  7123. // RFC1035. Specifically, the name must be 1-63 characters long and
  7124. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7125. // the first character must be a lowercase letter, and all following
  7126. // characters must be a dash, lowercase letter, or digit, except the
  7127. // last character, which cannot be a dash.
  7128. Name string `json:"name,omitempty"`
  7129. // RawDisk: The parameters of the raw disk image.
  7130. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  7131. // SelfLink: [Output Only] Server-defined URL for the resource.
  7132. SelfLink string `json:"selfLink,omitempty"`
  7133. // SourceDisk: URL of the source disk used to create this image. This
  7134. // can be a full or valid partial URL. You must provide either this
  7135. // property or the rawDisk.source property but not both to create an
  7136. // image. For example, the following are valid values:
  7137. // -
  7138. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  7139. // - projects/project/zones/zone/disks/disk
  7140. // - zones/zone/disks/disk
  7141. SourceDisk string `json:"sourceDisk,omitempty"`
  7142. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  7143. // source disk. Required if the source disk is protected by a
  7144. // customer-supplied encryption key.
  7145. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  7146. // SourceDiskId: The ID value of the disk used to create this image.
  7147. // This value may be used to determine whether the image was taken from
  7148. // the current or a previous instance of a given disk name.
  7149. SourceDiskId string `json:"sourceDiskId,omitempty"`
  7150. // SourceImage: URL of the source image used to create this image. This
  7151. // can be a full or valid partial URL. You must provide exactly one of:
  7152. //
  7153. // - this property, or
  7154. // - the rawDisk.source property, or
  7155. // - the sourceDisk property in order to create an image.
  7156. SourceImage string `json:"sourceImage,omitempty"`
  7157. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  7158. // source image. Required if the source image is protected by a
  7159. // customer-supplied encryption key.
  7160. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  7161. // SourceImageId: [Output Only] The ID value of the image used to create
  7162. // this image. This value may be used to determine whether the image was
  7163. // taken from the current or a previous instance of a given image name.
  7164. SourceImageId string `json:"sourceImageId,omitempty"`
  7165. // SourceSnapshot: URL of the source snapshot used to create this image.
  7166. // This can be a full or valid partial URL. You must provide exactly one
  7167. // of:
  7168. // - this property, or
  7169. // - the sourceImage property, or
  7170. // - the rawDisk.source property, or
  7171. // - the sourceDisk property in order to create an image.
  7172. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  7173. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  7174. // the source snapshot. Required if the source snapshot is protected by
  7175. // a customer-supplied encryption key.
  7176. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  7177. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  7178. // create this image. This value may be used to determine whether the
  7179. // snapshot was taken from the current or a previous instance of a given
  7180. // snapshot name.
  7181. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  7182. // SourceType: The type of the image used to create this disk. The
  7183. // default and only value is RAW
  7184. //
  7185. // Possible values:
  7186. // "RAW" (default)
  7187. SourceType string `json:"sourceType,omitempty"`
  7188. // Status: [Output Only] The status of the image. An image can be used
  7189. // to create other resources, such as instances, only after the image
  7190. // has been successfully created and the status is set to READY.
  7191. // Possible values are FAILED, PENDING, or READY.
  7192. //
  7193. // Possible values:
  7194. // "FAILED"
  7195. // "PENDING"
  7196. // "READY"
  7197. Status string `json:"status,omitempty"`
  7198. // ServerResponse contains the HTTP response code and headers from the
  7199. // server.
  7200. googleapi.ServerResponse `json:"-"`
  7201. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  7202. // unconditionally include in API requests. By default, fields with
  7203. // empty values are omitted from API requests. However, any non-pointer,
  7204. // non-interface field appearing in ForceSendFields will be sent to the
  7205. // server regardless of whether the field is empty or not. This may be
  7206. // used to include empty fields in Patch requests.
  7207. ForceSendFields []string `json:"-"`
  7208. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  7209. // include in API requests with the JSON null value. By default, fields
  7210. // with empty values are omitted from API requests. However, any field
  7211. // with an empty value appearing in NullFields will be sent to the
  7212. // server as null. It is an error if a field in this list has a
  7213. // non-empty value. This may be used to include null fields in Patch
  7214. // requests.
  7215. NullFields []string `json:"-"`
  7216. }
  7217. func (s *Image) MarshalJSON() ([]byte, error) {
  7218. type NoMethod Image
  7219. raw := NoMethod(*s)
  7220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7221. }
  7222. // ImageRawDisk: The parameters of the raw disk image.
  7223. type ImageRawDisk struct {
  7224. // ContainerType: The format used to encode and transmit the block
  7225. // device, which should be TAR. This is just a container and
  7226. // transmission format and not a runtime format. Provided by the client
  7227. // when the disk image is created.
  7228. //
  7229. // Possible values:
  7230. // "TAR"
  7231. ContainerType string `json:"containerType,omitempty"`
  7232. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  7233. // unpackaging; provided by the client when the disk image is created.
  7234. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  7235. // Source: The full Google Cloud Storage URL where the disk image is
  7236. // stored. You must provide either this property or the sourceDisk
  7237. // property but not both.
  7238. Source string `json:"source,omitempty"`
  7239. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  7240. // unconditionally include in API requests. By default, fields with
  7241. // empty values are omitted from API requests. However, any non-pointer,
  7242. // non-interface field appearing in ForceSendFields will be sent to the
  7243. // server regardless of whether the field is empty or not. This may be
  7244. // used to include empty fields in Patch requests.
  7245. ForceSendFields []string `json:"-"`
  7246. // NullFields is a list of field names (e.g. "ContainerType") to include
  7247. // in API requests with the JSON null value. By default, fields with
  7248. // empty values are omitted from API requests. However, any field with
  7249. // an empty value appearing in NullFields will be sent to the server as
  7250. // null. It is an error if a field in this list has a non-empty value.
  7251. // This may be used to include null fields in Patch requests.
  7252. NullFields []string `json:"-"`
  7253. }
  7254. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  7255. type NoMethod ImageRawDisk
  7256. raw := NoMethod(*s)
  7257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7258. }
  7259. // ImageList: Contains a list of images.
  7260. type ImageList struct {
  7261. // Id: [Output Only] Unique identifier for the resource; defined by the
  7262. // server.
  7263. Id string `json:"id,omitempty"`
  7264. // Items: A list of Image resources.
  7265. Items []*Image `json:"items,omitempty"`
  7266. // Kind: Type of resource.
  7267. Kind string `json:"kind,omitempty"`
  7268. // NextPageToken: [Output Only] This token allows you to get the next
  7269. // page of results for list requests. If the number of results is larger
  7270. // than maxResults, use the nextPageToken as a value for the query
  7271. // parameter pageToken in the next list request. Subsequent list
  7272. // requests will have their own nextPageToken to continue paging through
  7273. // the results.
  7274. NextPageToken string `json:"nextPageToken,omitempty"`
  7275. // SelfLink: [Output Only] Server-defined URL for this resource.
  7276. SelfLink string `json:"selfLink,omitempty"`
  7277. // Warning: [Output Only] Informational warning message.
  7278. Warning *ImageListWarning `json:"warning,omitempty"`
  7279. // ServerResponse contains the HTTP response code and headers from the
  7280. // server.
  7281. googleapi.ServerResponse `json:"-"`
  7282. // ForceSendFields is a list of field names (e.g. "Id") to
  7283. // unconditionally include in API requests. By default, fields with
  7284. // empty values are omitted from API requests. However, any non-pointer,
  7285. // non-interface field appearing in ForceSendFields will be sent to the
  7286. // server regardless of whether the field is empty or not. This may be
  7287. // used to include empty fields in Patch requests.
  7288. ForceSendFields []string `json:"-"`
  7289. // NullFields is a list of field names (e.g. "Id") to include in API
  7290. // requests with the JSON null value. By default, fields with empty
  7291. // values are omitted from API requests. However, any field with an
  7292. // empty value appearing in NullFields will be sent to the server as
  7293. // null. It is an error if a field in this list has a non-empty value.
  7294. // This may be used to include null fields in Patch requests.
  7295. NullFields []string `json:"-"`
  7296. }
  7297. func (s *ImageList) MarshalJSON() ([]byte, error) {
  7298. type NoMethod ImageList
  7299. raw := NoMethod(*s)
  7300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7301. }
  7302. // ImageListWarning: [Output Only] Informational warning message.
  7303. type ImageListWarning struct {
  7304. // Code: [Output Only] A warning code, if applicable. For example,
  7305. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7306. // the response.
  7307. //
  7308. // Possible values:
  7309. // "CLEANUP_FAILED"
  7310. // "DEPRECATED_RESOURCE_USED"
  7311. // "DEPRECATED_TYPE_USED"
  7312. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7313. // "EXPERIMENTAL_TYPE_USED"
  7314. // "EXTERNAL_API_WARNING"
  7315. // "FIELD_VALUE_OVERRIDEN"
  7316. // "INJECTED_KERNELS_DEPRECATED"
  7317. // "MISSING_TYPE_DEPENDENCY"
  7318. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7319. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7320. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7321. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7322. // "NEXT_HOP_NOT_RUNNING"
  7323. // "NOT_CRITICAL_ERROR"
  7324. // "NO_RESULTS_ON_PAGE"
  7325. // "REQUIRED_TOS_AGREEMENT"
  7326. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7327. // "RESOURCE_NOT_DELETED"
  7328. // "SCHEMA_VALIDATION_IGNORED"
  7329. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7330. // "UNDECLARED_PROPERTIES"
  7331. // "UNREACHABLE"
  7332. Code string `json:"code,omitempty"`
  7333. // Data: [Output Only] Metadata about this warning in key: value format.
  7334. // For example:
  7335. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7336. Data []*ImageListWarningData `json:"data,omitempty"`
  7337. // Message: [Output Only] A human-readable description of the warning
  7338. // code.
  7339. Message string `json:"message,omitempty"`
  7340. // ForceSendFields is a list of field names (e.g. "Code") to
  7341. // unconditionally include in API requests. By default, fields with
  7342. // empty values are omitted from API requests. However, any non-pointer,
  7343. // non-interface field appearing in ForceSendFields will be sent to the
  7344. // server regardless of whether the field is empty or not. This may be
  7345. // used to include empty fields in Patch requests.
  7346. ForceSendFields []string `json:"-"`
  7347. // NullFields is a list of field names (e.g. "Code") to include in API
  7348. // requests with the JSON null value. By default, fields with empty
  7349. // values are omitted from API requests. However, any field with an
  7350. // empty value appearing in NullFields will be sent to the server as
  7351. // null. It is an error if a field in this list has a non-empty value.
  7352. // This may be used to include null fields in Patch requests.
  7353. NullFields []string `json:"-"`
  7354. }
  7355. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  7356. type NoMethod ImageListWarning
  7357. raw := NoMethod(*s)
  7358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7359. }
  7360. type ImageListWarningData struct {
  7361. // Key: [Output Only] A key that provides more detail on the warning
  7362. // being returned. For example, for warnings where there are no results
  7363. // in a list request for a particular zone, this key might be scope and
  7364. // the key value might be the zone name. Other examples might be a key
  7365. // indicating a deprecated resource and a suggested replacement, or a
  7366. // warning about invalid network settings (for example, if an instance
  7367. // attempts to perform IP forwarding but is not enabled for IP
  7368. // forwarding).
  7369. Key string `json:"key,omitempty"`
  7370. // Value: [Output Only] A warning data value corresponding to the key.
  7371. Value string `json:"value,omitempty"`
  7372. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  7380. // requests with the JSON null value. By default, fields with empty
  7381. // values are omitted from API requests. However, any field with an
  7382. // 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 *ImageListWarningData) MarshalJSON() ([]byte, error) {
  7388. type NoMethod ImageListWarningData
  7389. raw := NoMethod(*s)
  7390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7391. }
  7392. // Instance: An Instance resource. (== resource_for beta.instances ==)
  7393. // (== resource_for v1.instances ==)
  7394. type Instance struct {
  7395. // CanIpForward: Allows this instance to send and receive packets with
  7396. // non-matching destination or source IPs. This is required if you plan
  7397. // to use this instance to forward routes. For more information, see
  7398. // Enabling IP Forwarding.
  7399. CanIpForward bool `json:"canIpForward,omitempty"`
  7400. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  7401. CpuPlatform string `json:"cpuPlatform,omitempty"`
  7402. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7403. // format.
  7404. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7405. // DeletionProtection: Whether the resource should be protected against
  7406. // deletion.
  7407. DeletionProtection bool `json:"deletionProtection,omitempty"`
  7408. // Description: An optional description of this resource. Provide this
  7409. // property when you create the resource.
  7410. Description string `json:"description,omitempty"`
  7411. // Disks: Array of disks associated with this instance. Persistent disks
  7412. // must be created before you can assign them.
  7413. Disks []*AttachedDisk `json:"disks,omitempty"`
  7414. // GuestAccelerators: A list of the type and count of accelerator cards
  7415. // attached to the instance.
  7416. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  7417. // Id: [Output Only] The unique identifier for the resource. This
  7418. // identifier is defined by the server.
  7419. Id uint64 `json:"id,omitempty,string"`
  7420. // Kind: [Output Only] Type of the resource. Always compute#instance for
  7421. // instances.
  7422. Kind string `json:"kind,omitempty"`
  7423. // LabelFingerprint: A fingerprint for this request, which is
  7424. // essentially a hash of the label's contents and used for optimistic
  7425. // locking. The fingerprint is initially generated by Compute Engine and
  7426. // changes after every request to modify or update labels. You must
  7427. // always provide an up-to-date fingerprint hash in order to update or
  7428. // change labels.
  7429. //
  7430. // To see the latest fingerprint, make get() request to the instance.
  7431. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7432. // Labels: Labels to apply to this instance. These can be later modified
  7433. // by the setLabels method.
  7434. Labels map[string]string `json:"labels,omitempty"`
  7435. // MachineType: Full or partial URL of the machine type resource to use
  7436. // for this instance, in the format:
  7437. // zones/zone/machineTypes/machine-type. This is provided by the client
  7438. // when the instance is created. For example, the following is a valid
  7439. // partial url to a predefined machine
  7440. // type:
  7441. // zones/us-central1-f/machineTypes/n1-standard-1
  7442. //
  7443. //
  7444. // To create a custom machine type, provide a URL to a machine type in
  7445. // the following format, where CPUS is 1 or an even number up to 32 (2,
  7446. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  7447. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  7448. // 5 GB of memory is 5120
  7449. // MB):
  7450. // zones/zone/machineTypes/custom-CPUS-MEMORY
  7451. //
  7452. //
  7453. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  7454. //
  7455. // For a full list of restrictions, read the Specifications for custom
  7456. // machine types.
  7457. MachineType string `json:"machineType,omitempty"`
  7458. // Metadata: The metadata key/value pairs assigned to this instance.
  7459. // This includes custom metadata and predefined keys.
  7460. Metadata *Metadata `json:"metadata,omitempty"`
  7461. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  7462. // Applicable values are the friendly names of CPU platforms, such as
  7463. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  7464. // Bridge".
  7465. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  7466. // Name: The name of the resource, provided by the client when initially
  7467. // creating the resource. The resource name must be 1-63 characters
  7468. // long, and comply with RFC1035. Specifically, the name must be 1-63
  7469. // characters long and match the regular expression
  7470. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  7471. // a lowercase letter, and all following characters must be a dash,
  7472. // lowercase letter, or digit, except the last character, which cannot
  7473. // be a dash.
  7474. Name string `json:"name,omitempty"`
  7475. // NetworkInterfaces: An array of network configurations for this
  7476. // instance. These specify how interfaces are configured to interact
  7477. // with other network services, such as connecting to the internet.
  7478. // Multiple interfaces are supported per instance.
  7479. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  7480. // Scheduling: Sets the scheduling options for this instance.
  7481. Scheduling *Scheduling `json:"scheduling,omitempty"`
  7482. // SelfLink: [Output Only] Server-defined URL for this resource.
  7483. SelfLink string `json:"selfLink,omitempty"`
  7484. // ServiceAccounts: A list of service accounts, with their specified
  7485. // scopes, authorized for this instance. Only one service account per VM
  7486. // instance is supported.
  7487. //
  7488. // Service accounts generate access tokens that can be accessed through
  7489. // the metadata server and used to authenticate applications on the
  7490. // instance. See Service Accounts for more information.
  7491. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  7492. // StartRestricted: [Output Only] Whether a VM has been restricted for
  7493. // start because Compute Engine has detected suspicious activity.
  7494. StartRestricted bool `json:"startRestricted,omitempty"`
  7495. // Status: [Output Only] The status of the instance. One of the
  7496. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  7497. // SUSPENDING, SUSPENDED, and TERMINATED.
  7498. //
  7499. // Possible values:
  7500. // "PROVISIONING"
  7501. // "RUNNING"
  7502. // "STAGING"
  7503. // "STOPPED"
  7504. // "STOPPING"
  7505. // "SUSPENDED"
  7506. // "SUSPENDING"
  7507. // "TERMINATED"
  7508. Status string `json:"status,omitempty"`
  7509. // StatusMessage: [Output Only] An optional, human-readable explanation
  7510. // of the status.
  7511. StatusMessage string `json:"statusMessage,omitempty"`
  7512. // Tags: A list of tags to apply to this instance. Tags are used to
  7513. // identify valid sources or targets for network firewalls and are
  7514. // specified by the client during instance creation. The tags can be
  7515. // later modified by the setTags method. Each tag within the list must
  7516. // comply with RFC1035.
  7517. Tags *Tags `json:"tags,omitempty"`
  7518. // Zone: [Output Only] URL of the zone where the instance resides. You
  7519. // must specify this field as part of the HTTP request URL. It is not
  7520. // settable as a field in the request body.
  7521. Zone string `json:"zone,omitempty"`
  7522. // ServerResponse contains the HTTP response code and headers from the
  7523. // server.
  7524. googleapi.ServerResponse `json:"-"`
  7525. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  7526. // unconditionally include in API requests. By default, fields with
  7527. // empty values are omitted from API requests. However, any non-pointer,
  7528. // non-interface field appearing in ForceSendFields will be sent to the
  7529. // server regardless of whether the field is empty or not. This may be
  7530. // used to include empty fields in Patch requests.
  7531. ForceSendFields []string `json:"-"`
  7532. // NullFields is a list of field names (e.g. "CanIpForward") to include
  7533. // in API requests with the JSON null value. By default, fields with
  7534. // empty values are omitted from API requests. However, any field with
  7535. // an empty value appearing in NullFields will be sent to the server as
  7536. // null. It is an error if a field in this list has a non-empty value.
  7537. // This may be used to include null fields in Patch requests.
  7538. NullFields []string `json:"-"`
  7539. }
  7540. func (s *Instance) MarshalJSON() ([]byte, error) {
  7541. type NoMethod Instance
  7542. raw := NoMethod(*s)
  7543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7544. }
  7545. type InstanceAggregatedList struct {
  7546. // Id: [Output Only] Unique identifier for the resource; defined by the
  7547. // server.
  7548. Id string `json:"id,omitempty"`
  7549. // Items: A list of InstancesScopedList resources.
  7550. Items map[string]InstancesScopedList `json:"items,omitempty"`
  7551. // Kind: [Output Only] Type of resource. Always
  7552. // compute#instanceAggregatedList for aggregated lists of Instance
  7553. // resources.
  7554. Kind string `json:"kind,omitempty"`
  7555. // NextPageToken: [Output Only] This token allows you to get the next
  7556. // page of results for list requests. If the number of results is larger
  7557. // than maxResults, use the nextPageToken as a value for the query
  7558. // parameter pageToken in the next list request. Subsequent list
  7559. // requests will have their own nextPageToken to continue paging through
  7560. // the results.
  7561. NextPageToken string `json:"nextPageToken,omitempty"`
  7562. // SelfLink: [Output Only] Server-defined URL for this resource.
  7563. SelfLink string `json:"selfLink,omitempty"`
  7564. // Warning: [Output Only] Informational warning message.
  7565. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  7566. // ServerResponse contains the HTTP response code and headers from the
  7567. // server.
  7568. googleapi.ServerResponse `json:"-"`
  7569. // ForceSendFields is a list of field names (e.g. "Id") to
  7570. // unconditionally include in API requests. By default, fields with
  7571. // empty values are omitted from API requests. However, any non-pointer,
  7572. // non-interface field appearing in ForceSendFields will be sent to the
  7573. // server regardless of whether the field is empty or not. This may be
  7574. // used to include empty fields in Patch requests.
  7575. ForceSendFields []string `json:"-"`
  7576. // NullFields is a list of field names (e.g. "Id") to include in API
  7577. // requests with the JSON null value. By default, fields with empty
  7578. // values are omitted from API requests. However, any field with an
  7579. // empty value appearing in NullFields will be sent to the server as
  7580. // null. It is an error if a field in this list has a non-empty value.
  7581. // This may be used to include null fields in Patch requests.
  7582. NullFields []string `json:"-"`
  7583. }
  7584. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  7585. type NoMethod InstanceAggregatedList
  7586. raw := NoMethod(*s)
  7587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7588. }
  7589. // InstanceAggregatedListWarning: [Output Only] Informational warning
  7590. // message.
  7591. type InstanceAggregatedListWarning struct {
  7592. // Code: [Output Only] A warning code, if applicable. For example,
  7593. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7594. // the response.
  7595. //
  7596. // Possible values:
  7597. // "CLEANUP_FAILED"
  7598. // "DEPRECATED_RESOURCE_USED"
  7599. // "DEPRECATED_TYPE_USED"
  7600. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7601. // "EXPERIMENTAL_TYPE_USED"
  7602. // "EXTERNAL_API_WARNING"
  7603. // "FIELD_VALUE_OVERRIDEN"
  7604. // "INJECTED_KERNELS_DEPRECATED"
  7605. // "MISSING_TYPE_DEPENDENCY"
  7606. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7607. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7608. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7609. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7610. // "NEXT_HOP_NOT_RUNNING"
  7611. // "NOT_CRITICAL_ERROR"
  7612. // "NO_RESULTS_ON_PAGE"
  7613. // "REQUIRED_TOS_AGREEMENT"
  7614. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7615. // "RESOURCE_NOT_DELETED"
  7616. // "SCHEMA_VALIDATION_IGNORED"
  7617. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7618. // "UNDECLARED_PROPERTIES"
  7619. // "UNREACHABLE"
  7620. Code string `json:"code,omitempty"`
  7621. // Data: [Output Only] Metadata about this warning in key: value format.
  7622. // For example:
  7623. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7624. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  7625. // Message: [Output Only] A human-readable description of the warning
  7626. // code.
  7627. Message string `json:"message,omitempty"`
  7628. // ForceSendFields is a list of field names (e.g. "Code") to
  7629. // unconditionally include in API requests. By default, fields with
  7630. // empty values are omitted from API requests. However, any non-pointer,
  7631. // non-interface field appearing in ForceSendFields will be sent to the
  7632. // server regardless of whether the field is empty or not. This may be
  7633. // used to include empty fields in Patch requests.
  7634. ForceSendFields []string `json:"-"`
  7635. // NullFields is a list of field names (e.g. "Code") to include in API
  7636. // requests with the JSON null value. By default, fields with empty
  7637. // values are omitted from API requests. However, any field with an
  7638. // empty value appearing in NullFields will be sent to the server as
  7639. // null. It is an error if a field in this list has a non-empty value.
  7640. // This may be used to include null fields in Patch requests.
  7641. NullFields []string `json:"-"`
  7642. }
  7643. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  7644. type NoMethod InstanceAggregatedListWarning
  7645. raw := NoMethod(*s)
  7646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7647. }
  7648. type InstanceAggregatedListWarningData struct {
  7649. // Key: [Output Only] A key that provides more detail on the warning
  7650. // being returned. For example, for warnings where there are no results
  7651. // in a list request for a particular zone, this key might be scope and
  7652. // the key value might be the zone name. Other examples might be a key
  7653. // indicating a deprecated resource and a suggested replacement, or a
  7654. // warning about invalid network settings (for example, if an instance
  7655. // attempts to perform IP forwarding but is not enabled for IP
  7656. // forwarding).
  7657. Key string `json:"key,omitempty"`
  7658. // Value: [Output Only] A warning data value corresponding to the key.
  7659. Value string `json:"value,omitempty"`
  7660. // ForceSendFields is a list of field names (e.g. "Key") to
  7661. // unconditionally include in API requests. By default, fields with
  7662. // empty values are omitted from API requests. However, any non-pointer,
  7663. // non-interface field appearing in ForceSendFields will be sent to the
  7664. // server regardless of whether the field is empty or not. This may be
  7665. // used to include empty fields in Patch requests.
  7666. ForceSendFields []string `json:"-"`
  7667. // NullFields is a list of field names (e.g. "Key") to include in API
  7668. // requests with the JSON null value. By default, fields with empty
  7669. // values are omitted from API requests. However, any field with an
  7670. // empty value appearing in NullFields will be sent to the server as
  7671. // null. It is an error if a field in this list has a non-empty value.
  7672. // This may be used to include null fields in Patch requests.
  7673. NullFields []string `json:"-"`
  7674. }
  7675. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  7676. type NoMethod InstanceAggregatedListWarningData
  7677. raw := NoMethod(*s)
  7678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7679. }
  7680. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  7681. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  7682. // beta.regionInstanceGroups ==) (== resource_for
  7683. // v1.regionInstanceGroups ==)
  7684. type InstanceGroup struct {
  7685. // CreationTimestamp: [Output Only] The creation timestamp for this
  7686. // instance group in RFC3339 text format.
  7687. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7688. // Description: An optional description of this resource. Provide this
  7689. // property when you create the resource.
  7690. Description string `json:"description,omitempty"`
  7691. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  7692. // system uses this fingerprint to detect conflicts when multiple users
  7693. // change the named ports concurrently.
  7694. Fingerprint string `json:"fingerprint,omitempty"`
  7695. // Id: [Output Only] A unique identifier for this instance group,
  7696. // generated by the server.
  7697. Id uint64 `json:"id,omitempty,string"`
  7698. // Kind: [Output Only] The resource type, which is always
  7699. // compute#instanceGroup for instance groups.
  7700. Kind string `json:"kind,omitempty"`
  7701. // Name: The name of the instance group. The name must be 1-63
  7702. // characters long, and comply with RFC1035.
  7703. Name string `json:"name,omitempty"`
  7704. // NamedPorts: Assigns a name to a port number. For example: {name:
  7705. // "http", port: 80}
  7706. //
  7707. // This allows the system to reference ports by the assigned name
  7708. // instead of a port number. Named ports can also contain multiple
  7709. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  7710. // 8080}]
  7711. //
  7712. // Named ports apply to all instances in this instance group.
  7713. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  7714. // Network: The URL of the network to which all instances in the
  7715. // instance group belong.
  7716. Network string `json:"network,omitempty"`
  7717. // Region: [Output Only] The URL of the region where the instance group
  7718. // is located (for regional resources).
  7719. Region string `json:"region,omitempty"`
  7720. // SelfLink: [Output Only] The URL for this instance group. The server
  7721. // generates this URL.
  7722. SelfLink string `json:"selfLink,omitempty"`
  7723. // Size: [Output Only] The total number of instances in the instance
  7724. // group.
  7725. Size int64 `json:"size,omitempty"`
  7726. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  7727. // instances in the instance group belong.
  7728. Subnetwork string `json:"subnetwork,omitempty"`
  7729. // Zone: [Output Only] The URL of the zone where the instance group is
  7730. // located (for zonal resources).
  7731. Zone string `json:"zone,omitempty"`
  7732. // ServerResponse contains the HTTP response code and headers from the
  7733. // server.
  7734. googleapi.ServerResponse `json:"-"`
  7735. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  7736. // to unconditionally include in API requests. By default, fields with
  7737. // empty values are omitted from API requests. However, any non-pointer,
  7738. // non-interface field appearing in ForceSendFields will be sent to the
  7739. // server regardless of whether the field is empty or not. This may be
  7740. // used to include empty fields in Patch requests.
  7741. ForceSendFields []string `json:"-"`
  7742. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  7743. // include in API requests with the JSON null value. By default, fields
  7744. // with empty values are omitted from API requests. However, any field
  7745. // with an empty value appearing in NullFields will be sent to the
  7746. // server as null. It is an error if a field in this list has a
  7747. // non-empty value. This may be used to include null fields in Patch
  7748. // requests.
  7749. NullFields []string `json:"-"`
  7750. }
  7751. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  7752. type NoMethod InstanceGroup
  7753. raw := NoMethod(*s)
  7754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7755. }
  7756. type InstanceGroupAggregatedList struct {
  7757. // Id: [Output Only] Unique identifier for the resource; defined by the
  7758. // server.
  7759. Id string `json:"id,omitempty"`
  7760. // Items: A list of InstanceGroupsScopedList resources.
  7761. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  7762. // Kind: [Output Only] The resource type, which is always
  7763. // compute#instanceGroupAggregatedList for aggregated lists of instance
  7764. // groups.
  7765. Kind string `json:"kind,omitempty"`
  7766. // NextPageToken: [Output Only] This token allows you to get the next
  7767. // page of results for list requests. If the number of results is larger
  7768. // than maxResults, use the nextPageToken as a value for the query
  7769. // parameter pageToken in the next list request. Subsequent list
  7770. // requests will have their own nextPageToken to continue paging through
  7771. // the results.
  7772. NextPageToken string `json:"nextPageToken,omitempty"`
  7773. // SelfLink: [Output Only] Server-defined URL for this resource.
  7774. SelfLink string `json:"selfLink,omitempty"`
  7775. // Warning: [Output Only] Informational warning message.
  7776. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  7777. // ServerResponse contains the HTTP response code and headers from the
  7778. // server.
  7779. googleapi.ServerResponse `json:"-"`
  7780. // ForceSendFields is a list of field names (e.g. "Id") to
  7781. // unconditionally include in API requests. By default, fields with
  7782. // empty values are omitted from API requests. However, any non-pointer,
  7783. // non-interface field appearing in ForceSendFields will be sent to the
  7784. // server regardless of whether the field is empty or not. This may be
  7785. // used to include empty fields in Patch requests.
  7786. ForceSendFields []string `json:"-"`
  7787. // NullFields is a list of field names (e.g. "Id") to include in API
  7788. // requests with the JSON null value. By default, fields with empty
  7789. // values are omitted from API requests. However, any field with an
  7790. // empty value appearing in NullFields will be sent to the server as
  7791. // null. It is an error if a field in this list has a non-empty value.
  7792. // This may be used to include null fields in Patch requests.
  7793. NullFields []string `json:"-"`
  7794. }
  7795. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  7796. type NoMethod InstanceGroupAggregatedList
  7797. raw := NoMethod(*s)
  7798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7799. }
  7800. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  7801. // warning message.
  7802. type InstanceGroupAggregatedListWarning struct {
  7803. // Code: [Output Only] A warning code, if applicable. For example,
  7804. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7805. // the response.
  7806. //
  7807. // Possible values:
  7808. // "CLEANUP_FAILED"
  7809. // "DEPRECATED_RESOURCE_USED"
  7810. // "DEPRECATED_TYPE_USED"
  7811. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7812. // "EXPERIMENTAL_TYPE_USED"
  7813. // "EXTERNAL_API_WARNING"
  7814. // "FIELD_VALUE_OVERRIDEN"
  7815. // "INJECTED_KERNELS_DEPRECATED"
  7816. // "MISSING_TYPE_DEPENDENCY"
  7817. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7818. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7819. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7820. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7821. // "NEXT_HOP_NOT_RUNNING"
  7822. // "NOT_CRITICAL_ERROR"
  7823. // "NO_RESULTS_ON_PAGE"
  7824. // "REQUIRED_TOS_AGREEMENT"
  7825. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7826. // "RESOURCE_NOT_DELETED"
  7827. // "SCHEMA_VALIDATION_IGNORED"
  7828. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7829. // "UNDECLARED_PROPERTIES"
  7830. // "UNREACHABLE"
  7831. Code string `json:"code,omitempty"`
  7832. // Data: [Output Only] Metadata about this warning in key: value format.
  7833. // For example:
  7834. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7835. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  7836. // Message: [Output Only] A human-readable description of the warning
  7837. // code.
  7838. Message string `json:"message,omitempty"`
  7839. // ForceSendFields is a list of field names (e.g. "Code") to
  7840. // unconditionally include in API requests. By default, fields with
  7841. // empty values are omitted from API requests. However, any non-pointer,
  7842. // non-interface field appearing in ForceSendFields will be sent to the
  7843. // server regardless of whether the field is empty or not. This may be
  7844. // used to include empty fields in Patch requests.
  7845. ForceSendFields []string `json:"-"`
  7846. // NullFields is a list of field names (e.g. "Code") to include in API
  7847. // requests with the JSON null value. By default, fields with empty
  7848. // values are omitted from API requests. However, any field with an
  7849. // empty value appearing in NullFields will be sent to the server as
  7850. // null. It is an error if a field in this list has a non-empty value.
  7851. // This may be used to include null fields in Patch requests.
  7852. NullFields []string `json:"-"`
  7853. }
  7854. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  7855. type NoMethod InstanceGroupAggregatedListWarning
  7856. raw := NoMethod(*s)
  7857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7858. }
  7859. type InstanceGroupAggregatedListWarningData struct {
  7860. // Key: [Output Only] A key that provides more detail on the warning
  7861. // being returned. For example, for warnings where there are no results
  7862. // in a list request for a particular zone, this key might be scope and
  7863. // the key value might be the zone name. Other examples might be a key
  7864. // indicating a deprecated resource and a suggested replacement, or a
  7865. // warning about invalid network settings (for example, if an instance
  7866. // attempts to perform IP forwarding but is not enabled for IP
  7867. // forwarding).
  7868. Key string `json:"key,omitempty"`
  7869. // Value: [Output Only] A warning data value corresponding to the key.
  7870. Value string `json:"value,omitempty"`
  7871. // ForceSendFields is a list of field names (e.g. "Key") to
  7872. // unconditionally include in API requests. By default, fields with
  7873. // empty values are omitted from API requests. However, any non-pointer,
  7874. // non-interface field appearing in ForceSendFields will be sent to the
  7875. // server regardless of whether the field is empty or not. This may be
  7876. // used to include empty fields in Patch requests.
  7877. ForceSendFields []string `json:"-"`
  7878. // NullFields is a list of field names (e.g. "Key") to include in API
  7879. // requests with the JSON null value. By default, fields with empty
  7880. // values are omitted from API requests. However, any field with an
  7881. // empty value appearing in NullFields will be sent to the server as
  7882. // null. It is an error if a field in this list has a non-empty value.
  7883. // This may be used to include null fields in Patch requests.
  7884. NullFields []string `json:"-"`
  7885. }
  7886. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  7887. type NoMethod InstanceGroupAggregatedListWarningData
  7888. raw := NoMethod(*s)
  7889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7890. }
  7891. // InstanceGroupList: A list of InstanceGroup resources.
  7892. type InstanceGroupList struct {
  7893. // Id: [Output Only] Unique identifier for the resource; defined by the
  7894. // server.
  7895. Id string `json:"id,omitempty"`
  7896. // Items: A list of InstanceGroup resources.
  7897. Items []*InstanceGroup `json:"items,omitempty"`
  7898. // Kind: [Output Only] The resource type, which is always
  7899. // compute#instanceGroupList for instance group lists.
  7900. Kind string `json:"kind,omitempty"`
  7901. // NextPageToken: [Output Only] This token allows you to get the next
  7902. // page of results for list requests. If the number of results is larger
  7903. // than maxResults, use the nextPageToken as a value for the query
  7904. // parameter pageToken in the next list request. Subsequent list
  7905. // requests will have their own nextPageToken to continue paging through
  7906. // the results.
  7907. NextPageToken string `json:"nextPageToken,omitempty"`
  7908. // SelfLink: [Output Only] Server-defined URL for this resource.
  7909. SelfLink string `json:"selfLink,omitempty"`
  7910. // Warning: [Output Only] Informational warning message.
  7911. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  7912. // ServerResponse contains the HTTP response code and headers from the
  7913. // server.
  7914. googleapi.ServerResponse `json:"-"`
  7915. // ForceSendFields is a list of field names (e.g. "Id") to
  7916. // unconditionally include in API requests. By default, fields with
  7917. // empty values are omitted from API requests. However, any non-pointer,
  7918. // non-interface field appearing in ForceSendFields will be sent to the
  7919. // server regardless of whether the field is empty or not. This may be
  7920. // used to include empty fields in Patch requests.
  7921. ForceSendFields []string `json:"-"`
  7922. // NullFields is a list of field names (e.g. "Id") to include in API
  7923. // requests with the JSON null value. By default, fields with empty
  7924. // values are omitted from API requests. However, any field with an
  7925. // empty value appearing in NullFields will be sent to the server as
  7926. // null. It is an error if a field in this list has a non-empty value.
  7927. // This may be used to include null fields in Patch requests.
  7928. NullFields []string `json:"-"`
  7929. }
  7930. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  7931. type NoMethod InstanceGroupList
  7932. raw := NoMethod(*s)
  7933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7934. }
  7935. // InstanceGroupListWarning: [Output Only] Informational warning
  7936. // message.
  7937. type InstanceGroupListWarning struct {
  7938. // Code: [Output Only] A warning code, if applicable. For example,
  7939. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7940. // the response.
  7941. //
  7942. // Possible values:
  7943. // "CLEANUP_FAILED"
  7944. // "DEPRECATED_RESOURCE_USED"
  7945. // "DEPRECATED_TYPE_USED"
  7946. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7947. // "EXPERIMENTAL_TYPE_USED"
  7948. // "EXTERNAL_API_WARNING"
  7949. // "FIELD_VALUE_OVERRIDEN"
  7950. // "INJECTED_KERNELS_DEPRECATED"
  7951. // "MISSING_TYPE_DEPENDENCY"
  7952. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7953. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7954. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7955. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7956. // "NEXT_HOP_NOT_RUNNING"
  7957. // "NOT_CRITICAL_ERROR"
  7958. // "NO_RESULTS_ON_PAGE"
  7959. // "REQUIRED_TOS_AGREEMENT"
  7960. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7961. // "RESOURCE_NOT_DELETED"
  7962. // "SCHEMA_VALIDATION_IGNORED"
  7963. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7964. // "UNDECLARED_PROPERTIES"
  7965. // "UNREACHABLE"
  7966. Code string `json:"code,omitempty"`
  7967. // Data: [Output Only] Metadata about this warning in key: value format.
  7968. // For example:
  7969. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7970. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  7971. // Message: [Output Only] A human-readable description of the warning
  7972. // code.
  7973. Message string `json:"message,omitempty"`
  7974. // ForceSendFields is a list of field names (e.g. "Code") to
  7975. // unconditionally include in API requests. By default, fields with
  7976. // empty values are omitted from API requests. However, any non-pointer,
  7977. // non-interface field appearing in ForceSendFields will be sent to the
  7978. // server regardless of whether the field is empty or not. This may be
  7979. // used to include empty fields in Patch requests.
  7980. ForceSendFields []string `json:"-"`
  7981. // NullFields is a list of field names (e.g. "Code") to include in API
  7982. // requests with the JSON null value. By default, fields with empty
  7983. // values are omitted from API requests. However, any field with an
  7984. // empty value appearing in NullFields will be sent to the server as
  7985. // null. It is an error if a field in this list has a non-empty value.
  7986. // This may be used to include null fields in Patch requests.
  7987. NullFields []string `json:"-"`
  7988. }
  7989. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  7990. type NoMethod InstanceGroupListWarning
  7991. raw := NoMethod(*s)
  7992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7993. }
  7994. type InstanceGroupListWarningData struct {
  7995. // Key: [Output Only] A key that provides more detail on the warning
  7996. // being returned. For example, for warnings where there are no results
  7997. // in a list request for a particular zone, this key might be scope and
  7998. // the key value might be the zone name. Other examples might be a key
  7999. // indicating a deprecated resource and a suggested replacement, or a
  8000. // warning about invalid network settings (for example, if an instance
  8001. // attempts to perform IP forwarding but is not enabled for IP
  8002. // forwarding).
  8003. Key string `json:"key,omitempty"`
  8004. // Value: [Output Only] A warning data value corresponding to the key.
  8005. Value string `json:"value,omitempty"`
  8006. // ForceSendFields is a list of field names (e.g. "Key") to
  8007. // unconditionally include in API requests. By default, fields with
  8008. // empty values are omitted from API requests. However, any non-pointer,
  8009. // non-interface field appearing in ForceSendFields will be sent to the
  8010. // server regardless of whether the field is empty or not. This may be
  8011. // used to include empty fields in Patch requests.
  8012. ForceSendFields []string `json:"-"`
  8013. // NullFields is a list of field names (e.g. "Key") to include in API
  8014. // requests with the JSON null value. By default, fields with empty
  8015. // values are omitted from API requests. However, any field with an
  8016. // empty value appearing in NullFields will be sent to the server as
  8017. // null. It is an error if a field in this list has a non-empty value.
  8018. // This may be used to include null fields in Patch requests.
  8019. NullFields []string `json:"-"`
  8020. }
  8021. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  8022. type NoMethod InstanceGroupListWarningData
  8023. raw := NoMethod(*s)
  8024. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8025. }
  8026. // InstanceGroupManager: An Instance Group Manager resource. (==
  8027. // resource_for beta.instanceGroupManagers ==) (== resource_for
  8028. // v1.instanceGroupManagers ==) (== resource_for
  8029. // beta.regionInstanceGroupManagers ==) (== resource_for
  8030. // v1.regionInstanceGroupManagers ==)
  8031. type InstanceGroupManager struct {
  8032. // BaseInstanceName: The base instance name to use for instances in this
  8033. // group. The value must be 1-58 characters long. Instances are named by
  8034. // appending a hyphen and a random four-character string to the base
  8035. // instance name. The base instance name must comply with RFC1035.
  8036. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  8037. // CreationTimestamp: [Output Only] The creation timestamp for this
  8038. // managed instance group in RFC3339 text format.
  8039. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8040. // CurrentActions: [Output Only] The list of instance actions and the
  8041. // number of instances in this managed instance group that are scheduled
  8042. // for each of those actions.
  8043. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  8044. // Description: An optional description of this resource. Provide this
  8045. // property when you create the resource.
  8046. Description string `json:"description,omitempty"`
  8047. // Fingerprint: Fingerprint of this resource. This field may be used in
  8048. // optimistic locking. It will be ignored when inserting an
  8049. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  8050. // order to update the InstanceGroupManager.
  8051. Fingerprint string `json:"fingerprint,omitempty"`
  8052. // Id: [Output Only] A unique identifier for this resource type. The
  8053. // server generates this identifier.
  8054. Id uint64 `json:"id,omitempty,string"`
  8055. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  8056. InstanceGroup string `json:"instanceGroup,omitempty"`
  8057. // InstanceTemplate: The URL of the instance template that is specified
  8058. // for this managed instance group. The group uses this template to
  8059. // create all new instances in the managed instance group.
  8060. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  8061. // Kind: [Output Only] The resource type, which is always
  8062. // compute#instanceGroupManager for managed instance groups.
  8063. Kind string `json:"kind,omitempty"`
  8064. // Name: The name of the managed instance group. The name must be 1-63
  8065. // characters long, and comply with RFC1035.
  8066. Name string `json:"name,omitempty"`
  8067. // NamedPorts: Named ports configured for the Instance Groups
  8068. // complementary to this Instance Group Manager.
  8069. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  8070. // Region: [Output Only] The URL of the region where the managed
  8071. // instance group resides (for regional resources).
  8072. Region string `json:"region,omitempty"`
  8073. // SelfLink: [Output Only] The URL for this managed instance group. The
  8074. // server defines this URL.
  8075. SelfLink string `json:"selfLink,omitempty"`
  8076. // TargetPools: The URLs for all TargetPool resources to which instances
  8077. // in the instanceGroup field are added. The target pools automatically
  8078. // apply to all of the instances in the managed instance group.
  8079. TargetPools []string `json:"targetPools,omitempty"`
  8080. // TargetSize: The target number of running instances for this managed
  8081. // instance group. Deleting or abandoning instances reduces this number.
  8082. // Resizing the group changes this number.
  8083. TargetSize int64 `json:"targetSize,omitempty"`
  8084. // Zone: [Output Only] The URL of the zone where the managed instance
  8085. // group is located (for zonal resources).
  8086. Zone string `json:"zone,omitempty"`
  8087. // ServerResponse contains the HTTP response code and headers from the
  8088. // server.
  8089. googleapi.ServerResponse `json:"-"`
  8090. // ForceSendFields is a list of field names (e.g. "BaseInstanceName") to
  8091. // unconditionally include in API requests. By default, fields with
  8092. // empty values are omitted from API requests. However, any non-pointer,
  8093. // non-interface field appearing in ForceSendFields will be sent to the
  8094. // server regardless of whether the field is empty or not. This may be
  8095. // used to include empty fields in Patch requests.
  8096. ForceSendFields []string `json:"-"`
  8097. // NullFields is a list of field names (e.g. "BaseInstanceName") to
  8098. // include in API requests with the JSON null value. By default, fields
  8099. // with empty values are omitted from API requests. However, any field
  8100. // with an empty value appearing in NullFields will be sent to the
  8101. // server as null. It is an error if a field in this list has a
  8102. // non-empty value. This may be used to include null fields in Patch
  8103. // requests.
  8104. NullFields []string `json:"-"`
  8105. }
  8106. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  8107. type NoMethod InstanceGroupManager
  8108. raw := NoMethod(*s)
  8109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8110. }
  8111. type InstanceGroupManagerActionsSummary struct {
  8112. // Abandoning: [Output Only] The total number of instances in the
  8113. // managed instance group that are scheduled to be abandoned. Abandoning
  8114. // an instance removes it from the managed instance group without
  8115. // deleting it.
  8116. Abandoning int64 `json:"abandoning,omitempty"`
  8117. // Creating: [Output Only] The number of instances in the managed
  8118. // instance group that are scheduled to be created or are currently
  8119. // being created. If the group fails to create any of these instances,
  8120. // it tries again until it creates the instance successfully.
  8121. //
  8122. // If you have disabled creation retries, this field will not be
  8123. // populated; instead, the creatingWithoutRetries field will be
  8124. // populated.
  8125. Creating int64 `json:"creating,omitempty"`
  8126. // CreatingWithoutRetries: [Output Only] The number of instances that
  8127. // the managed instance group will attempt to create. The group attempts
  8128. // to create each instance only once. If the group fails to create any
  8129. // of these instances, it decreases the group's targetSize value
  8130. // accordingly.
  8131. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  8132. // Deleting: [Output Only] The number of instances in the managed
  8133. // instance group that are scheduled to be deleted or are currently
  8134. // being deleted.
  8135. Deleting int64 `json:"deleting,omitempty"`
  8136. // None: [Output Only] The number of instances in the managed instance
  8137. // group that are running and have no scheduled actions.
  8138. None int64 `json:"none,omitempty"`
  8139. // Recreating: [Output Only] The number of instances in the managed
  8140. // instance group that are scheduled to be recreated or are currently
  8141. // being being recreated. Recreating an instance deletes the existing
  8142. // root persistent disk and creates a new disk from the image that is
  8143. // defined in the instance template.
  8144. Recreating int64 `json:"recreating,omitempty"`
  8145. // Refreshing: [Output Only] The number of instances in the managed
  8146. // instance group that are being reconfigured with properties that do
  8147. // not require a restart or a recreate action. For example, setting or
  8148. // removing target pools for the instance.
  8149. Refreshing int64 `json:"refreshing,omitempty"`
  8150. // Restarting: [Output Only] The number of instances in the managed
  8151. // instance group that are scheduled to be restarted or are currently
  8152. // being restarted.
  8153. Restarting int64 `json:"restarting,omitempty"`
  8154. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  8155. // unconditionally include in API requests. By default, fields with
  8156. // empty values are omitted from API requests. However, any non-pointer,
  8157. // non-interface field appearing in ForceSendFields will be sent to the
  8158. // server regardless of whether the field is empty or not. This may be
  8159. // used to include empty fields in Patch requests.
  8160. ForceSendFields []string `json:"-"`
  8161. // NullFields is a list of field names (e.g. "Abandoning") to include in
  8162. // API requests with the JSON null value. By default, fields with empty
  8163. // values are omitted from API requests. However, any field with an
  8164. // empty value appearing in NullFields will be sent to the server as
  8165. // null. It is an error if a field in this list has a non-empty value.
  8166. // This may be used to include null fields in Patch requests.
  8167. NullFields []string `json:"-"`
  8168. }
  8169. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  8170. type NoMethod InstanceGroupManagerActionsSummary
  8171. raw := NoMethod(*s)
  8172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8173. }
  8174. type InstanceGroupManagerAggregatedList struct {
  8175. // Id: [Output Only] Unique identifier for the resource; defined by the
  8176. // server.
  8177. Id string `json:"id,omitempty"`
  8178. // Items: A list of InstanceGroupManagersScopedList resources.
  8179. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  8180. // Kind: [Output Only] The resource type, which is always
  8181. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  8182. // managed instance groups.
  8183. Kind string `json:"kind,omitempty"`
  8184. // NextPageToken: [Output Only] This token allows you to get the next
  8185. // page of results for list requests. If the number of results is larger
  8186. // than maxResults, use the nextPageToken as a value for the query
  8187. // parameter pageToken in the next list request. Subsequent list
  8188. // requests will have their own nextPageToken to continue paging through
  8189. // the results.
  8190. NextPageToken string `json:"nextPageToken,omitempty"`
  8191. // SelfLink: [Output Only] Server-defined URL for this resource.
  8192. SelfLink string `json:"selfLink,omitempty"`
  8193. // Warning: [Output Only] Informational warning message.
  8194. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  8195. // ServerResponse contains the HTTP response code and headers from the
  8196. // server.
  8197. googleapi.ServerResponse `json:"-"`
  8198. // ForceSendFields is a list of field names (e.g. "Id") to
  8199. // unconditionally include in API requests. By default, fields with
  8200. // empty values are omitted from API requests. However, any non-pointer,
  8201. // non-interface field appearing in ForceSendFields will be sent to the
  8202. // server regardless of whether the field is empty or not. This may be
  8203. // used to include empty fields in Patch requests.
  8204. ForceSendFields []string `json:"-"`
  8205. // NullFields is a list of field names (e.g. "Id") to include in API
  8206. // requests with the JSON null value. By default, fields with empty
  8207. // values are omitted from API requests. However, any field with an
  8208. // empty value appearing in NullFields will be sent to the server as
  8209. // null. It is an error if a field in this list has a non-empty value.
  8210. // This may be used to include null fields in Patch requests.
  8211. NullFields []string `json:"-"`
  8212. }
  8213. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  8214. type NoMethod InstanceGroupManagerAggregatedList
  8215. raw := NoMethod(*s)
  8216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8217. }
  8218. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  8219. // Informational warning message.
  8220. type InstanceGroupManagerAggregatedListWarning struct {
  8221. // Code: [Output Only] A warning code, if applicable. For example,
  8222. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8223. // the response.
  8224. //
  8225. // Possible values:
  8226. // "CLEANUP_FAILED"
  8227. // "DEPRECATED_RESOURCE_USED"
  8228. // "DEPRECATED_TYPE_USED"
  8229. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8230. // "EXPERIMENTAL_TYPE_USED"
  8231. // "EXTERNAL_API_WARNING"
  8232. // "FIELD_VALUE_OVERRIDEN"
  8233. // "INJECTED_KERNELS_DEPRECATED"
  8234. // "MISSING_TYPE_DEPENDENCY"
  8235. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8236. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8237. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8238. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8239. // "NEXT_HOP_NOT_RUNNING"
  8240. // "NOT_CRITICAL_ERROR"
  8241. // "NO_RESULTS_ON_PAGE"
  8242. // "REQUIRED_TOS_AGREEMENT"
  8243. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8244. // "RESOURCE_NOT_DELETED"
  8245. // "SCHEMA_VALIDATION_IGNORED"
  8246. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8247. // "UNDECLARED_PROPERTIES"
  8248. // "UNREACHABLE"
  8249. Code string `json:"code,omitempty"`
  8250. // Data: [Output Only] Metadata about this warning in key: value format.
  8251. // For example:
  8252. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8253. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  8254. // Message: [Output Only] A human-readable description of the warning
  8255. // code.
  8256. Message string `json:"message,omitempty"`
  8257. // ForceSendFields is a list of field names (e.g. "Code") to
  8258. // unconditionally include in API requests. By default, fields with
  8259. // empty values are omitted from API requests. However, any non-pointer,
  8260. // non-interface field appearing in ForceSendFields will be sent to the
  8261. // server regardless of whether the field is empty or not. This may be
  8262. // used to include empty fields in Patch requests.
  8263. ForceSendFields []string `json:"-"`
  8264. // NullFields is a list of field names (e.g. "Code") to include in API
  8265. // requests with the JSON null value. By default, fields with empty
  8266. // values are omitted from API requests. However, any field with an
  8267. // empty value appearing in NullFields will be sent to the server as
  8268. // null. It is an error if a field in this list has a non-empty value.
  8269. // This may be used to include null fields in Patch requests.
  8270. NullFields []string `json:"-"`
  8271. }
  8272. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8273. type NoMethod InstanceGroupManagerAggregatedListWarning
  8274. raw := NoMethod(*s)
  8275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8276. }
  8277. type InstanceGroupManagerAggregatedListWarningData struct {
  8278. // Key: [Output Only] A key that provides more detail on the warning
  8279. // being returned. For example, for warnings where there are no results
  8280. // in a list request for a particular zone, this key might be scope and
  8281. // the key value might be the zone name. Other examples might be a key
  8282. // indicating a deprecated resource and a suggested replacement, or a
  8283. // warning about invalid network settings (for example, if an instance
  8284. // attempts to perform IP forwarding but is not enabled for IP
  8285. // forwarding).
  8286. Key string `json:"key,omitempty"`
  8287. // Value: [Output Only] A warning data value corresponding to the key.
  8288. Value string `json:"value,omitempty"`
  8289. // ForceSendFields is a list of field names (e.g. "Key") to
  8290. // unconditionally include in API requests. By default, fields with
  8291. // empty values are omitted from API requests. However, any non-pointer,
  8292. // non-interface field appearing in ForceSendFields will be sent to the
  8293. // server regardless of whether the field is empty or not. This may be
  8294. // used to include empty fields in Patch requests.
  8295. ForceSendFields []string `json:"-"`
  8296. // NullFields is a list of field names (e.g. "Key") to include in API
  8297. // requests with the JSON null value. By default, fields with empty
  8298. // values are omitted from API requests. However, any field with an
  8299. // empty value appearing in NullFields will be sent to the server as
  8300. // null. It is an error if a field in this list has a non-empty value.
  8301. // This may be used to include null fields in Patch requests.
  8302. NullFields []string `json:"-"`
  8303. }
  8304. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8305. type NoMethod InstanceGroupManagerAggregatedListWarningData
  8306. raw := NoMethod(*s)
  8307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8308. }
  8309. // InstanceGroupManagerList: [Output Only] A list of managed instance
  8310. // groups.
  8311. type InstanceGroupManagerList struct {
  8312. // Id: [Output Only] Unique identifier for the resource; defined by the
  8313. // server.
  8314. Id string `json:"id,omitempty"`
  8315. // Items: A list of InstanceGroupManager resources.
  8316. Items []*InstanceGroupManager `json:"items,omitempty"`
  8317. // Kind: [Output Only] The resource type, which is always
  8318. // compute#instanceGroupManagerList for a list of managed instance
  8319. // groups.
  8320. Kind string `json:"kind,omitempty"`
  8321. // NextPageToken: [Output Only] This token allows you to get the next
  8322. // page of results for list requests. If the number of results is larger
  8323. // than maxResults, use the nextPageToken as a value for the query
  8324. // parameter pageToken in the next list request. Subsequent list
  8325. // requests will have their own nextPageToken to continue paging through
  8326. // the results.
  8327. NextPageToken string `json:"nextPageToken,omitempty"`
  8328. // SelfLink: [Output Only] Server-defined URL for this resource.
  8329. SelfLink string `json:"selfLink,omitempty"`
  8330. // Warning: [Output Only] Informational warning message.
  8331. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  8332. // ServerResponse contains the HTTP response code and headers from the
  8333. // server.
  8334. googleapi.ServerResponse `json:"-"`
  8335. // ForceSendFields is a list of field names (e.g. "Id") to
  8336. // unconditionally include in API requests. By default, fields with
  8337. // empty values are omitted from API requests. However, any non-pointer,
  8338. // non-interface field appearing in ForceSendFields will be sent to the
  8339. // server regardless of whether the field is empty or not. This may be
  8340. // used to include empty fields in Patch requests.
  8341. ForceSendFields []string `json:"-"`
  8342. // NullFields is a list of field names (e.g. "Id") to include in API
  8343. // requests with the JSON null value. By default, fields with empty
  8344. // values are omitted from API requests. However, any field with an
  8345. // empty value appearing in NullFields will be sent to the server as
  8346. // null. It is an error if a field in this list has a non-empty value.
  8347. // This may be used to include null fields in Patch requests.
  8348. NullFields []string `json:"-"`
  8349. }
  8350. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  8351. type NoMethod InstanceGroupManagerList
  8352. raw := NoMethod(*s)
  8353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8354. }
  8355. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  8356. // message.
  8357. type InstanceGroupManagerListWarning struct {
  8358. // Code: [Output Only] A warning code, if applicable. For example,
  8359. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8360. // the response.
  8361. //
  8362. // Possible values:
  8363. // "CLEANUP_FAILED"
  8364. // "DEPRECATED_RESOURCE_USED"
  8365. // "DEPRECATED_TYPE_USED"
  8366. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8367. // "EXPERIMENTAL_TYPE_USED"
  8368. // "EXTERNAL_API_WARNING"
  8369. // "FIELD_VALUE_OVERRIDEN"
  8370. // "INJECTED_KERNELS_DEPRECATED"
  8371. // "MISSING_TYPE_DEPENDENCY"
  8372. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8373. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8374. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8375. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8376. // "NEXT_HOP_NOT_RUNNING"
  8377. // "NOT_CRITICAL_ERROR"
  8378. // "NO_RESULTS_ON_PAGE"
  8379. // "REQUIRED_TOS_AGREEMENT"
  8380. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8381. // "RESOURCE_NOT_DELETED"
  8382. // "SCHEMA_VALIDATION_IGNORED"
  8383. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8384. // "UNDECLARED_PROPERTIES"
  8385. // "UNREACHABLE"
  8386. Code string `json:"code,omitempty"`
  8387. // Data: [Output Only] Metadata about this warning in key: value format.
  8388. // For example:
  8389. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8390. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  8391. // Message: [Output Only] A human-readable description of the warning
  8392. // code.
  8393. Message string `json:"message,omitempty"`
  8394. // ForceSendFields is a list of field names (e.g. "Code") to
  8395. // unconditionally include in API requests. By default, fields with
  8396. // empty values are omitted from API requests. However, any non-pointer,
  8397. // non-interface field appearing in ForceSendFields will be sent to the
  8398. // server regardless of whether the field is empty or not. This may be
  8399. // used to include empty fields in Patch requests.
  8400. ForceSendFields []string `json:"-"`
  8401. // NullFields is a list of field names (e.g. "Code") to include in API
  8402. // requests with the JSON null value. By default, fields with empty
  8403. // values are omitted from API requests. However, any field with an
  8404. // empty value appearing in NullFields will be sent to the server as
  8405. // null. It is an error if a field in this list has a non-empty value.
  8406. // This may be used to include null fields in Patch requests.
  8407. NullFields []string `json:"-"`
  8408. }
  8409. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  8410. type NoMethod InstanceGroupManagerListWarning
  8411. raw := NoMethod(*s)
  8412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8413. }
  8414. type InstanceGroupManagerListWarningData struct {
  8415. // Key: [Output Only] A key that provides more detail on the warning
  8416. // being returned. For example, for warnings where there are no results
  8417. // in a list request for a particular zone, this key might be scope and
  8418. // the key value might be the zone name. Other examples might be a key
  8419. // indicating a deprecated resource and a suggested replacement, or a
  8420. // warning about invalid network settings (for example, if an instance
  8421. // attempts to perform IP forwarding but is not enabled for IP
  8422. // forwarding).
  8423. Key string `json:"key,omitempty"`
  8424. // Value: [Output Only] A warning data value corresponding to the key.
  8425. Value string `json:"value,omitempty"`
  8426. // ForceSendFields is a list of field names (e.g. "Key") to
  8427. // unconditionally include in API requests. By default, fields with
  8428. // empty values are omitted from API requests. However, any non-pointer,
  8429. // non-interface field appearing in ForceSendFields will be sent to the
  8430. // server regardless of whether the field is empty or not. This may be
  8431. // used to include empty fields in Patch requests.
  8432. ForceSendFields []string `json:"-"`
  8433. // NullFields is a list of field names (e.g. "Key") to include in API
  8434. // requests with the JSON null value. By default, fields with empty
  8435. // values are omitted from API requests. However, any field with an
  8436. // empty value appearing in NullFields will be sent to the server as
  8437. // null. It is an error if a field in this list has a non-empty value.
  8438. // This may be used to include null fields in Patch requests.
  8439. NullFields []string `json:"-"`
  8440. }
  8441. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  8442. type NoMethod InstanceGroupManagerListWarningData
  8443. raw := NoMethod(*s)
  8444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8445. }
  8446. type InstanceGroupManagersAbandonInstancesRequest struct {
  8447. // Instances: The URLs of one or more instances to abandon. This can be
  8448. // a full URL or a partial URL, such as
  8449. // zones/[ZONE]/instances/[INSTANCE_NAME].
  8450. Instances []string `json:"instances,omitempty"`
  8451. // ForceSendFields is a list of field names (e.g. "Instances") to
  8452. // unconditionally include in API requests. By default, fields with
  8453. // empty values are omitted from API requests. However, any non-pointer,
  8454. // non-interface field appearing in ForceSendFields will be sent to the
  8455. // server regardless of whether the field is empty or not. This may be
  8456. // used to include empty fields in Patch requests.
  8457. ForceSendFields []string `json:"-"`
  8458. // NullFields is a list of field names (e.g. "Instances") to include in
  8459. // API requests with the JSON null value. By default, fields with empty
  8460. // values are omitted from API requests. However, any field with an
  8461. // empty value appearing in NullFields will be sent to the server as
  8462. // null. It is an error if a field in this list has a non-empty value.
  8463. // This may be used to include null fields in Patch requests.
  8464. NullFields []string `json:"-"`
  8465. }
  8466. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  8467. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  8468. raw := NoMethod(*s)
  8469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8470. }
  8471. type InstanceGroupManagersDeleteInstancesRequest struct {
  8472. // Instances: The URLs of one or more instances to delete. This can be a
  8473. // full URL or a partial URL, such as
  8474. // zones/[ZONE]/instances/[INSTANCE_NAME].
  8475. Instances []string `json:"instances,omitempty"`
  8476. // ForceSendFields is a list of field names (e.g. "Instances") to
  8477. // unconditionally include in API requests. By default, fields with
  8478. // empty values are omitted from API requests. However, any non-pointer,
  8479. // non-interface field appearing in ForceSendFields will be sent to the
  8480. // server regardless of whether the field is empty or not. This may be
  8481. // used to include empty fields in Patch requests.
  8482. ForceSendFields []string `json:"-"`
  8483. // NullFields is a list of field names (e.g. "Instances") to include in
  8484. // API requests with the JSON null value. By default, fields with empty
  8485. // values are omitted from API requests. However, any field with an
  8486. // empty value appearing in NullFields will be sent to the server as
  8487. // null. It is an error if a field in this list has a non-empty value.
  8488. // This may be used to include null fields in Patch requests.
  8489. NullFields []string `json:"-"`
  8490. }
  8491. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  8492. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  8493. raw := NoMethod(*s)
  8494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8495. }
  8496. type InstanceGroupManagersListManagedInstancesResponse struct {
  8497. // ManagedInstances: [Output Only] The list of instances in the managed
  8498. // instance group.
  8499. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  8500. // ServerResponse contains the HTTP response code and headers from the
  8501. // server.
  8502. googleapi.ServerResponse `json:"-"`
  8503. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  8504. // unconditionally include in API requests. By default, fields with
  8505. // empty values are omitted from API requests. However, any non-pointer,
  8506. // non-interface field appearing in ForceSendFields will be sent to the
  8507. // server regardless of whether the field is empty or not. This may be
  8508. // used to include empty fields in Patch requests.
  8509. ForceSendFields []string `json:"-"`
  8510. // NullFields is a list of field names (e.g. "ManagedInstances") to
  8511. // include in API requests with the JSON null value. By default, fields
  8512. // with empty values are omitted from API requests. However, any field
  8513. // with an empty value appearing in NullFields will be sent to the
  8514. // server as null. It is an error if a field in this list has a
  8515. // non-empty value. This may be used to include null fields in Patch
  8516. // requests.
  8517. NullFields []string `json:"-"`
  8518. }
  8519. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  8520. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  8521. raw := NoMethod(*s)
  8522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8523. }
  8524. type InstanceGroupManagersRecreateInstancesRequest struct {
  8525. // Instances: The URLs of one or more instances to recreate. This can be
  8526. // a full URL or a partial URL, such as
  8527. // zones/[ZONE]/instances/[INSTANCE_NAME].
  8528. Instances []string `json:"instances,omitempty"`
  8529. // ForceSendFields is a list of field names (e.g. "Instances") to
  8530. // unconditionally include in API requests. By default, fields with
  8531. // empty values are omitted from API requests. However, any non-pointer,
  8532. // non-interface field appearing in ForceSendFields will be sent to the
  8533. // server regardless of whether the field is empty or not. This may be
  8534. // used to include empty fields in Patch requests.
  8535. ForceSendFields []string `json:"-"`
  8536. // NullFields is a list of field names (e.g. "Instances") to include in
  8537. // API requests with the JSON null value. By default, fields with empty
  8538. // values are omitted from API requests. However, any field with an
  8539. // empty value appearing in NullFields will be sent to the server as
  8540. // null. It is an error if a field in this list has a non-empty value.
  8541. // This may be used to include null fields in Patch requests.
  8542. NullFields []string `json:"-"`
  8543. }
  8544. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  8545. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  8546. raw := NoMethod(*s)
  8547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8548. }
  8549. type InstanceGroupManagersScopedList struct {
  8550. // InstanceGroupManagers: [Output Only] The list of managed instance
  8551. // groups that are contained in the specified project and zone.
  8552. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  8553. // Warning: [Output Only] The warning that replaces the list of managed
  8554. // instance groups when the list is empty.
  8555. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  8556. // ForceSendFields is a list of field names (e.g.
  8557. // "InstanceGroupManagers") to unconditionally include in API requests.
  8558. // By default, fields with empty values are omitted from API requests.
  8559. // However, any non-pointer, non-interface field appearing in
  8560. // ForceSendFields will be sent to the server regardless of whether the
  8561. // field is empty or not. This may be used to include empty fields in
  8562. // Patch requests.
  8563. ForceSendFields []string `json:"-"`
  8564. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  8565. // include in API requests with the JSON null value. By default, fields
  8566. // with empty values are omitted from API requests. However, any field
  8567. // with an empty value appearing in NullFields will be sent to the
  8568. // server as null. It is an error if a field in this list has a
  8569. // non-empty value. This may be used to include null fields in Patch
  8570. // requests.
  8571. NullFields []string `json:"-"`
  8572. }
  8573. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  8574. type NoMethod InstanceGroupManagersScopedList
  8575. raw := NoMethod(*s)
  8576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8577. }
  8578. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  8579. // that replaces the list of managed instance groups when the list is
  8580. // empty.
  8581. type InstanceGroupManagersScopedListWarning struct {
  8582. // Code: [Output Only] A warning code, if applicable. For example,
  8583. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8584. // the response.
  8585. //
  8586. // Possible values:
  8587. // "CLEANUP_FAILED"
  8588. // "DEPRECATED_RESOURCE_USED"
  8589. // "DEPRECATED_TYPE_USED"
  8590. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8591. // "EXPERIMENTAL_TYPE_USED"
  8592. // "EXTERNAL_API_WARNING"
  8593. // "FIELD_VALUE_OVERRIDEN"
  8594. // "INJECTED_KERNELS_DEPRECATED"
  8595. // "MISSING_TYPE_DEPENDENCY"
  8596. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8597. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8598. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8599. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8600. // "NEXT_HOP_NOT_RUNNING"
  8601. // "NOT_CRITICAL_ERROR"
  8602. // "NO_RESULTS_ON_PAGE"
  8603. // "REQUIRED_TOS_AGREEMENT"
  8604. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8605. // "RESOURCE_NOT_DELETED"
  8606. // "SCHEMA_VALIDATION_IGNORED"
  8607. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8608. // "UNDECLARED_PROPERTIES"
  8609. // "UNREACHABLE"
  8610. Code string `json:"code,omitempty"`
  8611. // Data: [Output Only] Metadata about this warning in key: value format.
  8612. // For example:
  8613. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8614. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  8615. // Message: [Output Only] A human-readable description of the warning
  8616. // code.
  8617. Message string `json:"message,omitempty"`
  8618. // ForceSendFields is a list of field names (e.g. "Code") to
  8619. // unconditionally include in API requests. By default, fields with
  8620. // empty values are omitted from API requests. However, any non-pointer,
  8621. // non-interface field appearing in ForceSendFields will be sent to the
  8622. // server regardless of whether the field is empty or not. This may be
  8623. // used to include empty fields in Patch requests.
  8624. ForceSendFields []string `json:"-"`
  8625. // NullFields is a list of field names (e.g. "Code") to include in API
  8626. // requests with the JSON null value. By default, fields with empty
  8627. // values are omitted from API requests. However, any field with an
  8628. // empty value appearing in NullFields will be sent to the server as
  8629. // null. It is an error if a field in this list has a non-empty value.
  8630. // This may be used to include null fields in Patch requests.
  8631. NullFields []string `json:"-"`
  8632. }
  8633. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  8634. type NoMethod InstanceGroupManagersScopedListWarning
  8635. raw := NoMethod(*s)
  8636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8637. }
  8638. type InstanceGroupManagersScopedListWarningData struct {
  8639. // Key: [Output Only] A key that provides more detail on the warning
  8640. // being returned. For example, for warnings where there are no results
  8641. // in a list request for a particular zone, this key might be scope and
  8642. // the key value might be the zone name. Other examples might be a key
  8643. // indicating a deprecated resource and a suggested replacement, or a
  8644. // warning about invalid network settings (for example, if an instance
  8645. // attempts to perform IP forwarding but is not enabled for IP
  8646. // forwarding).
  8647. Key string `json:"key,omitempty"`
  8648. // Value: [Output Only] A warning data value corresponding to the key.
  8649. Value string `json:"value,omitempty"`
  8650. // ForceSendFields is a list of field names (e.g. "Key") to
  8651. // unconditionally include in API requests. By default, fields with
  8652. // empty values are omitted from API requests. However, any non-pointer,
  8653. // non-interface field appearing in ForceSendFields will be sent to the
  8654. // server regardless of whether the field is empty or not. This may be
  8655. // used to include empty fields in Patch requests.
  8656. ForceSendFields []string `json:"-"`
  8657. // NullFields is a list of field names (e.g. "Key") to include in API
  8658. // requests with the JSON null value. By default, fields with empty
  8659. // values are omitted from API requests. However, any field with an
  8660. // empty value appearing in NullFields will be sent to the server as
  8661. // null. It is an error if a field in this list has a non-empty value.
  8662. // This may be used to include null fields in Patch requests.
  8663. NullFields []string `json:"-"`
  8664. }
  8665. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  8666. type NoMethod InstanceGroupManagersScopedListWarningData
  8667. raw := NoMethod(*s)
  8668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8669. }
  8670. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  8671. // InstanceTemplate: The URL of the instance template that is specified
  8672. // for this managed instance group. The group uses this template to
  8673. // create all new instances in the managed instance group.
  8674. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  8675. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  8676. // unconditionally include in API requests. By default, fields with
  8677. // empty values are omitted from API requests. However, any non-pointer,
  8678. // non-interface field appearing in ForceSendFields will be sent to the
  8679. // server regardless of whether the field is empty or not. This may be
  8680. // used to include empty fields in Patch requests.
  8681. ForceSendFields []string `json:"-"`
  8682. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  8683. // include in API requests with the JSON null value. By default, fields
  8684. // with empty values are omitted from API requests. However, any field
  8685. // with an empty value appearing in NullFields will be sent to the
  8686. // server as null. It is an error if a field in this list has a
  8687. // non-empty value. This may be used to include null fields in Patch
  8688. // requests.
  8689. NullFields []string `json:"-"`
  8690. }
  8691. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  8692. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  8693. raw := NoMethod(*s)
  8694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8695. }
  8696. type InstanceGroupManagersSetTargetPoolsRequest struct {
  8697. // Fingerprint: The fingerprint of the target pools information. Use
  8698. // this optional property to prevent conflicts when multiple users
  8699. // change the target pools settings concurrently. Obtain the fingerprint
  8700. // with the instanceGroupManagers.get method. Then, include the
  8701. // fingerprint in your request to ensure that you do not overwrite
  8702. // changes that were applied from another concurrent request.
  8703. Fingerprint string `json:"fingerprint,omitempty"`
  8704. // TargetPools: The list of target pool URLs that instances in this
  8705. // managed instance group belong to. The managed instance group applies
  8706. // these target pools to all of the instances in the group. Existing
  8707. // instances and new instances in the group all receive these target
  8708. // pool settings.
  8709. TargetPools []string `json:"targetPools,omitempty"`
  8710. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  8711. // unconditionally include in API requests. By default, fields with
  8712. // empty values are omitted from API requests. However, any non-pointer,
  8713. // non-interface field appearing in ForceSendFields will be sent to the
  8714. // server regardless of whether the field is empty or not. This may be
  8715. // used to include empty fields in Patch requests.
  8716. ForceSendFields []string `json:"-"`
  8717. // NullFields is a list of field names (e.g. "Fingerprint") to include
  8718. // in API requests with the JSON null value. By default, fields with
  8719. // empty values are omitted from API requests. However, any field with
  8720. // an empty value appearing in NullFields will be sent to the server as
  8721. // null. It is an error if a field in this list has a non-empty value.
  8722. // This may be used to include null fields in Patch requests.
  8723. NullFields []string `json:"-"`
  8724. }
  8725. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  8726. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  8727. raw := NoMethod(*s)
  8728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8729. }
  8730. type InstanceGroupsAddInstancesRequest struct {
  8731. // Instances: The list of instances to add to the instance group.
  8732. Instances []*InstanceReference `json:"instances,omitempty"`
  8733. // ForceSendFields is a list of field names (e.g. "Instances") to
  8734. // unconditionally include in API requests. By default, fields with
  8735. // empty values are omitted from API requests. However, any non-pointer,
  8736. // non-interface field appearing in ForceSendFields will be sent to the
  8737. // server regardless of whether the field is empty or not. This may be
  8738. // used to include empty fields in Patch requests.
  8739. ForceSendFields []string `json:"-"`
  8740. // NullFields is a list of field names (e.g. "Instances") to include in
  8741. // API requests with the JSON null value. By default, fields with empty
  8742. // values are omitted from API requests. However, any field with an
  8743. // empty value appearing in NullFields will be sent to the server as
  8744. // null. It is an error if a field in this list has a non-empty value.
  8745. // This may be used to include null fields in Patch requests.
  8746. NullFields []string `json:"-"`
  8747. }
  8748. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  8749. type NoMethod InstanceGroupsAddInstancesRequest
  8750. raw := NoMethod(*s)
  8751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8752. }
  8753. type InstanceGroupsListInstances struct {
  8754. // Id: [Output Only] Unique identifier for the resource; defined by the
  8755. // server.
  8756. Id string `json:"id,omitempty"`
  8757. // Items: A list of InstanceWithNamedPorts resources.
  8758. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  8759. // Kind: [Output Only] The resource type, which is always
  8760. // compute#instanceGroupsListInstances for the list of instances in the
  8761. // specified instance group.
  8762. Kind string `json:"kind,omitempty"`
  8763. // NextPageToken: [Output Only] This token allows you to get the next
  8764. // page of results for list requests. If the number of results is larger
  8765. // than maxResults, use the nextPageToken as a value for the query
  8766. // parameter pageToken in the next list request. Subsequent list
  8767. // requests will have their own nextPageToken to continue paging through
  8768. // the results.
  8769. NextPageToken string `json:"nextPageToken,omitempty"`
  8770. // SelfLink: [Output Only] Server-defined URL for this resource.
  8771. SelfLink string `json:"selfLink,omitempty"`
  8772. // Warning: [Output Only] Informational warning message.
  8773. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  8774. // ServerResponse contains the HTTP response code and headers from the
  8775. // server.
  8776. googleapi.ServerResponse `json:"-"`
  8777. // ForceSendFields is a list of field names (e.g. "Id") to
  8778. // unconditionally include in API requests. By default, fields with
  8779. // empty values are omitted from API requests. However, any non-pointer,
  8780. // non-interface field appearing in ForceSendFields will be sent to the
  8781. // server regardless of whether the field is empty or not. This may be
  8782. // used to include empty fields in Patch requests.
  8783. ForceSendFields []string `json:"-"`
  8784. // NullFields is a list of field names (e.g. "Id") to include in API
  8785. // requests with the JSON null value. By default, fields with empty
  8786. // values are omitted from API requests. However, any field with an
  8787. // empty value appearing in NullFields will be sent to the server as
  8788. // null. It is an error if a field in this list has a non-empty value.
  8789. // This may be used to include null fields in Patch requests.
  8790. NullFields []string `json:"-"`
  8791. }
  8792. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  8793. type NoMethod InstanceGroupsListInstances
  8794. raw := NoMethod(*s)
  8795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8796. }
  8797. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  8798. // warning message.
  8799. type InstanceGroupsListInstancesWarning struct {
  8800. // Code: [Output Only] A warning code, if applicable. For example,
  8801. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8802. // the response.
  8803. //
  8804. // Possible values:
  8805. // "CLEANUP_FAILED"
  8806. // "DEPRECATED_RESOURCE_USED"
  8807. // "DEPRECATED_TYPE_USED"
  8808. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8809. // "EXPERIMENTAL_TYPE_USED"
  8810. // "EXTERNAL_API_WARNING"
  8811. // "FIELD_VALUE_OVERRIDEN"
  8812. // "INJECTED_KERNELS_DEPRECATED"
  8813. // "MISSING_TYPE_DEPENDENCY"
  8814. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8815. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8816. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8817. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8818. // "NEXT_HOP_NOT_RUNNING"
  8819. // "NOT_CRITICAL_ERROR"
  8820. // "NO_RESULTS_ON_PAGE"
  8821. // "REQUIRED_TOS_AGREEMENT"
  8822. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8823. // "RESOURCE_NOT_DELETED"
  8824. // "SCHEMA_VALIDATION_IGNORED"
  8825. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8826. // "UNDECLARED_PROPERTIES"
  8827. // "UNREACHABLE"
  8828. Code string `json:"code,omitempty"`
  8829. // Data: [Output Only] Metadata about this warning in key: value format.
  8830. // For example:
  8831. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8832. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  8833. // Message: [Output Only] A human-readable description of the warning
  8834. // code.
  8835. Message string `json:"message,omitempty"`
  8836. // ForceSendFields is a list of field names (e.g. "Code") to
  8837. // unconditionally include in API requests. By default, fields with
  8838. // empty values are omitted from API requests. However, any non-pointer,
  8839. // non-interface field appearing in ForceSendFields will be sent to the
  8840. // server regardless of whether the field is empty or not. This may be
  8841. // used to include empty fields in Patch requests.
  8842. ForceSendFields []string `json:"-"`
  8843. // NullFields is a list of field names (e.g. "Code") to include in API
  8844. // requests with the JSON null value. By default, fields with empty
  8845. // values are omitted from API requests. However, any field with an
  8846. // empty value appearing in NullFields will be sent to the server as
  8847. // null. It is an error if a field in this list has a non-empty value.
  8848. // This may be used to include null fields in Patch requests.
  8849. NullFields []string `json:"-"`
  8850. }
  8851. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  8852. type NoMethod InstanceGroupsListInstancesWarning
  8853. raw := NoMethod(*s)
  8854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8855. }
  8856. type InstanceGroupsListInstancesWarningData struct {
  8857. // Key: [Output Only] A key that provides more detail on the warning
  8858. // being returned. For example, for warnings where there are no results
  8859. // in a list request for a particular zone, this key might be scope and
  8860. // the key value might be the zone name. Other examples might be a key
  8861. // indicating a deprecated resource and a suggested replacement, or a
  8862. // warning about invalid network settings (for example, if an instance
  8863. // attempts to perform IP forwarding but is not enabled for IP
  8864. // forwarding).
  8865. Key string `json:"key,omitempty"`
  8866. // Value: [Output Only] A warning data value corresponding to the key.
  8867. Value string `json:"value,omitempty"`
  8868. // ForceSendFields is a list of field names (e.g. "Key") to
  8869. // unconditionally include in API requests. By default, fields with
  8870. // empty values are omitted from API requests. However, any non-pointer,
  8871. // non-interface field appearing in ForceSendFields will be sent to the
  8872. // server regardless of whether the field is empty or not. This may be
  8873. // used to include empty fields in Patch requests.
  8874. ForceSendFields []string `json:"-"`
  8875. // NullFields is a list of field names (e.g. "Key") to include in API
  8876. // requests with the JSON null value. By default, fields with empty
  8877. // values are omitted from API requests. However, any field with an
  8878. // empty value appearing in NullFields will be sent to the server as
  8879. // null. It is an error if a field in this list has a non-empty value.
  8880. // This may be used to include null fields in Patch requests.
  8881. NullFields []string `json:"-"`
  8882. }
  8883. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  8884. type NoMethod InstanceGroupsListInstancesWarningData
  8885. raw := NoMethod(*s)
  8886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8887. }
  8888. type InstanceGroupsListInstancesRequest struct {
  8889. // InstanceState: A filter for the state of the instances in the
  8890. // instance group. Valid options are ALL or RUNNING. If you do not
  8891. // specify this parameter the list includes all instances regardless of
  8892. // their state.
  8893. //
  8894. // Possible values:
  8895. // "ALL"
  8896. // "RUNNING"
  8897. InstanceState string `json:"instanceState,omitempty"`
  8898. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  8899. // unconditionally include in API requests. By default, fields with
  8900. // empty values are omitted from API requests. However, any non-pointer,
  8901. // non-interface field appearing in ForceSendFields will be sent to the
  8902. // server regardless of whether the field is empty or not. This may be
  8903. // used to include empty fields in Patch requests.
  8904. ForceSendFields []string `json:"-"`
  8905. // NullFields is a list of field names (e.g. "InstanceState") to include
  8906. // in API requests with the JSON null value. By default, fields with
  8907. // empty values are omitted from API requests. However, any field with
  8908. // an empty value appearing in NullFields will be sent to the server as
  8909. // null. It is an error if a field in this list has a non-empty value.
  8910. // This may be used to include null fields in Patch requests.
  8911. NullFields []string `json:"-"`
  8912. }
  8913. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  8914. type NoMethod InstanceGroupsListInstancesRequest
  8915. raw := NoMethod(*s)
  8916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8917. }
  8918. type InstanceGroupsRemoveInstancesRequest struct {
  8919. // Instances: The list of instances to remove from the instance group.
  8920. Instances []*InstanceReference `json:"instances,omitempty"`
  8921. // ForceSendFields is a list of field names (e.g. "Instances") to
  8922. // unconditionally include in API requests. By default, fields with
  8923. // empty values are omitted from API requests. However, any non-pointer,
  8924. // non-interface field appearing in ForceSendFields will be sent to the
  8925. // server regardless of whether the field is empty or not. This may be
  8926. // used to include empty fields in Patch requests.
  8927. ForceSendFields []string `json:"-"`
  8928. // NullFields is a list of field names (e.g. "Instances") to include in
  8929. // API requests with the JSON null value. By default, fields with empty
  8930. // values are omitted from API requests. However, any field with an
  8931. // empty value appearing in NullFields will be sent to the server as
  8932. // null. It is an error if a field in this list has a non-empty value.
  8933. // This may be used to include null fields in Patch requests.
  8934. NullFields []string `json:"-"`
  8935. }
  8936. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  8937. type NoMethod InstanceGroupsRemoveInstancesRequest
  8938. raw := NoMethod(*s)
  8939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8940. }
  8941. type InstanceGroupsScopedList struct {
  8942. // InstanceGroups: [Output Only] The list of instance groups that are
  8943. // contained in this scope.
  8944. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  8945. // Warning: [Output Only] An informational warning that replaces the
  8946. // list of instance groups when the list is empty.
  8947. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  8948. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  8949. // unconditionally include in API requests. By default, fields with
  8950. // empty values are omitted from API requests. However, any non-pointer,
  8951. // non-interface field appearing in ForceSendFields will be sent to the
  8952. // server regardless of whether the field is empty or not. This may be
  8953. // used to include empty fields in Patch requests.
  8954. ForceSendFields []string `json:"-"`
  8955. // NullFields is a list of field names (e.g. "InstanceGroups") to
  8956. // include in API requests with the JSON null value. By default, fields
  8957. // with empty values are omitted from API requests. However, any field
  8958. // with an empty value appearing in NullFields will be sent to the
  8959. // server as null. It is an error if a field in this list has a
  8960. // non-empty value. This may be used to include null fields in Patch
  8961. // requests.
  8962. NullFields []string `json:"-"`
  8963. }
  8964. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  8965. type NoMethod InstanceGroupsScopedList
  8966. raw := NoMethod(*s)
  8967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8968. }
  8969. // InstanceGroupsScopedListWarning: [Output Only] An informational
  8970. // warning that replaces the list of instance groups when the list is
  8971. // empty.
  8972. type InstanceGroupsScopedListWarning struct {
  8973. // Code: [Output Only] A warning code, if applicable. For example,
  8974. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8975. // the response.
  8976. //
  8977. // Possible values:
  8978. // "CLEANUP_FAILED"
  8979. // "DEPRECATED_RESOURCE_USED"
  8980. // "DEPRECATED_TYPE_USED"
  8981. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8982. // "EXPERIMENTAL_TYPE_USED"
  8983. // "EXTERNAL_API_WARNING"
  8984. // "FIELD_VALUE_OVERRIDEN"
  8985. // "INJECTED_KERNELS_DEPRECATED"
  8986. // "MISSING_TYPE_DEPENDENCY"
  8987. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8988. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8989. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8990. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8991. // "NEXT_HOP_NOT_RUNNING"
  8992. // "NOT_CRITICAL_ERROR"
  8993. // "NO_RESULTS_ON_PAGE"
  8994. // "REQUIRED_TOS_AGREEMENT"
  8995. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8996. // "RESOURCE_NOT_DELETED"
  8997. // "SCHEMA_VALIDATION_IGNORED"
  8998. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8999. // "UNDECLARED_PROPERTIES"
  9000. // "UNREACHABLE"
  9001. Code string `json:"code,omitempty"`
  9002. // Data: [Output Only] Metadata about this warning in key: value format.
  9003. // For example:
  9004. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9005. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  9006. // Message: [Output Only] A human-readable description of the warning
  9007. // code.
  9008. Message string `json:"message,omitempty"`
  9009. // ForceSendFields is a list of field names (e.g. "Code") to
  9010. // unconditionally include in API requests. By default, fields with
  9011. // empty values are omitted from API requests. However, any non-pointer,
  9012. // non-interface field appearing in ForceSendFields will be sent to the
  9013. // server regardless of whether the field is empty or not. This may be
  9014. // used to include empty fields in Patch requests.
  9015. ForceSendFields []string `json:"-"`
  9016. // NullFields is a list of field names (e.g. "Code") to include in API
  9017. // requests with the JSON null value. By default, fields with empty
  9018. // values are omitted from API requests. However, any field with an
  9019. // empty value appearing in NullFields will be sent to the server as
  9020. // null. It is an error if a field in this list has a non-empty value.
  9021. // This may be used to include null fields in Patch requests.
  9022. NullFields []string `json:"-"`
  9023. }
  9024. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  9025. type NoMethod InstanceGroupsScopedListWarning
  9026. raw := NoMethod(*s)
  9027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9028. }
  9029. type InstanceGroupsScopedListWarningData struct {
  9030. // Key: [Output Only] A key that provides more detail on the warning
  9031. // being returned. For example, for warnings where there are no results
  9032. // in a list request for a particular zone, this key might be scope and
  9033. // the key value might be the zone name. Other examples might be a key
  9034. // indicating a deprecated resource and a suggested replacement, or a
  9035. // warning about invalid network settings (for example, if an instance
  9036. // attempts to perform IP forwarding but is not enabled for IP
  9037. // forwarding).
  9038. Key string `json:"key,omitempty"`
  9039. // Value: [Output Only] A warning data value corresponding to the key.
  9040. Value string `json:"value,omitempty"`
  9041. // ForceSendFields is a list of field names (e.g. "Key") to
  9042. // unconditionally include in API requests. By default, fields with
  9043. // empty values are omitted from API requests. However, any non-pointer,
  9044. // non-interface field appearing in ForceSendFields will be sent to the
  9045. // server regardless of whether the field is empty or not. This may be
  9046. // used to include empty fields in Patch requests.
  9047. ForceSendFields []string `json:"-"`
  9048. // NullFields is a list of field names (e.g. "Key") to include in API
  9049. // requests with the JSON null value. By default, fields with empty
  9050. // values are omitted from API requests. However, any field with an
  9051. // empty value appearing in NullFields will be sent to the server as
  9052. // null. It is an error if a field in this list has a non-empty value.
  9053. // This may be used to include null fields in Patch requests.
  9054. NullFields []string `json:"-"`
  9055. }
  9056. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  9057. type NoMethod InstanceGroupsScopedListWarningData
  9058. raw := NoMethod(*s)
  9059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9060. }
  9061. type InstanceGroupsSetNamedPortsRequest struct {
  9062. // Fingerprint: The fingerprint of the named ports information for this
  9063. // instance group. Use this optional property to prevent conflicts when
  9064. // multiple users change the named ports settings concurrently. Obtain
  9065. // the fingerprint with the instanceGroups.get method. Then, include the
  9066. // fingerprint in your request to ensure that you do not overwrite
  9067. // changes that were applied from another concurrent request.
  9068. Fingerprint string `json:"fingerprint,omitempty"`
  9069. // NamedPorts: The list of named ports to set for this instance group.
  9070. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  9071. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  9072. // unconditionally include in API requests. By default, fields with
  9073. // empty values are omitted from API requests. However, any non-pointer,
  9074. // non-interface field appearing in ForceSendFields will be sent to the
  9075. // server regardless of whether the field is empty or not. This may be
  9076. // used to include empty fields in Patch requests.
  9077. ForceSendFields []string `json:"-"`
  9078. // NullFields is a list of field names (e.g. "Fingerprint") to include
  9079. // in API requests with the JSON null value. By default, fields with
  9080. // empty values are omitted from API requests. However, any field with
  9081. // an empty value appearing in NullFields will be sent to the server as
  9082. // null. It is an error if a field in this list has a non-empty value.
  9083. // This may be used to include null fields in Patch requests.
  9084. NullFields []string `json:"-"`
  9085. }
  9086. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  9087. type NoMethod InstanceGroupsSetNamedPortsRequest
  9088. raw := NoMethod(*s)
  9089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9090. }
  9091. // InstanceList: Contains a list of instances.
  9092. type InstanceList struct {
  9093. // Id: [Output Only] Unique identifier for the resource; defined by the
  9094. // server.
  9095. Id string `json:"id,omitempty"`
  9096. // Items: A list of Instance resources.
  9097. Items []*Instance `json:"items,omitempty"`
  9098. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  9099. // lists of Instance resources.
  9100. Kind string `json:"kind,omitempty"`
  9101. // NextPageToken: [Output Only] This token allows you to get the next
  9102. // page of results for list requests. If the number of results is larger
  9103. // than maxResults, use the nextPageToken as a value for the query
  9104. // parameter pageToken in the next list request. Subsequent list
  9105. // requests will have their own nextPageToken to continue paging through
  9106. // the results.
  9107. NextPageToken string `json:"nextPageToken,omitempty"`
  9108. // SelfLink: [Output Only] Server-defined URL for this resource.
  9109. SelfLink string `json:"selfLink,omitempty"`
  9110. // Warning: [Output Only] Informational warning message.
  9111. Warning *InstanceListWarning `json:"warning,omitempty"`
  9112. // ServerResponse contains the HTTP response code and headers from the
  9113. // server.
  9114. googleapi.ServerResponse `json:"-"`
  9115. // ForceSendFields is a list of field names (e.g. "Id") to
  9116. // unconditionally include in API requests. By default, fields with
  9117. // empty values are omitted from API requests. However, any non-pointer,
  9118. // non-interface field appearing in ForceSendFields will be sent to the
  9119. // server regardless of whether the field is empty or not. This may be
  9120. // used to include empty fields in Patch requests.
  9121. ForceSendFields []string `json:"-"`
  9122. // NullFields is a list of field names (e.g. "Id") to include in API
  9123. // requests with the JSON null value. By default, fields with empty
  9124. // values are omitted from API requests. However, any field with an
  9125. // empty value appearing in NullFields will be sent to the server as
  9126. // null. It is an error if a field in this list has a non-empty value.
  9127. // This may be used to include null fields in Patch requests.
  9128. NullFields []string `json:"-"`
  9129. }
  9130. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  9131. type NoMethod InstanceList
  9132. raw := NoMethod(*s)
  9133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9134. }
  9135. // InstanceListWarning: [Output Only] Informational warning message.
  9136. type InstanceListWarning struct {
  9137. // Code: [Output Only] A warning code, if applicable. For example,
  9138. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9139. // the response.
  9140. //
  9141. // Possible values:
  9142. // "CLEANUP_FAILED"
  9143. // "DEPRECATED_RESOURCE_USED"
  9144. // "DEPRECATED_TYPE_USED"
  9145. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9146. // "EXPERIMENTAL_TYPE_USED"
  9147. // "EXTERNAL_API_WARNING"
  9148. // "FIELD_VALUE_OVERRIDEN"
  9149. // "INJECTED_KERNELS_DEPRECATED"
  9150. // "MISSING_TYPE_DEPENDENCY"
  9151. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9152. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9153. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9154. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9155. // "NEXT_HOP_NOT_RUNNING"
  9156. // "NOT_CRITICAL_ERROR"
  9157. // "NO_RESULTS_ON_PAGE"
  9158. // "REQUIRED_TOS_AGREEMENT"
  9159. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9160. // "RESOURCE_NOT_DELETED"
  9161. // "SCHEMA_VALIDATION_IGNORED"
  9162. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9163. // "UNDECLARED_PROPERTIES"
  9164. // "UNREACHABLE"
  9165. Code string `json:"code,omitempty"`
  9166. // Data: [Output Only] Metadata about this warning in key: value format.
  9167. // For example:
  9168. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9169. Data []*InstanceListWarningData `json:"data,omitempty"`
  9170. // Message: [Output Only] A human-readable description of the warning
  9171. // code.
  9172. Message string `json:"message,omitempty"`
  9173. // ForceSendFields is a list of field names (e.g. "Code") to
  9174. // unconditionally include in API requests. By default, fields with
  9175. // empty values are omitted from API requests. However, any non-pointer,
  9176. // non-interface field appearing in ForceSendFields will be sent to the
  9177. // server regardless of whether the field is empty or not. This may be
  9178. // used to include empty fields in Patch requests.
  9179. ForceSendFields []string `json:"-"`
  9180. // NullFields is a list of field names (e.g. "Code") to include in API
  9181. // requests with the JSON null value. By default, fields with empty
  9182. // values are omitted from API requests. However, any field with an
  9183. // empty value appearing in NullFields will be sent to the server as
  9184. // null. It is an error if a field in this list has a non-empty value.
  9185. // This may be used to include null fields in Patch requests.
  9186. NullFields []string `json:"-"`
  9187. }
  9188. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  9189. type NoMethod InstanceListWarning
  9190. raw := NoMethod(*s)
  9191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9192. }
  9193. type InstanceListWarningData struct {
  9194. // Key: [Output Only] A key that provides more detail on the warning
  9195. // being returned. For example, for warnings where there are no results
  9196. // in a list request for a particular zone, this key might be scope and
  9197. // the key value might be the zone name. Other examples might be a key
  9198. // indicating a deprecated resource and a suggested replacement, or a
  9199. // warning about invalid network settings (for example, if an instance
  9200. // attempts to perform IP forwarding but is not enabled for IP
  9201. // forwarding).
  9202. Key string `json:"key,omitempty"`
  9203. // Value: [Output Only] A warning data value corresponding to the key.
  9204. Value string `json:"value,omitempty"`
  9205. // ForceSendFields is a list of field names (e.g. "Key") to
  9206. // unconditionally include in API requests. By default, fields with
  9207. // empty values are omitted from API requests. However, any non-pointer,
  9208. // non-interface field appearing in ForceSendFields will be sent to the
  9209. // server regardless of whether the field is empty or not. This may be
  9210. // used to include empty fields in Patch requests.
  9211. ForceSendFields []string `json:"-"`
  9212. // NullFields is a list of field names (e.g. "Key") to include in API
  9213. // requests with the JSON null value. By default, fields with empty
  9214. // values are omitted from API requests. However, any field with an
  9215. // empty value appearing in NullFields will be sent to the server as
  9216. // null. It is an error if a field in this list has a non-empty value.
  9217. // This may be used to include null fields in Patch requests.
  9218. NullFields []string `json:"-"`
  9219. }
  9220. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  9221. type NoMethod InstanceListWarningData
  9222. raw := NoMethod(*s)
  9223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9224. }
  9225. // InstanceListReferrers: Contains a list of instance referrers.
  9226. type InstanceListReferrers struct {
  9227. // Id: [Output Only] Unique identifier for the resource; defined by the
  9228. // server.
  9229. Id string `json:"id,omitempty"`
  9230. // Items: A list of Reference resources.
  9231. Items []*Reference `json:"items,omitempty"`
  9232. // Kind: [Output Only] Type of resource. Always
  9233. // compute#instanceListReferrers for lists of Instance referrers.
  9234. Kind string `json:"kind,omitempty"`
  9235. // NextPageToken: [Output Only] This token allows you to get the next
  9236. // page of results for list requests. If the number of results is larger
  9237. // than maxResults, use the nextPageToken as a value for the query
  9238. // parameter pageToken in the next list request. Subsequent list
  9239. // requests will have their own nextPageToken to continue paging through
  9240. // the results.
  9241. NextPageToken string `json:"nextPageToken,omitempty"`
  9242. // SelfLink: [Output Only] Server-defined URL for this resource.
  9243. SelfLink string `json:"selfLink,omitempty"`
  9244. // Warning: [Output Only] Informational warning message.
  9245. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  9246. // ServerResponse contains the HTTP response code and headers from the
  9247. // server.
  9248. googleapi.ServerResponse `json:"-"`
  9249. // ForceSendFields is a list of field names (e.g. "Id") to
  9250. // unconditionally include in API requests. By default, fields with
  9251. // empty values are omitted from API requests. However, any non-pointer,
  9252. // non-interface field appearing in ForceSendFields will be sent to the
  9253. // server regardless of whether the field is empty or not. This may be
  9254. // used to include empty fields in Patch requests.
  9255. ForceSendFields []string `json:"-"`
  9256. // NullFields is a list of field names (e.g. "Id") to include in API
  9257. // requests with the JSON null value. By default, fields with empty
  9258. // values are omitted from API requests. However, any field with an
  9259. // empty value appearing in NullFields will be sent to the server as
  9260. // null. It is an error if a field in this list has a non-empty value.
  9261. // This may be used to include null fields in Patch requests.
  9262. NullFields []string `json:"-"`
  9263. }
  9264. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  9265. type NoMethod InstanceListReferrers
  9266. raw := NoMethod(*s)
  9267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9268. }
  9269. // InstanceListReferrersWarning: [Output Only] Informational warning
  9270. // message.
  9271. type InstanceListReferrersWarning struct {
  9272. // Code: [Output Only] A warning code, if applicable. For example,
  9273. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9274. // the response.
  9275. //
  9276. // Possible values:
  9277. // "CLEANUP_FAILED"
  9278. // "DEPRECATED_RESOURCE_USED"
  9279. // "DEPRECATED_TYPE_USED"
  9280. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9281. // "EXPERIMENTAL_TYPE_USED"
  9282. // "EXTERNAL_API_WARNING"
  9283. // "FIELD_VALUE_OVERRIDEN"
  9284. // "INJECTED_KERNELS_DEPRECATED"
  9285. // "MISSING_TYPE_DEPENDENCY"
  9286. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9287. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9288. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9289. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9290. // "NEXT_HOP_NOT_RUNNING"
  9291. // "NOT_CRITICAL_ERROR"
  9292. // "NO_RESULTS_ON_PAGE"
  9293. // "REQUIRED_TOS_AGREEMENT"
  9294. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9295. // "RESOURCE_NOT_DELETED"
  9296. // "SCHEMA_VALIDATION_IGNORED"
  9297. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9298. // "UNDECLARED_PROPERTIES"
  9299. // "UNREACHABLE"
  9300. Code string `json:"code,omitempty"`
  9301. // Data: [Output Only] Metadata about this warning in key: value format.
  9302. // For example:
  9303. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9304. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  9305. // Message: [Output Only] A human-readable description of the warning
  9306. // code.
  9307. Message string `json:"message,omitempty"`
  9308. // ForceSendFields is a list of field names (e.g. "Code") to
  9309. // unconditionally include in API requests. By default, fields with
  9310. // empty values are omitted from API requests. However, any non-pointer,
  9311. // non-interface field appearing in ForceSendFields will be sent to the
  9312. // server regardless of whether the field is empty or not. This may be
  9313. // used to include empty fields in Patch requests.
  9314. ForceSendFields []string `json:"-"`
  9315. // NullFields is a list of field names (e.g. "Code") to include in API
  9316. // requests with the JSON null value. By default, fields with empty
  9317. // values are omitted from API requests. However, any field with an
  9318. // empty value appearing in NullFields will be sent to the server as
  9319. // null. It is an error if a field in this list has a non-empty value.
  9320. // This may be used to include null fields in Patch requests.
  9321. NullFields []string `json:"-"`
  9322. }
  9323. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  9324. type NoMethod InstanceListReferrersWarning
  9325. raw := NoMethod(*s)
  9326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9327. }
  9328. type InstanceListReferrersWarningData struct {
  9329. // Key: [Output Only] A key that provides more detail on the warning
  9330. // being returned. For example, for warnings where there are no results
  9331. // in a list request for a particular zone, this key might be scope and
  9332. // the key value might be the zone name. Other examples might be a key
  9333. // indicating a deprecated resource and a suggested replacement, or a
  9334. // warning about invalid network settings (for example, if an instance
  9335. // attempts to perform IP forwarding but is not enabled for IP
  9336. // forwarding).
  9337. Key string `json:"key,omitempty"`
  9338. // Value: [Output Only] A warning data value corresponding to the key.
  9339. Value string `json:"value,omitempty"`
  9340. // ForceSendFields is a list of field names (e.g. "Key") to
  9341. // unconditionally include in API requests. By default, fields with
  9342. // empty values are omitted from API requests. However, any non-pointer,
  9343. // non-interface field appearing in ForceSendFields will be sent to the
  9344. // server regardless of whether the field is empty or not. This may be
  9345. // used to include empty fields in Patch requests.
  9346. ForceSendFields []string `json:"-"`
  9347. // NullFields is a list of field names (e.g. "Key") to include in API
  9348. // requests with the JSON null value. By default, fields with empty
  9349. // values are omitted from API requests. However, any field with an
  9350. // empty value appearing in NullFields will be sent to the server as
  9351. // null. It is an error if a field in this list has a non-empty value.
  9352. // This may be used to include null fields in Patch requests.
  9353. NullFields []string `json:"-"`
  9354. }
  9355. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  9356. type NoMethod InstanceListReferrersWarningData
  9357. raw := NoMethod(*s)
  9358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9359. }
  9360. type InstanceMoveRequest struct {
  9361. // DestinationZone: The URL of the destination zone to move the
  9362. // instance. This can be a full or partial URL. For example, the
  9363. // following are all valid URLs to a zone:
  9364. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  9365. //
  9366. // - projects/project/zones/zone
  9367. // - zones/zone
  9368. DestinationZone string `json:"destinationZone,omitempty"`
  9369. // TargetInstance: The URL of the target instance to move. This can be a
  9370. // full or partial URL. For example, the following are all valid URLs to
  9371. // an instance:
  9372. // -
  9373. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  9374. // - projects/project/zones/zone/instances/instance
  9375. // - zones/zone/instances/instance
  9376. TargetInstance string `json:"targetInstance,omitempty"`
  9377. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  9378. // unconditionally include in API requests. By default, fields with
  9379. // empty values are omitted from API requests. However, any non-pointer,
  9380. // non-interface field appearing in ForceSendFields will be sent to the
  9381. // server regardless of whether the field is empty or not. This may be
  9382. // used to include empty fields in Patch requests.
  9383. ForceSendFields []string `json:"-"`
  9384. // NullFields is a list of field names (e.g. "DestinationZone") to
  9385. // include in API requests with the JSON null value. By default, fields
  9386. // with empty values are omitted from API requests. However, any field
  9387. // with an empty value appearing in NullFields will be sent to the
  9388. // server as null. It is an error if a field in this list has a
  9389. // non-empty value. This may be used to include null fields in Patch
  9390. // requests.
  9391. NullFields []string `json:"-"`
  9392. }
  9393. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  9394. type NoMethod InstanceMoveRequest
  9395. raw := NoMethod(*s)
  9396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9397. }
  9398. type InstanceProperties struct {
  9399. // CanIpForward: Enables instances created based on this template to
  9400. // send packets with source IP addresses other than their own and
  9401. // receive packets with destination IP addresses other than their own.
  9402. // If these instances will be used as an IP gateway or it will be set as
  9403. // the next-hop in a Route resource, specify true. If unsure, leave this
  9404. // set to false. See the Enable IP forwarding documentation for more
  9405. // information.
  9406. CanIpForward bool `json:"canIpForward,omitempty"`
  9407. // Description: An optional text description for the instances that are
  9408. // created from this instance template.
  9409. Description string `json:"description,omitempty"`
  9410. // Disks: An array of disks that are associated with the instances that
  9411. // are created from this template.
  9412. Disks []*AttachedDisk `json:"disks,omitempty"`
  9413. // GuestAccelerators: A list of guest accelerator cards' type and count
  9414. // to use for instances created from the instance template.
  9415. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  9416. // Labels: Labels to apply to instances that are created from this
  9417. // template.
  9418. Labels map[string]string `json:"labels,omitempty"`
  9419. // MachineType: The machine type to use for instances that are created
  9420. // from this template.
  9421. MachineType string `json:"machineType,omitempty"`
  9422. // Metadata: The metadata key/value pairs to assign to instances that
  9423. // are created from this template. These pairs can consist of custom
  9424. // metadata or predefined keys. See Project and instance metadata for
  9425. // more information.
  9426. Metadata *Metadata `json:"metadata,omitempty"`
  9427. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  9428. // instance may be scheduled on the specified or newer cpu/platform.
  9429. // Applicable values are the friendly names of CPU platforms, such as
  9430. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  9431. // Bridge". For more information, read Specifying a Minimum CPU
  9432. // Platform.
  9433. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  9434. // NetworkInterfaces: An array of network access configurations for this
  9435. // interface.
  9436. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  9437. // Scheduling: Specifies the scheduling options for the instances that
  9438. // are created from this template.
  9439. Scheduling *Scheduling `json:"scheduling,omitempty"`
  9440. // ServiceAccounts: A list of service accounts with specified scopes.
  9441. // Access tokens for these service accounts are available to the
  9442. // instances that are created from this template. Use metadata queries
  9443. // to obtain the access tokens for these instances.
  9444. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  9445. // Tags: A list of tags to apply to the instances that are created from
  9446. // this template. The tags identify valid sources or targets for network
  9447. // firewalls. The setTags method can modify this list of tags. Each tag
  9448. // within the list must comply with RFC1035.
  9449. Tags *Tags `json:"tags,omitempty"`
  9450. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  9451. // unconditionally include in API requests. By default, fields with
  9452. // empty values are omitted from API requests. However, any non-pointer,
  9453. // non-interface field appearing in ForceSendFields will be sent to the
  9454. // server regardless of whether the field is empty or not. This may be
  9455. // used to include empty fields in Patch requests.
  9456. ForceSendFields []string `json:"-"`
  9457. // NullFields is a list of field names (e.g. "CanIpForward") to include
  9458. // in API requests with the JSON null value. By default, fields with
  9459. // empty values are omitted from API requests. However, any field with
  9460. // an empty value appearing in NullFields will be sent to the server as
  9461. // null. It is an error if a field in this list has a non-empty value.
  9462. // This may be used to include null fields in Patch requests.
  9463. NullFields []string `json:"-"`
  9464. }
  9465. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  9466. type NoMethod InstanceProperties
  9467. raw := NoMethod(*s)
  9468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9469. }
  9470. type InstanceReference struct {
  9471. // Instance: The URL for a specific instance.
  9472. Instance string `json:"instance,omitempty"`
  9473. // ForceSendFields is a list of field names (e.g. "Instance") to
  9474. // unconditionally include in API requests. By default, fields with
  9475. // empty values are omitted from API requests. However, any non-pointer,
  9476. // non-interface field appearing in ForceSendFields will be sent to the
  9477. // server regardless of whether the field is empty or not. This may be
  9478. // used to include empty fields in Patch requests.
  9479. ForceSendFields []string `json:"-"`
  9480. // NullFields is a list of field names (e.g. "Instance") to include in
  9481. // API requests with the JSON null value. By default, fields with empty
  9482. // values are omitted from API requests. However, any field with an
  9483. // empty value appearing in NullFields will be sent to the server as
  9484. // null. It is an error if a field in this list has a non-empty value.
  9485. // This may be used to include null fields in Patch requests.
  9486. NullFields []string `json:"-"`
  9487. }
  9488. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  9489. type NoMethod InstanceReference
  9490. raw := NoMethod(*s)
  9491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9492. }
  9493. // InstanceTemplate: An Instance Template resource. (== resource_for
  9494. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  9495. type InstanceTemplate struct {
  9496. // CreationTimestamp: [Output Only] The creation timestamp for this
  9497. // instance template in RFC3339 text format.
  9498. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9499. // Description: An optional description of this resource. Provide this
  9500. // property when you create the resource.
  9501. Description string `json:"description,omitempty"`
  9502. // Id: [Output Only] A unique identifier for this instance template. The
  9503. // server defines this identifier.
  9504. Id uint64 `json:"id,omitempty,string"`
  9505. // Kind: [Output Only] The resource type, which is always
  9506. // compute#instanceTemplate for instance templates.
  9507. Kind string `json:"kind,omitempty"`
  9508. // Name: Name of the resource; provided by the client when the resource
  9509. // is created. The name must be 1-63 characters long, and comply with
  9510. // RFC1035. Specifically, the name must be 1-63 characters long and
  9511. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9512. // the first character must be a lowercase letter, and all following
  9513. // characters must be a dash, lowercase letter, or digit, except the
  9514. // last character, which cannot be a dash.
  9515. Name string `json:"name,omitempty"`
  9516. // Properties: The instance properties for this instance template.
  9517. Properties *InstanceProperties `json:"properties,omitempty"`
  9518. // SelfLink: [Output Only] The URL for this instance template. The
  9519. // server defines this URL.
  9520. SelfLink string `json:"selfLink,omitempty"`
  9521. // SourceInstance: The source instance used to create the template. You
  9522. // can provide this as a partial or full URL to the resource. For
  9523. // example, the following are valid values:
  9524. // -
  9525. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  9526. // - projects/project/zones/zone/instances/instance
  9527. SourceInstance string `json:"sourceInstance,omitempty"`
  9528. // SourceInstanceParams: The source instance params to use to create
  9529. // this instance template.
  9530. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  9531. // ServerResponse contains the HTTP response code and headers from the
  9532. // server.
  9533. googleapi.ServerResponse `json:"-"`
  9534. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9535. // to unconditionally include in API requests. By default, fields with
  9536. // empty values are omitted from API requests. However, any non-pointer,
  9537. // non-interface field appearing in ForceSendFields will be sent to the
  9538. // server regardless of whether the field is empty or not. This may be
  9539. // used to include empty fields in Patch requests.
  9540. ForceSendFields []string `json:"-"`
  9541. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9542. // include in API requests with the JSON null value. By default, fields
  9543. // with empty values are omitted from API requests. However, any field
  9544. // with an empty value appearing in NullFields will be sent to the
  9545. // server as null. It is an error if a field in this list has a
  9546. // non-empty value. This may be used to include null fields in Patch
  9547. // requests.
  9548. NullFields []string `json:"-"`
  9549. }
  9550. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  9551. type NoMethod InstanceTemplate
  9552. raw := NoMethod(*s)
  9553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9554. }
  9555. // InstanceTemplateList: A list of instance templates.
  9556. type InstanceTemplateList struct {
  9557. // Id: [Output Only] Unique identifier for the resource; defined by the
  9558. // server.
  9559. Id string `json:"id,omitempty"`
  9560. // Items: A list of InstanceTemplate resources.
  9561. Items []*InstanceTemplate `json:"items,omitempty"`
  9562. // Kind: [Output Only] The resource type, which is always
  9563. // compute#instanceTemplatesListResponse for instance template lists.
  9564. Kind string `json:"kind,omitempty"`
  9565. // NextPageToken: [Output Only] This token allows you to get the next
  9566. // page of results for list requests. If the number of results is larger
  9567. // than maxResults, use the nextPageToken as a value for the query
  9568. // parameter pageToken in the next list request. Subsequent list
  9569. // requests will have their own nextPageToken to continue paging through
  9570. // the results.
  9571. NextPageToken string `json:"nextPageToken,omitempty"`
  9572. // SelfLink: [Output Only] Server-defined URL for this resource.
  9573. SelfLink string `json:"selfLink,omitempty"`
  9574. // Warning: [Output Only] Informational warning message.
  9575. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  9576. // ServerResponse contains the HTTP response code and headers from the
  9577. // server.
  9578. googleapi.ServerResponse `json:"-"`
  9579. // ForceSendFields is a list of field names (e.g. "Id") to
  9580. // unconditionally include in API requests. By default, fields with
  9581. // empty values are omitted from API requests. However, any non-pointer,
  9582. // non-interface field appearing in ForceSendFields will be sent to the
  9583. // server regardless of whether the field is empty or not. This may be
  9584. // used to include empty fields in Patch requests.
  9585. ForceSendFields []string `json:"-"`
  9586. // NullFields is a list of field names (e.g. "Id") to include in API
  9587. // requests with the JSON null value. By default, fields with empty
  9588. // values are omitted from API requests. However, any field with an
  9589. // empty value appearing in NullFields will be sent to the server as
  9590. // null. It is an error if a field in this list has a non-empty value.
  9591. // This may be used to include null fields in Patch requests.
  9592. NullFields []string `json:"-"`
  9593. }
  9594. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  9595. type NoMethod InstanceTemplateList
  9596. raw := NoMethod(*s)
  9597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9598. }
  9599. // InstanceTemplateListWarning: [Output Only] Informational warning
  9600. // message.
  9601. type InstanceTemplateListWarning struct {
  9602. // Code: [Output Only] A warning code, if applicable. For example,
  9603. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9604. // the response.
  9605. //
  9606. // Possible values:
  9607. // "CLEANUP_FAILED"
  9608. // "DEPRECATED_RESOURCE_USED"
  9609. // "DEPRECATED_TYPE_USED"
  9610. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9611. // "EXPERIMENTAL_TYPE_USED"
  9612. // "EXTERNAL_API_WARNING"
  9613. // "FIELD_VALUE_OVERRIDEN"
  9614. // "INJECTED_KERNELS_DEPRECATED"
  9615. // "MISSING_TYPE_DEPENDENCY"
  9616. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9617. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9618. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9619. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9620. // "NEXT_HOP_NOT_RUNNING"
  9621. // "NOT_CRITICAL_ERROR"
  9622. // "NO_RESULTS_ON_PAGE"
  9623. // "REQUIRED_TOS_AGREEMENT"
  9624. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9625. // "RESOURCE_NOT_DELETED"
  9626. // "SCHEMA_VALIDATION_IGNORED"
  9627. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9628. // "UNDECLARED_PROPERTIES"
  9629. // "UNREACHABLE"
  9630. Code string `json:"code,omitempty"`
  9631. // Data: [Output Only] Metadata about this warning in key: value format.
  9632. // For example:
  9633. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9634. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  9635. // Message: [Output Only] A human-readable description of the warning
  9636. // code.
  9637. Message string `json:"message,omitempty"`
  9638. // ForceSendFields is a list of field names (e.g. "Code") to
  9639. // unconditionally include in API requests. By default, fields with
  9640. // empty values are omitted from API requests. However, any non-pointer,
  9641. // non-interface field appearing in ForceSendFields will be sent to the
  9642. // server regardless of whether the field is empty or not. This may be
  9643. // used to include empty fields in Patch requests.
  9644. ForceSendFields []string `json:"-"`
  9645. // NullFields is a list of field names (e.g. "Code") to include in API
  9646. // requests with the JSON null value. By default, fields with empty
  9647. // values are omitted from API requests. However, any field with an
  9648. // empty value appearing in NullFields will be sent to the server as
  9649. // null. It is an error if a field in this list has a non-empty value.
  9650. // This may be used to include null fields in Patch requests.
  9651. NullFields []string `json:"-"`
  9652. }
  9653. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  9654. type NoMethod InstanceTemplateListWarning
  9655. raw := NoMethod(*s)
  9656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9657. }
  9658. type InstanceTemplateListWarningData struct {
  9659. // Key: [Output Only] A key that provides more detail on the warning
  9660. // being returned. For example, for warnings where there are no results
  9661. // in a list request for a particular zone, this key might be scope and
  9662. // the key value might be the zone name. Other examples might be a key
  9663. // indicating a deprecated resource and a suggested replacement, or a
  9664. // warning about invalid network settings (for example, if an instance
  9665. // attempts to perform IP forwarding but is not enabled for IP
  9666. // forwarding).
  9667. Key string `json:"key,omitempty"`
  9668. // Value: [Output Only] A warning data value corresponding to the key.
  9669. Value string `json:"value,omitempty"`
  9670. // ForceSendFields is a list of field names (e.g. "Key") to
  9671. // unconditionally include in API requests. By default, fields with
  9672. // empty values are omitted from API requests. However, any non-pointer,
  9673. // non-interface field appearing in ForceSendFields will be sent to the
  9674. // server regardless of whether the field is empty or not. This may be
  9675. // used to include empty fields in Patch requests.
  9676. ForceSendFields []string `json:"-"`
  9677. // NullFields is a list of field names (e.g. "Key") to include in API
  9678. // requests with the JSON null value. By default, fields with empty
  9679. // values are omitted from API requests. However, any field with an
  9680. // empty value appearing in NullFields will be sent to the server as
  9681. // null. It is an error if a field in this list has a non-empty value.
  9682. // This may be used to include null fields in Patch requests.
  9683. NullFields []string `json:"-"`
  9684. }
  9685. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  9686. type NoMethod InstanceTemplateListWarningData
  9687. raw := NoMethod(*s)
  9688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9689. }
  9690. type InstanceWithNamedPorts struct {
  9691. // Instance: [Output Only] The URL of the instance.
  9692. Instance string `json:"instance,omitempty"`
  9693. // NamedPorts: [Output Only] The named ports that belong to this
  9694. // instance group.
  9695. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  9696. // Status: [Output Only] The status of the instance.
  9697. //
  9698. // Possible values:
  9699. // "PROVISIONING"
  9700. // "RUNNING"
  9701. // "STAGING"
  9702. // "STOPPED"
  9703. // "STOPPING"
  9704. // "SUSPENDED"
  9705. // "SUSPENDING"
  9706. // "TERMINATED"
  9707. Status string `json:"status,omitempty"`
  9708. // ForceSendFields is a list of field names (e.g. "Instance") to
  9709. // unconditionally include in API requests. By default, fields with
  9710. // empty values are omitted from API requests. However, any non-pointer,
  9711. // non-interface field appearing in ForceSendFields will be sent to the
  9712. // server regardless of whether the field is empty or not. This may be
  9713. // used to include empty fields in Patch requests.
  9714. ForceSendFields []string `json:"-"`
  9715. // NullFields is a list of field names (e.g. "Instance") to include in
  9716. // API requests with the JSON null value. By default, fields with empty
  9717. // values are omitted from API requests. However, any field with an
  9718. // empty value appearing in NullFields will be sent to the server as
  9719. // null. It is an error if a field in this list has a non-empty value.
  9720. // This may be used to include null fields in Patch requests.
  9721. NullFields []string `json:"-"`
  9722. }
  9723. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  9724. type NoMethod InstanceWithNamedPorts
  9725. raw := NoMethod(*s)
  9726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9727. }
  9728. type InstancesScopedList struct {
  9729. // Instances: [Output Only] A list of instances contained in this scope.
  9730. Instances []*Instance `json:"instances,omitempty"`
  9731. // Warning: [Output Only] Informational warning which replaces the list
  9732. // of instances when the list is empty.
  9733. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  9734. // ForceSendFields is a list of field names (e.g. "Instances") to
  9735. // unconditionally include in API requests. By default, fields with
  9736. // empty values are omitted from API requests. However, any non-pointer,
  9737. // non-interface field appearing in ForceSendFields will be sent to the
  9738. // server regardless of whether the field is empty or not. This may be
  9739. // used to include empty fields in Patch requests.
  9740. ForceSendFields []string `json:"-"`
  9741. // NullFields is a list of field names (e.g. "Instances") to include in
  9742. // API requests with the JSON null value. By default, fields with empty
  9743. // values are omitted from API requests. However, any field with an
  9744. // empty value appearing in NullFields will be sent to the server as
  9745. // null. It is an error if a field in this list has a non-empty value.
  9746. // This may be used to include null fields in Patch requests.
  9747. NullFields []string `json:"-"`
  9748. }
  9749. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  9750. type NoMethod InstancesScopedList
  9751. raw := NoMethod(*s)
  9752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9753. }
  9754. // InstancesScopedListWarning: [Output Only] Informational warning which
  9755. // replaces the list of instances when the list is empty.
  9756. type InstancesScopedListWarning struct {
  9757. // Code: [Output Only] A warning code, if applicable. For example,
  9758. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9759. // the response.
  9760. //
  9761. // Possible values:
  9762. // "CLEANUP_FAILED"
  9763. // "DEPRECATED_RESOURCE_USED"
  9764. // "DEPRECATED_TYPE_USED"
  9765. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9766. // "EXPERIMENTAL_TYPE_USED"
  9767. // "EXTERNAL_API_WARNING"
  9768. // "FIELD_VALUE_OVERRIDEN"
  9769. // "INJECTED_KERNELS_DEPRECATED"
  9770. // "MISSING_TYPE_DEPENDENCY"
  9771. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9772. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9773. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9774. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9775. // "NEXT_HOP_NOT_RUNNING"
  9776. // "NOT_CRITICAL_ERROR"
  9777. // "NO_RESULTS_ON_PAGE"
  9778. // "REQUIRED_TOS_AGREEMENT"
  9779. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9780. // "RESOURCE_NOT_DELETED"
  9781. // "SCHEMA_VALIDATION_IGNORED"
  9782. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9783. // "UNDECLARED_PROPERTIES"
  9784. // "UNREACHABLE"
  9785. Code string `json:"code,omitempty"`
  9786. // Data: [Output Only] Metadata about this warning in key: value format.
  9787. // For example:
  9788. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9789. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  9790. // Message: [Output Only] A human-readable description of the warning
  9791. // code.
  9792. Message string `json:"message,omitempty"`
  9793. // ForceSendFields is a list of field names (e.g. "Code") to
  9794. // unconditionally include in API requests. By default, fields with
  9795. // empty values are omitted from API requests. However, any non-pointer,
  9796. // non-interface field appearing in ForceSendFields will be sent to the
  9797. // server regardless of whether the field is empty or not. This may be
  9798. // used to include empty fields in Patch requests.
  9799. ForceSendFields []string `json:"-"`
  9800. // NullFields is a list of field names (e.g. "Code") to include in API
  9801. // requests with the JSON null value. By default, fields with empty
  9802. // values are omitted from API requests. However, any field with an
  9803. // empty value appearing in NullFields will be sent to the server as
  9804. // null. It is an error if a field in this list has a non-empty value.
  9805. // This may be used to include null fields in Patch requests.
  9806. NullFields []string `json:"-"`
  9807. }
  9808. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  9809. type NoMethod InstancesScopedListWarning
  9810. raw := NoMethod(*s)
  9811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9812. }
  9813. type InstancesScopedListWarningData struct {
  9814. // Key: [Output Only] A key that provides more detail on the warning
  9815. // being returned. For example, for warnings where there are no results
  9816. // in a list request for a particular zone, this key might be scope and
  9817. // the key value might be the zone name. Other examples might be a key
  9818. // indicating a deprecated resource and a suggested replacement, or a
  9819. // warning about invalid network settings (for example, if an instance
  9820. // attempts to perform IP forwarding but is not enabled for IP
  9821. // forwarding).
  9822. Key string `json:"key,omitempty"`
  9823. // Value: [Output Only] A warning data value corresponding to the key.
  9824. Value string `json:"value,omitempty"`
  9825. // ForceSendFields is a list of field names (e.g. "Key") to
  9826. // unconditionally include in API requests. By default, fields with
  9827. // empty values are omitted from API requests. However, any non-pointer,
  9828. // non-interface field appearing in ForceSendFields will be sent to the
  9829. // server regardless of whether the field is empty or not. This may be
  9830. // used to include empty fields in Patch requests.
  9831. ForceSendFields []string `json:"-"`
  9832. // NullFields is a list of field names (e.g. "Key") to include in API
  9833. // requests with the JSON null value. By default, fields with empty
  9834. // values are omitted from API requests. However, any field with an
  9835. // empty value appearing in NullFields will be sent to the server as
  9836. // null. It is an error if a field in this list has a non-empty value.
  9837. // This may be used to include null fields in Patch requests.
  9838. NullFields []string `json:"-"`
  9839. }
  9840. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  9841. type NoMethod InstancesScopedListWarningData
  9842. raw := NoMethod(*s)
  9843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9844. }
  9845. type InstancesSetLabelsRequest struct {
  9846. // LabelFingerprint: Fingerprint of the previous set of labels for this
  9847. // resource, used to prevent conflicts. Provide the latest fingerprint
  9848. // value when making a request to add or change labels.
  9849. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  9850. Labels map[string]string `json:"labels,omitempty"`
  9851. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  9852. // unconditionally include in API requests. By default, fields with
  9853. // empty values are omitted from API requests. However, any non-pointer,
  9854. // non-interface field appearing in ForceSendFields will be sent to the
  9855. // server regardless of whether the field is empty or not. This may be
  9856. // used to include empty fields in Patch requests.
  9857. ForceSendFields []string `json:"-"`
  9858. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  9859. // include in API requests with the JSON null value. By default, fields
  9860. // with empty values are omitted from API requests. However, any field
  9861. // with an empty value appearing in NullFields will be sent to the
  9862. // server as null. It is an error if a field in this list has a
  9863. // non-empty value. This may be used to include null fields in Patch
  9864. // requests.
  9865. NullFields []string `json:"-"`
  9866. }
  9867. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  9868. type NoMethod InstancesSetLabelsRequest
  9869. raw := NoMethod(*s)
  9870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9871. }
  9872. type InstancesSetMachineResourcesRequest struct {
  9873. // GuestAccelerators: A list of the type and count of accelerator cards
  9874. // attached to the instance.
  9875. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  9876. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  9877. // to unconditionally include in API requests. By default, fields with
  9878. // empty values are omitted from API requests. However, any non-pointer,
  9879. // non-interface field appearing in ForceSendFields will be sent to the
  9880. // server regardless of whether the field is empty or not. This may be
  9881. // used to include empty fields in Patch requests.
  9882. ForceSendFields []string `json:"-"`
  9883. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  9884. // include in API requests with the JSON null value. By default, fields
  9885. // with empty values are omitted from API requests. However, any field
  9886. // with an empty value appearing in NullFields will be sent to the
  9887. // server as null. It is an error if a field in this list has a
  9888. // non-empty value. This may be used to include null fields in Patch
  9889. // requests.
  9890. NullFields []string `json:"-"`
  9891. }
  9892. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  9893. type NoMethod InstancesSetMachineResourcesRequest
  9894. raw := NoMethod(*s)
  9895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9896. }
  9897. type InstancesSetMachineTypeRequest struct {
  9898. // MachineType: Full or partial URL of the machine type resource. See
  9899. // Machine Types for a full list of machine types. For example:
  9900. // zones/us-central1-f/machineTypes/n1-standard-1
  9901. MachineType string `json:"machineType,omitempty"`
  9902. // ForceSendFields is a list of field names (e.g. "MachineType") to
  9903. // unconditionally include in API requests. By default, fields with
  9904. // empty values are omitted from API requests. However, any non-pointer,
  9905. // non-interface field appearing in ForceSendFields will be sent to the
  9906. // server regardless of whether the field is empty or not. This may be
  9907. // used to include empty fields in Patch requests.
  9908. ForceSendFields []string `json:"-"`
  9909. // NullFields is a list of field names (e.g. "MachineType") to include
  9910. // in API requests with the JSON null value. By default, fields with
  9911. // empty values are omitted from API requests. However, any field with
  9912. // an empty value appearing in NullFields will be sent to the server as
  9913. // null. It is an error if a field in this list has a non-empty value.
  9914. // This may be used to include null fields in Patch requests.
  9915. NullFields []string `json:"-"`
  9916. }
  9917. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  9918. type NoMethod InstancesSetMachineTypeRequest
  9919. raw := NoMethod(*s)
  9920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9921. }
  9922. type InstancesSetMinCpuPlatformRequest struct {
  9923. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  9924. // at.
  9925. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  9926. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  9927. // unconditionally include in API requests. By default, fields with
  9928. // empty values are omitted from API requests. However, any non-pointer,
  9929. // non-interface field appearing in ForceSendFields will be sent to the
  9930. // server regardless of whether the field is empty or not. This may be
  9931. // used to include empty fields in Patch requests.
  9932. ForceSendFields []string `json:"-"`
  9933. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  9934. // include in API requests with the JSON null value. By default, fields
  9935. // with empty values are omitted from API requests. However, any field
  9936. // with an empty value appearing in NullFields will be sent to the
  9937. // server as null. It is an error if a field in this list has a
  9938. // non-empty value. This may be used to include null fields in Patch
  9939. // requests.
  9940. NullFields []string `json:"-"`
  9941. }
  9942. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  9943. type NoMethod InstancesSetMinCpuPlatformRequest
  9944. raw := NoMethod(*s)
  9945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9946. }
  9947. type InstancesSetServiceAccountRequest struct {
  9948. // Email: Email address of the service account.
  9949. Email string `json:"email,omitempty"`
  9950. // Scopes: The list of scopes to be made available for this service
  9951. // account.
  9952. Scopes []string `json:"scopes,omitempty"`
  9953. // ForceSendFields is a list of field names (e.g. "Email") to
  9954. // unconditionally include in API requests. By default, fields with
  9955. // empty values are omitted from API requests. However, any non-pointer,
  9956. // non-interface field appearing in ForceSendFields will be sent to the
  9957. // server regardless of whether the field is empty or not. This may be
  9958. // used to include empty fields in Patch requests.
  9959. ForceSendFields []string `json:"-"`
  9960. // NullFields is a list of field names (e.g. "Email") to include in API
  9961. // requests with the JSON null value. By default, fields with empty
  9962. // values are omitted from API requests. However, any field with an
  9963. // empty value appearing in NullFields will be sent to the server as
  9964. // null. It is an error if a field in this list has a non-empty value.
  9965. // This may be used to include null fields in Patch requests.
  9966. NullFields []string `json:"-"`
  9967. }
  9968. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  9969. type NoMethod InstancesSetServiceAccountRequest
  9970. raw := NoMethod(*s)
  9971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9972. }
  9973. type InstancesStartWithEncryptionKeyRequest struct {
  9974. // Disks: Array of disks associated with this instance that are
  9975. // protected with a customer-supplied encryption key.
  9976. //
  9977. // In order to start the instance, the disk url and its corresponding
  9978. // key must be provided.
  9979. //
  9980. // If the disk is not protected with a customer-supplied encryption key
  9981. // it should not be specified.
  9982. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  9983. // ForceSendFields is a list of field names (e.g. "Disks") to
  9984. // unconditionally include in API requests. By default, fields with
  9985. // empty values are omitted from API requests. However, any non-pointer,
  9986. // non-interface field appearing in ForceSendFields will be sent to the
  9987. // server regardless of whether the field is empty or not. This may be
  9988. // used to include empty fields in Patch requests.
  9989. ForceSendFields []string `json:"-"`
  9990. // NullFields is a list of field names (e.g. "Disks") to include in API
  9991. // requests with the JSON null value. By default, fields with empty
  9992. // values are omitted from API requests. However, any field with an
  9993. // empty value appearing in NullFields will be sent to the server as
  9994. // null. It is an error if a field in this list has a non-empty value.
  9995. // This may be used to include null fields in Patch requests.
  9996. NullFields []string `json:"-"`
  9997. }
  9998. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  9999. type NoMethod InstancesStartWithEncryptionKeyRequest
  10000. raw := NoMethod(*s)
  10001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10002. }
  10003. // Interconnect: Represents an Interconnects resource. The Interconnects
  10004. // resource is a dedicated connection between Google's network and your
  10005. // on-premises network. For more information, see the Dedicated
  10006. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  10007. // beta.interconnects ==)
  10008. type Interconnect struct {
  10009. // AdminEnabled: Administrative status of the interconnect. When this is
  10010. // set to true, the Interconnect is functional and can carry traffic.
  10011. // When set to false, no packets can be carried over the interconnect
  10012. // and no BGP routes are exchanged over it. By default, the status is
  10013. // set to true.
  10014. AdminEnabled bool `json:"adminEnabled,omitempty"`
  10015. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  10016. // describe the individual circuits in this LAG.
  10017. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  10018. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10019. // format.
  10020. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10021. // CustomerName: Customer name, to put in the Letter of Authorization as
  10022. // the party authorized to request a crossconnect.
  10023. CustomerName string `json:"customerName,omitempty"`
  10024. // Description: An optional description of this resource. Provide this
  10025. // property when you create the resource.
  10026. Description string `json:"description,omitempty"`
  10027. // ExpectedOutages: [Output Only] A list of outages expected for this
  10028. // Interconnect.
  10029. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  10030. // GoogleIpAddress: [Output Only] IP address configured on the Google
  10031. // side of the Interconnect link. This can be used only for ping tests.
  10032. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  10033. // GoogleReferenceId: [Output Only] Google reference ID; to be used when
  10034. // raising support tickets with Google or otherwise to debug backend
  10035. // connectivity issues.
  10036. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  10037. // Id: [Output Only] The unique identifier for the resource. This
  10038. // identifier is defined by the server.
  10039. Id uint64 `json:"id,omitempty,string"`
  10040. // InterconnectAttachments: [Output Only] A list of the URLs of all
  10041. // InterconnectAttachments configured to use this Interconnect.
  10042. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  10043. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  10044. // been deprecated in favor of "DEDICATED"
  10045. //
  10046. // Possible values:
  10047. // "DEDICATED"
  10048. // "IT_PRIVATE"
  10049. // "PARTNER"
  10050. InterconnectType string `json:"interconnectType,omitempty"`
  10051. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  10052. // for interconnects.
  10053. Kind string `json:"kind,omitempty"`
  10054. // LinkType: Type of link requested. This field indicates speed of each
  10055. // of the links in the bundle, not the entire bundle. Only 10G per link
  10056. // is allowed for a dedicated interconnect. Options: Ethernet_10G_LR
  10057. //
  10058. // Possible values:
  10059. // "LINK_TYPE_ETHERNET_10G_LR"
  10060. LinkType string `json:"linkType,omitempty"`
  10061. // Location: URL of the InterconnectLocation object that represents
  10062. // where this connection is to be provisioned.
  10063. Location string `json:"location,omitempty"`
  10064. // Name: Name of the resource. Provided by the client when the resource
  10065. // is created. The name must be 1-63 characters long, and comply with
  10066. // RFC1035. Specifically, the name must be 1-63 characters long and
  10067. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10068. // the first character must be a lowercase letter, and all following
  10069. // characters must be a dash, lowercase letter, or digit, except the
  10070. // last character, which cannot be a dash.
  10071. Name string `json:"name,omitempty"`
  10072. // NocContactEmail: Email address to contact the customer NOC for
  10073. // operations and maintenance notifications regarding this Interconnect.
  10074. // If specified, this will be used for notifications in addition to all
  10075. // other forms described, such as Stackdriver logs alerting and Cloud
  10076. // Notifications.
  10077. NocContactEmail string `json:"nocContactEmail,omitempty"`
  10078. // OperationalStatus: [Output Only] The current status of whether or not
  10079. // this Interconnect is functional.
  10080. //
  10081. // Possible values:
  10082. // "OS_ACTIVE"
  10083. // "OS_UNPROVISIONED"
  10084. OperationalStatus string `json:"operationalStatus,omitempty"`
  10085. // PeerIpAddress: [Output Only] IP address configured on the customer
  10086. // side of the Interconnect link. The customer should configure this IP
  10087. // address during turnup when prompted by Google NOC. This can be used
  10088. // only for ping tests.
  10089. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  10090. // ProvisionedLinkCount: [Output Only] Number of links actually
  10091. // provisioned in this interconnect.
  10092. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  10093. // RequestedLinkCount: Target number of physical links in the link
  10094. // bundle, as requested by the customer.
  10095. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  10096. // SelfLink: [Output Only] Server-defined URL for the resource.
  10097. SelfLink string `json:"selfLink,omitempty"`
  10098. // State: [Output Only] The current state of whether or not this
  10099. // Interconnect is functional.
  10100. //
  10101. // Possible values:
  10102. // "ACTIVE"
  10103. // "UNPROVISIONED"
  10104. State string `json:"state,omitempty"`
  10105. // ServerResponse contains the HTTP response code and headers from the
  10106. // server.
  10107. googleapi.ServerResponse `json:"-"`
  10108. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  10109. // unconditionally include in API requests. By default, fields with
  10110. // empty values are omitted from API requests. However, any non-pointer,
  10111. // non-interface field appearing in ForceSendFields will be sent to the
  10112. // server regardless of whether the field is empty or not. This may be
  10113. // used to include empty fields in Patch requests.
  10114. ForceSendFields []string `json:"-"`
  10115. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  10116. // in API requests with the JSON null value. By default, fields with
  10117. // empty values are omitted from API requests. However, any field with
  10118. // an empty value appearing in NullFields will be sent to the server as
  10119. // null. It is an error if a field in this list has a non-empty value.
  10120. // This may be used to include null fields in Patch requests.
  10121. NullFields []string `json:"-"`
  10122. }
  10123. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  10124. type NoMethod Interconnect
  10125. raw := NoMethod(*s)
  10126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10127. }
  10128. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  10129. // attachment) resource. For more information, see Creating VLAN
  10130. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  10131. // resource_for v1.interconnectAttachments ==)
  10132. type InterconnectAttachment struct {
  10133. // AdminEnabled: Determines whether this Attachment will carry packets.
  10134. // Not present for PARTNER_PROVIDER.
  10135. AdminEnabled bool `json:"adminEnabled,omitempty"`
  10136. // Bandwidth: Provisioned bandwidth capacity for the
  10137. // interconnectAttachment. Can be set by the partner to update the
  10138. // customer's provisioned bandwidth. Output only for for PARTNER type,
  10139. // mutable for PARTNER_PROVIDER, not available for DEDICATED.
  10140. //
  10141. // Possible values:
  10142. // "BPS_100M"
  10143. // "BPS_10G"
  10144. // "BPS_1G"
  10145. // "BPS_200M"
  10146. // "BPS_2G"
  10147. // "BPS_300M"
  10148. // "BPS_400M"
  10149. // "BPS_500M"
  10150. // "BPS_50M"
  10151. // "BPS_5G"
  10152. Bandwidth string `json:"bandwidth,omitempty"`
  10153. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  10154. // restrict the allocation of cloudRouterIpAddress and
  10155. // customerRouterIpAddress for this attachment. All prefixes must be
  10156. // within link-local address space (169.254.0.0/16) and must be /29 or
  10157. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  10158. // from the supplied candidate prefix(es). The request will fail if all
  10159. // possible /29s are in use on Google?s edge. If not supplied, Google
  10160. // will randomly select an unused /29 from all of link-local space.
  10161. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  10162. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  10163. // be configured on Cloud Router Interface for this interconnect
  10164. // attachment.
  10165. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  10166. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10167. // format.
  10168. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10169. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  10170. // to be configured on the customer router subinterface for this
  10171. // interconnect attachment.
  10172. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  10173. // Description: An optional description of this resource.
  10174. Description string `json:"description,omitempty"`
  10175. // EdgeAvailabilityDomain: Desired availability domain for the
  10176. // attachment. Only available for type PARTNER, at creation time. For
  10177. // improved reliability, customers should configure a pair of
  10178. // attachments with one per availability domain. The selected
  10179. // availability domain will be provided to the Partner via the pairing
  10180. // key so that the provisioned circuit will lie in the specified domain.
  10181. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  10182. //
  10183. // Possible values:
  10184. // "AVAILABILITY_DOMAIN_1"
  10185. // "AVAILABILITY_DOMAIN_2"
  10186. // "AVAILABILITY_DOMAIN_ANY"
  10187. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  10188. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  10189. // raising support tickets with Google or otherwise to debug backend
  10190. // connectivity issues.
  10191. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  10192. // Id: [Output Only] The unique identifier for the resource. This
  10193. // identifier is defined by the server.
  10194. Id uint64 `json:"id,omitempty,string"`
  10195. // Interconnect: URL of the underlying Interconnect object that this
  10196. // attachment's traffic will traverse through.
  10197. Interconnect string `json:"interconnect,omitempty"`
  10198. // Kind: [Output Only] Type of the resource. Always
  10199. // compute#interconnectAttachment for interconnect attachments.
  10200. Kind string `json:"kind,omitempty"`
  10201. // Name: Name of the resource. Provided by the client when the resource
  10202. // is created. The name must be 1-63 characters long, and comply with
  10203. // RFC1035. Specifically, the name must be 1-63 characters long and
  10204. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10205. // the first character must be a lowercase letter, and all following
  10206. // characters must be a dash, lowercase letter, or digit, except the
  10207. // last character, which cannot be a dash.
  10208. Name string `json:"name,omitempty"`
  10209. // OperationalStatus: [Output Only] The current status of whether or not
  10210. // this interconnect attachment is functional.
  10211. //
  10212. // Possible values:
  10213. // "OS_ACTIVE"
  10214. // "OS_UNPROVISIONED"
  10215. OperationalStatus string `json:"operationalStatus,omitempty"`
  10216. // PairingKey: [Output only for type PARTNER. Input only for
  10217. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  10218. // of an PARTNER attachment used to initiate provisioning with a
  10219. // selected partner. Of the form "XXXXX/region/domain"
  10220. PairingKey string `json:"pairingKey,omitempty"`
  10221. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  10222. // by a layer 3 Partner if they configured BGP on behalf of the
  10223. // customer. Output only for PARTNER type, input only for
  10224. // PARTNER_PROVIDER, not available for DEDICATED.
  10225. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  10226. // PartnerMetadata: Informational metadata about Partner attachments
  10227. // from Partners to display to customers. Output only for for PARTNER
  10228. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  10229. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  10230. // PrivateInterconnectInfo: [Output Only] Information specific to an
  10231. // InterconnectAttachment. This property is populated if the
  10232. // interconnect that this is attached to is of type DEDICATED.
  10233. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  10234. // Region: [Output Only] URL of the region where the regional
  10235. // interconnect attachment resides. You must specify this field as part
  10236. // of the HTTP request URL. It is not settable as a field in the request
  10237. // body.
  10238. Region string `json:"region,omitempty"`
  10239. // Router: URL of the cloud router to be used for dynamic routing. This
  10240. // router must be in the same region as this InterconnectAttachment. The
  10241. // InterconnectAttachment will automatically connect the Interconnect to
  10242. // the network & region within which the Cloud Router is configured.
  10243. Router string `json:"router,omitempty"`
  10244. // SelfLink: [Output Only] Server-defined URL for the resource.
  10245. SelfLink string `json:"selfLink,omitempty"`
  10246. // State: [Output Only] The current state of this attachment's
  10247. // functionality.
  10248. //
  10249. // Possible values:
  10250. // "ACTIVE"
  10251. // "DEFUNCT"
  10252. // "PARTNER_REQUEST_RECEIVED"
  10253. // "PENDING_CUSTOMER"
  10254. // "PENDING_PARTNER"
  10255. // "STATE_UNSPECIFIED"
  10256. // "UNPROVISIONED"
  10257. State string `json:"state,omitempty"`
  10258. // Possible values:
  10259. // "DEDICATED"
  10260. // "PARTNER"
  10261. // "PARTNER_PROVIDER"
  10262. Type string `json:"type,omitempty"`
  10263. // VlanTag8021q: Available only for DEDICATED and PARTNER_PROVIDER.
  10264. // Desired VLAN tag for this attachment, in the range 2-4094. This field
  10265. // refers to 802.1q VLAN tag, also known as IEEE 802.1Q Only specified
  10266. // at creation time.
  10267. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  10268. // ServerResponse contains the HTTP response code and headers from the
  10269. // server.
  10270. googleapi.ServerResponse `json:"-"`
  10271. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  10272. // unconditionally include in API requests. By default, fields with
  10273. // empty values are omitted from API requests. However, any non-pointer,
  10274. // non-interface field appearing in ForceSendFields will be sent to the
  10275. // server regardless of whether the field is empty or not. This may be
  10276. // used to include empty fields in Patch requests.
  10277. ForceSendFields []string `json:"-"`
  10278. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  10279. // in API requests with the JSON null value. By default, fields with
  10280. // empty values are omitted from API requests. However, any field with
  10281. // an empty value appearing in NullFields will be sent to the server as
  10282. // null. It is an error if a field in this list has a non-empty value.
  10283. // This may be used to include null fields in Patch requests.
  10284. NullFields []string `json:"-"`
  10285. }
  10286. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  10287. type NoMethod InterconnectAttachment
  10288. raw := NoMethod(*s)
  10289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10290. }
  10291. type InterconnectAttachmentAggregatedList struct {
  10292. // Id: [Output Only] Unique identifier for the resource; defined by the
  10293. // server.
  10294. Id string `json:"id,omitempty"`
  10295. // Items: A list of InterconnectAttachmentsScopedList resources.
  10296. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  10297. // Kind: [Output Only] Type of resource. Always
  10298. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  10299. // interconnect attachments.
  10300. Kind string `json:"kind,omitempty"`
  10301. // NextPageToken: [Output Only] This token allows you to get the next
  10302. // page of results for list requests. If the number of results is larger
  10303. // than maxResults, use the nextPageToken as a value for the query
  10304. // parameter pageToken in the next list request. Subsequent list
  10305. // requests will have their own nextPageToken to continue paging through
  10306. // the results.
  10307. NextPageToken string `json:"nextPageToken,omitempty"`
  10308. // SelfLink: [Output Only] Server-defined URL for this resource.
  10309. SelfLink string `json:"selfLink,omitempty"`
  10310. // Warning: [Output Only] Informational warning message.
  10311. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  10312. // ServerResponse contains the HTTP response code and headers from the
  10313. // server.
  10314. googleapi.ServerResponse `json:"-"`
  10315. // ForceSendFields is a list of field names (e.g. "Id") to
  10316. // unconditionally include in API requests. By default, fields with
  10317. // empty values are omitted from API requests. However, any non-pointer,
  10318. // non-interface field appearing in ForceSendFields will be sent to the
  10319. // server regardless of whether the field is empty or not. This may be
  10320. // used to include empty fields in Patch requests.
  10321. ForceSendFields []string `json:"-"`
  10322. // NullFields is a list of field names (e.g. "Id") to include in API
  10323. // requests with the JSON null value. By default, fields with empty
  10324. // values are omitted from API requests. However, any field with an
  10325. // empty value appearing in NullFields will be sent to the server as
  10326. // null. It is an error if a field in this list has a non-empty value.
  10327. // This may be used to include null fields in Patch requests.
  10328. NullFields []string `json:"-"`
  10329. }
  10330. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  10331. type NoMethod InterconnectAttachmentAggregatedList
  10332. raw := NoMethod(*s)
  10333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10334. }
  10335. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  10336. // Informational warning message.
  10337. type InterconnectAttachmentAggregatedListWarning struct {
  10338. // Code: [Output Only] A warning code, if applicable. For example,
  10339. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10340. // the response.
  10341. //
  10342. // Possible values:
  10343. // "CLEANUP_FAILED"
  10344. // "DEPRECATED_RESOURCE_USED"
  10345. // "DEPRECATED_TYPE_USED"
  10346. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10347. // "EXPERIMENTAL_TYPE_USED"
  10348. // "EXTERNAL_API_WARNING"
  10349. // "FIELD_VALUE_OVERRIDEN"
  10350. // "INJECTED_KERNELS_DEPRECATED"
  10351. // "MISSING_TYPE_DEPENDENCY"
  10352. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10353. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10354. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10355. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10356. // "NEXT_HOP_NOT_RUNNING"
  10357. // "NOT_CRITICAL_ERROR"
  10358. // "NO_RESULTS_ON_PAGE"
  10359. // "REQUIRED_TOS_AGREEMENT"
  10360. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10361. // "RESOURCE_NOT_DELETED"
  10362. // "SCHEMA_VALIDATION_IGNORED"
  10363. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10364. // "UNDECLARED_PROPERTIES"
  10365. // "UNREACHABLE"
  10366. Code string `json:"code,omitempty"`
  10367. // Data: [Output Only] Metadata about this warning in key: value format.
  10368. // For example:
  10369. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10370. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  10371. // Message: [Output Only] A human-readable description of the warning
  10372. // code.
  10373. Message string `json:"message,omitempty"`
  10374. // ForceSendFields is a list of field names (e.g. "Code") to
  10375. // unconditionally include in API requests. By default, fields with
  10376. // empty values are omitted from API requests. However, any non-pointer,
  10377. // non-interface field appearing in ForceSendFields will be sent to the
  10378. // server regardless of whether the field is empty or not. This may be
  10379. // used to include empty fields in Patch requests.
  10380. ForceSendFields []string `json:"-"`
  10381. // NullFields is a list of field names (e.g. "Code") to include in API
  10382. // requests with the JSON null value. By default, fields with empty
  10383. // values are omitted from API requests. However, any field with an
  10384. // empty value appearing in NullFields will be sent to the server as
  10385. // null. It is an error if a field in this list has a non-empty value.
  10386. // This may be used to include null fields in Patch requests.
  10387. NullFields []string `json:"-"`
  10388. }
  10389. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10390. type NoMethod InterconnectAttachmentAggregatedListWarning
  10391. raw := NoMethod(*s)
  10392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10393. }
  10394. type InterconnectAttachmentAggregatedListWarningData struct {
  10395. // Key: [Output Only] A key that provides more detail on the warning
  10396. // being returned. For example, for warnings where there are no results
  10397. // in a list request for a particular zone, this key might be scope and
  10398. // the key value might be the zone name. Other examples might be a key
  10399. // indicating a deprecated resource and a suggested replacement, or a
  10400. // warning about invalid network settings (for example, if an instance
  10401. // attempts to perform IP forwarding but is not enabled for IP
  10402. // forwarding).
  10403. Key string `json:"key,omitempty"`
  10404. // Value: [Output Only] A warning data value corresponding to the key.
  10405. Value string `json:"value,omitempty"`
  10406. // ForceSendFields is a list of field names (e.g. "Key") to
  10407. // unconditionally include in API requests. By default, fields with
  10408. // empty values are omitted from API requests. However, any non-pointer,
  10409. // non-interface field appearing in ForceSendFields will be sent to the
  10410. // server regardless of whether the field is empty or not. This may be
  10411. // used to include empty fields in Patch requests.
  10412. ForceSendFields []string `json:"-"`
  10413. // NullFields is a list of field names (e.g. "Key") to include in API
  10414. // requests with the JSON null value. By default, fields with empty
  10415. // values are omitted from API requests. However, any field with an
  10416. // empty value appearing in NullFields will be sent to the server as
  10417. // null. It is an error if a field in this list has a non-empty value.
  10418. // This may be used to include null fields in Patch requests.
  10419. NullFields []string `json:"-"`
  10420. }
  10421. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10422. type NoMethod InterconnectAttachmentAggregatedListWarningData
  10423. raw := NoMethod(*s)
  10424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10425. }
  10426. // InterconnectAttachmentList: Response to the list request, and
  10427. // contains a list of interconnect attachments.
  10428. type InterconnectAttachmentList struct {
  10429. // Id: [Output Only] Unique identifier for the resource; defined by the
  10430. // server.
  10431. Id string `json:"id,omitempty"`
  10432. // Items: A list of InterconnectAttachment resources.
  10433. Items []*InterconnectAttachment `json:"items,omitempty"`
  10434. // Kind: [Output Only] Type of resource. Always
  10435. // compute#interconnectAttachmentList for lists of interconnect
  10436. // attachments.
  10437. Kind string `json:"kind,omitempty"`
  10438. // NextPageToken: [Output Only] This token allows you to get the next
  10439. // page of results for list requests. If the number of results is larger
  10440. // than maxResults, use the nextPageToken as a value for the query
  10441. // parameter pageToken in the next list request. Subsequent list
  10442. // requests will have their own nextPageToken to continue paging through
  10443. // the results.
  10444. NextPageToken string `json:"nextPageToken,omitempty"`
  10445. // SelfLink: [Output Only] Server-defined URL for this resource.
  10446. SelfLink string `json:"selfLink,omitempty"`
  10447. // Warning: [Output Only] Informational warning message.
  10448. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  10449. // ServerResponse contains the HTTP response code and headers from the
  10450. // server.
  10451. googleapi.ServerResponse `json:"-"`
  10452. // ForceSendFields is a list of field names (e.g. "Id") to
  10453. // unconditionally include in API requests. By default, fields with
  10454. // empty values are omitted from API requests. However, any non-pointer,
  10455. // non-interface field appearing in ForceSendFields will be sent to the
  10456. // server regardless of whether the field is empty or not. This may be
  10457. // used to include empty fields in Patch requests.
  10458. ForceSendFields []string `json:"-"`
  10459. // NullFields is a list of field names (e.g. "Id") to include in API
  10460. // requests with the JSON null value. By default, fields with empty
  10461. // values are omitted from API requests. However, any field with an
  10462. // empty value appearing in NullFields will be sent to the server as
  10463. // null. It is an error if a field in this list has a non-empty value.
  10464. // This may be used to include null fields in Patch requests.
  10465. NullFields []string `json:"-"`
  10466. }
  10467. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  10468. type NoMethod InterconnectAttachmentList
  10469. raw := NoMethod(*s)
  10470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10471. }
  10472. // InterconnectAttachmentListWarning: [Output Only] Informational
  10473. // warning message.
  10474. type InterconnectAttachmentListWarning struct {
  10475. // Code: [Output Only] A warning code, if applicable. For example,
  10476. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10477. // the response.
  10478. //
  10479. // Possible values:
  10480. // "CLEANUP_FAILED"
  10481. // "DEPRECATED_RESOURCE_USED"
  10482. // "DEPRECATED_TYPE_USED"
  10483. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10484. // "EXPERIMENTAL_TYPE_USED"
  10485. // "EXTERNAL_API_WARNING"
  10486. // "FIELD_VALUE_OVERRIDEN"
  10487. // "INJECTED_KERNELS_DEPRECATED"
  10488. // "MISSING_TYPE_DEPENDENCY"
  10489. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10490. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10491. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10492. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10493. // "NEXT_HOP_NOT_RUNNING"
  10494. // "NOT_CRITICAL_ERROR"
  10495. // "NO_RESULTS_ON_PAGE"
  10496. // "REQUIRED_TOS_AGREEMENT"
  10497. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10498. // "RESOURCE_NOT_DELETED"
  10499. // "SCHEMA_VALIDATION_IGNORED"
  10500. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10501. // "UNDECLARED_PROPERTIES"
  10502. // "UNREACHABLE"
  10503. Code string `json:"code,omitempty"`
  10504. // Data: [Output Only] Metadata about this warning in key: value format.
  10505. // For example:
  10506. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10507. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  10508. // Message: [Output Only] A human-readable description of the warning
  10509. // code.
  10510. Message string `json:"message,omitempty"`
  10511. // ForceSendFields is a list of field names (e.g. "Code") to
  10512. // unconditionally include in API requests. By default, fields with
  10513. // empty values are omitted from API requests. However, any non-pointer,
  10514. // non-interface field appearing in ForceSendFields will be sent to the
  10515. // server regardless of whether the field is empty or not. This may be
  10516. // used to include empty fields in Patch requests.
  10517. ForceSendFields []string `json:"-"`
  10518. // NullFields is a list of field names (e.g. "Code") to include in API
  10519. // requests with the JSON null value. By default, fields with empty
  10520. // values are omitted from API requests. However, any field with an
  10521. // empty value appearing in NullFields will be sent to the server as
  10522. // null. It is an error if a field in this list has a non-empty value.
  10523. // This may be used to include null fields in Patch requests.
  10524. NullFields []string `json:"-"`
  10525. }
  10526. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  10527. type NoMethod InterconnectAttachmentListWarning
  10528. raw := NoMethod(*s)
  10529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10530. }
  10531. type InterconnectAttachmentListWarningData struct {
  10532. // Key: [Output Only] A key that provides more detail on the warning
  10533. // being returned. For example, for warnings where there are no results
  10534. // in a list request for a particular zone, this key might be scope and
  10535. // the key value might be the zone name. Other examples might be a key
  10536. // indicating a deprecated resource and a suggested replacement, or a
  10537. // warning about invalid network settings (for example, if an instance
  10538. // attempts to perform IP forwarding but is not enabled for IP
  10539. // forwarding).
  10540. Key string `json:"key,omitempty"`
  10541. // Value: [Output Only] A warning data value corresponding to the key.
  10542. Value string `json:"value,omitempty"`
  10543. // ForceSendFields is a list of field names (e.g. "Key") to
  10544. // unconditionally include in API requests. By default, fields with
  10545. // empty values are omitted from API requests. However, any non-pointer,
  10546. // non-interface field appearing in ForceSendFields will be sent to the
  10547. // server regardless of whether the field is empty or not. This may be
  10548. // used to include empty fields in Patch requests.
  10549. ForceSendFields []string `json:"-"`
  10550. // NullFields is a list of field names (e.g. "Key") to include in API
  10551. // requests with the JSON null value. By default, fields with empty
  10552. // values are omitted from API requests. However, any field with an
  10553. // empty value appearing in NullFields will be sent to the server as
  10554. // null. It is an error if a field in this list has a non-empty value.
  10555. // This may be used to include null fields in Patch requests.
  10556. NullFields []string `json:"-"`
  10557. }
  10558. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  10559. type NoMethod InterconnectAttachmentListWarningData
  10560. raw := NoMethod(*s)
  10561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10562. }
  10563. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  10564. // Partner attachments from Partners to display to customers. These
  10565. // fields are propagated from PARTNER_PROVIDER attachments to their
  10566. // corresponding PARTNER attachments.
  10567. type InterconnectAttachmentPartnerMetadata struct {
  10568. // InterconnectName: Plain text name of the Interconnect this attachment
  10569. // is connected to, as displayed in the Partner?s portal. For instance
  10570. // ?Chicago 1?. This value may be validated to match approved Partner
  10571. // values.
  10572. InterconnectName string `json:"interconnectName,omitempty"`
  10573. // PartnerName: Plain text name of the Partner providing this
  10574. // attachment. This value may be validated to match approved Partner
  10575. // values.
  10576. PartnerName string `json:"partnerName,omitempty"`
  10577. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  10578. // may customise this to be a deep-link to the specific resource on the
  10579. // Partner portal. This value may be validated to match approved Partner
  10580. // values.
  10581. PortalUrl string `json:"portalUrl,omitempty"`
  10582. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  10583. // unconditionally include in API requests. By default, fields with
  10584. // empty values are omitted from API requests. However, any non-pointer,
  10585. // non-interface field appearing in ForceSendFields will be sent to the
  10586. // server regardless of whether the field is empty or not. This may be
  10587. // used to include empty fields in Patch requests.
  10588. ForceSendFields []string `json:"-"`
  10589. // NullFields is a list of field names (e.g. "InterconnectName") to
  10590. // include in API requests with the JSON null value. By default, fields
  10591. // with empty values are omitted from API requests. However, any field
  10592. // with an empty value appearing in NullFields will be sent to the
  10593. // server as null. It is an error if a field in this list has a
  10594. // non-empty value. This may be used to include null fields in Patch
  10595. // requests.
  10596. NullFields []string `json:"-"`
  10597. }
  10598. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  10599. type NoMethod InterconnectAttachmentPartnerMetadata
  10600. raw := NoMethod(*s)
  10601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10602. }
  10603. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  10604. // attachment when this belongs to an interconnect of type DEDICATED.
  10605. type InterconnectAttachmentPrivateInfo struct {
  10606. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  10607. // traffic between Google and the customer, going to and from this
  10608. // network and region.
  10609. Tag8021q int64 `json:"tag8021q,omitempty"`
  10610. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  10611. // unconditionally include in API requests. By default, fields with
  10612. // empty values are omitted from API requests. However, any non-pointer,
  10613. // non-interface field appearing in ForceSendFields will be sent to the
  10614. // server regardless of whether the field is empty or not. This may be
  10615. // used to include empty fields in Patch requests.
  10616. ForceSendFields []string `json:"-"`
  10617. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  10618. // API requests with the JSON null value. By default, fields with empty
  10619. // values are omitted from API requests. However, any field with an
  10620. // empty value appearing in NullFields will be sent to the server as
  10621. // null. It is an error if a field in this list has a non-empty value.
  10622. // This may be used to include null fields in Patch requests.
  10623. NullFields []string `json:"-"`
  10624. }
  10625. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  10626. type NoMethod InterconnectAttachmentPrivateInfo
  10627. raw := NoMethod(*s)
  10628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10629. }
  10630. type InterconnectAttachmentsScopedList struct {
  10631. // InterconnectAttachments: A list of interconnect attachments contained
  10632. // in this scope.
  10633. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  10634. // Warning: Informational warning which replaces the list of addresses
  10635. // when the list is empty.
  10636. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  10637. // ForceSendFields is a list of field names (e.g.
  10638. // "InterconnectAttachments") to unconditionally include in API
  10639. // requests. By default, fields with empty values are omitted from API
  10640. // requests. However, any non-pointer, non-interface field appearing in
  10641. // ForceSendFields will be sent to the server regardless of whether the
  10642. // field is empty or not. This may be used to include empty fields in
  10643. // Patch requests.
  10644. ForceSendFields []string `json:"-"`
  10645. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  10646. // to include in API requests with the JSON null value. By default,
  10647. // fields with empty values are omitted from API requests. However, any
  10648. // field with an empty value appearing in NullFields will be sent to the
  10649. // server as null. It is an error if a field in this list has a
  10650. // non-empty value. This may be used to include null fields in Patch
  10651. // requests.
  10652. NullFields []string `json:"-"`
  10653. }
  10654. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  10655. type NoMethod InterconnectAttachmentsScopedList
  10656. raw := NoMethod(*s)
  10657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10658. }
  10659. // InterconnectAttachmentsScopedListWarning: Informational warning which
  10660. // replaces the list of addresses when the list is empty.
  10661. type InterconnectAttachmentsScopedListWarning struct {
  10662. // Code: [Output Only] A warning code, if applicable. For example,
  10663. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10664. // the response.
  10665. //
  10666. // Possible values:
  10667. // "CLEANUP_FAILED"
  10668. // "DEPRECATED_RESOURCE_USED"
  10669. // "DEPRECATED_TYPE_USED"
  10670. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10671. // "EXPERIMENTAL_TYPE_USED"
  10672. // "EXTERNAL_API_WARNING"
  10673. // "FIELD_VALUE_OVERRIDEN"
  10674. // "INJECTED_KERNELS_DEPRECATED"
  10675. // "MISSING_TYPE_DEPENDENCY"
  10676. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10677. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10678. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10679. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10680. // "NEXT_HOP_NOT_RUNNING"
  10681. // "NOT_CRITICAL_ERROR"
  10682. // "NO_RESULTS_ON_PAGE"
  10683. // "REQUIRED_TOS_AGREEMENT"
  10684. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10685. // "RESOURCE_NOT_DELETED"
  10686. // "SCHEMA_VALIDATION_IGNORED"
  10687. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10688. // "UNDECLARED_PROPERTIES"
  10689. // "UNREACHABLE"
  10690. Code string `json:"code,omitempty"`
  10691. // Data: [Output Only] Metadata about this warning in key: value format.
  10692. // For example:
  10693. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10694. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  10695. // Message: [Output Only] A human-readable description of the warning
  10696. // code.
  10697. Message string `json:"message,omitempty"`
  10698. // ForceSendFields is a list of field names (e.g. "Code") to
  10699. // unconditionally include in API requests. By default, fields with
  10700. // empty values are omitted from API requests. However, any non-pointer,
  10701. // non-interface field appearing in ForceSendFields will be sent to the
  10702. // server regardless of whether the field is empty or not. This may be
  10703. // used to include empty fields in Patch requests.
  10704. ForceSendFields []string `json:"-"`
  10705. // NullFields is a list of field names (e.g. "Code") to include in API
  10706. // requests with the JSON null value. By default, fields with empty
  10707. // values are omitted from API requests. However, any field with an
  10708. // empty value appearing in NullFields will be sent to the server as
  10709. // null. It is an error if a field in this list has a non-empty value.
  10710. // This may be used to include null fields in Patch requests.
  10711. NullFields []string `json:"-"`
  10712. }
  10713. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  10714. type NoMethod InterconnectAttachmentsScopedListWarning
  10715. raw := NoMethod(*s)
  10716. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10717. }
  10718. type InterconnectAttachmentsScopedListWarningData struct {
  10719. // Key: [Output Only] A key that provides more detail on the warning
  10720. // being returned. For example, for warnings where there are no results
  10721. // in a list request for a particular zone, this key might be scope and
  10722. // the key value might be the zone name. Other examples might be a key
  10723. // indicating a deprecated resource and a suggested replacement, or a
  10724. // warning about invalid network settings (for example, if an instance
  10725. // attempts to perform IP forwarding but is not enabled for IP
  10726. // forwarding).
  10727. Key string `json:"key,omitempty"`
  10728. // Value: [Output Only] A warning data value corresponding to the key.
  10729. Value string `json:"value,omitempty"`
  10730. // ForceSendFields is a list of field names (e.g. "Key") to
  10731. // unconditionally include in API requests. By default, fields with
  10732. // empty values are omitted from API requests. However, any non-pointer,
  10733. // non-interface field appearing in ForceSendFields will be sent to the
  10734. // server regardless of whether the field is empty or not. This may be
  10735. // used to include empty fields in Patch requests.
  10736. ForceSendFields []string `json:"-"`
  10737. // NullFields is a list of field names (e.g. "Key") to include in API
  10738. // requests with the JSON null value. By default, fields with empty
  10739. // values are omitted from API requests. However, any field with an
  10740. // empty value appearing in NullFields will be sent to the server as
  10741. // null. It is an error if a field in this list has a non-empty value.
  10742. // This may be used to include null fields in Patch requests.
  10743. NullFields []string `json:"-"`
  10744. }
  10745. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  10746. type NoMethod InterconnectAttachmentsScopedListWarningData
  10747. raw := NoMethod(*s)
  10748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10749. }
  10750. // InterconnectCircuitInfo: Describes a single physical circuit between
  10751. // the Customer and Google. CircuitInfo objects are created by Google,
  10752. // so all fields are output only. Next id: 4
  10753. type InterconnectCircuitInfo struct {
  10754. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  10755. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  10756. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  10757. // at circuit turn-up.
  10758. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  10759. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  10760. // circuit turn-up and provided by Google to the customer in the LOA.
  10761. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  10762. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  10763. // unconditionally include in API requests. By default, fields with
  10764. // empty values are omitted from API requests. However, any non-pointer,
  10765. // non-interface field appearing in ForceSendFields will be sent to the
  10766. // server regardless of whether the field is empty or not. This may be
  10767. // used to include empty fields in Patch requests.
  10768. ForceSendFields []string `json:"-"`
  10769. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  10770. // include in API requests with the JSON null value. By default, fields
  10771. // with empty values are omitted from API requests. However, any field
  10772. // with an empty value appearing in NullFields will be sent to the
  10773. // server as null. It is an error if a field in this list has a
  10774. // non-empty value. This may be used to include null fields in Patch
  10775. // requests.
  10776. NullFields []string `json:"-"`
  10777. }
  10778. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  10779. type NoMethod InterconnectCircuitInfo
  10780. raw := NoMethod(*s)
  10781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10782. }
  10783. // InterconnectList: Response to the list request, and contains a list
  10784. // of interconnects.
  10785. type InterconnectList struct {
  10786. // Id: [Output Only] Unique identifier for the resource; defined by the
  10787. // server.
  10788. Id string `json:"id,omitempty"`
  10789. // Items: A list of Interconnect resources.
  10790. Items []*Interconnect `json:"items,omitempty"`
  10791. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  10792. // for lists of interconnects.
  10793. Kind string `json:"kind,omitempty"`
  10794. // NextPageToken: [Output Only] This token allows you to get the next
  10795. // page of results for list requests. If the number of results is larger
  10796. // than maxResults, use the nextPageToken as a value for the query
  10797. // parameter pageToken in the next list request. Subsequent list
  10798. // requests will have their own nextPageToken to continue paging through
  10799. // the results.
  10800. NextPageToken string `json:"nextPageToken,omitempty"`
  10801. // SelfLink: [Output Only] Server-defined URL for this resource.
  10802. SelfLink string `json:"selfLink,omitempty"`
  10803. // Warning: [Output Only] Informational warning message.
  10804. Warning *InterconnectListWarning `json:"warning,omitempty"`
  10805. // ServerResponse contains the HTTP response code and headers from the
  10806. // server.
  10807. googleapi.ServerResponse `json:"-"`
  10808. // ForceSendFields is a list of field names (e.g. "Id") to
  10809. // unconditionally include in API requests. By default, fields with
  10810. // empty values are omitted from API requests. However, any non-pointer,
  10811. // non-interface field appearing in ForceSendFields will be sent to the
  10812. // server regardless of whether the field is empty or not. This may be
  10813. // used to include empty fields in Patch requests.
  10814. ForceSendFields []string `json:"-"`
  10815. // NullFields is a list of field names (e.g. "Id") to include in API
  10816. // requests with the JSON null value. By default, fields with empty
  10817. // values are omitted from API requests. However, any field with an
  10818. // empty value appearing in NullFields will be sent to the server as
  10819. // null. It is an error if a field in this list has a non-empty value.
  10820. // This may be used to include null fields in Patch requests.
  10821. NullFields []string `json:"-"`
  10822. }
  10823. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  10824. type NoMethod InterconnectList
  10825. raw := NoMethod(*s)
  10826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10827. }
  10828. // InterconnectListWarning: [Output Only] Informational warning message.
  10829. type InterconnectListWarning struct {
  10830. // Code: [Output Only] A warning code, if applicable. For example,
  10831. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10832. // the response.
  10833. //
  10834. // Possible values:
  10835. // "CLEANUP_FAILED"
  10836. // "DEPRECATED_RESOURCE_USED"
  10837. // "DEPRECATED_TYPE_USED"
  10838. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10839. // "EXPERIMENTAL_TYPE_USED"
  10840. // "EXTERNAL_API_WARNING"
  10841. // "FIELD_VALUE_OVERRIDEN"
  10842. // "INJECTED_KERNELS_DEPRECATED"
  10843. // "MISSING_TYPE_DEPENDENCY"
  10844. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10845. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10846. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10847. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10848. // "NEXT_HOP_NOT_RUNNING"
  10849. // "NOT_CRITICAL_ERROR"
  10850. // "NO_RESULTS_ON_PAGE"
  10851. // "REQUIRED_TOS_AGREEMENT"
  10852. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10853. // "RESOURCE_NOT_DELETED"
  10854. // "SCHEMA_VALIDATION_IGNORED"
  10855. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10856. // "UNDECLARED_PROPERTIES"
  10857. // "UNREACHABLE"
  10858. Code string `json:"code,omitempty"`
  10859. // Data: [Output Only] Metadata about this warning in key: value format.
  10860. // For example:
  10861. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10862. Data []*InterconnectListWarningData `json:"data,omitempty"`
  10863. // Message: [Output Only] A human-readable description of the warning
  10864. // code.
  10865. Message string `json:"message,omitempty"`
  10866. // ForceSendFields is a list of field names (e.g. "Code") to
  10867. // unconditionally include in API requests. By default, fields with
  10868. // empty values are omitted from API requests. However, any non-pointer,
  10869. // non-interface field appearing in ForceSendFields will be sent to the
  10870. // server regardless of whether the field is empty or not. This may be
  10871. // used to include empty fields in Patch requests.
  10872. ForceSendFields []string `json:"-"`
  10873. // NullFields is a list of field names (e.g. "Code") to include in API
  10874. // requests with the JSON null value. By default, fields with empty
  10875. // values are omitted from API requests. However, any field with an
  10876. // empty value appearing in NullFields will be sent to the server as
  10877. // null. It is an error if a field in this list has a non-empty value.
  10878. // This may be used to include null fields in Patch requests.
  10879. NullFields []string `json:"-"`
  10880. }
  10881. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  10882. type NoMethod InterconnectListWarning
  10883. raw := NoMethod(*s)
  10884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10885. }
  10886. type InterconnectListWarningData struct {
  10887. // Key: [Output Only] A key that provides more detail on the warning
  10888. // being returned. For example, for warnings where there are no results
  10889. // in a list request for a particular zone, this key might be scope and
  10890. // the key value might be the zone name. Other examples might be a key
  10891. // indicating a deprecated resource and a suggested replacement, or a
  10892. // warning about invalid network settings (for example, if an instance
  10893. // attempts to perform IP forwarding but is not enabled for IP
  10894. // forwarding).
  10895. Key string `json:"key,omitempty"`
  10896. // Value: [Output Only] A warning data value corresponding to the key.
  10897. Value string `json:"value,omitempty"`
  10898. // ForceSendFields is a list of field names (e.g. "Key") to
  10899. // unconditionally include in API requests. By default, fields with
  10900. // empty values are omitted from API requests. However, any non-pointer,
  10901. // non-interface field appearing in ForceSendFields will be sent to the
  10902. // server regardless of whether the field is empty or not. This may be
  10903. // used to include empty fields in Patch requests.
  10904. ForceSendFields []string `json:"-"`
  10905. // NullFields is a list of field names (e.g. "Key") to include in API
  10906. // requests with the JSON null value. By default, fields with empty
  10907. // values are omitted from API requests. However, any field with an
  10908. // empty value appearing in NullFields will be sent to the server as
  10909. // null. It is an error if a field in this list has a non-empty value.
  10910. // This may be used to include null fields in Patch requests.
  10911. NullFields []string `json:"-"`
  10912. }
  10913. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  10914. type NoMethod InterconnectListWarningData
  10915. raw := NoMethod(*s)
  10916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10917. }
  10918. // InterconnectLocation: Represents an InterconnectLocations resource.
  10919. // The InterconnectLocations resource describes the locations where you
  10920. // can connect to Google's networks. For more information, see
  10921. // Colocation Facilities.
  10922. type InterconnectLocation struct {
  10923. // Address: [Output Only] The postal address of the Point of Presence,
  10924. // each line in the address is separated by a newline character.
  10925. Address string `json:"address,omitempty"`
  10926. // AvailabilityZone: [Output Only] Availability zone for this location.
  10927. // Within a metropolitan area (metro), maintenance will not be
  10928. // simultaneously scheduled in more than one availability zone. Example:
  10929. // "zone1" or "zone2".
  10930. AvailabilityZone string `json:"availabilityZone,omitempty"`
  10931. // City: [Output Only] Metropolitan area designator that indicates which
  10932. // city an interconnect is located. For example: "Chicago, IL",
  10933. // "Amsterdam, Netherlands".
  10934. City string `json:"city,omitempty"`
  10935. // Continent: [Output Only] Continent for this location.
  10936. //
  10937. // Possible values:
  10938. // "AFRICA"
  10939. // "ASIA_PAC"
  10940. // "C_AFRICA"
  10941. // "C_ASIA_PAC"
  10942. // "C_EUROPE"
  10943. // "C_NORTH_AMERICA"
  10944. // "C_SOUTH_AMERICA"
  10945. // "EUROPE"
  10946. // "NORTH_AMERICA"
  10947. // "SOUTH_AMERICA"
  10948. Continent string `json:"continent,omitempty"`
  10949. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10950. // format.
  10951. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10952. // Description: [Output Only] An optional description of the resource.
  10953. Description string `json:"description,omitempty"`
  10954. // FacilityProvider: [Output Only] The name of the provider for this
  10955. // facility (e.g., EQUINIX).
  10956. FacilityProvider string `json:"facilityProvider,omitempty"`
  10957. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  10958. // Identifier for this facility (e.g., Ashburn-DC1).
  10959. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  10960. // Id: [Output Only] The unique identifier for the resource. This
  10961. // identifier is defined by the server.
  10962. Id uint64 `json:"id,omitempty,string"`
  10963. // Kind: [Output Only] Type of the resource. Always
  10964. // compute#interconnectLocation for interconnect locations.
  10965. Kind string `json:"kind,omitempty"`
  10966. // Name: [Output Only] Name of the resource.
  10967. Name string `json:"name,omitempty"`
  10968. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  10969. // facility (corresponding with a netfac type in peeringdb).
  10970. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  10971. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  10972. // objects, that describe parameters pertaining to the relation between
  10973. // this InterconnectLocation and various Google Cloud regions.
  10974. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  10975. // SelfLink: [Output Only] Server-defined URL for the resource.
  10976. SelfLink string `json:"selfLink,omitempty"`
  10977. // ServerResponse contains the HTTP response code and headers from the
  10978. // server.
  10979. googleapi.ServerResponse `json:"-"`
  10980. // ForceSendFields is a list of field names (e.g. "Address") to
  10981. // unconditionally include in API requests. By default, fields with
  10982. // empty values are omitted from API requests. However, any non-pointer,
  10983. // non-interface field appearing in ForceSendFields will be sent to the
  10984. // server regardless of whether the field is empty or not. This may be
  10985. // used to include empty fields in Patch requests.
  10986. ForceSendFields []string `json:"-"`
  10987. // NullFields is a list of field names (e.g. "Address") to include in
  10988. // API requests with the JSON null value. By default, fields with empty
  10989. // values are omitted from API requests. However, any field with an
  10990. // empty value appearing in NullFields will be sent to the server as
  10991. // null. It is an error if a field in this list has a non-empty value.
  10992. // This may be used to include null fields in Patch requests.
  10993. NullFields []string `json:"-"`
  10994. }
  10995. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  10996. type NoMethod InterconnectLocation
  10997. raw := NoMethod(*s)
  10998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10999. }
  11000. // InterconnectLocationList: Response to the list request, and contains
  11001. // a list of interconnect locations.
  11002. type InterconnectLocationList struct {
  11003. // Id: [Output Only] Unique identifier for the resource; defined by the
  11004. // server.
  11005. Id string `json:"id,omitempty"`
  11006. // Items: A list of InterconnectLocation resources.
  11007. Items []*InterconnectLocation `json:"items,omitempty"`
  11008. // Kind: [Output Only] Type of resource. Always
  11009. // compute#interconnectLocationList for lists of interconnect locations.
  11010. Kind string `json:"kind,omitempty"`
  11011. // NextPageToken: [Output Only] This token allows you to get the next
  11012. // page of results for list requests. If the number of results is larger
  11013. // than maxResults, use the nextPageToken as a value for the query
  11014. // parameter pageToken in the next list request. Subsequent list
  11015. // requests will have their own nextPageToken to continue paging through
  11016. // the results.
  11017. NextPageToken string `json:"nextPageToken,omitempty"`
  11018. // SelfLink: [Output Only] Server-defined URL for this resource.
  11019. SelfLink string `json:"selfLink,omitempty"`
  11020. // Warning: [Output Only] Informational warning message.
  11021. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  11022. // ServerResponse contains the HTTP response code and headers from the
  11023. // server.
  11024. googleapi.ServerResponse `json:"-"`
  11025. // ForceSendFields is a list of field names (e.g. "Id") to
  11026. // unconditionally include in API requests. By default, fields with
  11027. // empty values are omitted from API requests. However, any non-pointer,
  11028. // non-interface field appearing in ForceSendFields will be sent to the
  11029. // server regardless of whether the field is empty or not. This may be
  11030. // used to include empty fields in Patch requests.
  11031. ForceSendFields []string `json:"-"`
  11032. // NullFields is a list of field names (e.g. "Id") to include in API
  11033. // requests with the JSON null value. By default, fields with empty
  11034. // values are omitted from API requests. However, any field with an
  11035. // empty value appearing in NullFields will be sent to the server as
  11036. // null. It is an error if a field in this list has a non-empty value.
  11037. // This may be used to include null fields in Patch requests.
  11038. NullFields []string `json:"-"`
  11039. }
  11040. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  11041. type NoMethod InterconnectLocationList
  11042. raw := NoMethod(*s)
  11043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11044. }
  11045. // InterconnectLocationListWarning: [Output Only] Informational warning
  11046. // message.
  11047. type InterconnectLocationListWarning struct {
  11048. // Code: [Output Only] A warning code, if applicable. For example,
  11049. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11050. // the response.
  11051. //
  11052. // Possible values:
  11053. // "CLEANUP_FAILED"
  11054. // "DEPRECATED_RESOURCE_USED"
  11055. // "DEPRECATED_TYPE_USED"
  11056. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11057. // "EXPERIMENTAL_TYPE_USED"
  11058. // "EXTERNAL_API_WARNING"
  11059. // "FIELD_VALUE_OVERRIDEN"
  11060. // "INJECTED_KERNELS_DEPRECATED"
  11061. // "MISSING_TYPE_DEPENDENCY"
  11062. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11063. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11064. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11065. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11066. // "NEXT_HOP_NOT_RUNNING"
  11067. // "NOT_CRITICAL_ERROR"
  11068. // "NO_RESULTS_ON_PAGE"
  11069. // "REQUIRED_TOS_AGREEMENT"
  11070. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11071. // "RESOURCE_NOT_DELETED"
  11072. // "SCHEMA_VALIDATION_IGNORED"
  11073. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11074. // "UNDECLARED_PROPERTIES"
  11075. // "UNREACHABLE"
  11076. Code string `json:"code,omitempty"`
  11077. // Data: [Output Only] Metadata about this warning in key: value format.
  11078. // For example:
  11079. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11080. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  11081. // Message: [Output Only] A human-readable description of the warning
  11082. // code.
  11083. Message string `json:"message,omitempty"`
  11084. // ForceSendFields is a list of field names (e.g. "Code") to
  11085. // unconditionally include in API requests. By default, fields with
  11086. // empty values are omitted from API requests. However, any non-pointer,
  11087. // non-interface field appearing in ForceSendFields will be sent to the
  11088. // server regardless of whether the field is empty or not. This may be
  11089. // used to include empty fields in Patch requests.
  11090. ForceSendFields []string `json:"-"`
  11091. // NullFields is a list of field names (e.g. "Code") to include in API
  11092. // requests with the JSON null value. By default, fields with empty
  11093. // values are omitted from API requests. However, any field with an
  11094. // empty value appearing in NullFields will be sent to the server as
  11095. // null. It is an error if a field in this list has a non-empty value.
  11096. // This may be used to include null fields in Patch requests.
  11097. NullFields []string `json:"-"`
  11098. }
  11099. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  11100. type NoMethod InterconnectLocationListWarning
  11101. raw := NoMethod(*s)
  11102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11103. }
  11104. type InterconnectLocationListWarningData struct {
  11105. // Key: [Output Only] A key that provides more detail on the warning
  11106. // being returned. For example, for warnings where there are no results
  11107. // in a list request for a particular zone, this key might be scope and
  11108. // the key value might be the zone name. Other examples might be a key
  11109. // indicating a deprecated resource and a suggested replacement, or a
  11110. // warning about invalid network settings (for example, if an instance
  11111. // attempts to perform IP forwarding but is not enabled for IP
  11112. // forwarding).
  11113. Key string `json:"key,omitempty"`
  11114. // Value: [Output Only] A warning data value corresponding to the key.
  11115. Value string `json:"value,omitempty"`
  11116. // ForceSendFields is a list of field names (e.g. "Key") to
  11117. // unconditionally include in API requests. By default, fields with
  11118. // empty values are omitted from API requests. However, any non-pointer,
  11119. // non-interface field appearing in ForceSendFields will be sent to the
  11120. // server regardless of whether the field is empty or not. This may be
  11121. // used to include empty fields in Patch requests.
  11122. ForceSendFields []string `json:"-"`
  11123. // NullFields is a list of field names (e.g. "Key") to include in API
  11124. // requests with the JSON null value. By default, fields with empty
  11125. // values are omitted from API requests. However, any field with an
  11126. // empty value appearing in NullFields will be sent to the server as
  11127. // null. It is an error if a field in this list has a non-empty value.
  11128. // This may be used to include null fields in Patch requests.
  11129. NullFields []string `json:"-"`
  11130. }
  11131. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  11132. type NoMethod InterconnectLocationListWarningData
  11133. raw := NoMethod(*s)
  11134. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11135. }
  11136. // InterconnectLocationRegionInfo: Information about any potential
  11137. // InterconnectAttachments between an Interconnect at a specific
  11138. // InterconnectLocation, and a specific Cloud Region.
  11139. type InterconnectLocationRegionInfo struct {
  11140. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  11141. // InterconnectLocation to a VM in this region.
  11142. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  11143. // LocationPresence: Identifies the network presence of this location.
  11144. //
  11145. // Possible values:
  11146. // "GLOBAL"
  11147. // "LOCAL_REGION"
  11148. // "LP_GLOBAL"
  11149. // "LP_LOCAL_REGION"
  11150. LocationPresence string `json:"locationPresence,omitempty"`
  11151. // Region: URL for the region of this location.
  11152. Region string `json:"region,omitempty"`
  11153. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  11154. // unconditionally include in API requests. By default, fields with
  11155. // empty values are omitted from API requests. However, any non-pointer,
  11156. // non-interface field appearing in ForceSendFields will be sent to the
  11157. // server regardless of whether the field is empty or not. This may be
  11158. // used to include empty fields in Patch requests.
  11159. ForceSendFields []string `json:"-"`
  11160. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  11161. // in API requests with the JSON null value. By default, fields with
  11162. // empty values are omitted from API requests. However, any field with
  11163. // an empty value appearing in NullFields will be sent to the server as
  11164. // null. It is an error if a field in this list has a non-empty value.
  11165. // This may be used to include null fields in Patch requests.
  11166. NullFields []string `json:"-"`
  11167. }
  11168. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  11169. type NoMethod InterconnectLocationRegionInfo
  11170. raw := NoMethod(*s)
  11171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11172. }
  11173. // InterconnectOutageNotification: Description of a planned outage on
  11174. // this Interconnect. Next id: 9
  11175. type InterconnectOutageNotification struct {
  11176. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  11177. // Google-side circuit IDs that will be affected.
  11178. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  11179. // Description: A description about the purpose of the outage.
  11180. Description string `json:"description,omitempty"`
  11181. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  11182. // epoch).
  11183. EndTime int64 `json:"endTime,omitempty,string"`
  11184. // IssueType: Form this outage is expected to take. Note that the "IT_"
  11185. // versions of this enum have been deprecated in favor of the unprefixed
  11186. // values.
  11187. //
  11188. // Possible values:
  11189. // "IT_OUTAGE"
  11190. // "IT_PARTIAL_OUTAGE"
  11191. // "OUTAGE"
  11192. // "PARTIAL_OUTAGE"
  11193. IssueType string `json:"issueType,omitempty"`
  11194. // Name: Unique identifier for this outage notification.
  11195. Name string `json:"name,omitempty"`
  11196. // Source: The party that generated this notification. Note that
  11197. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  11198. //
  11199. // Possible values:
  11200. // "GOOGLE"
  11201. // "NSRC_GOOGLE"
  11202. Source string `json:"source,omitempty"`
  11203. // StartTime: Scheduled start time for the outage (milliseconds since
  11204. // Unix epoch).
  11205. StartTime int64 `json:"startTime,omitempty,string"`
  11206. // State: State of this notification. Note that the "NS_" versions of
  11207. // this enum have been deprecated in favor of the unprefixed values.
  11208. //
  11209. // Possible values:
  11210. // "ACTIVE"
  11211. // "CANCELLED"
  11212. // "NS_ACTIVE"
  11213. // "NS_CANCELED"
  11214. State string `json:"state,omitempty"`
  11215. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  11216. // unconditionally include in API requests. By default, fields with
  11217. // empty values are omitted from API requests. However, any non-pointer,
  11218. // non-interface field appearing in ForceSendFields will be sent to the
  11219. // server regardless of whether the field is empty or not. This may be
  11220. // used to include empty fields in Patch requests.
  11221. ForceSendFields []string `json:"-"`
  11222. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  11223. // include in API requests with the JSON null value. By default, fields
  11224. // with empty values are omitted from API requests. However, any field
  11225. // with an empty value appearing in NullFields will be sent to the
  11226. // server as null. It is an error if a field in this list has a
  11227. // non-empty value. This may be used to include null fields in Patch
  11228. // requests.
  11229. NullFields []string `json:"-"`
  11230. }
  11231. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  11232. type NoMethod InterconnectOutageNotification
  11233. raw := NoMethod(*s)
  11234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11235. }
  11236. // License: A license resource.
  11237. type License struct {
  11238. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  11239. // reflects whether a license charges a usage fee.
  11240. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  11241. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11242. // format.
  11243. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11244. // Description: An optional textual description of the resource;
  11245. // provided by the client when the resource is created.
  11246. Description string `json:"description,omitempty"`
  11247. // Id: [Output Only] The unique identifier for the resource. This
  11248. // identifier is defined by the server.
  11249. Id uint64 `json:"id,omitempty,string"`
  11250. // Kind: [Output Only] Type of resource. Always compute#license for
  11251. // licenses.
  11252. Kind string `json:"kind,omitempty"`
  11253. // LicenseCode: [Output Only] The unique code used to attach this
  11254. // license to images, snapshots, and disks.
  11255. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  11256. // Name: [Output Only] Name of the resource. The name is 1-63 characters
  11257. // long and complies with RFC1035.
  11258. Name string `json:"name,omitempty"`
  11259. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  11260. // SelfLink: [Output Only] Server-defined URL for the resource.
  11261. SelfLink string `json:"selfLink,omitempty"`
  11262. // Transferable: If false, licenses will not be copied from the source
  11263. // resource when creating an image from a disk, disk from snapshot, or
  11264. // snapshot from disk.
  11265. Transferable bool `json:"transferable,omitempty"`
  11266. // ServerResponse contains the HTTP response code and headers from the
  11267. // server.
  11268. googleapi.ServerResponse `json:"-"`
  11269. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  11270. // unconditionally include in API requests. By default, fields with
  11271. // empty values are omitted from API requests. However, any non-pointer,
  11272. // non-interface field appearing in ForceSendFields will be sent to the
  11273. // server regardless of whether the field is empty or not. This may be
  11274. // used to include empty fields in Patch requests.
  11275. ForceSendFields []string `json:"-"`
  11276. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  11277. // in API requests with the JSON null value. By default, fields with
  11278. // empty values are omitted from API requests. However, any field with
  11279. // an empty value appearing in NullFields will be sent to the server as
  11280. // null. It is an error if a field in this list has a non-empty value.
  11281. // This may be used to include null fields in Patch requests.
  11282. NullFields []string `json:"-"`
  11283. }
  11284. func (s *License) MarshalJSON() ([]byte, error) {
  11285. type NoMethod License
  11286. raw := NoMethod(*s)
  11287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11288. }
  11289. type LicenseCode struct {
  11290. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11291. // format.
  11292. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11293. // Description: [Output Only] Description of this License Code.
  11294. Description string `json:"description,omitempty"`
  11295. // Id: [Output Only] The unique identifier for the resource. This
  11296. // identifier is defined by the server.
  11297. Id uint64 `json:"id,omitempty,string"`
  11298. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  11299. // licenses.
  11300. Kind string `json:"kind,omitempty"`
  11301. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  11302. // with the same License Code.
  11303. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  11304. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  11305. // long and must be a valid 64 bit integer.
  11306. Name string `json:"name,omitempty"`
  11307. // SelfLink: [Output Only] Server-defined URL for the resource.
  11308. SelfLink string `json:"selfLink,omitempty"`
  11309. // State: [Output Only] Current state of this License Code.
  11310. //
  11311. // Possible values:
  11312. // "DISABLED"
  11313. // "ENABLED"
  11314. // "RESTRICTED"
  11315. // "STATE_UNSPECIFIED"
  11316. // "TERMINATED"
  11317. State string `json:"state,omitempty"`
  11318. // Transferable: [Output Only] If true, the license will remain attached
  11319. // when creating images or snapshots from disks. Otherwise, the license
  11320. // is not transferred.
  11321. Transferable bool `json:"transferable,omitempty"`
  11322. // ServerResponse contains the HTTP response code and headers from the
  11323. // server.
  11324. googleapi.ServerResponse `json:"-"`
  11325. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  11326. // to unconditionally include in API requests. By default, fields with
  11327. // empty values are omitted from API requests. However, any non-pointer,
  11328. // non-interface field appearing in ForceSendFields will be sent to the
  11329. // server regardless of whether the field is empty or not. This may be
  11330. // used to include empty fields in Patch requests.
  11331. ForceSendFields []string `json:"-"`
  11332. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  11333. // include in API requests with the JSON null value. By default, fields
  11334. // with empty values are omitted from API requests. However, any field
  11335. // with an empty value appearing in NullFields will be sent to the
  11336. // server as null. It is an error if a field in this list has a
  11337. // non-empty value. This may be used to include null fields in Patch
  11338. // requests.
  11339. NullFields []string `json:"-"`
  11340. }
  11341. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  11342. type NoMethod LicenseCode
  11343. raw := NoMethod(*s)
  11344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11345. }
  11346. type LicenseCodeLicenseAlias struct {
  11347. // Description: [Output Only] Description of this License Code.
  11348. Description string `json:"description,omitempty"`
  11349. // SelfLink: [Output Only] URL of license corresponding to this License
  11350. // Code.
  11351. SelfLink string `json:"selfLink,omitempty"`
  11352. // ForceSendFields is a list of field names (e.g. "Description") to
  11353. // unconditionally include in API requests. By default, fields with
  11354. // empty values are omitted from API requests. However, any non-pointer,
  11355. // non-interface field appearing in ForceSendFields will be sent to the
  11356. // server regardless of whether the field is empty or not. This may be
  11357. // used to include empty fields in Patch requests.
  11358. ForceSendFields []string `json:"-"`
  11359. // NullFields is a list of field names (e.g. "Description") to include
  11360. // in API requests with the JSON null value. By default, fields with
  11361. // empty values are omitted from API requests. However, any field with
  11362. // an empty value appearing in NullFields will be sent to the server as
  11363. // null. It is an error if a field in this list has a non-empty value.
  11364. // This may be used to include null fields in Patch requests.
  11365. NullFields []string `json:"-"`
  11366. }
  11367. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  11368. type NoMethod LicenseCodeLicenseAlias
  11369. raw := NoMethod(*s)
  11370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11371. }
  11372. type LicenseResourceRequirements struct {
  11373. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  11374. // Instance. Enforced at Instance creation and Instance start.
  11375. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  11376. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  11377. // Instance creation and Instance start.
  11378. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  11379. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  11380. // unconditionally include in API requests. By default, fields with
  11381. // empty values are omitted from API requests. However, any non-pointer,
  11382. // non-interface field appearing in ForceSendFields will be sent to the
  11383. // server regardless of whether the field is empty or not. This may be
  11384. // used to include empty fields in Patch requests.
  11385. ForceSendFields []string `json:"-"`
  11386. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  11387. // include in API requests with the JSON null value. By default, fields
  11388. // with empty values are omitted from API requests. However, any field
  11389. // with an empty value appearing in NullFields will be sent to the
  11390. // server as null. It is an error if a field in this list has a
  11391. // non-empty value. This may be used to include null fields in Patch
  11392. // requests.
  11393. NullFields []string `json:"-"`
  11394. }
  11395. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  11396. type NoMethod LicenseResourceRequirements
  11397. raw := NoMethod(*s)
  11398. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11399. }
  11400. type LicensesListResponse struct {
  11401. // Id: [Output Only] Unique identifier for the resource; defined by the
  11402. // server.
  11403. Id string `json:"id,omitempty"`
  11404. // Items: A list of License resources.
  11405. Items []*License `json:"items,omitempty"`
  11406. // NextPageToken: [Output Only] This token allows you to get the next
  11407. // page of results for list requests. If the number of results is larger
  11408. // than maxResults, use the nextPageToken as a value for the query
  11409. // parameter pageToken in the next list request. Subsequent list
  11410. // requests will have their own nextPageToken to continue paging through
  11411. // the results.
  11412. NextPageToken string `json:"nextPageToken,omitempty"`
  11413. // SelfLink: [Output Only] Server-defined URL for this resource.
  11414. SelfLink string `json:"selfLink,omitempty"`
  11415. // Warning: [Output Only] Informational warning message.
  11416. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  11417. // ServerResponse contains the HTTP response code and headers from the
  11418. // server.
  11419. googleapi.ServerResponse `json:"-"`
  11420. // ForceSendFields is a list of field names (e.g. "Id") to
  11421. // unconditionally include in API requests. By default, fields with
  11422. // empty values are omitted from API requests. However, any non-pointer,
  11423. // non-interface field appearing in ForceSendFields will be sent to the
  11424. // server regardless of whether the field is empty or not. This may be
  11425. // used to include empty fields in Patch requests.
  11426. ForceSendFields []string `json:"-"`
  11427. // NullFields is a list of field names (e.g. "Id") to include in API
  11428. // requests with the JSON null value. By default, fields with empty
  11429. // values are omitted from API requests. However, any field with an
  11430. // empty value appearing in NullFields will be sent to the server as
  11431. // null. It is an error if a field in this list has a non-empty value.
  11432. // This may be used to include null fields in Patch requests.
  11433. NullFields []string `json:"-"`
  11434. }
  11435. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  11436. type NoMethod LicensesListResponse
  11437. raw := NoMethod(*s)
  11438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11439. }
  11440. // LicensesListResponseWarning: [Output Only] Informational warning
  11441. // message.
  11442. type LicensesListResponseWarning struct {
  11443. // Code: [Output Only] A warning code, if applicable. For example,
  11444. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11445. // the response.
  11446. //
  11447. // Possible values:
  11448. // "CLEANUP_FAILED"
  11449. // "DEPRECATED_RESOURCE_USED"
  11450. // "DEPRECATED_TYPE_USED"
  11451. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11452. // "EXPERIMENTAL_TYPE_USED"
  11453. // "EXTERNAL_API_WARNING"
  11454. // "FIELD_VALUE_OVERRIDEN"
  11455. // "INJECTED_KERNELS_DEPRECATED"
  11456. // "MISSING_TYPE_DEPENDENCY"
  11457. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11458. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11459. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11460. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11461. // "NEXT_HOP_NOT_RUNNING"
  11462. // "NOT_CRITICAL_ERROR"
  11463. // "NO_RESULTS_ON_PAGE"
  11464. // "REQUIRED_TOS_AGREEMENT"
  11465. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11466. // "RESOURCE_NOT_DELETED"
  11467. // "SCHEMA_VALIDATION_IGNORED"
  11468. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11469. // "UNDECLARED_PROPERTIES"
  11470. // "UNREACHABLE"
  11471. Code string `json:"code,omitempty"`
  11472. // Data: [Output Only] Metadata about this warning in key: value format.
  11473. // For example:
  11474. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11475. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  11476. // Message: [Output Only] A human-readable description of the warning
  11477. // code.
  11478. Message string `json:"message,omitempty"`
  11479. // ForceSendFields is a list of field names (e.g. "Code") to
  11480. // unconditionally include in API requests. By default, fields with
  11481. // empty values are omitted from API requests. However, any non-pointer,
  11482. // non-interface field appearing in ForceSendFields will be sent to the
  11483. // server regardless of whether the field is empty or not. This may be
  11484. // used to include empty fields in Patch requests.
  11485. ForceSendFields []string `json:"-"`
  11486. // NullFields is a list of field names (e.g. "Code") to include in API
  11487. // requests with the JSON null value. By default, fields with empty
  11488. // values are omitted from API requests. However, any field with an
  11489. // empty value appearing in NullFields will be sent to the server as
  11490. // null. It is an error if a field in this list has a non-empty value.
  11491. // This may be used to include null fields in Patch requests.
  11492. NullFields []string `json:"-"`
  11493. }
  11494. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  11495. type NoMethod LicensesListResponseWarning
  11496. raw := NoMethod(*s)
  11497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11498. }
  11499. type LicensesListResponseWarningData struct {
  11500. // Key: [Output Only] A key that provides more detail on the warning
  11501. // being returned. For example, for warnings where there are no results
  11502. // in a list request for a particular zone, this key might be scope and
  11503. // the key value might be the zone name. Other examples might be a key
  11504. // indicating a deprecated resource and a suggested replacement, or a
  11505. // warning about invalid network settings (for example, if an instance
  11506. // attempts to perform IP forwarding but is not enabled for IP
  11507. // forwarding).
  11508. Key string `json:"key,omitempty"`
  11509. // Value: [Output Only] A warning data value corresponding to the key.
  11510. Value string `json:"value,omitempty"`
  11511. // ForceSendFields is a list of field names (e.g. "Key") to
  11512. // unconditionally include in API requests. By default, fields with
  11513. // empty values are omitted from API requests. However, any non-pointer,
  11514. // non-interface field appearing in ForceSendFields will be sent to the
  11515. // server regardless of whether the field is empty or not. This may be
  11516. // used to include empty fields in Patch requests.
  11517. ForceSendFields []string `json:"-"`
  11518. // NullFields is a list of field names (e.g. "Key") to include in API
  11519. // requests with the JSON null value. By default, fields with empty
  11520. // values are omitted from API requests. However, any field with an
  11521. // empty value appearing in NullFields will be sent to the server as
  11522. // null. It is an error if a field in this list has a non-empty value.
  11523. // This may be used to include null fields in Patch requests.
  11524. NullFields []string `json:"-"`
  11525. }
  11526. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  11527. type NoMethod LicensesListResponseWarningData
  11528. raw := NoMethod(*s)
  11529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11530. }
  11531. // MachineType: A Machine Type resource. (== resource_for
  11532. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  11533. type MachineType struct {
  11534. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11535. // format.
  11536. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11537. // Deprecated: [Output Only] The deprecation status associated with this
  11538. // machine type.
  11539. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  11540. // Description: [Output Only] An optional textual description of the
  11541. // resource.
  11542. Description string `json:"description,omitempty"`
  11543. // GuestCpus: [Output Only] The number of virtual CPUs that are
  11544. // available to the instance.
  11545. GuestCpus int64 `json:"guestCpus,omitempty"`
  11546. // Id: [Output Only] The unique identifier for the resource. This
  11547. // identifier is defined by the server.
  11548. Id uint64 `json:"id,omitempty,string"`
  11549. // ImageSpaceGb: [Deprecated] This property is deprecated and will never
  11550. // be populated with any relevant values.
  11551. ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"`
  11552. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  11553. // CPU. See Shared-core machine types for more information.
  11554. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  11555. // Kind: [Output Only] The type of the resource. Always
  11556. // compute#machineType for machine types.
  11557. Kind string `json:"kind,omitempty"`
  11558. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  11559. // allowed.
  11560. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  11561. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  11562. // disks size (GB) allowed.
  11563. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  11564. // MemoryMb: [Output Only] The amount of physical memory available to
  11565. // the instance, defined in MB.
  11566. MemoryMb int64 `json:"memoryMb,omitempty"`
  11567. // Name: [Output Only] Name of the resource.
  11568. Name string `json:"name,omitempty"`
  11569. // ScratchDisks: [Output Only] A list of extended scratch disks assigned
  11570. // to the instance.
  11571. ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"`
  11572. // SelfLink: [Output Only] Server-defined URL for the resource.
  11573. SelfLink string `json:"selfLink,omitempty"`
  11574. // Zone: [Output Only] The name of the zone where the machine type
  11575. // resides, such as us-central1-a.
  11576. Zone string `json:"zone,omitempty"`
  11577. // ServerResponse contains the HTTP response code and headers from the
  11578. // server.
  11579. googleapi.ServerResponse `json:"-"`
  11580. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  11581. // to unconditionally include in API requests. By default, fields with
  11582. // empty values are omitted from API requests. However, any non-pointer,
  11583. // non-interface field appearing in ForceSendFields will be sent to the
  11584. // server regardless of whether the field is empty or not. This may be
  11585. // used to include empty fields in Patch requests.
  11586. ForceSendFields []string `json:"-"`
  11587. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  11588. // include in API requests with the JSON null value. By default, fields
  11589. // with empty values are omitted from API requests. However, any field
  11590. // with an empty value appearing in NullFields will be sent to the
  11591. // server as null. It is an error if a field in this list has a
  11592. // non-empty value. This may be used to include null fields in Patch
  11593. // requests.
  11594. NullFields []string `json:"-"`
  11595. }
  11596. func (s *MachineType) MarshalJSON() ([]byte, error) {
  11597. type NoMethod MachineType
  11598. raw := NoMethod(*s)
  11599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11600. }
  11601. type MachineTypeScratchDisks struct {
  11602. // DiskGb: Size of the scratch disk, defined in GB.
  11603. DiskGb int64 `json:"diskGb,omitempty"`
  11604. // ForceSendFields is a list of field names (e.g. "DiskGb") to
  11605. // unconditionally include in API requests. By default, fields with
  11606. // empty values are omitted from API requests. However, any non-pointer,
  11607. // non-interface field appearing in ForceSendFields will be sent to the
  11608. // server regardless of whether the field is empty or not. This may be
  11609. // used to include empty fields in Patch requests.
  11610. ForceSendFields []string `json:"-"`
  11611. // NullFields is a list of field names (e.g. "DiskGb") to include in API
  11612. // requests with the JSON null value. By default, fields with empty
  11613. // values are omitted from API requests. However, any field with an
  11614. // empty value appearing in NullFields will be sent to the server as
  11615. // null. It is an error if a field in this list has a non-empty value.
  11616. // This may be used to include null fields in Patch requests.
  11617. NullFields []string `json:"-"`
  11618. }
  11619. func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) {
  11620. type NoMethod MachineTypeScratchDisks
  11621. raw := NoMethod(*s)
  11622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11623. }
  11624. type MachineTypeAggregatedList struct {
  11625. // Id: [Output Only] Unique identifier for the resource; defined by the
  11626. // server.
  11627. Id string `json:"id,omitempty"`
  11628. // Items: A list of MachineTypesScopedList resources.
  11629. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  11630. // Kind: [Output Only] Type of resource. Always
  11631. // compute#machineTypeAggregatedList for aggregated lists of machine
  11632. // types.
  11633. Kind string `json:"kind,omitempty"`
  11634. // NextPageToken: [Output Only] This token allows you to get the next
  11635. // page of results for list requests. If the number of results is larger
  11636. // than maxResults, use the nextPageToken as a value for the query
  11637. // parameter pageToken in the next list request. Subsequent list
  11638. // requests will have their own nextPageToken to continue paging through
  11639. // the results.
  11640. NextPageToken string `json:"nextPageToken,omitempty"`
  11641. // SelfLink: [Output Only] Server-defined URL for this resource.
  11642. SelfLink string `json:"selfLink,omitempty"`
  11643. // Warning: [Output Only] Informational warning message.
  11644. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  11645. // ServerResponse contains the HTTP response code and headers from the
  11646. // server.
  11647. googleapi.ServerResponse `json:"-"`
  11648. // ForceSendFields is a list of field names (e.g. "Id") to
  11649. // unconditionally include in API requests. By default, fields with
  11650. // empty values are omitted from API requests. However, any non-pointer,
  11651. // non-interface field appearing in ForceSendFields will be sent to the
  11652. // server regardless of whether the field is empty or not. This may be
  11653. // used to include empty fields in Patch requests.
  11654. ForceSendFields []string `json:"-"`
  11655. // NullFields is a list of field names (e.g. "Id") to include in API
  11656. // requests with the JSON null value. By default, fields with empty
  11657. // values are omitted from API requests. However, any field with an
  11658. // empty value appearing in NullFields will be sent to the server as
  11659. // null. It is an error if a field in this list has a non-empty value.
  11660. // This may be used to include null fields in Patch requests.
  11661. NullFields []string `json:"-"`
  11662. }
  11663. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  11664. type NoMethod MachineTypeAggregatedList
  11665. raw := NoMethod(*s)
  11666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11667. }
  11668. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  11669. // message.
  11670. type MachineTypeAggregatedListWarning struct {
  11671. // Code: [Output Only] A warning code, if applicable. For example,
  11672. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11673. // the response.
  11674. //
  11675. // Possible values:
  11676. // "CLEANUP_FAILED"
  11677. // "DEPRECATED_RESOURCE_USED"
  11678. // "DEPRECATED_TYPE_USED"
  11679. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11680. // "EXPERIMENTAL_TYPE_USED"
  11681. // "EXTERNAL_API_WARNING"
  11682. // "FIELD_VALUE_OVERRIDEN"
  11683. // "INJECTED_KERNELS_DEPRECATED"
  11684. // "MISSING_TYPE_DEPENDENCY"
  11685. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11686. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11687. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11688. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11689. // "NEXT_HOP_NOT_RUNNING"
  11690. // "NOT_CRITICAL_ERROR"
  11691. // "NO_RESULTS_ON_PAGE"
  11692. // "REQUIRED_TOS_AGREEMENT"
  11693. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11694. // "RESOURCE_NOT_DELETED"
  11695. // "SCHEMA_VALIDATION_IGNORED"
  11696. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11697. // "UNDECLARED_PROPERTIES"
  11698. // "UNREACHABLE"
  11699. Code string `json:"code,omitempty"`
  11700. // Data: [Output Only] Metadata about this warning in key: value format.
  11701. // For example:
  11702. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11703. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  11704. // Message: [Output Only] A human-readable description of the warning
  11705. // code.
  11706. Message string `json:"message,omitempty"`
  11707. // ForceSendFields is a list of field names (e.g. "Code") to
  11708. // unconditionally include in API requests. By default, fields with
  11709. // empty values are omitted from API requests. However, any non-pointer,
  11710. // non-interface field appearing in ForceSendFields will be sent to the
  11711. // server regardless of whether the field is empty or not. This may be
  11712. // used to include empty fields in Patch requests.
  11713. ForceSendFields []string `json:"-"`
  11714. // NullFields is a list of field names (e.g. "Code") to include in API
  11715. // requests with the JSON null value. By default, fields with empty
  11716. // values are omitted from API requests. However, any field with an
  11717. // empty value appearing in NullFields will be sent to the server as
  11718. // null. It is an error if a field in this list has a non-empty value.
  11719. // This may be used to include null fields in Patch requests.
  11720. NullFields []string `json:"-"`
  11721. }
  11722. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  11723. type NoMethod MachineTypeAggregatedListWarning
  11724. raw := NoMethod(*s)
  11725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11726. }
  11727. type MachineTypeAggregatedListWarningData struct {
  11728. // Key: [Output Only] A key that provides more detail on the warning
  11729. // being returned. For example, for warnings where there are no results
  11730. // in a list request for a particular zone, this key might be scope and
  11731. // the key value might be the zone name. Other examples might be a key
  11732. // indicating a deprecated resource and a suggested replacement, or a
  11733. // warning about invalid network settings (for example, if an instance
  11734. // attempts to perform IP forwarding but is not enabled for IP
  11735. // forwarding).
  11736. Key string `json:"key,omitempty"`
  11737. // Value: [Output Only] A warning data value corresponding to the key.
  11738. Value string `json:"value,omitempty"`
  11739. // ForceSendFields is a list of field names (e.g. "Key") to
  11740. // unconditionally include in API requests. By default, fields with
  11741. // empty values are omitted from API requests. However, any non-pointer,
  11742. // non-interface field appearing in ForceSendFields will be sent to the
  11743. // server regardless of whether the field is empty or not. This may be
  11744. // used to include empty fields in Patch requests.
  11745. ForceSendFields []string `json:"-"`
  11746. // NullFields is a list of field names (e.g. "Key") to include in API
  11747. // requests with the JSON null value. By default, fields with empty
  11748. // values are omitted from API requests. However, any field with an
  11749. // empty value appearing in NullFields will be sent to the server as
  11750. // null. It is an error if a field in this list has a non-empty value.
  11751. // This may be used to include null fields in Patch requests.
  11752. NullFields []string `json:"-"`
  11753. }
  11754. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  11755. type NoMethod MachineTypeAggregatedListWarningData
  11756. raw := NoMethod(*s)
  11757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11758. }
  11759. // MachineTypeList: Contains a list of machine types.
  11760. type MachineTypeList struct {
  11761. // Id: [Output Only] Unique identifier for the resource; defined by the
  11762. // server.
  11763. Id string `json:"id,omitempty"`
  11764. // Items: A list of MachineType resources.
  11765. Items []*MachineType `json:"items,omitempty"`
  11766. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  11767. // for lists of machine types.
  11768. Kind string `json:"kind,omitempty"`
  11769. // NextPageToken: [Output Only] This token allows you to get the next
  11770. // page of results for list requests. If the number of results is larger
  11771. // than maxResults, use the nextPageToken as a value for the query
  11772. // parameter pageToken in the next list request. Subsequent list
  11773. // requests will have their own nextPageToken to continue paging through
  11774. // the results.
  11775. NextPageToken string `json:"nextPageToken,omitempty"`
  11776. // SelfLink: [Output Only] Server-defined URL for this resource.
  11777. SelfLink string `json:"selfLink,omitempty"`
  11778. // Warning: [Output Only] Informational warning message.
  11779. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  11780. // ServerResponse contains the HTTP response code and headers from the
  11781. // server.
  11782. googleapi.ServerResponse `json:"-"`
  11783. // ForceSendFields is a list of field names (e.g. "Id") to
  11784. // unconditionally include in API requests. By default, fields with
  11785. // empty values are omitted from API requests. However, any non-pointer,
  11786. // non-interface field appearing in ForceSendFields will be sent to the
  11787. // server regardless of whether the field is empty or not. This may be
  11788. // used to include empty fields in Patch requests.
  11789. ForceSendFields []string `json:"-"`
  11790. // NullFields is a list of field names (e.g. "Id") to include in API
  11791. // requests with the JSON null value. By default, fields with empty
  11792. // values are omitted from API requests. However, any field with an
  11793. // empty value appearing in NullFields will be sent to the server as
  11794. // null. It is an error if a field in this list has a non-empty value.
  11795. // This may be used to include null fields in Patch requests.
  11796. NullFields []string `json:"-"`
  11797. }
  11798. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  11799. type NoMethod MachineTypeList
  11800. raw := NoMethod(*s)
  11801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11802. }
  11803. // MachineTypeListWarning: [Output Only] Informational warning message.
  11804. type MachineTypeListWarning struct {
  11805. // Code: [Output Only] A warning code, if applicable. For example,
  11806. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11807. // the response.
  11808. //
  11809. // Possible values:
  11810. // "CLEANUP_FAILED"
  11811. // "DEPRECATED_RESOURCE_USED"
  11812. // "DEPRECATED_TYPE_USED"
  11813. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11814. // "EXPERIMENTAL_TYPE_USED"
  11815. // "EXTERNAL_API_WARNING"
  11816. // "FIELD_VALUE_OVERRIDEN"
  11817. // "INJECTED_KERNELS_DEPRECATED"
  11818. // "MISSING_TYPE_DEPENDENCY"
  11819. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11820. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11821. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11822. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11823. // "NEXT_HOP_NOT_RUNNING"
  11824. // "NOT_CRITICAL_ERROR"
  11825. // "NO_RESULTS_ON_PAGE"
  11826. // "REQUIRED_TOS_AGREEMENT"
  11827. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11828. // "RESOURCE_NOT_DELETED"
  11829. // "SCHEMA_VALIDATION_IGNORED"
  11830. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11831. // "UNDECLARED_PROPERTIES"
  11832. // "UNREACHABLE"
  11833. Code string `json:"code,omitempty"`
  11834. // Data: [Output Only] Metadata about this warning in key: value format.
  11835. // For example:
  11836. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11837. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  11838. // Message: [Output Only] A human-readable description of the warning
  11839. // code.
  11840. Message string `json:"message,omitempty"`
  11841. // ForceSendFields is a list of field names (e.g. "Code") to
  11842. // unconditionally include in API requests. By default, fields with
  11843. // empty values are omitted from API requests. However, any non-pointer,
  11844. // non-interface field appearing in ForceSendFields will be sent to the
  11845. // server regardless of whether the field is empty or not. This may be
  11846. // used to include empty fields in Patch requests.
  11847. ForceSendFields []string `json:"-"`
  11848. // NullFields is a list of field names (e.g. "Code") to include in API
  11849. // requests with the JSON null value. By default, fields with empty
  11850. // values are omitted from API requests. However, any field with an
  11851. // empty value appearing in NullFields will be sent to the server as
  11852. // null. It is an error if a field in this list has a non-empty value.
  11853. // This may be used to include null fields in Patch requests.
  11854. NullFields []string `json:"-"`
  11855. }
  11856. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  11857. type NoMethod MachineTypeListWarning
  11858. raw := NoMethod(*s)
  11859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11860. }
  11861. type MachineTypeListWarningData struct {
  11862. // Key: [Output Only] A key that provides more detail on the warning
  11863. // being returned. For example, for warnings where there are no results
  11864. // in a list request for a particular zone, this key might be scope and
  11865. // the key value might be the zone name. Other examples might be a key
  11866. // indicating a deprecated resource and a suggested replacement, or a
  11867. // warning about invalid network settings (for example, if an instance
  11868. // attempts to perform IP forwarding but is not enabled for IP
  11869. // forwarding).
  11870. Key string `json:"key,omitempty"`
  11871. // Value: [Output Only] A warning data value corresponding to the key.
  11872. Value string `json:"value,omitempty"`
  11873. // ForceSendFields is a list of field names (e.g. "Key") to
  11874. // unconditionally include in API requests. By default, fields with
  11875. // empty values are omitted from API requests. However, any non-pointer,
  11876. // non-interface field appearing in ForceSendFields will be sent to the
  11877. // server regardless of whether the field is empty or not. This may be
  11878. // used to include empty fields in Patch requests.
  11879. ForceSendFields []string `json:"-"`
  11880. // NullFields is a list of field names (e.g. "Key") to include in API
  11881. // requests with the JSON null value. By default, fields with empty
  11882. // values are omitted from API requests. However, any field with an
  11883. // empty value appearing in NullFields will be sent to the server as
  11884. // null. It is an error if a field in this list has a non-empty value.
  11885. // This may be used to include null fields in Patch requests.
  11886. NullFields []string `json:"-"`
  11887. }
  11888. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  11889. type NoMethod MachineTypeListWarningData
  11890. raw := NoMethod(*s)
  11891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11892. }
  11893. type MachineTypesScopedList struct {
  11894. // MachineTypes: [Output Only] A list of machine types contained in this
  11895. // scope.
  11896. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  11897. // Warning: [Output Only] An informational warning that appears when the
  11898. // machine types list is empty.
  11899. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  11900. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  11901. // unconditionally include in API requests. By default, fields with
  11902. // empty values are omitted from API requests. However, any non-pointer,
  11903. // non-interface field appearing in ForceSendFields will be sent to the
  11904. // server regardless of whether the field is empty or not. This may be
  11905. // used to include empty fields in Patch requests.
  11906. ForceSendFields []string `json:"-"`
  11907. // NullFields is a list of field names (e.g. "MachineTypes") to include
  11908. // in API requests with the JSON null value. By default, fields with
  11909. // empty values are omitted from API requests. However, any field with
  11910. // an empty value appearing in NullFields will be sent to the server as
  11911. // null. It is an error if a field in this list has a non-empty value.
  11912. // This may be used to include null fields in Patch requests.
  11913. NullFields []string `json:"-"`
  11914. }
  11915. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  11916. type NoMethod MachineTypesScopedList
  11917. raw := NoMethod(*s)
  11918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11919. }
  11920. // MachineTypesScopedListWarning: [Output Only] An informational warning
  11921. // that appears when the machine types list is empty.
  11922. type MachineTypesScopedListWarning struct {
  11923. // Code: [Output Only] A warning code, if applicable. For example,
  11924. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11925. // the response.
  11926. //
  11927. // Possible values:
  11928. // "CLEANUP_FAILED"
  11929. // "DEPRECATED_RESOURCE_USED"
  11930. // "DEPRECATED_TYPE_USED"
  11931. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11932. // "EXPERIMENTAL_TYPE_USED"
  11933. // "EXTERNAL_API_WARNING"
  11934. // "FIELD_VALUE_OVERRIDEN"
  11935. // "INJECTED_KERNELS_DEPRECATED"
  11936. // "MISSING_TYPE_DEPENDENCY"
  11937. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11938. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11939. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11940. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11941. // "NEXT_HOP_NOT_RUNNING"
  11942. // "NOT_CRITICAL_ERROR"
  11943. // "NO_RESULTS_ON_PAGE"
  11944. // "REQUIRED_TOS_AGREEMENT"
  11945. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11946. // "RESOURCE_NOT_DELETED"
  11947. // "SCHEMA_VALIDATION_IGNORED"
  11948. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11949. // "UNDECLARED_PROPERTIES"
  11950. // "UNREACHABLE"
  11951. Code string `json:"code,omitempty"`
  11952. // Data: [Output Only] Metadata about this warning in key: value format.
  11953. // For example:
  11954. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11955. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  11956. // Message: [Output Only] A human-readable description of the warning
  11957. // code.
  11958. Message string `json:"message,omitempty"`
  11959. // ForceSendFields is a list of field names (e.g. "Code") to
  11960. // unconditionally include in API requests. By default, fields with
  11961. // empty values are omitted from API requests. However, any non-pointer,
  11962. // non-interface field appearing in ForceSendFields will be sent to the
  11963. // server regardless of whether the field is empty or not. This may be
  11964. // used to include empty fields in Patch requests.
  11965. ForceSendFields []string `json:"-"`
  11966. // NullFields is a list of field names (e.g. "Code") to include in API
  11967. // requests with the JSON null value. By default, fields with empty
  11968. // values are omitted from API requests. However, any field with an
  11969. // empty value appearing in NullFields will be sent to the server as
  11970. // null. It is an error if a field in this list has a non-empty value.
  11971. // This may be used to include null fields in Patch requests.
  11972. NullFields []string `json:"-"`
  11973. }
  11974. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  11975. type NoMethod MachineTypesScopedListWarning
  11976. raw := NoMethod(*s)
  11977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11978. }
  11979. type MachineTypesScopedListWarningData struct {
  11980. // Key: [Output Only] A key that provides more detail on the warning
  11981. // being returned. For example, for warnings where there are no results
  11982. // in a list request for a particular zone, this key might be scope and
  11983. // the key value might be the zone name. Other examples might be a key
  11984. // indicating a deprecated resource and a suggested replacement, or a
  11985. // warning about invalid network settings (for example, if an instance
  11986. // attempts to perform IP forwarding but is not enabled for IP
  11987. // forwarding).
  11988. Key string `json:"key,omitempty"`
  11989. // Value: [Output Only] A warning data value corresponding to the key.
  11990. Value string `json:"value,omitempty"`
  11991. // ForceSendFields is a list of field names (e.g. "Key") to
  11992. // unconditionally include in API requests. By default, fields with
  11993. // empty values are omitted from API requests. However, any non-pointer,
  11994. // non-interface field appearing in ForceSendFields will be sent to the
  11995. // server regardless of whether the field is empty or not. This may be
  11996. // used to include empty fields in Patch requests.
  11997. ForceSendFields []string `json:"-"`
  11998. // NullFields is a list of field names (e.g. "Key") to include in API
  11999. // requests with the JSON null value. By default, fields with empty
  12000. // values are omitted from API requests. However, any field with an
  12001. // empty value appearing in NullFields will be sent to the server as
  12002. // null. It is an error if a field in this list has a non-empty value.
  12003. // This may be used to include null fields in Patch requests.
  12004. NullFields []string `json:"-"`
  12005. }
  12006. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  12007. type NoMethod MachineTypesScopedListWarningData
  12008. raw := NoMethod(*s)
  12009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12010. }
  12011. // ManagedInstance: A Managed Instance resource.
  12012. type ManagedInstance struct {
  12013. // CurrentAction: [Output Only] The current action that the managed
  12014. // instance group has scheduled for the instance. Possible values:
  12015. // - NONE The instance is running, and the managed instance group does
  12016. // not have any scheduled actions for this instance.
  12017. // - CREATING The managed instance group is creating this instance. If
  12018. // the group fails to create this instance, it will try again until it
  12019. // is successful.
  12020. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  12021. // to create this instance only once. If the group fails to create this
  12022. // instance, it does not try again and the group's targetSize value is
  12023. // decreased instead.
  12024. // - RECREATING The managed instance group is recreating this instance.
  12025. //
  12026. // - DELETING The managed instance group is permanently deleting this
  12027. // instance.
  12028. // - ABANDONING The managed instance group is abandoning this instance.
  12029. // The instance will be removed from the instance group and from any
  12030. // target pools that are associated with this group.
  12031. // - RESTARTING The managed instance group is restarting the instance.
  12032. //
  12033. // - REFRESHING The managed instance group is applying configuration
  12034. // changes to the instance without stopping it. For example, the group
  12035. // can update the target pool list for an instance without stopping that
  12036. // instance.
  12037. // - VERIFYING The managed instance group has created the instance and
  12038. // it is in the process of being verified.
  12039. //
  12040. // Possible values:
  12041. // "ABANDONING"
  12042. // "CREATING"
  12043. // "CREATING_WITHOUT_RETRIES"
  12044. // "DELETING"
  12045. // "NONE"
  12046. // "RECREATING"
  12047. // "REFRESHING"
  12048. // "RESTARTING"
  12049. CurrentAction string `json:"currentAction,omitempty"`
  12050. // Id: [Output only] The unique identifier for this resource. This field
  12051. // is empty when instance does not exist.
  12052. Id uint64 `json:"id,omitempty,string"`
  12053. // Instance: [Output Only] The URL of the instance. The URL can exist
  12054. // even if the instance has not yet been created.
  12055. Instance string `json:"instance,omitempty"`
  12056. // InstanceStatus: [Output Only] The status of the instance. This field
  12057. // is empty when the instance does not exist.
  12058. //
  12059. // Possible values:
  12060. // "PROVISIONING"
  12061. // "RUNNING"
  12062. // "STAGING"
  12063. // "STOPPED"
  12064. // "STOPPING"
  12065. // "SUSPENDED"
  12066. // "SUSPENDING"
  12067. // "TERMINATED"
  12068. InstanceStatus string `json:"instanceStatus,omitempty"`
  12069. // LastAttempt: [Output Only] Information about the last attempt to
  12070. // create or delete the instance.
  12071. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  12072. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  12073. // unconditionally include in API requests. By default, fields with
  12074. // empty values are omitted from API requests. However, any non-pointer,
  12075. // non-interface field appearing in ForceSendFields will be sent to the
  12076. // server regardless of whether the field is empty or not. This may be
  12077. // used to include empty fields in Patch requests.
  12078. ForceSendFields []string `json:"-"`
  12079. // NullFields is a list of field names (e.g. "CurrentAction") to include
  12080. // in API requests with the JSON null value. By default, fields with
  12081. // empty values are omitted from API requests. However, any field with
  12082. // an empty value appearing in NullFields will be sent to the server as
  12083. // null. It is an error if a field in this list has a non-empty value.
  12084. // This may be used to include null fields in Patch requests.
  12085. NullFields []string `json:"-"`
  12086. }
  12087. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  12088. type NoMethod ManagedInstance
  12089. raw := NoMethod(*s)
  12090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12091. }
  12092. type ManagedInstanceLastAttempt struct {
  12093. // Errors: [Output Only] Encountered errors during the last attempt to
  12094. // create or delete the instance.
  12095. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  12096. // ForceSendFields is a list of field names (e.g. "Errors") to
  12097. // unconditionally include in API requests. By default, fields with
  12098. // empty values are omitted from API requests. However, any non-pointer,
  12099. // non-interface field appearing in ForceSendFields will be sent to the
  12100. // server regardless of whether the field is empty or not. This may be
  12101. // used to include empty fields in Patch requests.
  12102. ForceSendFields []string `json:"-"`
  12103. // NullFields is a list of field names (e.g. "Errors") to include in API
  12104. // requests with the JSON null value. By default, fields with empty
  12105. // values are omitted from API requests. However, any field with an
  12106. // empty value appearing in NullFields will be sent to the server as
  12107. // null. It is an error if a field in this list has a non-empty value.
  12108. // This may be used to include null fields in Patch requests.
  12109. NullFields []string `json:"-"`
  12110. }
  12111. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  12112. type NoMethod ManagedInstanceLastAttempt
  12113. raw := NoMethod(*s)
  12114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12115. }
  12116. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  12117. // during the last attempt to create or delete the instance.
  12118. type ManagedInstanceLastAttemptErrors struct {
  12119. // Errors: [Output Only] The array of errors encountered while
  12120. // processing this operation.
  12121. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  12122. // ForceSendFields is a list of field names (e.g. "Errors") to
  12123. // unconditionally include in API requests. By default, fields with
  12124. // empty values are omitted from API requests. However, any non-pointer,
  12125. // non-interface field appearing in ForceSendFields will be sent to the
  12126. // server regardless of whether the field is empty or not. This may be
  12127. // used to include empty fields in Patch requests.
  12128. ForceSendFields []string `json:"-"`
  12129. // NullFields is a list of field names (e.g. "Errors") to include in API
  12130. // requests with the JSON null value. By default, fields with empty
  12131. // values are omitted from API requests. However, any field with an
  12132. // empty value appearing in NullFields will be sent to the server as
  12133. // null. It is an error if a field in this list has a non-empty value.
  12134. // This may be used to include null fields in Patch requests.
  12135. NullFields []string `json:"-"`
  12136. }
  12137. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  12138. type NoMethod ManagedInstanceLastAttemptErrors
  12139. raw := NoMethod(*s)
  12140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12141. }
  12142. type ManagedInstanceLastAttemptErrorsErrors struct {
  12143. // Code: [Output Only] The error type identifier for this error.
  12144. Code string `json:"code,omitempty"`
  12145. // Location: [Output Only] Indicates the field in the request that
  12146. // caused the error. This property is optional.
  12147. Location string `json:"location,omitempty"`
  12148. // Message: [Output Only] An optional, human-readable error message.
  12149. Message string `json:"message,omitempty"`
  12150. // ForceSendFields is a list of field names (e.g. "Code") to
  12151. // unconditionally include in API requests. By default, fields with
  12152. // empty values are omitted from API requests. However, any non-pointer,
  12153. // non-interface field appearing in ForceSendFields will be sent to the
  12154. // server regardless of whether the field is empty or not. This may be
  12155. // used to include empty fields in Patch requests.
  12156. ForceSendFields []string `json:"-"`
  12157. // NullFields is a list of field names (e.g. "Code") to include in API
  12158. // requests with the JSON null value. By default, fields with empty
  12159. // values are omitted from API requests. However, any field with an
  12160. // empty value appearing in NullFields will be sent to the server as
  12161. // null. It is an error if a field in this list has a non-empty value.
  12162. // This may be used to include null fields in Patch requests.
  12163. NullFields []string `json:"-"`
  12164. }
  12165. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  12166. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  12167. raw := NoMethod(*s)
  12168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12169. }
  12170. // Metadata: A metadata key/value entry.
  12171. type Metadata struct {
  12172. // Fingerprint: Specifies a fingerprint for this request, which is
  12173. // essentially a hash of the metadata's contents and used for optimistic
  12174. // locking. The fingerprint is initially generated by Compute Engine and
  12175. // changes after every request to modify or update metadata. You must
  12176. // always provide an up-to-date fingerprint hash in order to update or
  12177. // change metadata.
  12178. Fingerprint string `json:"fingerprint,omitempty"`
  12179. // Items: Array of key/value pairs. The total size of all keys and
  12180. // values must be less than 512 KB.
  12181. Items []*MetadataItems `json:"items,omitempty"`
  12182. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  12183. // metadata.
  12184. Kind string `json:"kind,omitempty"`
  12185. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  12186. // unconditionally include in API requests. By default, fields with
  12187. // empty values are omitted from API requests. However, any non-pointer,
  12188. // non-interface field appearing in ForceSendFields will be sent to the
  12189. // server regardless of whether the field is empty or not. This may be
  12190. // used to include empty fields in Patch requests.
  12191. ForceSendFields []string `json:"-"`
  12192. // NullFields is a list of field names (e.g. "Fingerprint") to include
  12193. // in API requests with the JSON null value. By default, fields with
  12194. // empty values are omitted from API requests. However, any field with
  12195. // an empty value appearing in NullFields will be sent to the server as
  12196. // null. It is an error if a field in this list has a non-empty value.
  12197. // This may be used to include null fields in Patch requests.
  12198. NullFields []string `json:"-"`
  12199. }
  12200. func (s *Metadata) MarshalJSON() ([]byte, error) {
  12201. type NoMethod Metadata
  12202. raw := NoMethod(*s)
  12203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12204. }
  12205. type MetadataItems struct {
  12206. // Key: Key for the metadata entry. Keys must conform to the following
  12207. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  12208. // reflected as part of a URL in the metadata server. Additionally, to
  12209. // avoid ambiguity, keys must not conflict with any other metadata keys
  12210. // for the project.
  12211. Key string `json:"key,omitempty"`
  12212. // Value: Value for the metadata entry. These are free-form strings, and
  12213. // only have meaning as interpreted by the image running in the
  12214. // instance. The only restriction placed on values is that their size
  12215. // must be less than or equal to 262144 bytes (256 KiB).
  12216. Value *string `json:"value,omitempty"`
  12217. // ForceSendFields is a list of field names (e.g. "Key") to
  12218. // unconditionally include in API requests. By default, fields with
  12219. // empty values are omitted from API requests. However, any non-pointer,
  12220. // non-interface field appearing in ForceSendFields will be sent to the
  12221. // server regardless of whether the field is empty or not. This may be
  12222. // used to include empty fields in Patch requests.
  12223. ForceSendFields []string `json:"-"`
  12224. // NullFields is a list of field names (e.g. "Key") to include in API
  12225. // requests with the JSON null value. By default, fields with empty
  12226. // values are omitted from API requests. However, any field with an
  12227. // empty value appearing in NullFields will be sent to the server as
  12228. // null. It is an error if a field in this list has a non-empty value.
  12229. // This may be used to include null fields in Patch requests.
  12230. NullFields []string `json:"-"`
  12231. }
  12232. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  12233. type NoMethod MetadataItems
  12234. raw := NoMethod(*s)
  12235. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12236. }
  12237. // NamedPort: The named port. For example: .
  12238. type NamedPort struct {
  12239. // Name: The name for this named port. The name must be 1-63 characters
  12240. // long, and comply with RFC1035.
  12241. Name string `json:"name,omitempty"`
  12242. // Port: The port number, which can be a value between 1 and 65535.
  12243. Port int64 `json:"port,omitempty"`
  12244. // ForceSendFields is a list of field names (e.g. "Name") to
  12245. // unconditionally include in API requests. By default, fields with
  12246. // empty values are omitted from API requests. However, any non-pointer,
  12247. // non-interface field appearing in ForceSendFields will be sent to the
  12248. // server regardless of whether the field is empty or not. This may be
  12249. // used to include empty fields in Patch requests.
  12250. ForceSendFields []string `json:"-"`
  12251. // NullFields is a list of field names (e.g. "Name") to include in API
  12252. // requests with the JSON null value. By default, fields with empty
  12253. // values are omitted from API requests. However, any field with an
  12254. // empty value appearing in NullFields will be sent to the server as
  12255. // null. It is an error if a field in this list has a non-empty value.
  12256. // This may be used to include null fields in Patch requests.
  12257. NullFields []string `json:"-"`
  12258. }
  12259. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  12260. type NoMethod NamedPort
  12261. raw := NoMethod(*s)
  12262. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12263. }
  12264. // Network: Represents a Network resource. Read Networks and Firewalls
  12265. // for more information. (== resource_for v1.networks ==) (==
  12266. // resource_for beta.networks ==)
  12267. type Network struct {
  12268. // IPv4Range: The range of internal addresses that are legal on this
  12269. // network. This range is a CIDR specification, for example:
  12270. // 192.168.0.0/16. Provided by the client when the network is created.
  12271. IPv4Range string `json:"IPv4Range,omitempty"`
  12272. // AutoCreateSubnetworks: When set to true, the network is created in
  12273. // "auto subnet mode". When set to false, the network is in "custom
  12274. // subnet mode".
  12275. //
  12276. // In "auto subnet mode", a newly created network is assigned the
  12277. // default CIDR of 10.128.0.0/9 and it automatically creates one
  12278. // subnetwork per region.
  12279. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  12280. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12281. // format.
  12282. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12283. // Description: An optional description of this resource. Provide this
  12284. // property when you create the resource.
  12285. Description string `json:"description,omitempty"`
  12286. // GatewayIPv4: A gateway address for default routing to other networks.
  12287. // This value is read only and is selected by the Google Compute Engine,
  12288. // typically as the first usable address in the IPv4Range.
  12289. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  12290. // Id: [Output Only] The unique identifier for the resource. This
  12291. // identifier is defined by the server.
  12292. Id uint64 `json:"id,omitempty,string"`
  12293. // Kind: [Output Only] Type of the resource. Always compute#network for
  12294. // networks.
  12295. Kind string `json:"kind,omitempty"`
  12296. // Name: Name of the resource. Provided by the client when the resource
  12297. // is created. The name must be 1-63 characters long, and comply with
  12298. // RFC1035. Specifically, the name must be 1-63 characters long and
  12299. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  12300. // the first character must be a lowercase letter, and all following
  12301. // characters must be a dash, lowercase letter, or digit, except the
  12302. // last character, which cannot be a dash.
  12303. Name string `json:"name,omitempty"`
  12304. // Peerings: [Output Only] A list of network peerings for the resource.
  12305. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  12306. // RoutingConfig: The network-level routing configuration for this
  12307. // network. Used by Cloud Router to determine what type of network-wide
  12308. // routing behavior to enforce.
  12309. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  12310. // SelfLink: [Output Only] Server-defined URL for the resource.
  12311. SelfLink string `json:"selfLink,omitempty"`
  12312. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  12313. // all subnetworks in this network.
  12314. Subnetworks []string `json:"subnetworks,omitempty"`
  12315. // ServerResponse contains the HTTP response code and headers from the
  12316. // server.
  12317. googleapi.ServerResponse `json:"-"`
  12318. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  12319. // unconditionally include in API requests. By default, fields with
  12320. // empty values are omitted from API requests. However, any non-pointer,
  12321. // non-interface field appearing in ForceSendFields will be sent to the
  12322. // server regardless of whether the field is empty or not. This may be
  12323. // used to include empty fields in Patch requests.
  12324. ForceSendFields []string `json:"-"`
  12325. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  12326. // API requests with the JSON null value. By default, fields with empty
  12327. // values are omitted from API requests. However, any field with an
  12328. // empty value appearing in NullFields will be sent to the server as
  12329. // null. It is an error if a field in this list has a non-empty value.
  12330. // This may be used to include null fields in Patch requests.
  12331. NullFields []string `json:"-"`
  12332. }
  12333. func (s *Network) MarshalJSON() ([]byte, error) {
  12334. type NoMethod Network
  12335. raw := NoMethod(*s)
  12336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12337. }
  12338. // NetworkInterface: A network interface resource attached to an
  12339. // instance.
  12340. type NetworkInterface struct {
  12341. // AccessConfigs: An array of configurations for this interface.
  12342. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  12343. // there are no accessConfigs specified, then this instance will have no
  12344. // external internet access.
  12345. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  12346. // AliasIpRanges: An array of alias IP ranges for this network
  12347. // interface. Can only be specified for network interfaces on
  12348. // subnet-mode networks.
  12349. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  12350. // Fingerprint: Fingerprint hash of contents stored in this network
  12351. // interface. This field will be ignored when inserting an Instance or
  12352. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  12353. // in order to update the NetworkInterface.
  12354. Fingerprint string `json:"fingerprint,omitempty"`
  12355. // Kind: [Output Only] Type of the resource. Always
  12356. // compute#networkInterface for network interfaces.
  12357. Kind string `json:"kind,omitempty"`
  12358. // Name: [Output Only] The name of the network interface, generated by
  12359. // the server. For network devices, these are eth0, eth1, etc.
  12360. Name string `json:"name,omitempty"`
  12361. // Network: URL of the network resource for this instance. When creating
  12362. // an instance, if neither the network nor the subnetwork is specified,
  12363. // the default network global/networks/default is used; if the network
  12364. // is not specified but the subnetwork is specified, the network is
  12365. // inferred.
  12366. //
  12367. // This field is optional when creating a firewall rule. If not
  12368. // specified when creating a firewall rule, the default network
  12369. // global/networks/default is used.
  12370. //
  12371. // If you specify this property, you can specify the network as a full
  12372. // or partial URL. For example, the following are all valid URLs:
  12373. // -
  12374. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  12375. // - projects/project/global/networks/network
  12376. // - global/networks/default
  12377. Network string `json:"network,omitempty"`
  12378. // NetworkIP: An IPv4 internal network address to assign to the instance
  12379. // for this network interface. If not specified by the user, an unused
  12380. // internal IP is assigned by the system.
  12381. NetworkIP string `json:"networkIP,omitempty"`
  12382. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  12383. // the network resource is in legacy mode, do not provide this property.
  12384. // If the network is in auto subnet mode, providing the subnetwork is
  12385. // optional. If the network is in custom subnet mode, then this field
  12386. // should be specified. If you specify this property, you can specify
  12387. // the subnetwork as a full or partial URL. For example, the following
  12388. // are all valid URLs:
  12389. // -
  12390. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  12391. // - regions/region/subnetworks/subnetwork
  12392. Subnetwork string `json:"subnetwork,omitempty"`
  12393. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  12394. // unconditionally include in API requests. By default, fields with
  12395. // empty values are omitted from API requests. However, any non-pointer,
  12396. // non-interface field appearing in ForceSendFields will be sent to the
  12397. // server regardless of whether the field is empty or not. This may be
  12398. // used to include empty fields in Patch requests.
  12399. ForceSendFields []string `json:"-"`
  12400. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  12401. // in API requests with the JSON null value. By default, fields with
  12402. // empty values are omitted from API requests. However, any field with
  12403. // an empty value appearing in NullFields will be sent to the server as
  12404. // null. It is an error if a field in this list has a non-empty value.
  12405. // This may be used to include null fields in Patch requests.
  12406. NullFields []string `json:"-"`
  12407. }
  12408. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  12409. type NoMethod NetworkInterface
  12410. raw := NoMethod(*s)
  12411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12412. }
  12413. // NetworkList: Contains a list of networks.
  12414. type NetworkList struct {
  12415. // Id: [Output Only] Unique identifier for the resource; defined by the
  12416. // server.
  12417. Id string `json:"id,omitempty"`
  12418. // Items: A list of Network resources.
  12419. Items []*Network `json:"items,omitempty"`
  12420. // Kind: [Output Only] Type of resource. Always compute#networkList for
  12421. // lists of networks.
  12422. Kind string `json:"kind,omitempty"`
  12423. // NextPageToken: [Output Only] This token allows you to get the next
  12424. // page of results for list requests. If the number of results is larger
  12425. // than maxResults, use the nextPageToken as a value for the query
  12426. // parameter pageToken in the next list request. Subsequent list
  12427. // requests will have their own nextPageToken to continue paging through
  12428. // the results.
  12429. NextPageToken string `json:"nextPageToken,omitempty"`
  12430. // SelfLink: [Output Only] Server-defined URL for this resource.
  12431. SelfLink string `json:"selfLink,omitempty"`
  12432. // Warning: [Output Only] Informational warning message.
  12433. Warning *NetworkListWarning `json:"warning,omitempty"`
  12434. // ServerResponse contains the HTTP response code and headers from the
  12435. // server.
  12436. googleapi.ServerResponse `json:"-"`
  12437. // ForceSendFields is a list of field names (e.g. "Id") to
  12438. // unconditionally include in API requests. By default, fields with
  12439. // empty values are omitted from API requests. However, any non-pointer,
  12440. // non-interface field appearing in ForceSendFields will be sent to the
  12441. // server regardless of whether the field is empty or not. This may be
  12442. // used to include empty fields in Patch requests.
  12443. ForceSendFields []string `json:"-"`
  12444. // NullFields is a list of field names (e.g. "Id") to include in API
  12445. // requests with the JSON null value. By default, fields with empty
  12446. // values are omitted from API requests. However, any field with an
  12447. // empty value appearing in NullFields will be sent to the server as
  12448. // null. It is an error if a field in this list has a non-empty value.
  12449. // This may be used to include null fields in Patch requests.
  12450. NullFields []string `json:"-"`
  12451. }
  12452. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  12453. type NoMethod NetworkList
  12454. raw := NoMethod(*s)
  12455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12456. }
  12457. // NetworkListWarning: [Output Only] Informational warning message.
  12458. type NetworkListWarning struct {
  12459. // Code: [Output Only] A warning code, if applicable. For example,
  12460. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12461. // the response.
  12462. //
  12463. // Possible values:
  12464. // "CLEANUP_FAILED"
  12465. // "DEPRECATED_RESOURCE_USED"
  12466. // "DEPRECATED_TYPE_USED"
  12467. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12468. // "EXPERIMENTAL_TYPE_USED"
  12469. // "EXTERNAL_API_WARNING"
  12470. // "FIELD_VALUE_OVERRIDEN"
  12471. // "INJECTED_KERNELS_DEPRECATED"
  12472. // "MISSING_TYPE_DEPENDENCY"
  12473. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12474. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12475. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12476. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12477. // "NEXT_HOP_NOT_RUNNING"
  12478. // "NOT_CRITICAL_ERROR"
  12479. // "NO_RESULTS_ON_PAGE"
  12480. // "REQUIRED_TOS_AGREEMENT"
  12481. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12482. // "RESOURCE_NOT_DELETED"
  12483. // "SCHEMA_VALIDATION_IGNORED"
  12484. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12485. // "UNDECLARED_PROPERTIES"
  12486. // "UNREACHABLE"
  12487. Code string `json:"code,omitempty"`
  12488. // Data: [Output Only] Metadata about this warning in key: value format.
  12489. // For example:
  12490. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12491. Data []*NetworkListWarningData `json:"data,omitempty"`
  12492. // Message: [Output Only] A human-readable description of the warning
  12493. // code.
  12494. Message string `json:"message,omitempty"`
  12495. // ForceSendFields is a list of field names (e.g. "Code") to
  12496. // unconditionally include in API requests. By default, fields with
  12497. // empty values are omitted from API requests. However, any non-pointer,
  12498. // non-interface field appearing in ForceSendFields will be sent to the
  12499. // server regardless of whether the field is empty or not. This may be
  12500. // used to include empty fields in Patch requests.
  12501. ForceSendFields []string `json:"-"`
  12502. // NullFields is a list of field names (e.g. "Code") to include in API
  12503. // requests with the JSON null value. By default, fields with empty
  12504. // values are omitted from API requests. However, any field with an
  12505. // empty value appearing in NullFields will be sent to the server as
  12506. // null. It is an error if a field in this list has a non-empty value.
  12507. // This may be used to include null fields in Patch requests.
  12508. NullFields []string `json:"-"`
  12509. }
  12510. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  12511. type NoMethod NetworkListWarning
  12512. raw := NoMethod(*s)
  12513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12514. }
  12515. type NetworkListWarningData struct {
  12516. // Key: [Output Only] A key that provides more detail on the warning
  12517. // being returned. For example, for warnings where there are no results
  12518. // in a list request for a particular zone, this key might be scope and
  12519. // the key value might be the zone name. Other examples might be a key
  12520. // indicating a deprecated resource and a suggested replacement, or a
  12521. // warning about invalid network settings (for example, if an instance
  12522. // attempts to perform IP forwarding but is not enabled for IP
  12523. // forwarding).
  12524. Key string `json:"key,omitempty"`
  12525. // Value: [Output Only] A warning data value corresponding to the key.
  12526. Value string `json:"value,omitempty"`
  12527. // ForceSendFields is a list of field names (e.g. "Key") to
  12528. // unconditionally include in API requests. By default, fields with
  12529. // empty values are omitted from API requests. However, any non-pointer,
  12530. // non-interface field appearing in ForceSendFields will be sent to the
  12531. // server regardless of whether the field is empty or not. This may be
  12532. // used to include empty fields in Patch requests.
  12533. ForceSendFields []string `json:"-"`
  12534. // NullFields is a list of field names (e.g. "Key") to include in API
  12535. // requests with the JSON null value. By default, fields with empty
  12536. // values are omitted from API requests. However, any field with an
  12537. // empty value appearing in NullFields will be sent to the server as
  12538. // null. It is an error if a field in this list has a non-empty value.
  12539. // This may be used to include null fields in Patch requests.
  12540. NullFields []string `json:"-"`
  12541. }
  12542. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  12543. type NoMethod NetworkListWarningData
  12544. raw := NoMethod(*s)
  12545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12546. }
  12547. // NetworkPeering: A network peering attached to a network resource. The
  12548. // message includes the peering name, peer network, peering state, and a
  12549. // flag indicating whether Google Compute Engine should automatically
  12550. // create routes for the peering.
  12551. type NetworkPeering struct {
  12552. // AutoCreateRoutes: Whether full mesh connectivity is created and
  12553. // managed automatically. When it is set to true, Google Compute Engine
  12554. // will automatically create and manage the routes between two networks
  12555. // when the state is ACTIVE. Otherwise, user needs to create routes
  12556. // manually to route packets to peer network.
  12557. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  12558. // Name: Name of this peering. Provided by the client when the peering
  12559. // is created. The name must comply with RFC1035. Specifically, the name
  12560. // must be 1-63 characters long and match regular expression
  12561. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  12562. // a lowercase letter, and all the following characters must be a dash,
  12563. // lowercase letter, or digit, except the last character, which cannot
  12564. // be a dash.
  12565. Name string `json:"name,omitempty"`
  12566. // Network: The URL of the peer network. It can be either full URL or
  12567. // partial URL. The peer network may belong to a different project. If
  12568. // the partial URL does not contain project, it is assumed that the peer
  12569. // network is in the same project as the current network.
  12570. Network string `json:"network,omitempty"`
  12571. // State: [Output Only] State for the peering.
  12572. //
  12573. // Possible values:
  12574. // "ACTIVE"
  12575. // "INACTIVE"
  12576. State string `json:"state,omitempty"`
  12577. // StateDetails: [Output Only] Details about the current state of the
  12578. // peering.
  12579. StateDetails string `json:"stateDetails,omitempty"`
  12580. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  12581. // unconditionally include in API requests. By default, fields with
  12582. // empty values are omitted from API requests. However, any non-pointer,
  12583. // non-interface field appearing in ForceSendFields will be sent to the
  12584. // server regardless of whether the field is empty or not. This may be
  12585. // used to include empty fields in Patch requests.
  12586. ForceSendFields []string `json:"-"`
  12587. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  12588. // include in API requests with the JSON null value. By default, fields
  12589. // with empty values are omitted from API requests. However, any field
  12590. // with an empty value appearing in NullFields will be sent to the
  12591. // server as null. It is an error if a field in this list has a
  12592. // non-empty value. This may be used to include null fields in Patch
  12593. // requests.
  12594. NullFields []string `json:"-"`
  12595. }
  12596. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  12597. type NoMethod NetworkPeering
  12598. raw := NoMethod(*s)
  12599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12600. }
  12601. // NetworkRoutingConfig: A routing configuration attached to a network
  12602. // resource. The message includes the list of routers associated with
  12603. // the network, and a flag indicating the type of routing behavior to
  12604. // enforce network-wide.
  12605. type NetworkRoutingConfig struct {
  12606. // RoutingMode: The network-wide routing mode to use. If set to
  12607. // REGIONAL, this network's cloud routers will only advertise routes
  12608. // with subnetworks of this network in the same region as the router. If
  12609. // set to GLOBAL, this network's cloud routers will advertise routes
  12610. // with all subnetworks of this network, across regions.
  12611. //
  12612. // Possible values:
  12613. // "GLOBAL"
  12614. // "REGIONAL"
  12615. RoutingMode string `json:"routingMode,omitempty"`
  12616. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  12617. // unconditionally include in API requests. By default, fields with
  12618. // empty values are omitted from API requests. However, any non-pointer,
  12619. // non-interface field appearing in ForceSendFields will be sent to the
  12620. // server regardless of whether the field is empty or not. This may be
  12621. // used to include empty fields in Patch requests.
  12622. ForceSendFields []string `json:"-"`
  12623. // NullFields is a list of field names (e.g. "RoutingMode") to include
  12624. // in API requests with the JSON null value. By default, fields with
  12625. // empty values are omitted from API requests. However, any field with
  12626. // an empty value appearing in NullFields will be sent to the server as
  12627. // null. It is an error if a field in this list has a non-empty value.
  12628. // This may be used to include null fields in Patch requests.
  12629. NullFields []string `json:"-"`
  12630. }
  12631. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  12632. type NoMethod NetworkRoutingConfig
  12633. raw := NoMethod(*s)
  12634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12635. }
  12636. type NetworksAddPeeringRequest struct {
  12637. // AutoCreateRoutes: Whether Google Compute Engine manages the routes
  12638. // automatically.
  12639. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  12640. // Name: Name of the peering, which should conform to RFC1035.
  12641. Name string `json:"name,omitempty"`
  12642. // PeerNetwork: URL of the peer network. It can be either full URL or
  12643. // partial URL. The peer network may belong to a different project. If
  12644. // the partial URL does not contain project, it is assumed that the peer
  12645. // network is in the same project as the current network.
  12646. PeerNetwork string `json:"peerNetwork,omitempty"`
  12647. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  12648. // unconditionally include in API requests. By default, fields with
  12649. // empty values are omitted from API requests. However, any non-pointer,
  12650. // non-interface field appearing in ForceSendFields will be sent to the
  12651. // server regardless of whether the field is empty or not. This may be
  12652. // used to include empty fields in Patch requests.
  12653. ForceSendFields []string `json:"-"`
  12654. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  12655. // include in API requests with the JSON null value. By default, fields
  12656. // with empty values are omitted from API requests. However, any field
  12657. // with an empty value appearing in NullFields will be sent to the
  12658. // server as null. It is an error if a field in this list has a
  12659. // non-empty value. This may be used to include null fields in Patch
  12660. // requests.
  12661. NullFields []string `json:"-"`
  12662. }
  12663. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  12664. type NoMethod NetworksAddPeeringRequest
  12665. raw := NoMethod(*s)
  12666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12667. }
  12668. type NetworksRemovePeeringRequest struct {
  12669. // Name: Name of the peering, which should conform to RFC1035.
  12670. Name string `json:"name,omitempty"`
  12671. // ForceSendFields is a list of field names (e.g. "Name") to
  12672. // unconditionally include in API requests. By default, fields with
  12673. // empty values are omitted from API requests. However, any non-pointer,
  12674. // non-interface field appearing in ForceSendFields will be sent to the
  12675. // server regardless of whether the field is empty or not. This may be
  12676. // used to include empty fields in Patch requests.
  12677. ForceSendFields []string `json:"-"`
  12678. // NullFields is a list of field names (e.g. "Name") to include in API
  12679. // requests with the JSON null value. By default, fields with empty
  12680. // values are omitted from API requests. However, any field with an
  12681. // empty value appearing in NullFields will be sent to the server as
  12682. // null. It is an error if a field in this list has a non-empty value.
  12683. // This may be used to include null fields in Patch requests.
  12684. NullFields []string `json:"-"`
  12685. }
  12686. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  12687. type NoMethod NetworksRemovePeeringRequest
  12688. raw := NoMethod(*s)
  12689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12690. }
  12691. // Operation: An Operation resource, used to manage asynchronous API
  12692. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  12693. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  12694. // (== resource_for beta.regionOperations ==) (== resource_for
  12695. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  12696. type Operation struct {
  12697. // ClientOperationId: [Output Only] The value of `requestId` if you
  12698. // provided it in the request. Not present otherwise.
  12699. ClientOperationId string `json:"clientOperationId,omitempty"`
  12700. // CreationTimestamp: [Deprecated] This field is deprecated.
  12701. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12702. // Description: [Output Only] A textual description of the operation,
  12703. // which is set when the operation is created.
  12704. Description string `json:"description,omitempty"`
  12705. // EndTime: [Output Only] The time that this operation was completed.
  12706. // This value is in RFC3339 text format.
  12707. EndTime string `json:"endTime,omitempty"`
  12708. // Error: [Output Only] If errors are generated during processing of the
  12709. // operation, this field will be populated.
  12710. Error *OperationError `json:"error,omitempty"`
  12711. // HttpErrorMessage: [Output Only] If the operation fails, this field
  12712. // contains the HTTP error message that was returned, such as NOT FOUND.
  12713. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  12714. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  12715. // contains the HTTP error status code that was returned. For example, a
  12716. // 404 means the resource was not found.
  12717. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  12718. // Id: [Output Only] The unique identifier for the resource. This
  12719. // identifier is defined by the server.
  12720. Id uint64 `json:"id,omitempty,string"`
  12721. // InsertTime: [Output Only] The time that this operation was requested.
  12722. // This value is in RFC3339 text format.
  12723. InsertTime string `json:"insertTime,omitempty"`
  12724. // Kind: [Output Only] Type of the resource. Always compute#operation
  12725. // for Operation resources.
  12726. Kind string `json:"kind,omitempty"`
  12727. // Name: [Output Only] Name of the resource.
  12728. Name string `json:"name,omitempty"`
  12729. // OperationType: [Output Only] The type of operation, such as insert,
  12730. // update, or delete, and so on.
  12731. OperationType string `json:"operationType,omitempty"`
  12732. // Progress: [Output Only] An optional progress indicator that ranges
  12733. // from 0 to 100. There is no requirement that this be linear or support
  12734. // any granularity of operations. This should not be used to guess when
  12735. // the operation will be complete. This number should monotonically
  12736. // increase as the operation progresses.
  12737. Progress int64 `json:"progress,omitempty"`
  12738. // Region: [Output Only] The URL of the region where the operation
  12739. // resides. Only available when performing regional operations. You must
  12740. // specify this field as part of the HTTP request URL. It is not
  12741. // settable as a field in the request body.
  12742. Region string `json:"region,omitempty"`
  12743. // SelfLink: [Output Only] Server-defined URL for the resource.
  12744. SelfLink string `json:"selfLink,omitempty"`
  12745. // StartTime: [Output Only] The time that this operation was started by
  12746. // the server. This value is in RFC3339 text format.
  12747. StartTime string `json:"startTime,omitempty"`
  12748. // Status: [Output Only] The status of the operation, which can be one
  12749. // of the following: PENDING, RUNNING, or DONE.
  12750. //
  12751. // Possible values:
  12752. // "DONE"
  12753. // "PENDING"
  12754. // "RUNNING"
  12755. Status string `json:"status,omitempty"`
  12756. // StatusMessage: [Output Only] An optional textual description of the
  12757. // current status of the operation.
  12758. StatusMessage string `json:"statusMessage,omitempty"`
  12759. // TargetId: [Output Only] The unique target ID, which identifies a
  12760. // specific incarnation of the target resource.
  12761. TargetId uint64 `json:"targetId,omitempty,string"`
  12762. // TargetLink: [Output Only] The URL of the resource that the operation
  12763. // modifies. For operations related to creating a snapshot, this points
  12764. // to the persistent disk that the snapshot was created from.
  12765. TargetLink string `json:"targetLink,omitempty"`
  12766. // User: [Output Only] User who requested the operation, for example:
  12767. // user@example.com.
  12768. User string `json:"user,omitempty"`
  12769. // Warnings: [Output Only] If warning messages are generated during
  12770. // processing of the operation, this field will be populated.
  12771. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  12772. // Zone: [Output Only] The URL of the zone where the operation resides.
  12773. // Only available when performing per-zone operations. You must specify
  12774. // this field as part of the HTTP request URL. It is not settable as a
  12775. // field in the request body.
  12776. Zone string `json:"zone,omitempty"`
  12777. // ServerResponse contains the HTTP response code and headers from the
  12778. // server.
  12779. googleapi.ServerResponse `json:"-"`
  12780. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  12781. // to unconditionally include in API requests. By default, fields with
  12782. // empty values are omitted from API requests. However, any non-pointer,
  12783. // non-interface field appearing in ForceSendFields will be sent to the
  12784. // server regardless of whether the field is empty or not. This may be
  12785. // used to include empty fields in Patch requests.
  12786. ForceSendFields []string `json:"-"`
  12787. // NullFields is a list of field names (e.g. "ClientOperationId") to
  12788. // include in API requests with the JSON null value. By default, fields
  12789. // with empty values are omitted from API requests. However, any field
  12790. // with an empty value appearing in NullFields will be sent to the
  12791. // server as null. It is an error if a field in this list has a
  12792. // non-empty value. This may be used to include null fields in Patch
  12793. // requests.
  12794. NullFields []string `json:"-"`
  12795. }
  12796. func (s *Operation) MarshalJSON() ([]byte, error) {
  12797. type NoMethod Operation
  12798. raw := NoMethod(*s)
  12799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12800. }
  12801. // OperationError: [Output Only] If errors are generated during
  12802. // processing of the operation, this field will be populated.
  12803. type OperationError struct {
  12804. // Errors: [Output Only] The array of errors encountered while
  12805. // processing this operation.
  12806. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  12807. // ForceSendFields is a list of field names (e.g. "Errors") to
  12808. // unconditionally include in API requests. By default, fields with
  12809. // empty values are omitted from API requests. However, any non-pointer,
  12810. // non-interface field appearing in ForceSendFields will be sent to the
  12811. // server regardless of whether the field is empty or not. This may be
  12812. // used to include empty fields in Patch requests.
  12813. ForceSendFields []string `json:"-"`
  12814. // NullFields is a list of field names (e.g. "Errors") to include in API
  12815. // requests with the JSON null value. By default, fields with empty
  12816. // values are omitted from API requests. However, any field with an
  12817. // empty value appearing in NullFields will be sent to the server as
  12818. // null. It is an error if a field in this list has a non-empty value.
  12819. // This may be used to include null fields in Patch requests.
  12820. NullFields []string `json:"-"`
  12821. }
  12822. func (s *OperationError) MarshalJSON() ([]byte, error) {
  12823. type NoMethod OperationError
  12824. raw := NoMethod(*s)
  12825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12826. }
  12827. type OperationErrorErrors struct {
  12828. // Code: [Output Only] The error type identifier for this error.
  12829. Code string `json:"code,omitempty"`
  12830. // Location: [Output Only] Indicates the field in the request that
  12831. // caused the error. This property is optional.
  12832. Location string `json:"location,omitempty"`
  12833. // Message: [Output Only] An optional, human-readable error message.
  12834. Message string `json:"message,omitempty"`
  12835. // ForceSendFields is a list of field names (e.g. "Code") to
  12836. // unconditionally include in API requests. By default, fields with
  12837. // empty values are omitted from API requests. However, any non-pointer,
  12838. // non-interface field appearing in ForceSendFields will be sent to the
  12839. // server regardless of whether the field is empty or not. This may be
  12840. // used to include empty fields in Patch requests.
  12841. ForceSendFields []string `json:"-"`
  12842. // NullFields is a list of field names (e.g. "Code") to include in API
  12843. // requests with the JSON null value. By default, fields with empty
  12844. // values are omitted from API requests. However, any field with an
  12845. // empty value appearing in NullFields will be sent to the server as
  12846. // null. It is an error if a field in this list has a non-empty value.
  12847. // This may be used to include null fields in Patch requests.
  12848. NullFields []string `json:"-"`
  12849. }
  12850. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  12851. type NoMethod OperationErrorErrors
  12852. raw := NoMethod(*s)
  12853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12854. }
  12855. type OperationWarnings struct {
  12856. // Code: [Output Only] A warning code, if applicable. For example,
  12857. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12858. // the response.
  12859. //
  12860. // Possible values:
  12861. // "CLEANUP_FAILED"
  12862. // "DEPRECATED_RESOURCE_USED"
  12863. // "DEPRECATED_TYPE_USED"
  12864. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12865. // "EXPERIMENTAL_TYPE_USED"
  12866. // "EXTERNAL_API_WARNING"
  12867. // "FIELD_VALUE_OVERRIDEN"
  12868. // "INJECTED_KERNELS_DEPRECATED"
  12869. // "MISSING_TYPE_DEPENDENCY"
  12870. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12871. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12872. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12873. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12874. // "NEXT_HOP_NOT_RUNNING"
  12875. // "NOT_CRITICAL_ERROR"
  12876. // "NO_RESULTS_ON_PAGE"
  12877. // "REQUIRED_TOS_AGREEMENT"
  12878. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12879. // "RESOURCE_NOT_DELETED"
  12880. // "SCHEMA_VALIDATION_IGNORED"
  12881. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12882. // "UNDECLARED_PROPERTIES"
  12883. // "UNREACHABLE"
  12884. Code string `json:"code,omitempty"`
  12885. // Data: [Output Only] Metadata about this warning in key: value format.
  12886. // For example:
  12887. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12888. Data []*OperationWarningsData `json:"data,omitempty"`
  12889. // Message: [Output Only] A human-readable description of the warning
  12890. // code.
  12891. Message string `json:"message,omitempty"`
  12892. // ForceSendFields is a list of field names (e.g. "Code") to
  12893. // unconditionally include in API requests. By default, fields with
  12894. // empty values are omitted from API requests. However, any non-pointer,
  12895. // non-interface field appearing in ForceSendFields will be sent to the
  12896. // server regardless of whether the field is empty or not. This may be
  12897. // used to include empty fields in Patch requests.
  12898. ForceSendFields []string `json:"-"`
  12899. // NullFields is a list of field names (e.g. "Code") to include in API
  12900. // requests with the JSON null value. By default, fields with empty
  12901. // values are omitted from API requests. However, any field with an
  12902. // empty value appearing in NullFields will be sent to the server as
  12903. // null. It is an error if a field in this list has a non-empty value.
  12904. // This may be used to include null fields in Patch requests.
  12905. NullFields []string `json:"-"`
  12906. }
  12907. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  12908. type NoMethod OperationWarnings
  12909. raw := NoMethod(*s)
  12910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12911. }
  12912. type OperationWarningsData struct {
  12913. // Key: [Output Only] A key that provides more detail on the warning
  12914. // being returned. For example, for warnings where there are no results
  12915. // in a list request for a particular zone, this key might be scope and
  12916. // the key value might be the zone name. Other examples might be a key
  12917. // indicating a deprecated resource and a suggested replacement, or a
  12918. // warning about invalid network settings (for example, if an instance
  12919. // attempts to perform IP forwarding but is not enabled for IP
  12920. // forwarding).
  12921. Key string `json:"key,omitempty"`
  12922. // Value: [Output Only] A warning data value corresponding to the key.
  12923. Value string `json:"value,omitempty"`
  12924. // ForceSendFields is a list of field names (e.g. "Key") to
  12925. // unconditionally include in API requests. By default, fields with
  12926. // empty values are omitted from API requests. However, any non-pointer,
  12927. // non-interface field appearing in ForceSendFields will be sent to the
  12928. // server regardless of whether the field is empty or not. This may be
  12929. // used to include empty fields in Patch requests.
  12930. ForceSendFields []string `json:"-"`
  12931. // NullFields is a list of field names (e.g. "Key") to include in API
  12932. // requests with the JSON null value. By default, fields with empty
  12933. // values are omitted from API requests. However, any field with an
  12934. // empty value appearing in NullFields will be sent to the server as
  12935. // null. It is an error if a field in this list has a non-empty value.
  12936. // This may be used to include null fields in Patch requests.
  12937. NullFields []string `json:"-"`
  12938. }
  12939. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  12940. type NoMethod OperationWarningsData
  12941. raw := NoMethod(*s)
  12942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12943. }
  12944. type OperationAggregatedList struct {
  12945. // Id: [Output Only] The unique identifier for the resource. This
  12946. // identifier is defined by the server.
  12947. Id string `json:"id,omitempty"`
  12948. // Items: [Output Only] A map of scoped operation lists.
  12949. Items map[string]OperationsScopedList `json:"items,omitempty"`
  12950. // Kind: [Output Only] Type of resource. Always
  12951. // compute#operationAggregatedList for aggregated lists of operations.
  12952. Kind string `json:"kind,omitempty"`
  12953. // NextPageToken: [Output Only] This token allows you to get the next
  12954. // page of results for list requests. If the number of results is larger
  12955. // than maxResults, use the nextPageToken as a value for the query
  12956. // parameter pageToken in the next list request. Subsequent list
  12957. // requests will have their own nextPageToken to continue paging through
  12958. // the results.
  12959. NextPageToken string `json:"nextPageToken,omitempty"`
  12960. // SelfLink: [Output Only] Server-defined URL for this resource.
  12961. SelfLink string `json:"selfLink,omitempty"`
  12962. // Warning: [Output Only] Informational warning message.
  12963. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  12964. // ServerResponse contains the HTTP response code and headers from the
  12965. // server.
  12966. googleapi.ServerResponse `json:"-"`
  12967. // ForceSendFields is a list of field names (e.g. "Id") to
  12968. // unconditionally include in API requests. By default, fields with
  12969. // empty values are omitted from API requests. However, any non-pointer,
  12970. // non-interface field appearing in ForceSendFields will be sent to the
  12971. // server regardless of whether the field is empty or not. This may be
  12972. // used to include empty fields in Patch requests.
  12973. ForceSendFields []string `json:"-"`
  12974. // NullFields is a list of field names (e.g. "Id") to include in API
  12975. // requests with the JSON null value. By default, fields with empty
  12976. // values are omitted from API requests. However, any field with an
  12977. // empty value appearing in NullFields will be sent to the server as
  12978. // null. It is an error if a field in this list has a non-empty value.
  12979. // This may be used to include null fields in Patch requests.
  12980. NullFields []string `json:"-"`
  12981. }
  12982. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  12983. type NoMethod OperationAggregatedList
  12984. raw := NoMethod(*s)
  12985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12986. }
  12987. // OperationAggregatedListWarning: [Output Only] Informational warning
  12988. // message.
  12989. type OperationAggregatedListWarning struct {
  12990. // Code: [Output Only] A warning code, if applicable. For example,
  12991. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12992. // the response.
  12993. //
  12994. // Possible values:
  12995. // "CLEANUP_FAILED"
  12996. // "DEPRECATED_RESOURCE_USED"
  12997. // "DEPRECATED_TYPE_USED"
  12998. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12999. // "EXPERIMENTAL_TYPE_USED"
  13000. // "EXTERNAL_API_WARNING"
  13001. // "FIELD_VALUE_OVERRIDEN"
  13002. // "INJECTED_KERNELS_DEPRECATED"
  13003. // "MISSING_TYPE_DEPENDENCY"
  13004. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13005. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13006. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13007. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13008. // "NEXT_HOP_NOT_RUNNING"
  13009. // "NOT_CRITICAL_ERROR"
  13010. // "NO_RESULTS_ON_PAGE"
  13011. // "REQUIRED_TOS_AGREEMENT"
  13012. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13013. // "RESOURCE_NOT_DELETED"
  13014. // "SCHEMA_VALIDATION_IGNORED"
  13015. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13016. // "UNDECLARED_PROPERTIES"
  13017. // "UNREACHABLE"
  13018. Code string `json:"code,omitempty"`
  13019. // Data: [Output Only] Metadata about this warning in key: value format.
  13020. // For example:
  13021. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13022. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  13023. // Message: [Output Only] A human-readable description of the warning
  13024. // code.
  13025. Message string `json:"message,omitempty"`
  13026. // ForceSendFields is a list of field names (e.g. "Code") to
  13027. // unconditionally include in API requests. By default, fields with
  13028. // empty values are omitted from API requests. However, any non-pointer,
  13029. // non-interface field appearing in ForceSendFields will be sent to the
  13030. // server regardless of whether the field is empty or not. This may be
  13031. // used to include empty fields in Patch requests.
  13032. ForceSendFields []string `json:"-"`
  13033. // NullFields is a list of field names (e.g. "Code") to include in API
  13034. // requests with the JSON null value. By default, fields with empty
  13035. // values are omitted from API requests. However, any field with an
  13036. // empty value appearing in NullFields will be sent to the server as
  13037. // null. It is an error if a field in this list has a non-empty value.
  13038. // This may be used to include null fields in Patch requests.
  13039. NullFields []string `json:"-"`
  13040. }
  13041. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13042. type NoMethod OperationAggregatedListWarning
  13043. raw := NoMethod(*s)
  13044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13045. }
  13046. type OperationAggregatedListWarningData struct {
  13047. // Key: [Output Only] A key that provides more detail on the warning
  13048. // being returned. For example, for warnings where there are no results
  13049. // in a list request for a particular zone, this key might be scope and
  13050. // the key value might be the zone name. Other examples might be a key
  13051. // indicating a deprecated resource and a suggested replacement, or a
  13052. // warning about invalid network settings (for example, if an instance
  13053. // attempts to perform IP forwarding but is not enabled for IP
  13054. // forwarding).
  13055. Key string `json:"key,omitempty"`
  13056. // Value: [Output Only] A warning data value corresponding to the key.
  13057. Value string `json:"value,omitempty"`
  13058. // ForceSendFields is a list of field names (e.g. "Key") to
  13059. // unconditionally include in API requests. By default, fields with
  13060. // empty values are omitted from API requests. However, any non-pointer,
  13061. // non-interface field appearing in ForceSendFields will be sent to the
  13062. // server regardless of whether the field is empty or not. This may be
  13063. // used to include empty fields in Patch requests.
  13064. ForceSendFields []string `json:"-"`
  13065. // NullFields is a list of field names (e.g. "Key") to include in API
  13066. // requests with the JSON null value. By default, fields with empty
  13067. // values are omitted from API requests. However, any field with an
  13068. // empty value appearing in NullFields will be sent to the server as
  13069. // null. It is an error if a field in this list has a non-empty value.
  13070. // This may be used to include null fields in Patch requests.
  13071. NullFields []string `json:"-"`
  13072. }
  13073. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13074. type NoMethod OperationAggregatedListWarningData
  13075. raw := NoMethod(*s)
  13076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13077. }
  13078. // OperationList: Contains a list of Operation resources.
  13079. type OperationList struct {
  13080. // Id: [Output Only] The unique identifier for the resource. This
  13081. // identifier is defined by the server.
  13082. Id string `json:"id,omitempty"`
  13083. // Items: [Output Only] A list of Operation resources.
  13084. Items []*Operation `json:"items,omitempty"`
  13085. // Kind: [Output Only] Type of resource. Always compute#operations for
  13086. // Operations resource.
  13087. Kind string `json:"kind,omitempty"`
  13088. // NextPageToken: [Output Only] This token allows you to get the next
  13089. // page of results for list requests. If the number of results is larger
  13090. // than maxResults, use the nextPageToken as a value for the query
  13091. // parameter pageToken in the next list request. Subsequent list
  13092. // requests will have their own nextPageToken to continue paging through
  13093. // the results.
  13094. NextPageToken string `json:"nextPageToken,omitempty"`
  13095. // SelfLink: [Output Only] Server-defined URL for this resource.
  13096. SelfLink string `json:"selfLink,omitempty"`
  13097. // Warning: [Output Only] Informational warning message.
  13098. Warning *OperationListWarning `json:"warning,omitempty"`
  13099. // ServerResponse contains the HTTP response code and headers from the
  13100. // server.
  13101. googleapi.ServerResponse `json:"-"`
  13102. // ForceSendFields is a list of field names (e.g. "Id") to
  13103. // unconditionally include in API requests. By default, fields with
  13104. // empty values are omitted from API requests. However, any non-pointer,
  13105. // non-interface field appearing in ForceSendFields will be sent to the
  13106. // server regardless of whether the field is empty or not. This may be
  13107. // used to include empty fields in Patch requests.
  13108. ForceSendFields []string `json:"-"`
  13109. // NullFields is a list of field names (e.g. "Id") to include in API
  13110. // requests with the JSON null value. By default, fields with empty
  13111. // values are omitted from API requests. However, any field with an
  13112. // empty value appearing in NullFields will be sent to the server as
  13113. // null. It is an error if a field in this list has a non-empty value.
  13114. // This may be used to include null fields in Patch requests.
  13115. NullFields []string `json:"-"`
  13116. }
  13117. func (s *OperationList) MarshalJSON() ([]byte, error) {
  13118. type NoMethod OperationList
  13119. raw := NoMethod(*s)
  13120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13121. }
  13122. // OperationListWarning: [Output Only] Informational warning message.
  13123. type OperationListWarning struct {
  13124. // Code: [Output Only] A warning code, if applicable. For example,
  13125. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13126. // the response.
  13127. //
  13128. // Possible values:
  13129. // "CLEANUP_FAILED"
  13130. // "DEPRECATED_RESOURCE_USED"
  13131. // "DEPRECATED_TYPE_USED"
  13132. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13133. // "EXPERIMENTAL_TYPE_USED"
  13134. // "EXTERNAL_API_WARNING"
  13135. // "FIELD_VALUE_OVERRIDEN"
  13136. // "INJECTED_KERNELS_DEPRECATED"
  13137. // "MISSING_TYPE_DEPENDENCY"
  13138. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13139. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13140. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13141. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13142. // "NEXT_HOP_NOT_RUNNING"
  13143. // "NOT_CRITICAL_ERROR"
  13144. // "NO_RESULTS_ON_PAGE"
  13145. // "REQUIRED_TOS_AGREEMENT"
  13146. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13147. // "RESOURCE_NOT_DELETED"
  13148. // "SCHEMA_VALIDATION_IGNORED"
  13149. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13150. // "UNDECLARED_PROPERTIES"
  13151. // "UNREACHABLE"
  13152. Code string `json:"code,omitempty"`
  13153. // Data: [Output Only] Metadata about this warning in key: value format.
  13154. // For example:
  13155. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13156. Data []*OperationListWarningData `json:"data,omitempty"`
  13157. // Message: [Output Only] A human-readable description of the warning
  13158. // code.
  13159. Message string `json:"message,omitempty"`
  13160. // ForceSendFields is a list of field names (e.g. "Code") to
  13161. // unconditionally include in API requests. By default, fields with
  13162. // empty values are omitted from API requests. However, any non-pointer,
  13163. // non-interface field appearing in ForceSendFields will be sent to the
  13164. // server regardless of whether the field is empty or not. This may be
  13165. // used to include empty fields in Patch requests.
  13166. ForceSendFields []string `json:"-"`
  13167. // NullFields is a list of field names (e.g. "Code") to include in API
  13168. // requests with the JSON null value. By default, fields with empty
  13169. // values are omitted from API requests. However, any field with an
  13170. // empty value appearing in NullFields will be sent to the server as
  13171. // null. It is an error if a field in this list has a non-empty value.
  13172. // This may be used to include null fields in Patch requests.
  13173. NullFields []string `json:"-"`
  13174. }
  13175. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  13176. type NoMethod OperationListWarning
  13177. raw := NoMethod(*s)
  13178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13179. }
  13180. type OperationListWarningData struct {
  13181. // Key: [Output Only] A key that provides more detail on the warning
  13182. // being returned. For example, for warnings where there are no results
  13183. // in a list request for a particular zone, this key might be scope and
  13184. // the key value might be the zone name. Other examples might be a key
  13185. // indicating a deprecated resource and a suggested replacement, or a
  13186. // warning about invalid network settings (for example, if an instance
  13187. // attempts to perform IP forwarding but is not enabled for IP
  13188. // forwarding).
  13189. Key string `json:"key,omitempty"`
  13190. // Value: [Output Only] A warning data value corresponding to the key.
  13191. Value string `json:"value,omitempty"`
  13192. // ForceSendFields is a list of field names (e.g. "Key") to
  13193. // unconditionally include in API requests. By default, fields with
  13194. // empty values are omitted from API requests. However, any non-pointer,
  13195. // non-interface field appearing in ForceSendFields will be sent to the
  13196. // server regardless of whether the field is empty or not. This may be
  13197. // used to include empty fields in Patch requests.
  13198. ForceSendFields []string `json:"-"`
  13199. // NullFields is a list of field names (e.g. "Key") to include in API
  13200. // requests with the JSON null value. By default, fields with empty
  13201. // values are omitted from API requests. However, any field with an
  13202. // empty value appearing in NullFields will be sent to the server as
  13203. // null. It is an error if a field in this list has a non-empty value.
  13204. // This may be used to include null fields in Patch requests.
  13205. NullFields []string `json:"-"`
  13206. }
  13207. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  13208. type NoMethod OperationListWarningData
  13209. raw := NoMethod(*s)
  13210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13211. }
  13212. type OperationsScopedList struct {
  13213. // Operations: [Output Only] A list of operations contained in this
  13214. // scope.
  13215. Operations []*Operation `json:"operations,omitempty"`
  13216. // Warning: [Output Only] Informational warning which replaces the list
  13217. // of operations when the list is empty.
  13218. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  13219. // ForceSendFields is a list of field names (e.g. "Operations") to
  13220. // unconditionally include in API requests. By default, fields with
  13221. // empty values are omitted from API requests. However, any non-pointer,
  13222. // non-interface field appearing in ForceSendFields will be sent to the
  13223. // server regardless of whether the field is empty or not. This may be
  13224. // used to include empty fields in Patch requests.
  13225. ForceSendFields []string `json:"-"`
  13226. // NullFields is a list of field names (e.g. "Operations") to include in
  13227. // API requests with the JSON null value. By default, fields with empty
  13228. // values are omitted from API requests. However, any field with an
  13229. // empty value appearing in NullFields will be sent to the server as
  13230. // null. It is an error if a field in this list has a non-empty value.
  13231. // This may be used to include null fields in Patch requests.
  13232. NullFields []string `json:"-"`
  13233. }
  13234. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  13235. type NoMethod OperationsScopedList
  13236. raw := NoMethod(*s)
  13237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13238. }
  13239. // OperationsScopedListWarning: [Output Only] Informational warning
  13240. // which replaces the list of operations when the list is empty.
  13241. type OperationsScopedListWarning struct {
  13242. // Code: [Output Only] A warning code, if applicable. For example,
  13243. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13244. // the response.
  13245. //
  13246. // Possible values:
  13247. // "CLEANUP_FAILED"
  13248. // "DEPRECATED_RESOURCE_USED"
  13249. // "DEPRECATED_TYPE_USED"
  13250. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13251. // "EXPERIMENTAL_TYPE_USED"
  13252. // "EXTERNAL_API_WARNING"
  13253. // "FIELD_VALUE_OVERRIDEN"
  13254. // "INJECTED_KERNELS_DEPRECATED"
  13255. // "MISSING_TYPE_DEPENDENCY"
  13256. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13257. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13258. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13259. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13260. // "NEXT_HOP_NOT_RUNNING"
  13261. // "NOT_CRITICAL_ERROR"
  13262. // "NO_RESULTS_ON_PAGE"
  13263. // "REQUIRED_TOS_AGREEMENT"
  13264. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13265. // "RESOURCE_NOT_DELETED"
  13266. // "SCHEMA_VALIDATION_IGNORED"
  13267. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13268. // "UNDECLARED_PROPERTIES"
  13269. // "UNREACHABLE"
  13270. Code string `json:"code,omitempty"`
  13271. // Data: [Output Only] Metadata about this warning in key: value format.
  13272. // For example:
  13273. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13274. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  13275. // Message: [Output Only] A human-readable description of the warning
  13276. // code.
  13277. Message string `json:"message,omitempty"`
  13278. // ForceSendFields is a list of field names (e.g. "Code") to
  13279. // unconditionally include in API requests. By default, fields with
  13280. // empty values are omitted from API requests. However, any non-pointer,
  13281. // non-interface field appearing in ForceSendFields will be sent to the
  13282. // server regardless of whether the field is empty or not. This may be
  13283. // used to include empty fields in Patch requests.
  13284. ForceSendFields []string `json:"-"`
  13285. // NullFields is a list of field names (e.g. "Code") to include in API
  13286. // requests with the JSON null value. By default, fields with empty
  13287. // values are omitted from API requests. However, any field with an
  13288. // empty value appearing in NullFields will be sent to the server as
  13289. // null. It is an error if a field in this list has a non-empty value.
  13290. // This may be used to include null fields in Patch requests.
  13291. NullFields []string `json:"-"`
  13292. }
  13293. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  13294. type NoMethod OperationsScopedListWarning
  13295. raw := NoMethod(*s)
  13296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13297. }
  13298. type OperationsScopedListWarningData struct {
  13299. // Key: [Output Only] A key that provides more detail on the warning
  13300. // being returned. For example, for warnings where there are no results
  13301. // in a list request for a particular zone, this key might be scope and
  13302. // the key value might be the zone name. Other examples might be a key
  13303. // indicating a deprecated resource and a suggested replacement, or a
  13304. // warning about invalid network settings (for example, if an instance
  13305. // attempts to perform IP forwarding but is not enabled for IP
  13306. // forwarding).
  13307. Key string `json:"key,omitempty"`
  13308. // Value: [Output Only] A warning data value corresponding to the key.
  13309. Value string `json:"value,omitempty"`
  13310. // ForceSendFields is a list of field names (e.g. "Key") to
  13311. // unconditionally include in API requests. By default, fields with
  13312. // empty values are omitted from API requests. However, any non-pointer,
  13313. // non-interface field appearing in ForceSendFields will be sent to the
  13314. // server regardless of whether the field is empty or not. This may be
  13315. // used to include empty fields in Patch requests.
  13316. ForceSendFields []string `json:"-"`
  13317. // NullFields is a list of field names (e.g. "Key") to include in API
  13318. // requests with the JSON null value. By default, fields with empty
  13319. // values are omitted from API requests. However, any field with an
  13320. // empty value appearing in NullFields will be sent to the server as
  13321. // null. It is an error if a field in this list has a non-empty value.
  13322. // This may be used to include null fields in Patch requests.
  13323. NullFields []string `json:"-"`
  13324. }
  13325. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  13326. type NoMethod OperationsScopedListWarningData
  13327. raw := NoMethod(*s)
  13328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13329. }
  13330. // PathMatcher: A matcher for the path portion of the URL. The
  13331. // BackendService from the longest-matched rule will serve the URL. If
  13332. // no rule was matched, the default service will be used.
  13333. type PathMatcher struct {
  13334. // DefaultService: The full or partial URL to the BackendService
  13335. // resource. This will be used if none of the pathRules defined by this
  13336. // PathMatcher is matched by the URL's path portion. For example, the
  13337. // following are all valid URLs to a BackendService resource:
  13338. // -
  13339. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  13340. // - compute/v1/projects/project/global/backendServices/backendService
  13341. //
  13342. // - global/backendServices/backendService
  13343. DefaultService string `json:"defaultService,omitempty"`
  13344. // Description: An optional description of this resource. Provide this
  13345. // property when you create the resource.
  13346. Description string `json:"description,omitempty"`
  13347. // Name: The name to which this PathMatcher is referred by the HostRule.
  13348. Name string `json:"name,omitempty"`
  13349. // PathRules: The list of path rules.
  13350. PathRules []*PathRule `json:"pathRules,omitempty"`
  13351. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  13352. // unconditionally include in API requests. By default, fields with
  13353. // empty values are omitted from API requests. However, any non-pointer,
  13354. // non-interface field appearing in ForceSendFields will be sent to the
  13355. // server regardless of whether the field is empty or not. This may be
  13356. // used to include empty fields in Patch requests.
  13357. ForceSendFields []string `json:"-"`
  13358. // NullFields is a list of field names (e.g. "DefaultService") to
  13359. // include in API requests with the JSON null value. By default, fields
  13360. // with empty values are omitted from API requests. However, any field
  13361. // with an empty value appearing in NullFields will be sent to the
  13362. // server as null. It is an error if a field in this list has a
  13363. // non-empty value. This may be used to include null fields in Patch
  13364. // requests.
  13365. NullFields []string `json:"-"`
  13366. }
  13367. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  13368. type NoMethod PathMatcher
  13369. raw := NoMethod(*s)
  13370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13371. }
  13372. // PathRule: A path-matching rule for a URL. If matched, will use the
  13373. // specified BackendService to handle the traffic arriving at this URL.
  13374. type PathRule struct {
  13375. // Paths: The list of path patterns to match. Each must start with / and
  13376. // the only place a * is allowed is at the end following a /. The string
  13377. // fed to the path matcher does not include any text after the first ?
  13378. // or #, and those chars are not allowed here.
  13379. Paths []string `json:"paths,omitempty"`
  13380. // Service: The URL of the BackendService resource if this rule is
  13381. // matched.
  13382. Service string `json:"service,omitempty"`
  13383. // ForceSendFields is a list of field names (e.g. "Paths") to
  13384. // unconditionally include in API requests. By default, fields with
  13385. // empty values are omitted from API requests. However, any non-pointer,
  13386. // non-interface field appearing in ForceSendFields will be sent to the
  13387. // server regardless of whether the field is empty or not. This may be
  13388. // used to include empty fields in Patch requests.
  13389. ForceSendFields []string `json:"-"`
  13390. // NullFields is a list of field names (e.g. "Paths") to include in API
  13391. // requests with the JSON null value. By default, fields with empty
  13392. // values are omitted from API requests. However, any field with an
  13393. // empty value appearing in NullFields will be sent to the server as
  13394. // null. It is an error if a field in this list has a non-empty value.
  13395. // This may be used to include null fields in Patch requests.
  13396. NullFields []string `json:"-"`
  13397. }
  13398. func (s *PathRule) MarshalJSON() ([]byte, error) {
  13399. type NoMethod PathRule
  13400. raw := NoMethod(*s)
  13401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13402. }
  13403. // Project: A Project resource. For an overview of projects, see Cloud
  13404. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  13405. // resource_for beta.projects ==)
  13406. type Project struct {
  13407. // CommonInstanceMetadata: Metadata key/value pairs available to all
  13408. // instances contained in this project. See Custom metadata for more
  13409. // information.
  13410. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  13411. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13412. // format.
  13413. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13414. // DefaultServiceAccount: [Output Only] Default service account used by
  13415. // VMs running in this project.
  13416. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  13417. // Description: An optional textual description of the resource.
  13418. Description string `json:"description,omitempty"`
  13419. // EnabledFeatures: Restricted features enabled for use on this project.
  13420. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  13421. // Id: [Output Only] The unique identifier for the resource. This
  13422. // identifier is defined by the server. This is not the project ID, and
  13423. // is just a unique ID used by Compute Engine to identify resources.
  13424. Id uint64 `json:"id,omitempty,string"`
  13425. // Kind: [Output Only] Type of the resource. Always compute#project for
  13426. // projects.
  13427. Kind string `json:"kind,omitempty"`
  13428. // Name: The project ID. For example: my-example-project. Use the
  13429. // project ID to make requests to Compute Engine.
  13430. Name string `json:"name,omitempty"`
  13431. // Quotas: [Output Only] Quotas assigned to this project.
  13432. Quotas []*Quota `json:"quotas,omitempty"`
  13433. // SelfLink: [Output Only] Server-defined URL for the resource.
  13434. SelfLink string `json:"selfLink,omitempty"`
  13435. // UsageExportLocation: The naming prefix for daily usage reports and
  13436. // the Google Cloud Storage bucket where they are stored.
  13437. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  13438. // XpnProjectStatus: [Output Only] The role this project has in a shared
  13439. // VPC configuration. Currently only HOST projects are differentiated.
  13440. //
  13441. // Possible values:
  13442. // "HOST"
  13443. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  13444. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  13445. // ServerResponse contains the HTTP response code and headers from the
  13446. // server.
  13447. googleapi.ServerResponse `json:"-"`
  13448. // ForceSendFields is a list of field names (e.g.
  13449. // "CommonInstanceMetadata") to unconditionally include in API requests.
  13450. // By default, fields with empty values are omitted from API requests.
  13451. // However, any non-pointer, non-interface field appearing in
  13452. // ForceSendFields will be sent to the server regardless of whether the
  13453. // field is empty or not. This may be used to include empty fields in
  13454. // Patch requests.
  13455. ForceSendFields []string `json:"-"`
  13456. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  13457. // to include in API requests with the JSON null value. By default,
  13458. // fields with empty values are omitted from API requests. However, any
  13459. // field with an empty value appearing in NullFields will be sent to the
  13460. // server as null. It is an error if a field in this list has a
  13461. // non-empty value. This may be used to include null fields in Patch
  13462. // requests.
  13463. NullFields []string `json:"-"`
  13464. }
  13465. func (s *Project) MarshalJSON() ([]byte, error) {
  13466. type NoMethod Project
  13467. raw := NoMethod(*s)
  13468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13469. }
  13470. type ProjectsDisableXpnResourceRequest struct {
  13471. // XpnResource: Service resource (a.k.a service project) ID.
  13472. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  13473. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  13474. // unconditionally include in API requests. By default, fields with
  13475. // empty values are omitted from API requests. However, any non-pointer,
  13476. // non-interface field appearing in ForceSendFields will be sent to the
  13477. // server regardless of whether the field is empty or not. This may be
  13478. // used to include empty fields in Patch requests.
  13479. ForceSendFields []string `json:"-"`
  13480. // NullFields is a list of field names (e.g. "XpnResource") to include
  13481. // in API requests with the JSON null value. By default, fields with
  13482. // empty values are omitted from API requests. However, any field with
  13483. // an empty value appearing in NullFields will be sent to the server as
  13484. // null. It is an error if a field in this list has a non-empty value.
  13485. // This may be used to include null fields in Patch requests.
  13486. NullFields []string `json:"-"`
  13487. }
  13488. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  13489. type NoMethod ProjectsDisableXpnResourceRequest
  13490. raw := NoMethod(*s)
  13491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13492. }
  13493. type ProjectsEnableXpnResourceRequest struct {
  13494. // XpnResource: Service resource (a.k.a service project) ID.
  13495. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  13496. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  13497. // unconditionally include in API requests. By default, fields with
  13498. // empty values are omitted from API requests. However, any non-pointer,
  13499. // non-interface field appearing in ForceSendFields will be sent to the
  13500. // server regardless of whether the field is empty or not. This may be
  13501. // used to include empty fields in Patch requests.
  13502. ForceSendFields []string `json:"-"`
  13503. // NullFields is a list of field names (e.g. "XpnResource") to include
  13504. // in API requests with the JSON null value. By default, fields with
  13505. // empty values are omitted from API requests. However, any field with
  13506. // an empty value appearing in NullFields will be sent to the server as
  13507. // null. It is an error if a field in this list has a non-empty value.
  13508. // This may be used to include null fields in Patch requests.
  13509. NullFields []string `json:"-"`
  13510. }
  13511. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  13512. type NoMethod ProjectsEnableXpnResourceRequest
  13513. raw := NoMethod(*s)
  13514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13515. }
  13516. type ProjectsGetXpnResources struct {
  13517. // Kind: [Output Only] Type of resource. Always
  13518. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  13519. // service projects)
  13520. Kind string `json:"kind,omitempty"`
  13521. // NextPageToken: [Output Only] This token allows you to get the next
  13522. // page of results for list requests. If the number of results is larger
  13523. // than maxResults, use the nextPageToken as a value for the query
  13524. // parameter pageToken in the next list request. Subsequent list
  13525. // requests will have their own nextPageToken to continue paging through
  13526. // the results.
  13527. NextPageToken string `json:"nextPageToken,omitempty"`
  13528. // Resources: Service resources (a.k.a service projects) attached to
  13529. // this project as their shared VPC host.
  13530. Resources []*XpnResourceId `json:"resources,omitempty"`
  13531. // ServerResponse contains the HTTP response code and headers from the
  13532. // server.
  13533. googleapi.ServerResponse `json:"-"`
  13534. // ForceSendFields is a list of field names (e.g. "Kind") to
  13535. // unconditionally include in API requests. By default, fields with
  13536. // empty values are omitted from API requests. However, any non-pointer,
  13537. // non-interface field appearing in ForceSendFields will be sent to the
  13538. // server regardless of whether the field is empty or not. This may be
  13539. // used to include empty fields in Patch requests.
  13540. ForceSendFields []string `json:"-"`
  13541. // NullFields is a list of field names (e.g. "Kind") to include in API
  13542. // requests with the JSON null value. By default, fields with empty
  13543. // values are omitted from API requests. However, any field with an
  13544. // empty value appearing in NullFields will be sent to the server as
  13545. // null. It is an error if a field in this list has a non-empty value.
  13546. // This may be used to include null fields in Patch requests.
  13547. NullFields []string `json:"-"`
  13548. }
  13549. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  13550. type NoMethod ProjectsGetXpnResources
  13551. raw := NoMethod(*s)
  13552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13553. }
  13554. type ProjectsListXpnHostsRequest struct {
  13555. // Organization: Optional organization ID managed by Cloud Resource
  13556. // Manager, for which to list shared VPC host projects. If not
  13557. // specified, the organization will be inferred from the project.
  13558. Organization string `json:"organization,omitempty"`
  13559. // ForceSendFields is a list of field names (e.g. "Organization") to
  13560. // unconditionally include in API requests. By default, fields with
  13561. // empty values are omitted from API requests. However, any non-pointer,
  13562. // non-interface field appearing in ForceSendFields will be sent to the
  13563. // server regardless of whether the field is empty or not. This may be
  13564. // used to include empty fields in Patch requests.
  13565. ForceSendFields []string `json:"-"`
  13566. // NullFields is a list of field names (e.g. "Organization") to include
  13567. // in API requests with the JSON null value. By default, fields with
  13568. // empty values are omitted from API requests. However, any field with
  13569. // an empty value appearing in NullFields will be sent to the server as
  13570. // null. It is an error if a field in this list has a non-empty value.
  13571. // This may be used to include null fields in Patch requests.
  13572. NullFields []string `json:"-"`
  13573. }
  13574. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  13575. type NoMethod ProjectsListXpnHostsRequest
  13576. raw := NoMethod(*s)
  13577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13578. }
  13579. // Quota: A quotas entry.
  13580. type Quota struct {
  13581. // Limit: [Output Only] Quota limit for this metric.
  13582. Limit float64 `json:"limit,omitempty"`
  13583. // Metric: [Output Only] Name of the quota metric.
  13584. //
  13585. // Possible values:
  13586. // "AUTOSCALERS"
  13587. // "BACKEND_BUCKETS"
  13588. // "BACKEND_SERVICES"
  13589. // "COMMITMENTS"
  13590. // "CPUS"
  13591. // "CPUS_ALL_REGIONS"
  13592. // "DISKS_TOTAL_GB"
  13593. // "FIREWALLS"
  13594. // "FORWARDING_RULES"
  13595. // "HEALTH_CHECKS"
  13596. // "IMAGES"
  13597. // "INSTANCES"
  13598. // "INSTANCE_GROUPS"
  13599. // "INSTANCE_GROUP_MANAGERS"
  13600. // "INSTANCE_TEMPLATES"
  13601. // "INTERCONNECTS"
  13602. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  13603. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  13604. // "INTERNAL_ADDRESSES"
  13605. // "IN_USE_ADDRESSES"
  13606. // "LOCAL_SSD_TOTAL_GB"
  13607. // "NETWORKS"
  13608. // "NVIDIA_K80_GPUS"
  13609. // "NVIDIA_P100_GPUS"
  13610. // "NVIDIA_V100_GPUS"
  13611. // "PREEMPTIBLE_CPUS"
  13612. // "PREEMPTIBLE_LOCAL_SSD_GB"
  13613. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  13614. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  13615. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  13616. // "REGIONAL_AUTOSCALERS"
  13617. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  13618. // "ROUTERS"
  13619. // "ROUTES"
  13620. // "SECURITY_POLICIES"
  13621. // "SECURITY_POLICY_RULES"
  13622. // "SNAPSHOTS"
  13623. // "SSD_TOTAL_GB"
  13624. // "SSL_CERTIFICATES"
  13625. // "STATIC_ADDRESSES"
  13626. // "SUBNETWORKS"
  13627. // "TARGET_HTTPS_PROXIES"
  13628. // "TARGET_HTTP_PROXIES"
  13629. // "TARGET_INSTANCES"
  13630. // "TARGET_POOLS"
  13631. // "TARGET_SSL_PROXIES"
  13632. // "TARGET_TCP_PROXIES"
  13633. // "TARGET_VPN_GATEWAYS"
  13634. // "URL_MAPS"
  13635. // "VPN_TUNNELS"
  13636. Metric string `json:"metric,omitempty"`
  13637. // Usage: [Output Only] Current usage of this metric.
  13638. Usage float64 `json:"usage,omitempty"`
  13639. // ForceSendFields is a list of field names (e.g. "Limit") to
  13640. // unconditionally include in API requests. By default, fields with
  13641. // empty values are omitted from API requests. However, any non-pointer,
  13642. // non-interface field appearing in ForceSendFields will be sent to the
  13643. // server regardless of whether the field is empty or not. This may be
  13644. // used to include empty fields in Patch requests.
  13645. ForceSendFields []string `json:"-"`
  13646. // NullFields is a list of field names (e.g. "Limit") to include in API
  13647. // requests with the JSON null value. By default, fields with empty
  13648. // values are omitted from API requests. However, any field with an
  13649. // empty value appearing in NullFields will be sent to the server as
  13650. // null. It is an error if a field in this list has a non-empty value.
  13651. // This may be used to include null fields in Patch requests.
  13652. NullFields []string `json:"-"`
  13653. }
  13654. func (s *Quota) MarshalJSON() ([]byte, error) {
  13655. type NoMethod Quota
  13656. raw := NoMethod(*s)
  13657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13658. }
  13659. func (s *Quota) UnmarshalJSON(data []byte) error {
  13660. type NoMethod Quota
  13661. var s1 struct {
  13662. Limit gensupport.JSONFloat64 `json:"limit"`
  13663. Usage gensupport.JSONFloat64 `json:"usage"`
  13664. *NoMethod
  13665. }
  13666. s1.NoMethod = (*NoMethod)(s)
  13667. if err := json.Unmarshal(data, &s1); err != nil {
  13668. return err
  13669. }
  13670. s.Limit = float64(s1.Limit)
  13671. s.Usage = float64(s1.Usage)
  13672. return nil
  13673. }
  13674. // Reference: Represents a reference to a resource.
  13675. type Reference struct {
  13676. // Kind: [Output Only] Type of the resource. Always compute#reference
  13677. // for references.
  13678. Kind string `json:"kind,omitempty"`
  13679. // ReferenceType: A description of the reference type with no implied
  13680. // semantics. Possible values include:
  13681. // - MEMBER_OF
  13682. ReferenceType string `json:"referenceType,omitempty"`
  13683. // Referrer: URL of the resource which refers to the target.
  13684. Referrer string `json:"referrer,omitempty"`
  13685. // Target: URL of the resource to which this reference points.
  13686. Target string `json:"target,omitempty"`
  13687. // ForceSendFields is a list of field names (e.g. "Kind") to
  13688. // unconditionally include in API requests. By default, fields with
  13689. // empty values are omitted from API requests. However, any non-pointer,
  13690. // non-interface field appearing in ForceSendFields will be sent to the
  13691. // server regardless of whether the field is empty or not. This may be
  13692. // used to include empty fields in Patch requests.
  13693. ForceSendFields []string `json:"-"`
  13694. // NullFields is a list of field names (e.g. "Kind") to include in API
  13695. // requests with the JSON null value. By default, fields with empty
  13696. // values are omitted from API requests. However, any field with an
  13697. // empty value appearing in NullFields will be sent to the server as
  13698. // null. It is an error if a field in this list has a non-empty value.
  13699. // This may be used to include null fields in Patch requests.
  13700. NullFields []string `json:"-"`
  13701. }
  13702. func (s *Reference) MarshalJSON() ([]byte, error) {
  13703. type NoMethod Reference
  13704. raw := NoMethod(*s)
  13705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13706. }
  13707. // Region: Region resource. (== resource_for beta.regions ==) (==
  13708. // resource_for v1.regions ==)
  13709. type Region struct {
  13710. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13711. // format.
  13712. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13713. // Deprecated: [Output Only] The deprecation status associated with this
  13714. // region.
  13715. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  13716. // Description: [Output Only] Textual description of the resource.
  13717. Description string `json:"description,omitempty"`
  13718. // Id: [Output Only] The unique identifier for the resource. This
  13719. // identifier is defined by the server.
  13720. Id uint64 `json:"id,omitempty,string"`
  13721. // Kind: [Output Only] Type of the resource. Always compute#region for
  13722. // regions.
  13723. Kind string `json:"kind,omitempty"`
  13724. // Name: [Output Only] Name of the resource.
  13725. Name string `json:"name,omitempty"`
  13726. // Quotas: [Output Only] Quotas assigned to this region.
  13727. Quotas []*Quota `json:"quotas,omitempty"`
  13728. // SelfLink: [Output Only] Server-defined URL for the resource.
  13729. SelfLink string `json:"selfLink,omitempty"`
  13730. // Status: [Output Only] Status of the region, either UP or DOWN.
  13731. //
  13732. // Possible values:
  13733. // "DOWN"
  13734. // "UP"
  13735. Status string `json:"status,omitempty"`
  13736. // Zones: [Output Only] A list of zones available in this region, in the
  13737. // form of resource URLs.
  13738. Zones []string `json:"zones,omitempty"`
  13739. // ServerResponse contains the HTTP response code and headers from the
  13740. // server.
  13741. googleapi.ServerResponse `json:"-"`
  13742. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  13743. // to unconditionally include in API requests. By default, fields with
  13744. // empty values are omitted from API requests. However, any non-pointer,
  13745. // non-interface field appearing in ForceSendFields will be sent to the
  13746. // server regardless of whether the field is empty or not. This may be
  13747. // used to include empty fields in Patch requests.
  13748. ForceSendFields []string `json:"-"`
  13749. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  13750. // include in API requests with the JSON null value. By default, fields
  13751. // with empty values are omitted from API requests. However, any field
  13752. // with an empty value appearing in NullFields will be sent to the
  13753. // server as null. It is an error if a field in this list has a
  13754. // non-empty value. This may be used to include null fields in Patch
  13755. // requests.
  13756. NullFields []string `json:"-"`
  13757. }
  13758. func (s *Region) MarshalJSON() ([]byte, error) {
  13759. type NoMethod Region
  13760. raw := NoMethod(*s)
  13761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13762. }
  13763. // RegionAutoscalerList: Contains a list of autoscalers.
  13764. type RegionAutoscalerList struct {
  13765. // Id: [Output Only] Unique identifier for the resource; defined by the
  13766. // server.
  13767. Id string `json:"id,omitempty"`
  13768. // Items: A list of Autoscaler resources.
  13769. Items []*Autoscaler `json:"items,omitempty"`
  13770. // Kind: Type of resource.
  13771. Kind string `json:"kind,omitempty"`
  13772. // NextPageToken: [Output Only] This token allows you to get the next
  13773. // page of results for list requests. If the number of results is larger
  13774. // than maxResults, use the nextPageToken as a value for the query
  13775. // parameter pageToken in the next list request. Subsequent list
  13776. // requests will have their own nextPageToken to continue paging through
  13777. // the results.
  13778. NextPageToken string `json:"nextPageToken,omitempty"`
  13779. // SelfLink: [Output Only] Server-defined URL for this resource.
  13780. SelfLink string `json:"selfLink,omitempty"`
  13781. // Warning: [Output Only] Informational warning message.
  13782. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  13783. // ServerResponse contains the HTTP response code and headers from the
  13784. // server.
  13785. googleapi.ServerResponse `json:"-"`
  13786. // ForceSendFields is a list of field names (e.g. "Id") to
  13787. // unconditionally include in API requests. By default, fields with
  13788. // empty values are omitted from API requests. However, any non-pointer,
  13789. // non-interface field appearing in ForceSendFields will be sent to the
  13790. // server regardless of whether the field is empty or not. This may be
  13791. // used to include empty fields in Patch requests.
  13792. ForceSendFields []string `json:"-"`
  13793. // NullFields is a list of field names (e.g. "Id") to include in API
  13794. // requests with the JSON null value. By default, fields with empty
  13795. // values are omitted from API requests. However, any field with an
  13796. // empty value appearing in NullFields will be sent to the server as
  13797. // null. It is an error if a field in this list has a non-empty value.
  13798. // This may be used to include null fields in Patch requests.
  13799. NullFields []string `json:"-"`
  13800. }
  13801. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  13802. type NoMethod RegionAutoscalerList
  13803. raw := NoMethod(*s)
  13804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13805. }
  13806. // RegionAutoscalerListWarning: [Output Only] Informational warning
  13807. // message.
  13808. type RegionAutoscalerListWarning struct {
  13809. // Code: [Output Only] A warning code, if applicable. For example,
  13810. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13811. // the response.
  13812. //
  13813. // Possible values:
  13814. // "CLEANUP_FAILED"
  13815. // "DEPRECATED_RESOURCE_USED"
  13816. // "DEPRECATED_TYPE_USED"
  13817. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13818. // "EXPERIMENTAL_TYPE_USED"
  13819. // "EXTERNAL_API_WARNING"
  13820. // "FIELD_VALUE_OVERRIDEN"
  13821. // "INJECTED_KERNELS_DEPRECATED"
  13822. // "MISSING_TYPE_DEPENDENCY"
  13823. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13824. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13825. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13826. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13827. // "NEXT_HOP_NOT_RUNNING"
  13828. // "NOT_CRITICAL_ERROR"
  13829. // "NO_RESULTS_ON_PAGE"
  13830. // "REQUIRED_TOS_AGREEMENT"
  13831. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13832. // "RESOURCE_NOT_DELETED"
  13833. // "SCHEMA_VALIDATION_IGNORED"
  13834. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13835. // "UNDECLARED_PROPERTIES"
  13836. // "UNREACHABLE"
  13837. Code string `json:"code,omitempty"`
  13838. // Data: [Output Only] Metadata about this warning in key: value format.
  13839. // For example:
  13840. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13841. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  13842. // Message: [Output Only] A human-readable description of the warning
  13843. // code.
  13844. Message string `json:"message,omitempty"`
  13845. // ForceSendFields is a list of field names (e.g. "Code") to
  13846. // unconditionally include in API requests. By default, fields with
  13847. // empty values are omitted from API requests. However, any non-pointer,
  13848. // non-interface field appearing in ForceSendFields will be sent to the
  13849. // server regardless of whether the field is empty or not. This may be
  13850. // used to include empty fields in Patch requests.
  13851. ForceSendFields []string `json:"-"`
  13852. // NullFields is a list of field names (e.g. "Code") to include in API
  13853. // requests with the JSON null value. By default, fields with empty
  13854. // values are omitted from API requests. However, any field with an
  13855. // empty value appearing in NullFields will be sent to the server as
  13856. // null. It is an error if a field in this list has a non-empty value.
  13857. // This may be used to include null fields in Patch requests.
  13858. NullFields []string `json:"-"`
  13859. }
  13860. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  13861. type NoMethod RegionAutoscalerListWarning
  13862. raw := NoMethod(*s)
  13863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13864. }
  13865. type RegionAutoscalerListWarningData struct {
  13866. // Key: [Output Only] A key that provides more detail on the warning
  13867. // being returned. For example, for warnings where there are no results
  13868. // in a list request for a particular zone, this key might be scope and
  13869. // the key value might be the zone name. Other examples might be a key
  13870. // indicating a deprecated resource and a suggested replacement, or a
  13871. // warning about invalid network settings (for example, if an instance
  13872. // attempts to perform IP forwarding but is not enabled for IP
  13873. // forwarding).
  13874. Key string `json:"key,omitempty"`
  13875. // Value: [Output Only] A warning data value corresponding to the key.
  13876. Value string `json:"value,omitempty"`
  13877. // ForceSendFields is a list of field names (e.g. "Key") to
  13878. // unconditionally include in API requests. By default, fields with
  13879. // empty values are omitted from API requests. However, any non-pointer,
  13880. // non-interface field appearing in ForceSendFields will be sent to the
  13881. // server regardless of whether the field is empty or not. This may be
  13882. // used to include empty fields in Patch requests.
  13883. ForceSendFields []string `json:"-"`
  13884. // NullFields is a list of field names (e.g. "Key") to include in API
  13885. // requests with the JSON null value. By default, fields with empty
  13886. // values are omitted from API requests. However, any field with an
  13887. // empty value appearing in NullFields will be sent to the server as
  13888. // null. It is an error if a field in this list has a non-empty value.
  13889. // This may be used to include null fields in Patch requests.
  13890. NullFields []string `json:"-"`
  13891. }
  13892. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  13893. type NoMethod RegionAutoscalerListWarningData
  13894. raw := NoMethod(*s)
  13895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13896. }
  13897. type RegionDiskTypeList struct {
  13898. // Id: [Output Only] Unique identifier for the resource; defined by the
  13899. // server.
  13900. Id string `json:"id,omitempty"`
  13901. // Items: A list of DiskType resources.
  13902. Items []*DiskType `json:"items,omitempty"`
  13903. // Kind: [Output Only] Type of resource. Always
  13904. // compute#regionDiskTypeList for region disk types.
  13905. Kind string `json:"kind,omitempty"`
  13906. // NextPageToken: [Output Only] This token allows you to get the next
  13907. // page of results for list requests. If the number of results is larger
  13908. // than maxResults, use the nextPageToken as a value for the query
  13909. // parameter pageToken in the next list request. Subsequent list
  13910. // requests will have their own nextPageToken to continue paging through
  13911. // the results.
  13912. NextPageToken string `json:"nextPageToken,omitempty"`
  13913. // SelfLink: [Output Only] Server-defined URL for this resource.
  13914. SelfLink string `json:"selfLink,omitempty"`
  13915. // Warning: [Output Only] Informational warning message.
  13916. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  13917. // ServerResponse contains the HTTP response code and headers from the
  13918. // server.
  13919. googleapi.ServerResponse `json:"-"`
  13920. // ForceSendFields is a list of field names (e.g. "Id") to
  13921. // unconditionally include in API requests. By default, fields with
  13922. // empty values are omitted from API requests. However, any non-pointer,
  13923. // non-interface field appearing in ForceSendFields will be sent to the
  13924. // server regardless of whether the field is empty or not. This may be
  13925. // used to include empty fields in Patch requests.
  13926. ForceSendFields []string `json:"-"`
  13927. // NullFields is a list of field names (e.g. "Id") to include in API
  13928. // requests with the JSON null value. By default, fields with empty
  13929. // values are omitted from API requests. However, any field with an
  13930. // empty value appearing in NullFields will be sent to the server as
  13931. // null. It is an error if a field in this list has a non-empty value.
  13932. // This may be used to include null fields in Patch requests.
  13933. NullFields []string `json:"-"`
  13934. }
  13935. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  13936. type NoMethod RegionDiskTypeList
  13937. raw := NoMethod(*s)
  13938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13939. }
  13940. // RegionDiskTypeListWarning: [Output Only] Informational warning
  13941. // message.
  13942. type RegionDiskTypeListWarning struct {
  13943. // Code: [Output Only] A warning code, if applicable. For example,
  13944. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13945. // the response.
  13946. //
  13947. // Possible values:
  13948. // "CLEANUP_FAILED"
  13949. // "DEPRECATED_RESOURCE_USED"
  13950. // "DEPRECATED_TYPE_USED"
  13951. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13952. // "EXPERIMENTAL_TYPE_USED"
  13953. // "EXTERNAL_API_WARNING"
  13954. // "FIELD_VALUE_OVERRIDEN"
  13955. // "INJECTED_KERNELS_DEPRECATED"
  13956. // "MISSING_TYPE_DEPENDENCY"
  13957. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13958. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13959. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13960. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13961. // "NEXT_HOP_NOT_RUNNING"
  13962. // "NOT_CRITICAL_ERROR"
  13963. // "NO_RESULTS_ON_PAGE"
  13964. // "REQUIRED_TOS_AGREEMENT"
  13965. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13966. // "RESOURCE_NOT_DELETED"
  13967. // "SCHEMA_VALIDATION_IGNORED"
  13968. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13969. // "UNDECLARED_PROPERTIES"
  13970. // "UNREACHABLE"
  13971. Code string `json:"code,omitempty"`
  13972. // Data: [Output Only] Metadata about this warning in key: value format.
  13973. // For example:
  13974. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13975. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  13976. // Message: [Output Only] A human-readable description of the warning
  13977. // code.
  13978. Message string `json:"message,omitempty"`
  13979. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") to include in API
  13987. // requests with the JSON null value. By default, fields with empty
  13988. // values are omitted from API requests. However, any field with an
  13989. // empty value appearing in NullFields will be sent to the server as
  13990. // null. It is an error if a field in this list has a non-empty value.
  13991. // This may be used to include null fields in Patch requests.
  13992. NullFields []string `json:"-"`
  13993. }
  13994. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  13995. type NoMethod RegionDiskTypeListWarning
  13996. raw := NoMethod(*s)
  13997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13998. }
  13999. type RegionDiskTypeListWarningData struct {
  14000. // Key: [Output Only] A key that provides more detail on the warning
  14001. // being returned. For example, for warnings where there are no results
  14002. // in a list request for a particular zone, this key might be scope and
  14003. // the key value might be the zone name. Other examples might be a key
  14004. // indicating a deprecated resource and a suggested replacement, or a
  14005. // warning about invalid network settings (for example, if an instance
  14006. // attempts to perform IP forwarding but is not enabled for IP
  14007. // forwarding).
  14008. Key string `json:"key,omitempty"`
  14009. // Value: [Output Only] A warning data value corresponding to the key.
  14010. Value string `json:"value,omitempty"`
  14011. // ForceSendFields is a list of field names (e.g. "Key") to
  14012. // unconditionally include in API requests. By default, fields with
  14013. // empty values are omitted from API requests. However, any non-pointer,
  14014. // non-interface field appearing in ForceSendFields will be sent to the
  14015. // server regardless of whether the field is empty or not. This may be
  14016. // used to include empty fields in Patch requests.
  14017. ForceSendFields []string `json:"-"`
  14018. // NullFields is a list of field names (e.g. "Key") to include in API
  14019. // requests with the JSON null value. By default, fields with empty
  14020. // values are omitted from API requests. However, any field with an
  14021. // empty value appearing in NullFields will be sent to the server as
  14022. // null. It is an error if a field in this list has a non-empty value.
  14023. // This may be used to include null fields in Patch requests.
  14024. NullFields []string `json:"-"`
  14025. }
  14026. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  14027. type NoMethod RegionDiskTypeListWarningData
  14028. raw := NoMethod(*s)
  14029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14030. }
  14031. type RegionDisksResizeRequest struct {
  14032. // SizeGb: The new size of the regional persistent disk, which is
  14033. // specified in GB.
  14034. SizeGb int64 `json:"sizeGb,omitempty,string"`
  14035. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  14036. // unconditionally include in API requests. By default, fields with
  14037. // empty values are omitted from API requests. However, any non-pointer,
  14038. // non-interface field appearing in ForceSendFields will be sent to the
  14039. // server regardless of whether the field is empty or not. This may be
  14040. // used to include empty fields in Patch requests.
  14041. ForceSendFields []string `json:"-"`
  14042. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  14043. // requests with the JSON null value. By default, fields with empty
  14044. // values are omitted from API requests. However, any field with an
  14045. // empty value appearing in NullFields will be sent to the server as
  14046. // null. It is an error if a field in this list has a non-empty value.
  14047. // This may be used to include null fields in Patch requests.
  14048. NullFields []string `json:"-"`
  14049. }
  14050. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  14051. type NoMethod RegionDisksResizeRequest
  14052. raw := NoMethod(*s)
  14053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14054. }
  14055. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  14056. type RegionInstanceGroupList struct {
  14057. // Id: [Output Only] Unique identifier for the resource; defined by the
  14058. // server.
  14059. Id string `json:"id,omitempty"`
  14060. // Items: A list of InstanceGroup resources.
  14061. Items []*InstanceGroup `json:"items,omitempty"`
  14062. // Kind: The resource type.
  14063. Kind string `json:"kind,omitempty"`
  14064. // NextPageToken: [Output Only] This token allows you to get the next
  14065. // page of results for list requests. If the number of results is larger
  14066. // than maxResults, use the nextPageToken as a value for the query
  14067. // parameter pageToken in the next list request. Subsequent list
  14068. // requests will have their own nextPageToken to continue paging through
  14069. // the results.
  14070. NextPageToken string `json:"nextPageToken,omitempty"`
  14071. // SelfLink: [Output Only] Server-defined URL for this resource.
  14072. SelfLink string `json:"selfLink,omitempty"`
  14073. // Warning: [Output Only] Informational warning message.
  14074. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  14075. // ServerResponse contains the HTTP response code and headers from the
  14076. // server.
  14077. googleapi.ServerResponse `json:"-"`
  14078. // ForceSendFields is a list of field names (e.g. "Id") to
  14079. // unconditionally include in API requests. By default, fields with
  14080. // empty values are omitted from API requests. However, any non-pointer,
  14081. // non-interface field appearing in ForceSendFields will be sent to the
  14082. // server regardless of whether the field is empty or not. This may be
  14083. // used to include empty fields in Patch requests.
  14084. ForceSendFields []string `json:"-"`
  14085. // NullFields is a list of field names (e.g. "Id") to include in API
  14086. // requests with the JSON null value. By default, fields with empty
  14087. // values are omitted from API requests. However, any field with an
  14088. // empty value appearing in NullFields will be sent to the server as
  14089. // null. It is an error if a field in this list has a non-empty value.
  14090. // This may be used to include null fields in Patch requests.
  14091. NullFields []string `json:"-"`
  14092. }
  14093. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  14094. type NoMethod RegionInstanceGroupList
  14095. raw := NoMethod(*s)
  14096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14097. }
  14098. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  14099. // message.
  14100. type RegionInstanceGroupListWarning struct {
  14101. // Code: [Output Only] A warning code, if applicable. For example,
  14102. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14103. // the response.
  14104. //
  14105. // Possible values:
  14106. // "CLEANUP_FAILED"
  14107. // "DEPRECATED_RESOURCE_USED"
  14108. // "DEPRECATED_TYPE_USED"
  14109. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14110. // "EXPERIMENTAL_TYPE_USED"
  14111. // "EXTERNAL_API_WARNING"
  14112. // "FIELD_VALUE_OVERRIDEN"
  14113. // "INJECTED_KERNELS_DEPRECATED"
  14114. // "MISSING_TYPE_DEPENDENCY"
  14115. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14116. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14117. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14118. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14119. // "NEXT_HOP_NOT_RUNNING"
  14120. // "NOT_CRITICAL_ERROR"
  14121. // "NO_RESULTS_ON_PAGE"
  14122. // "REQUIRED_TOS_AGREEMENT"
  14123. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14124. // "RESOURCE_NOT_DELETED"
  14125. // "SCHEMA_VALIDATION_IGNORED"
  14126. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14127. // "UNDECLARED_PROPERTIES"
  14128. // "UNREACHABLE"
  14129. Code string `json:"code,omitempty"`
  14130. // Data: [Output Only] Metadata about this warning in key: value format.
  14131. // For example:
  14132. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14133. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  14134. // Message: [Output Only] A human-readable description of the warning
  14135. // code.
  14136. Message string `json:"message,omitempty"`
  14137. // ForceSendFields is a list of field names (e.g. "Code") to
  14138. // unconditionally include in API requests. By default, fields with
  14139. // empty values are omitted from API requests. However, any non-pointer,
  14140. // non-interface field appearing in ForceSendFields will be sent to the
  14141. // server regardless of whether the field is empty or not. This may be
  14142. // used to include empty fields in Patch requests.
  14143. ForceSendFields []string `json:"-"`
  14144. // NullFields is a list of field names (e.g. "Code") to include in API
  14145. // requests with the JSON null value. By default, fields with empty
  14146. // values are omitted from API requests. However, any field with an
  14147. // empty value appearing in NullFields will be sent to the server as
  14148. // null. It is an error if a field in this list has a non-empty value.
  14149. // This may be used to include null fields in Patch requests.
  14150. NullFields []string `json:"-"`
  14151. }
  14152. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  14153. type NoMethod RegionInstanceGroupListWarning
  14154. raw := NoMethod(*s)
  14155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14156. }
  14157. type RegionInstanceGroupListWarningData struct {
  14158. // Key: [Output Only] A key that provides more detail on the warning
  14159. // being returned. For example, for warnings where there are no results
  14160. // in a list request for a particular zone, this key might be scope and
  14161. // the key value might be the zone name. Other examples might be a key
  14162. // indicating a deprecated resource and a suggested replacement, or a
  14163. // warning about invalid network settings (for example, if an instance
  14164. // attempts to perform IP forwarding but is not enabled for IP
  14165. // forwarding).
  14166. Key string `json:"key,omitempty"`
  14167. // Value: [Output Only] A warning data value corresponding to the key.
  14168. Value string `json:"value,omitempty"`
  14169. // ForceSendFields is a list of field names (e.g. "Key") to
  14170. // unconditionally include in API requests. By default, fields with
  14171. // empty values are omitted from API requests. However, any non-pointer,
  14172. // non-interface field appearing in ForceSendFields will be sent to the
  14173. // server regardless of whether the field is empty or not. This may be
  14174. // used to include empty fields in Patch requests.
  14175. ForceSendFields []string `json:"-"`
  14176. // NullFields is a list of field names (e.g. "Key") to include in API
  14177. // requests with the JSON null value. By default, fields with empty
  14178. // values are omitted from API requests. However, any field with an
  14179. // empty value appearing in NullFields will be sent to the server as
  14180. // null. It is an error if a field in this list has a non-empty value.
  14181. // This may be used to include null fields in Patch requests.
  14182. NullFields []string `json:"-"`
  14183. }
  14184. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  14185. type NoMethod RegionInstanceGroupListWarningData
  14186. raw := NoMethod(*s)
  14187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14188. }
  14189. // RegionInstanceGroupManagerList: Contains a list of managed instance
  14190. // groups.
  14191. type RegionInstanceGroupManagerList struct {
  14192. // Id: [Output Only] Unique identifier for the resource; defined by the
  14193. // server.
  14194. Id string `json:"id,omitempty"`
  14195. // Items: A list of InstanceGroupManager resources.
  14196. Items []*InstanceGroupManager `json:"items,omitempty"`
  14197. // Kind: [Output Only] The resource type, which is always
  14198. // compute#instanceGroupManagerList for a list of managed instance
  14199. // groups that exist in th regional scope.
  14200. Kind string `json:"kind,omitempty"`
  14201. // NextPageToken: [Output Only] This token allows you to get the next
  14202. // page of results for list requests. If the number of results is larger
  14203. // than maxResults, use the nextPageToken as a value for the query
  14204. // parameter pageToken in the next list request. Subsequent list
  14205. // requests will have their own nextPageToken to continue paging through
  14206. // the results.
  14207. NextPageToken string `json:"nextPageToken,omitempty"`
  14208. // SelfLink: [Output Only] Server-defined URL for this resource.
  14209. SelfLink string `json:"selfLink,omitempty"`
  14210. // Warning: [Output Only] Informational warning message.
  14211. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  14212. // ServerResponse contains the HTTP response code and headers from the
  14213. // server.
  14214. googleapi.ServerResponse `json:"-"`
  14215. // ForceSendFields is a list of field names (e.g. "Id") to
  14216. // unconditionally include in API requests. By default, fields with
  14217. // empty values are omitted from API requests. However, any non-pointer,
  14218. // non-interface field appearing in ForceSendFields will be sent to the
  14219. // server regardless of whether the field is empty or not. This may be
  14220. // used to include empty fields in Patch requests.
  14221. ForceSendFields []string `json:"-"`
  14222. // NullFields is a list of field names (e.g. "Id") to include in API
  14223. // requests with the JSON null value. By default, fields with empty
  14224. // values are omitted from API requests. However, any field with an
  14225. // empty value appearing in NullFields will be sent to the server as
  14226. // null. It is an error if a field in this list has a non-empty value.
  14227. // This may be used to include null fields in Patch requests.
  14228. NullFields []string `json:"-"`
  14229. }
  14230. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  14231. type NoMethod RegionInstanceGroupManagerList
  14232. raw := NoMethod(*s)
  14233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14234. }
  14235. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  14236. // warning message.
  14237. type RegionInstanceGroupManagerListWarning struct {
  14238. // Code: [Output Only] A warning code, if applicable. For example,
  14239. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14240. // the response.
  14241. //
  14242. // Possible values:
  14243. // "CLEANUP_FAILED"
  14244. // "DEPRECATED_RESOURCE_USED"
  14245. // "DEPRECATED_TYPE_USED"
  14246. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14247. // "EXPERIMENTAL_TYPE_USED"
  14248. // "EXTERNAL_API_WARNING"
  14249. // "FIELD_VALUE_OVERRIDEN"
  14250. // "INJECTED_KERNELS_DEPRECATED"
  14251. // "MISSING_TYPE_DEPENDENCY"
  14252. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14253. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14254. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14255. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14256. // "NEXT_HOP_NOT_RUNNING"
  14257. // "NOT_CRITICAL_ERROR"
  14258. // "NO_RESULTS_ON_PAGE"
  14259. // "REQUIRED_TOS_AGREEMENT"
  14260. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14261. // "RESOURCE_NOT_DELETED"
  14262. // "SCHEMA_VALIDATION_IGNORED"
  14263. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14264. // "UNDECLARED_PROPERTIES"
  14265. // "UNREACHABLE"
  14266. Code string `json:"code,omitempty"`
  14267. // Data: [Output Only] Metadata about this warning in key: value format.
  14268. // For example:
  14269. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14270. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  14271. // Message: [Output Only] A human-readable description of the warning
  14272. // code.
  14273. Message string `json:"message,omitempty"`
  14274. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  14290. type NoMethod RegionInstanceGroupManagerListWarning
  14291. raw := NoMethod(*s)
  14292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14293. }
  14294. type RegionInstanceGroupManagerListWarningData struct {
  14295. // Key: [Output Only] A key that provides more detail on the warning
  14296. // being returned. For example, for warnings where there are no results
  14297. // in a list request for a particular zone, this key might be scope and
  14298. // the key value might be the zone name. Other examples might be a key
  14299. // indicating a deprecated resource and a suggested replacement, or a
  14300. // warning about invalid network settings (for example, if an instance
  14301. // attempts to perform IP forwarding but is not enabled for IP
  14302. // forwarding).
  14303. Key string `json:"key,omitempty"`
  14304. // Value: [Output Only] A warning data value corresponding to the key.
  14305. Value string `json:"value,omitempty"`
  14306. // ForceSendFields is a list of field names (e.g. "Key") to
  14307. // unconditionally include in API requests. By default, fields with
  14308. // empty values are omitted from API requests. However, any non-pointer,
  14309. // non-interface field appearing in ForceSendFields will be sent to the
  14310. // server regardless of whether the field is empty or not. This may be
  14311. // used to include empty fields in Patch requests.
  14312. ForceSendFields []string `json:"-"`
  14313. // NullFields is a list of field names (e.g. "Key") to include in API
  14314. // requests with the JSON null value. By default, fields with empty
  14315. // values are omitted from API requests. However, any field with an
  14316. // empty value appearing in NullFields will be sent to the server as
  14317. // null. It is an error if a field in this list has a non-empty value.
  14318. // This may be used to include null fields in Patch requests.
  14319. NullFields []string `json:"-"`
  14320. }
  14321. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  14322. type NoMethod RegionInstanceGroupManagerListWarningData
  14323. raw := NoMethod(*s)
  14324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14325. }
  14326. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  14327. // Instances: The URLs of one or more instances to abandon. This can be
  14328. // a full URL or a partial URL, such as
  14329. // zones/[ZONE]/instances/[INSTANCE_NAME].
  14330. Instances []string `json:"instances,omitempty"`
  14331. // ForceSendFields is a list of field names (e.g. "Instances") to
  14332. // unconditionally include in API requests. By default, fields with
  14333. // empty values are omitted from API requests. However, any non-pointer,
  14334. // non-interface field appearing in ForceSendFields will be sent to the
  14335. // server regardless of whether the field is empty or not. This may be
  14336. // used to include empty fields in Patch requests.
  14337. ForceSendFields []string `json:"-"`
  14338. // NullFields is a list of field names (e.g. "Instances") to include in
  14339. // API requests with the JSON null value. By default, fields with empty
  14340. // values are omitted from API requests. However, any field with an
  14341. // empty value appearing in NullFields will be sent to the server as
  14342. // null. It is an error if a field in this list has a non-empty value.
  14343. // This may be used to include null fields in Patch requests.
  14344. NullFields []string `json:"-"`
  14345. }
  14346. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  14347. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  14348. raw := NoMethod(*s)
  14349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14350. }
  14351. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  14352. // Instances: The URLs of one or more instances to delete. This can be a
  14353. // full URL or a partial URL, such as
  14354. // zones/[ZONE]/instances/[INSTANCE_NAME].
  14355. Instances []string `json:"instances,omitempty"`
  14356. // ForceSendFields is a list of field names (e.g. "Instances") to
  14357. // unconditionally include in API requests. By default, fields with
  14358. // empty values are omitted from API requests. However, any non-pointer,
  14359. // non-interface field appearing in ForceSendFields will be sent to the
  14360. // server regardless of whether the field is empty or not. This may be
  14361. // used to include empty fields in Patch requests.
  14362. ForceSendFields []string `json:"-"`
  14363. // NullFields is a list of field names (e.g. "Instances") to include in
  14364. // API requests with the JSON null value. By default, fields with empty
  14365. // values are omitted from API requests. However, any field with an
  14366. // empty value appearing in NullFields will be sent to the server as
  14367. // null. It is an error if a field in this list has a non-empty value.
  14368. // This may be used to include null fields in Patch requests.
  14369. NullFields []string `json:"-"`
  14370. }
  14371. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  14372. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  14373. raw := NoMethod(*s)
  14374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14375. }
  14376. type RegionInstanceGroupManagersListInstancesResponse struct {
  14377. // ManagedInstances: A list of managed instances.
  14378. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  14379. // ServerResponse contains the HTTP response code and headers from the
  14380. // server.
  14381. googleapi.ServerResponse `json:"-"`
  14382. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  14383. // unconditionally include in API requests. By default, fields with
  14384. // empty values are omitted from API requests. However, any non-pointer,
  14385. // non-interface field appearing in ForceSendFields will be sent to the
  14386. // server regardless of whether the field is empty or not. This may be
  14387. // used to include empty fields in Patch requests.
  14388. ForceSendFields []string `json:"-"`
  14389. // NullFields is a list of field names (e.g. "ManagedInstances") to
  14390. // include in API requests with the JSON null value. By default, fields
  14391. // with empty values are omitted from API requests. However, any field
  14392. // with an empty value appearing in NullFields will be sent to the
  14393. // server as null. It is an error if a field in this list has a
  14394. // non-empty value. This may be used to include null fields in Patch
  14395. // requests.
  14396. NullFields []string `json:"-"`
  14397. }
  14398. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  14399. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  14400. raw := NoMethod(*s)
  14401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14402. }
  14403. type RegionInstanceGroupManagersRecreateRequest struct {
  14404. // Instances: The URLs of one or more instances to recreate. This can be
  14405. // a full URL or a partial URL, such as
  14406. // zones/[ZONE]/instances/[INSTANCE_NAME].
  14407. Instances []string `json:"instances,omitempty"`
  14408. // ForceSendFields is a list of field names (e.g. "Instances") 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. "Instances") to include in
  14416. // API 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 *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  14424. type NoMethod RegionInstanceGroupManagersRecreateRequest
  14425. raw := NoMethod(*s)
  14426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14427. }
  14428. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  14429. // Fingerprint: Fingerprint of the target pools information, which is a
  14430. // hash of the contents. This field is used for optimistic locking when
  14431. // you update the target pool entries. This field is optional.
  14432. Fingerprint string `json:"fingerprint,omitempty"`
  14433. // TargetPools: The URL of all TargetPool resources to which instances
  14434. // in the instanceGroup field are added. The target pools automatically
  14435. // apply to all of the instances in the managed instance group.
  14436. TargetPools []string `json:"targetPools,omitempty"`
  14437. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  14438. // unconditionally include in API requests. By default, fields with
  14439. // empty values are omitted from API requests. However, any non-pointer,
  14440. // non-interface field appearing in ForceSendFields will be sent to the
  14441. // server regardless of whether the field is empty or not. This may be
  14442. // used to include empty fields in Patch requests.
  14443. ForceSendFields []string `json:"-"`
  14444. // NullFields is a list of field names (e.g. "Fingerprint") to include
  14445. // in API requests with the JSON null value. By default, fields with
  14446. // empty values are omitted from API requests. However, any field with
  14447. // an empty value appearing in NullFields will be sent to the server as
  14448. // null. It is an error if a field in this list has a non-empty value.
  14449. // This may be used to include null fields in Patch requests.
  14450. NullFields []string `json:"-"`
  14451. }
  14452. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  14453. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  14454. raw := NoMethod(*s)
  14455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14456. }
  14457. type RegionInstanceGroupManagersSetTemplateRequest struct {
  14458. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  14459. // new instances will be created.
  14460. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  14461. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  14462. // unconditionally include in API requests. By default, fields with
  14463. // empty values are omitted from API requests. However, any non-pointer,
  14464. // non-interface field appearing in ForceSendFields will be sent to the
  14465. // server regardless of whether the field is empty or not. This may be
  14466. // used to include empty fields in Patch requests.
  14467. ForceSendFields []string `json:"-"`
  14468. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  14469. // include in API requests with the JSON null value. By default, fields
  14470. // with empty values are omitted from API requests. However, any field
  14471. // with an empty value appearing in NullFields will be sent to the
  14472. // server as null. It is an error if a field in this list has a
  14473. // non-empty value. This may be used to include null fields in Patch
  14474. // requests.
  14475. NullFields []string `json:"-"`
  14476. }
  14477. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  14478. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  14479. raw := NoMethod(*s)
  14480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14481. }
  14482. type RegionInstanceGroupsListInstances struct {
  14483. // Id: [Output Only] Unique identifier for the resource; defined by the
  14484. // server.
  14485. Id string `json:"id,omitempty"`
  14486. // Items: A list of InstanceWithNamedPorts resources.
  14487. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  14488. // Kind: The resource type.
  14489. Kind string `json:"kind,omitempty"`
  14490. // NextPageToken: [Output Only] This token allows you to get the next
  14491. // page of results for list requests. If the number of results is larger
  14492. // than maxResults, use the nextPageToken as a value for the query
  14493. // parameter pageToken in the next list request. Subsequent list
  14494. // requests will have their own nextPageToken to continue paging through
  14495. // the results.
  14496. NextPageToken string `json:"nextPageToken,omitempty"`
  14497. // SelfLink: [Output Only] Server-defined URL for this resource.
  14498. SelfLink string `json:"selfLink,omitempty"`
  14499. // Warning: [Output Only] Informational warning message.
  14500. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  14501. // ServerResponse contains the HTTP response code and headers from the
  14502. // server.
  14503. googleapi.ServerResponse `json:"-"`
  14504. // ForceSendFields is a list of field names (e.g. "Id") to
  14505. // unconditionally include in API requests. By default, fields with
  14506. // empty values are omitted from API requests. However, any non-pointer,
  14507. // non-interface field appearing in ForceSendFields will be sent to the
  14508. // server regardless of whether the field is empty or not. This may be
  14509. // used to include empty fields in Patch requests.
  14510. ForceSendFields []string `json:"-"`
  14511. // NullFields is a list of field names (e.g. "Id") to include in API
  14512. // requests with the JSON null value. By default, fields with empty
  14513. // values are omitted from API requests. However, any field with an
  14514. // empty value appearing in NullFields will be sent to the server as
  14515. // null. It is an error if a field in this list has a non-empty value.
  14516. // This may be used to include null fields in Patch requests.
  14517. NullFields []string `json:"-"`
  14518. }
  14519. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  14520. type NoMethod RegionInstanceGroupsListInstances
  14521. raw := NoMethod(*s)
  14522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14523. }
  14524. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  14525. // warning message.
  14526. type RegionInstanceGroupsListInstancesWarning struct {
  14527. // Code: [Output Only] A warning code, if applicable. For example,
  14528. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14529. // the response.
  14530. //
  14531. // Possible values:
  14532. // "CLEANUP_FAILED"
  14533. // "DEPRECATED_RESOURCE_USED"
  14534. // "DEPRECATED_TYPE_USED"
  14535. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14536. // "EXPERIMENTAL_TYPE_USED"
  14537. // "EXTERNAL_API_WARNING"
  14538. // "FIELD_VALUE_OVERRIDEN"
  14539. // "INJECTED_KERNELS_DEPRECATED"
  14540. // "MISSING_TYPE_DEPENDENCY"
  14541. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14542. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14543. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14544. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14545. // "NEXT_HOP_NOT_RUNNING"
  14546. // "NOT_CRITICAL_ERROR"
  14547. // "NO_RESULTS_ON_PAGE"
  14548. // "REQUIRED_TOS_AGREEMENT"
  14549. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14550. // "RESOURCE_NOT_DELETED"
  14551. // "SCHEMA_VALIDATION_IGNORED"
  14552. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14553. // "UNDECLARED_PROPERTIES"
  14554. // "UNREACHABLE"
  14555. Code string `json:"code,omitempty"`
  14556. // Data: [Output Only] Metadata about this warning in key: value format.
  14557. // For example:
  14558. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14559. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  14560. // Message: [Output Only] A human-readable description of the warning
  14561. // code.
  14562. Message string `json:"message,omitempty"`
  14563. // ForceSendFields is a list of field names (e.g. "Code") to
  14564. // unconditionally include in API requests. By default, fields with
  14565. // empty values are omitted from API requests. However, any non-pointer,
  14566. // non-interface field appearing in ForceSendFields will be sent to the
  14567. // server regardless of whether the field is empty or not. This may be
  14568. // used to include empty fields in Patch requests.
  14569. ForceSendFields []string `json:"-"`
  14570. // NullFields is a list of field names (e.g. "Code") to include in API
  14571. // requests with the JSON null value. By default, fields with empty
  14572. // values are omitted from API requests. However, any field with an
  14573. // empty value appearing in NullFields will be sent to the server as
  14574. // null. It is an error if a field in this list has a non-empty value.
  14575. // This may be used to include null fields in Patch requests.
  14576. NullFields []string `json:"-"`
  14577. }
  14578. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  14579. type NoMethod RegionInstanceGroupsListInstancesWarning
  14580. raw := NoMethod(*s)
  14581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14582. }
  14583. type RegionInstanceGroupsListInstancesWarningData struct {
  14584. // Key: [Output Only] A key that provides more detail on the warning
  14585. // being returned. For example, for warnings where there are no results
  14586. // in a list request for a particular zone, this key might be scope and
  14587. // the key value might be the zone name. Other examples might be a key
  14588. // indicating a deprecated resource and a suggested replacement, or a
  14589. // warning about invalid network settings (for example, if an instance
  14590. // attempts to perform IP forwarding but is not enabled for IP
  14591. // forwarding).
  14592. Key string `json:"key,omitempty"`
  14593. // Value: [Output Only] A warning data value corresponding to the key.
  14594. Value string `json:"value,omitempty"`
  14595. // ForceSendFields is a list of field names (e.g. "Key") to
  14596. // unconditionally include in API requests. By default, fields with
  14597. // empty values are omitted from API requests. However, any non-pointer,
  14598. // non-interface field appearing in ForceSendFields will be sent to the
  14599. // server regardless of whether the field is empty or not. This may be
  14600. // used to include empty fields in Patch requests.
  14601. ForceSendFields []string `json:"-"`
  14602. // NullFields is a list of field names (e.g. "Key") to include in API
  14603. // requests with the JSON null value. By default, fields with empty
  14604. // values are omitted from API requests. However, any field with an
  14605. // empty value appearing in NullFields will be sent to the server as
  14606. // null. It is an error if a field in this list has a non-empty value.
  14607. // This may be used to include null fields in Patch requests.
  14608. NullFields []string `json:"-"`
  14609. }
  14610. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  14611. type NoMethod RegionInstanceGroupsListInstancesWarningData
  14612. raw := NoMethod(*s)
  14613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14614. }
  14615. type RegionInstanceGroupsListInstancesRequest struct {
  14616. // InstanceState: Instances in which state should be returned. Valid
  14617. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  14618. //
  14619. // Possible values:
  14620. // "ALL"
  14621. // "RUNNING"
  14622. InstanceState string `json:"instanceState,omitempty"`
  14623. // PortName: Name of port user is interested in. It is optional. If it
  14624. // is set, only information about this ports will be returned. If it is
  14625. // not set, all the named ports will be returned. Always lists all
  14626. // instances.
  14627. PortName string `json:"portName,omitempty"`
  14628. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  14629. // unconditionally include in API requests. By default, fields with
  14630. // empty values are omitted from API requests. However, any non-pointer,
  14631. // non-interface field appearing in ForceSendFields will be sent to the
  14632. // server regardless of whether the field is empty or not. This may be
  14633. // used to include empty fields in Patch requests.
  14634. ForceSendFields []string `json:"-"`
  14635. // NullFields is a list of field names (e.g. "InstanceState") to include
  14636. // in API requests with the JSON null value. By default, fields with
  14637. // empty values are omitted from API requests. However, any field with
  14638. // an empty value appearing in NullFields will be sent to the server as
  14639. // null. It is an error if a field in this list has a non-empty value.
  14640. // This may be used to include null fields in Patch requests.
  14641. NullFields []string `json:"-"`
  14642. }
  14643. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  14644. type NoMethod RegionInstanceGroupsListInstancesRequest
  14645. raw := NoMethod(*s)
  14646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14647. }
  14648. type RegionInstanceGroupsSetNamedPortsRequest struct {
  14649. // Fingerprint: The fingerprint of the named ports information for this
  14650. // instance group. Use this optional property to prevent conflicts when
  14651. // multiple users change the named ports settings concurrently. Obtain
  14652. // the fingerprint with the instanceGroups.get method. Then, include the
  14653. // fingerprint in your request to ensure that you do not overwrite
  14654. // changes that were applied from another concurrent request.
  14655. Fingerprint string `json:"fingerprint,omitempty"`
  14656. // NamedPorts: The list of named ports to set for this instance group.
  14657. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  14658. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  14659. // unconditionally include in API requests. By default, fields with
  14660. // empty values are omitted from API requests. However, any non-pointer,
  14661. // non-interface field appearing in ForceSendFields will be sent to the
  14662. // server regardless of whether the field is empty or not. This may be
  14663. // used to include empty fields in Patch requests.
  14664. ForceSendFields []string `json:"-"`
  14665. // NullFields is a list of field names (e.g. "Fingerprint") to include
  14666. // in API requests with the JSON null value. By default, fields with
  14667. // empty values are omitted from API requests. However, any field with
  14668. // an empty value appearing in NullFields will be sent to the server as
  14669. // null. It is an error if a field in this list has a non-empty value.
  14670. // This may be used to include null fields in Patch requests.
  14671. NullFields []string `json:"-"`
  14672. }
  14673. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  14674. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  14675. raw := NoMethod(*s)
  14676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14677. }
  14678. // RegionList: Contains a list of region resources.
  14679. type RegionList struct {
  14680. // Id: [Output Only] Unique identifier for the resource; defined by the
  14681. // server.
  14682. Id string `json:"id,omitempty"`
  14683. // Items: A list of Region resources.
  14684. Items []*Region `json:"items,omitempty"`
  14685. // Kind: [Output Only] Type of resource. Always compute#regionList for
  14686. // lists of regions.
  14687. Kind string `json:"kind,omitempty"`
  14688. // NextPageToken: [Output Only] This token allows you to get the next
  14689. // page of results for list requests. If the number of results is larger
  14690. // than maxResults, use the nextPageToken as a value for the query
  14691. // parameter pageToken in the next list request. Subsequent list
  14692. // requests will have their own nextPageToken to continue paging through
  14693. // the results.
  14694. NextPageToken string `json:"nextPageToken,omitempty"`
  14695. // SelfLink: [Output Only] Server-defined URL for this resource.
  14696. SelfLink string `json:"selfLink,omitempty"`
  14697. // Warning: [Output Only] Informational warning message.
  14698. Warning *RegionListWarning `json:"warning,omitempty"`
  14699. // ServerResponse contains the HTTP response code and headers from the
  14700. // server.
  14701. googleapi.ServerResponse `json:"-"`
  14702. // ForceSendFields is a list of field names (e.g. "Id") to
  14703. // unconditionally include in API requests. By default, fields with
  14704. // empty values are omitted from API requests. However, any non-pointer,
  14705. // non-interface field appearing in ForceSendFields will be sent to the
  14706. // server regardless of whether the field is empty or not. This may be
  14707. // used to include empty fields in Patch requests.
  14708. ForceSendFields []string `json:"-"`
  14709. // NullFields is a list of field names (e.g. "Id") to include in API
  14710. // requests with the JSON null value. By default, fields with empty
  14711. // values are omitted from API requests. However, any field with an
  14712. // empty value appearing in NullFields will be sent to the server as
  14713. // null. It is an error if a field in this list has a non-empty value.
  14714. // This may be used to include null fields in Patch requests.
  14715. NullFields []string `json:"-"`
  14716. }
  14717. func (s *RegionList) MarshalJSON() ([]byte, error) {
  14718. type NoMethod RegionList
  14719. raw := NoMethod(*s)
  14720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14721. }
  14722. // RegionListWarning: [Output Only] Informational warning message.
  14723. type RegionListWarning struct {
  14724. // Code: [Output Only] A warning code, if applicable. For example,
  14725. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14726. // the response.
  14727. //
  14728. // Possible values:
  14729. // "CLEANUP_FAILED"
  14730. // "DEPRECATED_RESOURCE_USED"
  14731. // "DEPRECATED_TYPE_USED"
  14732. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14733. // "EXPERIMENTAL_TYPE_USED"
  14734. // "EXTERNAL_API_WARNING"
  14735. // "FIELD_VALUE_OVERRIDEN"
  14736. // "INJECTED_KERNELS_DEPRECATED"
  14737. // "MISSING_TYPE_DEPENDENCY"
  14738. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14739. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14740. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14741. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14742. // "NEXT_HOP_NOT_RUNNING"
  14743. // "NOT_CRITICAL_ERROR"
  14744. // "NO_RESULTS_ON_PAGE"
  14745. // "REQUIRED_TOS_AGREEMENT"
  14746. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14747. // "RESOURCE_NOT_DELETED"
  14748. // "SCHEMA_VALIDATION_IGNORED"
  14749. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14750. // "UNDECLARED_PROPERTIES"
  14751. // "UNREACHABLE"
  14752. Code string `json:"code,omitempty"`
  14753. // Data: [Output Only] Metadata about this warning in key: value format.
  14754. // For example:
  14755. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14756. Data []*RegionListWarningData `json:"data,omitempty"`
  14757. // Message: [Output Only] A human-readable description of the warning
  14758. // code.
  14759. Message string `json:"message,omitempty"`
  14760. // ForceSendFields is a list of field names (e.g. "Code") to
  14761. // unconditionally include in API requests. By default, fields with
  14762. // empty values are omitted from API requests. However, any non-pointer,
  14763. // non-interface field appearing in ForceSendFields will be sent to the
  14764. // server regardless of whether the field is empty or not. This may be
  14765. // used to include empty fields in Patch requests.
  14766. ForceSendFields []string `json:"-"`
  14767. // NullFields is a list of field names (e.g. "Code") to include in API
  14768. // requests with the JSON null value. By default, fields with empty
  14769. // values are omitted from API requests. However, any field with an
  14770. // empty value appearing in NullFields will be sent to the server as
  14771. // null. It is an error if a field in this list has a non-empty value.
  14772. // This may be used to include null fields in Patch requests.
  14773. NullFields []string `json:"-"`
  14774. }
  14775. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  14776. type NoMethod RegionListWarning
  14777. raw := NoMethod(*s)
  14778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14779. }
  14780. type RegionListWarningData struct {
  14781. // Key: [Output Only] A key that provides more detail on the warning
  14782. // being returned. For example, for warnings where there are no results
  14783. // in a list request for a particular zone, this key might be scope and
  14784. // the key value might be the zone name. Other examples might be a key
  14785. // indicating a deprecated resource and a suggested replacement, or a
  14786. // warning about invalid network settings (for example, if an instance
  14787. // attempts to perform IP forwarding but is not enabled for IP
  14788. // forwarding).
  14789. Key string `json:"key,omitempty"`
  14790. // Value: [Output Only] A warning data value corresponding to the key.
  14791. Value string `json:"value,omitempty"`
  14792. // ForceSendFields is a list of field names (e.g. "Key") to
  14793. // unconditionally include in API requests. By default, fields with
  14794. // empty values are omitted from API requests. However, any non-pointer,
  14795. // non-interface field appearing in ForceSendFields will be sent to the
  14796. // server regardless of whether the field is empty or not. This may be
  14797. // used to include empty fields in Patch requests.
  14798. ForceSendFields []string `json:"-"`
  14799. // NullFields is a list of field names (e.g. "Key") to include in API
  14800. // requests with the JSON null value. By default, fields with empty
  14801. // values are omitted from API requests. However, any field with an
  14802. // empty value appearing in NullFields will be sent to the server as
  14803. // null. It is an error if a field in this list has a non-empty value.
  14804. // This may be used to include null fields in Patch requests.
  14805. NullFields []string `json:"-"`
  14806. }
  14807. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  14808. type NoMethod RegionListWarningData
  14809. raw := NoMethod(*s)
  14810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14811. }
  14812. type RegionSetLabelsRequest struct {
  14813. // LabelFingerprint: The fingerprint of the previous set of labels for
  14814. // this resource, used to detect conflicts. The fingerprint is initially
  14815. // generated by Compute Engine and changes after every request to modify
  14816. // or update labels. You must always provide an up-to-date fingerprint
  14817. // hash in order to update or change labels. Make a get() request to the
  14818. // resource to get the latest fingerprint.
  14819. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  14820. // Labels: The labels to set for this resource.
  14821. Labels map[string]string `json:"labels,omitempty"`
  14822. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  14823. // unconditionally include in API requests. By default, fields with
  14824. // empty values are omitted from API requests. However, any non-pointer,
  14825. // non-interface field appearing in ForceSendFields will be sent to the
  14826. // server regardless of whether the field is empty or not. This may be
  14827. // used to include empty fields in Patch requests.
  14828. ForceSendFields []string `json:"-"`
  14829. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  14830. // include in API requests with the JSON null value. By default, fields
  14831. // with empty values are omitted from API requests. However, any field
  14832. // with an empty value appearing in NullFields will be sent to the
  14833. // server as null. It is an error if a field in this list has a
  14834. // non-empty value. This may be used to include null fields in Patch
  14835. // requests.
  14836. NullFields []string `json:"-"`
  14837. }
  14838. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  14839. type NoMethod RegionSetLabelsRequest
  14840. raw := NoMethod(*s)
  14841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14842. }
  14843. // ResourceCommitment: Commitment for a particular resource (a
  14844. // Commitment is composed of one or more of these).
  14845. type ResourceCommitment struct {
  14846. // Amount: The amount of the resource purchased (in a type-dependent
  14847. // unit, such as bytes). For vCPUs, this can just be an integer. For
  14848. // memory, this must be provided in MB. Memory must be a multiple of 256
  14849. // MB, with up to 6.5GB of memory per every vCPU.
  14850. Amount int64 `json:"amount,omitempty,string"`
  14851. // Type: Type of resource for which this commitment applies. Possible
  14852. // values are VCPU and MEMORY
  14853. //
  14854. // Possible values:
  14855. // "MEMORY"
  14856. // "UNSPECIFIED"
  14857. // "VCPU"
  14858. Type string `json:"type,omitempty"`
  14859. // ForceSendFields is a list of field names (e.g. "Amount") to
  14860. // unconditionally include in API requests. By default, fields with
  14861. // empty values are omitted from API requests. However, any non-pointer,
  14862. // non-interface field appearing in ForceSendFields will be sent to the
  14863. // server regardless of whether the field is empty or not. This may be
  14864. // used to include empty fields in Patch requests.
  14865. ForceSendFields []string `json:"-"`
  14866. // NullFields is a list of field names (e.g. "Amount") to include in API
  14867. // requests with the JSON null value. By default, fields with empty
  14868. // values are omitted from API requests. However, any field with an
  14869. // empty value appearing in NullFields will be sent to the server as
  14870. // null. It is an error if a field in this list has a non-empty value.
  14871. // This may be used to include null fields in Patch requests.
  14872. NullFields []string `json:"-"`
  14873. }
  14874. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  14875. type NoMethod ResourceCommitment
  14876. raw := NoMethod(*s)
  14877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14878. }
  14879. type ResourceGroupReference struct {
  14880. // Group: A URI referencing one of the instance groups listed in the
  14881. // backend service.
  14882. Group string `json:"group,omitempty"`
  14883. // ForceSendFields is a list of field names (e.g. "Group") to
  14884. // unconditionally include in API requests. By default, fields with
  14885. // empty values are omitted from API requests. However, any non-pointer,
  14886. // non-interface field appearing in ForceSendFields will be sent to the
  14887. // server regardless of whether the field is empty or not. This may be
  14888. // used to include empty fields in Patch requests.
  14889. ForceSendFields []string `json:"-"`
  14890. // NullFields is a list of field names (e.g. "Group") to include in API
  14891. // requests with the JSON null value. By default, fields with empty
  14892. // values are omitted from API requests. However, any field with an
  14893. // empty value appearing in NullFields will be sent to the server as
  14894. // null. It is an error if a field in this list has a non-empty value.
  14895. // This may be used to include null fields in Patch requests.
  14896. NullFields []string `json:"-"`
  14897. }
  14898. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  14899. type NoMethod ResourceGroupReference
  14900. raw := NoMethod(*s)
  14901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14902. }
  14903. // Route: Represents a Route resource. A route specifies how certain
  14904. // packets should be handled by the network. Routes are associated with
  14905. // instances by tags and the set of routes for a particular instance is
  14906. // called its routing table.
  14907. //
  14908. // For each packet leaving an instance, the system searches that
  14909. // instance's routing table for a single best matching route. Routes
  14910. // match packets by destination IP address, preferring smaller or more
  14911. // specific ranges over larger ones. If there is a tie, the system
  14912. // selects the route with the smallest priority value. If there is still
  14913. // a tie, it uses the layer three and four packet headers to select just
  14914. // one of the remaining matching routes. The packet is then forwarded as
  14915. // specified by the nextHop field of the winning route - either to
  14916. // another instance destination, an instance gateway, or a Google
  14917. // Compute Engine-operated gateway.
  14918. //
  14919. // Packets that do not match any route in the sending instance's routing
  14920. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  14921. // v1.routes ==)
  14922. type Route struct {
  14923. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14924. // format.
  14925. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14926. // Description: An optional description of this resource. Provide this
  14927. // property when you create the resource.
  14928. Description string `json:"description,omitempty"`
  14929. // DestRange: The destination range of outgoing packets that this route
  14930. // applies to. Only IPv4 is supported.
  14931. DestRange string `json:"destRange,omitempty"`
  14932. // Id: [Output Only] The unique identifier for the resource. This
  14933. // identifier is defined by the server.
  14934. Id uint64 `json:"id,omitempty,string"`
  14935. // Kind: [Output Only] Type of this resource. Always compute#routes for
  14936. // Route resources.
  14937. Kind string `json:"kind,omitempty"`
  14938. // Name: Name of the resource. Provided by the client when the resource
  14939. // is created. The name must be 1-63 characters long, and comply with
  14940. // RFC1035. Specifically, the name must be 1-63 characters long and
  14941. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  14942. // the first character must be a lowercase letter, and all following
  14943. // characters must be a dash, lowercase letter, or digit, except the
  14944. // last character, which cannot be a dash.
  14945. Name string `json:"name,omitempty"`
  14946. // Network: Fully-qualified URL of the network that this route applies
  14947. // to.
  14948. Network string `json:"network,omitempty"`
  14949. // NextHopGateway: The URL to a gateway that should handle matching
  14950. // packets. You can only specify the internet gateway using a full or
  14951. // partial valid URL:
  14952. // projects/<project-id>/global/gateways/default-internet-gateway
  14953. NextHopGateway string `json:"nextHopGateway,omitempty"`
  14954. // NextHopInstance: The URL to an instance that should handle matching
  14955. // packets. You can specify this as a full or partial URL. For
  14956. // example:
  14957. // https://www.googleapis.com/compute/v1/projects/project/zones/
  14958. // zone/instances/
  14959. NextHopInstance string `json:"nextHopInstance,omitempty"`
  14960. // NextHopIp: The network IP address of an instance that should handle
  14961. // matching packets. Only IPv4 is supported.
  14962. NextHopIp string `json:"nextHopIp,omitempty"`
  14963. // NextHopNetwork: The URL of the local network if it should handle
  14964. // matching packets.
  14965. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  14966. // NextHopPeering: [Output Only] The network peering name that should
  14967. // handle matching packets, which should conform to RFC1035.
  14968. NextHopPeering string `json:"nextHopPeering,omitempty"`
  14969. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  14970. // packets.
  14971. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  14972. // Priority: The priority of this route. Priority is used to break ties
  14973. // in cases where there is more than one matching route of equal prefix
  14974. // length. In the case of two routes with equal prefix length, the one
  14975. // with the lowest-numbered priority value wins. Default value is 1000.
  14976. // Valid range is 0 through 65535.
  14977. Priority int64 `json:"priority,omitempty"`
  14978. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  14979. // resource.
  14980. SelfLink string `json:"selfLink,omitempty"`
  14981. // Tags: A list of instance tags to which this route applies.
  14982. Tags []string `json:"tags,omitempty"`
  14983. // Warnings: [Output Only] If potential misconfigurations are detected
  14984. // for this route, this field will be populated with warning messages.
  14985. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  14986. // ServerResponse contains the HTTP response code and headers from the
  14987. // server.
  14988. googleapi.ServerResponse `json:"-"`
  14989. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14990. // to unconditionally include in API requests. By default, fields with
  14991. // empty values are omitted from API requests. However, any non-pointer,
  14992. // non-interface field appearing in ForceSendFields will be sent to the
  14993. // server regardless of whether the field is empty or not. This may be
  14994. // used to include empty fields in Patch requests.
  14995. ForceSendFields []string `json:"-"`
  14996. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14997. // include in API requests with the JSON null value. By default, fields
  14998. // with empty values are omitted from API requests. However, any field
  14999. // with an empty value appearing in NullFields will be sent to the
  15000. // server as null. It is an error if a field in this list has a
  15001. // non-empty value. This may be used to include null fields in Patch
  15002. // requests.
  15003. NullFields []string `json:"-"`
  15004. }
  15005. func (s *Route) MarshalJSON() ([]byte, error) {
  15006. type NoMethod Route
  15007. raw := NoMethod(*s)
  15008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15009. }
  15010. type RouteWarnings struct {
  15011. // Code: [Output Only] A warning code, if applicable. For example,
  15012. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15013. // the response.
  15014. //
  15015. // Possible values:
  15016. // "CLEANUP_FAILED"
  15017. // "DEPRECATED_RESOURCE_USED"
  15018. // "DEPRECATED_TYPE_USED"
  15019. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15020. // "EXPERIMENTAL_TYPE_USED"
  15021. // "EXTERNAL_API_WARNING"
  15022. // "FIELD_VALUE_OVERRIDEN"
  15023. // "INJECTED_KERNELS_DEPRECATED"
  15024. // "MISSING_TYPE_DEPENDENCY"
  15025. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15026. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15027. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15028. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15029. // "NEXT_HOP_NOT_RUNNING"
  15030. // "NOT_CRITICAL_ERROR"
  15031. // "NO_RESULTS_ON_PAGE"
  15032. // "REQUIRED_TOS_AGREEMENT"
  15033. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15034. // "RESOURCE_NOT_DELETED"
  15035. // "SCHEMA_VALIDATION_IGNORED"
  15036. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15037. // "UNDECLARED_PROPERTIES"
  15038. // "UNREACHABLE"
  15039. Code string `json:"code,omitempty"`
  15040. // Data: [Output Only] Metadata about this warning in key: value format.
  15041. // For example:
  15042. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15043. Data []*RouteWarningsData `json:"data,omitempty"`
  15044. // Message: [Output Only] A human-readable description of the warning
  15045. // code.
  15046. Message string `json:"message,omitempty"`
  15047. // ForceSendFields is a list of field names (e.g. "Code") to
  15048. // unconditionally include in API requests. By default, fields with
  15049. // empty values are omitted from API requests. However, any non-pointer,
  15050. // non-interface field appearing in ForceSendFields will be sent to the
  15051. // server regardless of whether the field is empty or not. This may be
  15052. // used to include empty fields in Patch requests.
  15053. ForceSendFields []string `json:"-"`
  15054. // NullFields is a list of field names (e.g. "Code") to include in API
  15055. // requests with the JSON null value. By default, fields with empty
  15056. // values are omitted from API requests. However, any field with an
  15057. // empty value appearing in NullFields will be sent to the server as
  15058. // null. It is an error if a field in this list has a non-empty value.
  15059. // This may be used to include null fields in Patch requests.
  15060. NullFields []string `json:"-"`
  15061. }
  15062. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  15063. type NoMethod RouteWarnings
  15064. raw := NoMethod(*s)
  15065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15066. }
  15067. type RouteWarningsData struct {
  15068. // Key: [Output Only] A key that provides more detail on the warning
  15069. // being returned. For example, for warnings where there are no results
  15070. // in a list request for a particular zone, this key might be scope and
  15071. // the key value might be the zone name. Other examples might be a key
  15072. // indicating a deprecated resource and a suggested replacement, or a
  15073. // warning about invalid network settings (for example, if an instance
  15074. // attempts to perform IP forwarding but is not enabled for IP
  15075. // forwarding).
  15076. Key string `json:"key,omitempty"`
  15077. // Value: [Output Only] A warning data value corresponding to the key.
  15078. Value string `json:"value,omitempty"`
  15079. // ForceSendFields is a list of field names (e.g. "Key") to
  15080. // unconditionally include in API requests. By default, fields with
  15081. // empty values are omitted from API requests. However, any non-pointer,
  15082. // non-interface field appearing in ForceSendFields will be sent to the
  15083. // server regardless of whether the field is empty or not. This may be
  15084. // used to include empty fields in Patch requests.
  15085. ForceSendFields []string `json:"-"`
  15086. // NullFields is a list of field names (e.g. "Key") to include in API
  15087. // requests with the JSON null value. By default, fields with empty
  15088. // values are omitted from API requests. However, any field with an
  15089. // empty value appearing in NullFields will be sent to the server as
  15090. // null. It is an error if a field in this list has a non-empty value.
  15091. // This may be used to include null fields in Patch requests.
  15092. NullFields []string `json:"-"`
  15093. }
  15094. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  15095. type NoMethod RouteWarningsData
  15096. raw := NoMethod(*s)
  15097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15098. }
  15099. // RouteList: Contains a list of Route resources.
  15100. type RouteList struct {
  15101. // Id: [Output Only] Unique identifier for the resource; defined by the
  15102. // server.
  15103. Id string `json:"id,omitempty"`
  15104. // Items: A list of Route resources.
  15105. Items []*Route `json:"items,omitempty"`
  15106. // Kind: Type of resource.
  15107. Kind string `json:"kind,omitempty"`
  15108. // NextPageToken: [Output Only] This token allows you to get the next
  15109. // page of results for list requests. If the number of results is larger
  15110. // than maxResults, use the nextPageToken as a value for the query
  15111. // parameter pageToken in the next list request. Subsequent list
  15112. // requests will have their own nextPageToken to continue paging through
  15113. // the results.
  15114. NextPageToken string `json:"nextPageToken,omitempty"`
  15115. // SelfLink: [Output Only] Server-defined URL for this resource.
  15116. SelfLink string `json:"selfLink,omitempty"`
  15117. // Warning: [Output Only] Informational warning message.
  15118. Warning *RouteListWarning `json:"warning,omitempty"`
  15119. // ServerResponse contains the HTTP response code and headers from the
  15120. // server.
  15121. googleapi.ServerResponse `json:"-"`
  15122. // ForceSendFields is a list of field names (e.g. "Id") to
  15123. // unconditionally include in API requests. By default, fields with
  15124. // empty values are omitted from API requests. However, any non-pointer,
  15125. // non-interface field appearing in ForceSendFields will be sent to the
  15126. // server regardless of whether the field is empty or not. This may be
  15127. // used to include empty fields in Patch requests.
  15128. ForceSendFields []string `json:"-"`
  15129. // NullFields is a list of field names (e.g. "Id") to include in API
  15130. // requests with the JSON null value. By default, fields with empty
  15131. // values are omitted from API requests. However, any field with an
  15132. // empty value appearing in NullFields will be sent to the server as
  15133. // null. It is an error if a field in this list has a non-empty value.
  15134. // This may be used to include null fields in Patch requests.
  15135. NullFields []string `json:"-"`
  15136. }
  15137. func (s *RouteList) MarshalJSON() ([]byte, error) {
  15138. type NoMethod RouteList
  15139. raw := NoMethod(*s)
  15140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15141. }
  15142. // RouteListWarning: [Output Only] Informational warning message.
  15143. type RouteListWarning struct {
  15144. // Code: [Output Only] A warning code, if applicable. For example,
  15145. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15146. // the response.
  15147. //
  15148. // Possible values:
  15149. // "CLEANUP_FAILED"
  15150. // "DEPRECATED_RESOURCE_USED"
  15151. // "DEPRECATED_TYPE_USED"
  15152. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15153. // "EXPERIMENTAL_TYPE_USED"
  15154. // "EXTERNAL_API_WARNING"
  15155. // "FIELD_VALUE_OVERRIDEN"
  15156. // "INJECTED_KERNELS_DEPRECATED"
  15157. // "MISSING_TYPE_DEPENDENCY"
  15158. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15159. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15160. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15161. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15162. // "NEXT_HOP_NOT_RUNNING"
  15163. // "NOT_CRITICAL_ERROR"
  15164. // "NO_RESULTS_ON_PAGE"
  15165. // "REQUIRED_TOS_AGREEMENT"
  15166. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15167. // "RESOURCE_NOT_DELETED"
  15168. // "SCHEMA_VALIDATION_IGNORED"
  15169. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15170. // "UNDECLARED_PROPERTIES"
  15171. // "UNREACHABLE"
  15172. Code string `json:"code,omitempty"`
  15173. // Data: [Output Only] Metadata about this warning in key: value format.
  15174. // For example:
  15175. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15176. Data []*RouteListWarningData `json:"data,omitempty"`
  15177. // Message: [Output Only] A human-readable description of the warning
  15178. // code.
  15179. Message string `json:"message,omitempty"`
  15180. // ForceSendFields is a list of field names (e.g. "Code") to
  15181. // unconditionally include in API requests. By default, fields with
  15182. // empty values are omitted from API requests. However, any non-pointer,
  15183. // non-interface field appearing in ForceSendFields will be sent to the
  15184. // server regardless of whether the field is empty or not. This may be
  15185. // used to include empty fields in Patch requests.
  15186. ForceSendFields []string `json:"-"`
  15187. // NullFields is a list of field names (e.g. "Code") to include in API
  15188. // requests with the JSON null value. By default, fields with empty
  15189. // values are omitted from API requests. However, any field with an
  15190. // empty value appearing in NullFields will be sent to the server as
  15191. // null. It is an error if a field in this list has a non-empty value.
  15192. // This may be used to include null fields in Patch requests.
  15193. NullFields []string `json:"-"`
  15194. }
  15195. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  15196. type NoMethod RouteListWarning
  15197. raw := NoMethod(*s)
  15198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15199. }
  15200. type RouteListWarningData struct {
  15201. // Key: [Output Only] A key that provides more detail on the warning
  15202. // being returned. For example, for warnings where there are no results
  15203. // in a list request for a particular zone, this key might be scope and
  15204. // the key value might be the zone name. Other examples might be a key
  15205. // indicating a deprecated resource and a suggested replacement, or a
  15206. // warning about invalid network settings (for example, if an instance
  15207. // attempts to perform IP forwarding but is not enabled for IP
  15208. // forwarding).
  15209. Key string `json:"key,omitempty"`
  15210. // Value: [Output Only] A warning data value corresponding to the key.
  15211. Value string `json:"value,omitempty"`
  15212. // ForceSendFields is a list of field names (e.g. "Key") to
  15213. // unconditionally include in API requests. By default, fields with
  15214. // empty values are omitted from API requests. However, any non-pointer,
  15215. // non-interface field appearing in ForceSendFields will be sent to the
  15216. // server regardless of whether the field is empty or not. This may be
  15217. // used to include empty fields in Patch requests.
  15218. ForceSendFields []string `json:"-"`
  15219. // NullFields is a list of field names (e.g. "Key") to include in API
  15220. // requests with the JSON null value. By default, fields with empty
  15221. // values are omitted from API requests. However, any field with an
  15222. // empty value appearing in NullFields will be sent to the server as
  15223. // null. It is an error if a field in this list has a non-empty value.
  15224. // This may be used to include null fields in Patch requests.
  15225. NullFields []string `json:"-"`
  15226. }
  15227. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  15228. type NoMethod RouteListWarningData
  15229. raw := NoMethod(*s)
  15230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15231. }
  15232. // Router: Router resource.
  15233. type Router struct {
  15234. // Bgp: BGP information specific to this router.
  15235. Bgp *RouterBgp `json:"bgp,omitempty"`
  15236. // BgpPeers: BGP information that needs to be configured into the
  15237. // routing stack to establish the BGP peering. It must specify peer ASN
  15238. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  15239. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  15240. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15241. // format.
  15242. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15243. // Description: An optional description of this resource. Provide this
  15244. // property when you create the resource.
  15245. Description string `json:"description,omitempty"`
  15246. // Id: [Output Only] The unique identifier for the resource. This
  15247. // identifier is defined by the server.
  15248. Id uint64 `json:"id,omitempty,string"`
  15249. // Interfaces: Router interfaces. Each interface requires either one
  15250. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  15251. // range (e.g. ipRange), or both.
  15252. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  15253. // Kind: [Output Only] Type of resource. Always compute#router for
  15254. // routers.
  15255. Kind string `json:"kind,omitempty"`
  15256. // Name: Name of the resource. Provided by the client when the resource
  15257. // is created. The name must be 1-63 characters long, and comply with
  15258. // RFC1035. Specifically, the name must be 1-63 characters long and
  15259. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15260. // the first character must be a lowercase letter, and all following
  15261. // characters must be a dash, lowercase letter, or digit, except the
  15262. // last character, which cannot be a dash.
  15263. Name string `json:"name,omitempty"`
  15264. // Network: URI of the network to which this router belongs.
  15265. Network string `json:"network,omitempty"`
  15266. // Region: [Output Only] URI of the region where the router resides. You
  15267. // must specify this field as part of the HTTP request URL. It is not
  15268. // settable as a field in the request body.
  15269. Region string `json:"region,omitempty"`
  15270. // SelfLink: [Output Only] Server-defined URL for the resource.
  15271. SelfLink string `json:"selfLink,omitempty"`
  15272. // ServerResponse contains the HTTP response code and headers from the
  15273. // server.
  15274. googleapi.ServerResponse `json:"-"`
  15275. // ForceSendFields is a list of field names (e.g. "Bgp") to
  15276. // unconditionally include in API requests. By default, fields with
  15277. // empty values are omitted from API requests. However, any non-pointer,
  15278. // non-interface field appearing in ForceSendFields will be sent to the
  15279. // server regardless of whether the field is empty or not. This may be
  15280. // used to include empty fields in Patch requests.
  15281. ForceSendFields []string `json:"-"`
  15282. // NullFields is a list of field names (e.g. "Bgp") to include in API
  15283. // requests with the JSON null value. By default, fields with empty
  15284. // values are omitted from API requests. However, any field with an
  15285. // empty value appearing in NullFields will be sent to the server as
  15286. // null. It is an error if a field in this list has a non-empty value.
  15287. // This may be used to include null fields in Patch requests.
  15288. NullFields []string `json:"-"`
  15289. }
  15290. func (s *Router) MarshalJSON() ([]byte, error) {
  15291. type NoMethod Router
  15292. raw := NoMethod(*s)
  15293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15294. }
  15295. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  15296. // to advertise.
  15297. type RouterAdvertisedIpRange struct {
  15298. // Description: User-specified description for the IP range.
  15299. Description string `json:"description,omitempty"`
  15300. // Range: The IP range to advertise. The value must be a CIDR-formatted
  15301. // string.
  15302. Range string `json:"range,omitempty"`
  15303. // ForceSendFields is a list of field names (e.g. "Description") to
  15304. // unconditionally include in API requests. By default, fields with
  15305. // empty values are omitted from API requests. However, any non-pointer,
  15306. // non-interface field appearing in ForceSendFields will be sent to the
  15307. // server regardless of whether the field is empty or not. This may be
  15308. // used to include empty fields in Patch requests.
  15309. ForceSendFields []string `json:"-"`
  15310. // NullFields is a list of field names (e.g. "Description") to include
  15311. // in API requests with the JSON null value. By default, fields with
  15312. // empty values are omitted from API requests. However, any field with
  15313. // an empty value appearing in NullFields will be sent to the server as
  15314. // null. It is an error if a field in this list has a non-empty value.
  15315. // This may be used to include null fields in Patch requests.
  15316. NullFields []string `json:"-"`
  15317. }
  15318. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  15319. type NoMethod RouterAdvertisedIpRange
  15320. raw := NoMethod(*s)
  15321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15322. }
  15323. // RouterAggregatedList: Contains a list of routers.
  15324. type RouterAggregatedList struct {
  15325. // Id: [Output Only] Unique identifier for the resource; defined by the
  15326. // server.
  15327. Id string `json:"id,omitempty"`
  15328. // Items: A list of Router resources.
  15329. Items map[string]RoutersScopedList `json:"items,omitempty"`
  15330. // Kind: Type of resource.
  15331. Kind string `json:"kind,omitempty"`
  15332. // NextPageToken: [Output Only] This token allows you to get the next
  15333. // page of results for list requests. If the number of results is larger
  15334. // than maxResults, use the nextPageToken as a value for the query
  15335. // parameter pageToken in the next list request. Subsequent list
  15336. // requests will have their own nextPageToken to continue paging through
  15337. // the results.
  15338. NextPageToken string `json:"nextPageToken,omitempty"`
  15339. // SelfLink: [Output Only] Server-defined URL for this resource.
  15340. SelfLink string `json:"selfLink,omitempty"`
  15341. // Warning: [Output Only] Informational warning message.
  15342. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  15343. // ServerResponse contains the HTTP response code and headers from the
  15344. // server.
  15345. googleapi.ServerResponse `json:"-"`
  15346. // ForceSendFields is a list of field names (e.g. "Id") to
  15347. // unconditionally include in API requests. By default, fields with
  15348. // empty values are omitted from API requests. However, any non-pointer,
  15349. // non-interface field appearing in ForceSendFields will be sent to the
  15350. // server regardless of whether the field is empty or not. This may be
  15351. // used to include empty fields in Patch requests.
  15352. ForceSendFields []string `json:"-"`
  15353. // NullFields is a list of field names (e.g. "Id") to include in API
  15354. // requests with the JSON null value. By default, fields with empty
  15355. // values are omitted from API requests. However, any field with an
  15356. // empty value appearing in NullFields will be sent to the server as
  15357. // null. It is an error if a field in this list has a non-empty value.
  15358. // This may be used to include null fields in Patch requests.
  15359. NullFields []string `json:"-"`
  15360. }
  15361. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  15362. type NoMethod RouterAggregatedList
  15363. raw := NoMethod(*s)
  15364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15365. }
  15366. // RouterAggregatedListWarning: [Output Only] Informational warning
  15367. // message.
  15368. type RouterAggregatedListWarning struct {
  15369. // Code: [Output Only] A warning code, if applicable. For example,
  15370. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15371. // the response.
  15372. //
  15373. // Possible values:
  15374. // "CLEANUP_FAILED"
  15375. // "DEPRECATED_RESOURCE_USED"
  15376. // "DEPRECATED_TYPE_USED"
  15377. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15378. // "EXPERIMENTAL_TYPE_USED"
  15379. // "EXTERNAL_API_WARNING"
  15380. // "FIELD_VALUE_OVERRIDEN"
  15381. // "INJECTED_KERNELS_DEPRECATED"
  15382. // "MISSING_TYPE_DEPENDENCY"
  15383. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15384. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15385. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15386. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15387. // "NEXT_HOP_NOT_RUNNING"
  15388. // "NOT_CRITICAL_ERROR"
  15389. // "NO_RESULTS_ON_PAGE"
  15390. // "REQUIRED_TOS_AGREEMENT"
  15391. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15392. // "RESOURCE_NOT_DELETED"
  15393. // "SCHEMA_VALIDATION_IGNORED"
  15394. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15395. // "UNDECLARED_PROPERTIES"
  15396. // "UNREACHABLE"
  15397. Code string `json:"code,omitempty"`
  15398. // Data: [Output Only] Metadata about this warning in key: value format.
  15399. // For example:
  15400. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15401. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  15402. // Message: [Output Only] A human-readable description of the warning
  15403. // code.
  15404. Message string `json:"message,omitempty"`
  15405. // ForceSendFields is a list of field names (e.g. "Code") to
  15406. // unconditionally include in API requests. By default, fields with
  15407. // empty values are omitted from API requests. However, any non-pointer,
  15408. // non-interface field appearing in ForceSendFields will be sent to the
  15409. // server regardless of whether the field is empty or not. This may be
  15410. // used to include empty fields in Patch requests.
  15411. ForceSendFields []string `json:"-"`
  15412. // NullFields is a list of field names (e.g. "Code") to include in API
  15413. // requests with the JSON null value. By default, fields with empty
  15414. // values are omitted from API requests. However, any field with an
  15415. // empty value appearing in NullFields will be sent to the server as
  15416. // null. It is an error if a field in this list has a non-empty value.
  15417. // This may be used to include null fields in Patch requests.
  15418. NullFields []string `json:"-"`
  15419. }
  15420. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15421. type NoMethod RouterAggregatedListWarning
  15422. raw := NoMethod(*s)
  15423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15424. }
  15425. type RouterAggregatedListWarningData struct {
  15426. // Key: [Output Only] A key that provides more detail on the warning
  15427. // being returned. For example, for warnings where there are no results
  15428. // in a list request for a particular zone, this key might be scope and
  15429. // the key value might be the zone name. Other examples might be a key
  15430. // indicating a deprecated resource and a suggested replacement, or a
  15431. // warning about invalid network settings (for example, if an instance
  15432. // attempts to perform IP forwarding but is not enabled for IP
  15433. // forwarding).
  15434. Key string `json:"key,omitempty"`
  15435. // Value: [Output Only] A warning data value corresponding to the key.
  15436. Value string `json:"value,omitempty"`
  15437. // ForceSendFields is a list of field names (e.g. "Key") to
  15438. // unconditionally include in API requests. By default, fields with
  15439. // empty values are omitted from API requests. However, any non-pointer,
  15440. // non-interface field appearing in ForceSendFields will be sent to the
  15441. // server regardless of whether the field is empty or not. This may be
  15442. // used to include empty fields in Patch requests.
  15443. ForceSendFields []string `json:"-"`
  15444. // NullFields is a list of field names (e.g. "Key") to include in API
  15445. // requests with the JSON null value. By default, fields with empty
  15446. // values are omitted from API requests. However, any field with an
  15447. // empty value appearing in NullFields will be sent to the server as
  15448. // null. It is an error if a field in this list has a non-empty value.
  15449. // This may be used to include null fields in Patch requests.
  15450. NullFields []string `json:"-"`
  15451. }
  15452. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15453. type NoMethod RouterAggregatedListWarningData
  15454. raw := NoMethod(*s)
  15455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15456. }
  15457. type RouterBgp struct {
  15458. // AdvertiseMode: User-specified flag to indicate which mode to use for
  15459. // advertisement.
  15460. //
  15461. // Possible values:
  15462. // "CUSTOM"
  15463. // "DEFAULT"
  15464. AdvertiseMode string `json:"advertiseMode,omitempty"`
  15465. // AdvertisedGroups: User-specified list of prefix groups to advertise
  15466. // in custom mode. This field can only be populated if advertise_mode is
  15467. // CUSTOM and is advertised to all peers of the router. These groups
  15468. // will be advertised in addition to any specified prefixes. Leave this
  15469. // field blank to advertise no custom groups.
  15470. //
  15471. // Possible values:
  15472. // "ALL_SUBNETS"
  15473. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  15474. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  15475. // advertise in custom mode. This field can only be populated if
  15476. // advertise_mode is CUSTOM and is advertised to all peers of the
  15477. // router. These IP ranges will be advertised in addition to any
  15478. // specified groups. Leave this field blank to advertise no custom IP
  15479. // ranges.
  15480. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  15481. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  15482. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  15483. // this router resource. All VPN tunnels that link to this router will
  15484. // have the same local ASN.
  15485. Asn int64 `json:"asn,omitempty"`
  15486. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  15487. // unconditionally include in API requests. By default, fields with
  15488. // empty values are omitted from API requests. However, any non-pointer,
  15489. // non-interface field appearing in ForceSendFields will be sent to the
  15490. // server regardless of whether the field is empty or not. This may be
  15491. // used to include empty fields in Patch requests.
  15492. ForceSendFields []string `json:"-"`
  15493. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  15494. // in API requests with the JSON null value. By default, fields with
  15495. // empty values are omitted from API requests. However, any field with
  15496. // an empty value appearing in NullFields will be sent to the server as
  15497. // null. It is an error if a field in this list has a non-empty value.
  15498. // This may be used to include null fields in Patch requests.
  15499. NullFields []string `json:"-"`
  15500. }
  15501. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  15502. type NoMethod RouterBgp
  15503. raw := NoMethod(*s)
  15504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15505. }
  15506. type RouterBgpPeer struct {
  15507. // AdvertiseMode: User-specified flag to indicate which mode to use for
  15508. // advertisement.
  15509. //
  15510. // Possible values:
  15511. // "CUSTOM"
  15512. // "DEFAULT"
  15513. AdvertiseMode string `json:"advertiseMode,omitempty"`
  15514. // AdvertisedGroups: User-specified list of prefix groups to advertise
  15515. // in custom mode. This field can only be populated if advertise_mode is
  15516. // CUSTOM and overrides the list defined for the router (in Bgp
  15517. // message). These groups will be advertised in addition to any
  15518. // specified prefixes. Leave this field blank to advertise no custom
  15519. // groups.
  15520. //
  15521. // Possible values:
  15522. // "ALL_SUBNETS"
  15523. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  15524. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  15525. // advertise in custom mode. This field can only be populated if
  15526. // advertise_mode is CUSTOM and overrides the list defined for the
  15527. // router (in Bgp message). These IP ranges will be advertised in
  15528. // addition to any specified groups. Leave this field blank to advertise
  15529. // no custom IP ranges.
  15530. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  15531. // AdvertisedRoutePriority: The priority of routes advertised to this
  15532. // BGP peer. In the case where there is more than one matching route of
  15533. // maximum length, the routes with lowest priority value win.
  15534. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  15535. // InterfaceName: Name of the interface the BGP peer is associated with.
  15536. InterfaceName string `json:"interfaceName,omitempty"`
  15537. // IpAddress: IP address of the interface inside Google Cloud Platform.
  15538. // Only IPv4 is supported.
  15539. IpAddress string `json:"ipAddress,omitempty"`
  15540. // ManagementType: [Output Only] Type of how the resource/configuration
  15541. // of the BGP peer is managed. MANAGED_BY_USER is the default value;
  15542. // MANAGED_BY_ATTACHMENT represents an BGP peer that is automatically
  15543. // created for PARTNER interconnectAttachment, Google will automatically
  15544. // create/delete this type of BGP peer when the PARTNER
  15545. // interconnectAttachment is created/deleted.
  15546. //
  15547. // Possible values:
  15548. // "MANAGED_BY_ATTACHMENT"
  15549. // "MANAGED_BY_USER"
  15550. ManagementType string `json:"managementType,omitempty"`
  15551. // Name: Name of this BGP peer. The name must be 1-63 characters long
  15552. // and comply with RFC1035.
  15553. Name string `json:"name,omitempty"`
  15554. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  15555. // this value can be different for every tunnel.
  15556. PeerAsn int64 `json:"peerAsn,omitempty"`
  15557. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  15558. // Only IPv4 is supported.
  15559. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  15560. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  15561. // unconditionally include in API requests. By default, fields with
  15562. // empty values are omitted from API requests. However, any non-pointer,
  15563. // non-interface field appearing in ForceSendFields will be sent to the
  15564. // server regardless of whether the field is empty or not. This may be
  15565. // used to include empty fields in Patch requests.
  15566. ForceSendFields []string `json:"-"`
  15567. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  15568. // in API requests with the JSON null value. By default, fields with
  15569. // empty values are omitted from API requests. However, any field with
  15570. // an empty value appearing in NullFields will be sent to the server as
  15571. // null. It is an error if a field in this list has a non-empty value.
  15572. // This may be used to include null fields in Patch requests.
  15573. NullFields []string `json:"-"`
  15574. }
  15575. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  15576. type NoMethod RouterBgpPeer
  15577. raw := NoMethod(*s)
  15578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15579. }
  15580. type RouterInterface struct {
  15581. // IpRange: IP address and range of the interface. The IP range must be
  15582. // in the RFC3927 link-local IP space. The value must be a
  15583. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  15584. // truncate the address as it represents the IP address of the
  15585. // interface.
  15586. IpRange string `json:"ipRange,omitempty"`
  15587. // LinkedInterconnectAttachment: URI of the linked interconnect
  15588. // attachment. It must be in the same region as the router. Each
  15589. // interface can have at most one linked resource and it could either be
  15590. // a VPN Tunnel or an interconnect attachment.
  15591. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  15592. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  15593. // region as the router. Each interface can have at most one linked
  15594. // resource and it could either be a VPN Tunnel or an interconnect
  15595. // attachment.
  15596. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  15597. // ManagementType: [Output Only] Type of how the resource/configuration
  15598. // of the interface is managed. MANAGED_BY_USER is the default value;
  15599. // MANAGED_BY_ATTACHMENT represents an interface that is automatically
  15600. // created for PARTNER type interconnectAttachment, Google will
  15601. // automatically create/update/delete this type of interface when the
  15602. // PARTNER interconnectAttachment is created/provisioned/deleted.
  15603. //
  15604. // Possible values:
  15605. // "MANAGED_BY_ATTACHMENT"
  15606. // "MANAGED_BY_USER"
  15607. ManagementType string `json:"managementType,omitempty"`
  15608. // Name: Name of this interface entry. The name must be 1-63 characters
  15609. // long and comply with RFC1035.
  15610. Name string `json:"name,omitempty"`
  15611. // ForceSendFields is a list of field names (e.g. "IpRange") to
  15612. // unconditionally include in API requests. By default, fields with
  15613. // empty values are omitted from API requests. However, any non-pointer,
  15614. // non-interface field appearing in ForceSendFields will be sent to the
  15615. // server regardless of whether the field is empty or not. This may be
  15616. // used to include empty fields in Patch requests.
  15617. ForceSendFields []string `json:"-"`
  15618. // NullFields is a list of field names (e.g. "IpRange") to include in
  15619. // API requests with the JSON null value. By default, fields with empty
  15620. // values are omitted from API requests. However, any field with an
  15621. // empty value appearing in NullFields will be sent to the server as
  15622. // null. It is an error if a field in this list has a non-empty value.
  15623. // This may be used to include null fields in Patch requests.
  15624. NullFields []string `json:"-"`
  15625. }
  15626. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  15627. type NoMethod RouterInterface
  15628. raw := NoMethod(*s)
  15629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15630. }
  15631. // RouterList: Contains a list of Router resources.
  15632. type RouterList struct {
  15633. // Id: [Output Only] Unique identifier for the resource; defined by the
  15634. // server.
  15635. Id string `json:"id,omitempty"`
  15636. // Items: A list of Router resources.
  15637. Items []*Router `json:"items,omitempty"`
  15638. // Kind: [Output Only] Type of resource. Always compute#router for
  15639. // routers.
  15640. Kind string `json:"kind,omitempty"`
  15641. // NextPageToken: [Output Only] This token allows you to get the next
  15642. // page of results for list requests. If the number of results is larger
  15643. // than maxResults, use the nextPageToken as a value for the query
  15644. // parameter pageToken in the next list request. Subsequent list
  15645. // requests will have their own nextPageToken to continue paging through
  15646. // the results.
  15647. NextPageToken string `json:"nextPageToken,omitempty"`
  15648. // SelfLink: [Output Only] Server-defined URL for this resource.
  15649. SelfLink string `json:"selfLink,omitempty"`
  15650. // Warning: [Output Only] Informational warning message.
  15651. Warning *RouterListWarning `json:"warning,omitempty"`
  15652. // ServerResponse contains the HTTP response code and headers from the
  15653. // server.
  15654. googleapi.ServerResponse `json:"-"`
  15655. // ForceSendFields is a list of field names (e.g. "Id") to
  15656. // unconditionally include in API requests. By default, fields with
  15657. // empty values are omitted from API requests. However, any non-pointer,
  15658. // non-interface field appearing in ForceSendFields will be sent to the
  15659. // server regardless of whether the field is empty or not. This may be
  15660. // used to include empty fields in Patch requests.
  15661. ForceSendFields []string `json:"-"`
  15662. // NullFields is a list of field names (e.g. "Id") to include in API
  15663. // requests with the JSON null value. By default, fields with empty
  15664. // values are omitted from API requests. However, any field with an
  15665. // empty value appearing in NullFields will be sent to the server as
  15666. // null. It is an error if a field in this list has a non-empty value.
  15667. // This may be used to include null fields in Patch requests.
  15668. NullFields []string `json:"-"`
  15669. }
  15670. func (s *RouterList) MarshalJSON() ([]byte, error) {
  15671. type NoMethod RouterList
  15672. raw := NoMethod(*s)
  15673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15674. }
  15675. // RouterListWarning: [Output Only] Informational warning message.
  15676. type RouterListWarning struct {
  15677. // Code: [Output Only] A warning code, if applicable. For example,
  15678. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15679. // the response.
  15680. //
  15681. // Possible values:
  15682. // "CLEANUP_FAILED"
  15683. // "DEPRECATED_RESOURCE_USED"
  15684. // "DEPRECATED_TYPE_USED"
  15685. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15686. // "EXPERIMENTAL_TYPE_USED"
  15687. // "EXTERNAL_API_WARNING"
  15688. // "FIELD_VALUE_OVERRIDEN"
  15689. // "INJECTED_KERNELS_DEPRECATED"
  15690. // "MISSING_TYPE_DEPENDENCY"
  15691. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15692. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15693. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15694. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15695. // "NEXT_HOP_NOT_RUNNING"
  15696. // "NOT_CRITICAL_ERROR"
  15697. // "NO_RESULTS_ON_PAGE"
  15698. // "REQUIRED_TOS_AGREEMENT"
  15699. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15700. // "RESOURCE_NOT_DELETED"
  15701. // "SCHEMA_VALIDATION_IGNORED"
  15702. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15703. // "UNDECLARED_PROPERTIES"
  15704. // "UNREACHABLE"
  15705. Code string `json:"code,omitempty"`
  15706. // Data: [Output Only] Metadata about this warning in key: value format.
  15707. // For example:
  15708. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15709. Data []*RouterListWarningData `json:"data,omitempty"`
  15710. // Message: [Output Only] A human-readable description of the warning
  15711. // code.
  15712. Message string `json:"message,omitempty"`
  15713. // ForceSendFields is a list of field names (e.g. "Code") to
  15714. // unconditionally include in API requests. By default, fields with
  15715. // empty values are omitted from API requests. However, any non-pointer,
  15716. // non-interface field appearing in ForceSendFields will be sent to the
  15717. // server regardless of whether the field is empty or not. This may be
  15718. // used to include empty fields in Patch requests.
  15719. ForceSendFields []string `json:"-"`
  15720. // NullFields is a list of field names (e.g. "Code") to include in API
  15721. // requests with the JSON null value. By default, fields with empty
  15722. // values are omitted from API requests. However, any field with an
  15723. // empty value appearing in NullFields will be sent to the server as
  15724. // null. It is an error if a field in this list has a non-empty value.
  15725. // This may be used to include null fields in Patch requests.
  15726. NullFields []string `json:"-"`
  15727. }
  15728. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  15729. type NoMethod RouterListWarning
  15730. raw := NoMethod(*s)
  15731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15732. }
  15733. type RouterListWarningData struct {
  15734. // Key: [Output Only] A key that provides more detail on the warning
  15735. // being returned. For example, for warnings where there are no results
  15736. // in a list request for a particular zone, this key might be scope and
  15737. // the key value might be the zone name. Other examples might be a key
  15738. // indicating a deprecated resource and a suggested replacement, or a
  15739. // warning about invalid network settings (for example, if an instance
  15740. // attempts to perform IP forwarding but is not enabled for IP
  15741. // forwarding).
  15742. Key string `json:"key,omitempty"`
  15743. // Value: [Output Only] A warning data value corresponding to the key.
  15744. Value string `json:"value,omitempty"`
  15745. // ForceSendFields is a list of field names (e.g. "Key") to
  15746. // unconditionally include in API requests. By default, fields with
  15747. // empty values are omitted from API requests. However, any non-pointer,
  15748. // non-interface field appearing in ForceSendFields will be sent to the
  15749. // server regardless of whether the field is empty or not. This may be
  15750. // used to include empty fields in Patch requests.
  15751. ForceSendFields []string `json:"-"`
  15752. // NullFields is a list of field names (e.g. "Key") to include in API
  15753. // requests with the JSON null value. By default, fields with empty
  15754. // values are omitted from API requests. However, any field with an
  15755. // empty value appearing in NullFields will be sent to the server as
  15756. // null. It is an error if a field in this list has a non-empty value.
  15757. // This may be used to include null fields in Patch requests.
  15758. NullFields []string `json:"-"`
  15759. }
  15760. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  15761. type NoMethod RouterListWarningData
  15762. raw := NoMethod(*s)
  15763. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15764. }
  15765. type RouterStatus struct {
  15766. // BestRoutes: Best routes for this router's network.
  15767. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  15768. // BestRoutesForRouter: Best routes learned by this router.
  15769. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  15770. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  15771. // Network: URI of the network to which this router belongs.
  15772. Network string `json:"network,omitempty"`
  15773. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  15774. // unconditionally include in API requests. By default, fields with
  15775. // empty values are omitted from API requests. However, any non-pointer,
  15776. // non-interface field appearing in ForceSendFields will be sent to the
  15777. // server regardless of whether the field is empty or not. This may be
  15778. // used to include empty fields in Patch requests.
  15779. ForceSendFields []string `json:"-"`
  15780. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  15781. // API requests with the JSON null value. By default, fields with empty
  15782. // values are omitted from API requests. However, any field with an
  15783. // empty value appearing in NullFields will be sent to the server as
  15784. // null. It is an error if a field in this list has a non-empty value.
  15785. // This may be used to include null fields in Patch requests.
  15786. NullFields []string `json:"-"`
  15787. }
  15788. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  15789. type NoMethod RouterStatus
  15790. raw := NoMethod(*s)
  15791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15792. }
  15793. type RouterStatusBgpPeerStatus struct {
  15794. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  15795. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  15796. // IpAddress: IP address of the local BGP interface.
  15797. IpAddress string `json:"ipAddress,omitempty"`
  15798. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  15799. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  15800. // Name: Name of this BGP peer. Unique within the Routers resource.
  15801. Name string `json:"name,omitempty"`
  15802. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  15803. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  15804. // PeerIpAddress: IP address of the remote BGP interface.
  15805. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  15806. // State: BGP state as specified in RFC1771.
  15807. State string `json:"state,omitempty"`
  15808. // Status: Status of the BGP peer: {UP, DOWN}
  15809. //
  15810. // Possible values:
  15811. // "DOWN"
  15812. // "UNKNOWN"
  15813. // "UP"
  15814. Status string `json:"status,omitempty"`
  15815. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  15816. // days, 23 hours, 59 minutes, 59 seconds
  15817. Uptime string `json:"uptime,omitempty"`
  15818. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  15819. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  15820. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  15821. // unconditionally include in API requests. By default, fields with
  15822. // empty values are omitted from API requests. However, any non-pointer,
  15823. // non-interface field appearing in ForceSendFields will be sent to the
  15824. // server regardless of whether the field is empty or not. This may be
  15825. // used to include empty fields in Patch requests.
  15826. ForceSendFields []string `json:"-"`
  15827. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  15828. // include in API requests with the JSON null value. By default, fields
  15829. // with empty values are omitted from API requests. However, any field
  15830. // with an empty value appearing in NullFields will be sent to the
  15831. // server as null. It is an error if a field in this list has a
  15832. // non-empty value. This may be used to include null fields in Patch
  15833. // requests.
  15834. NullFields []string `json:"-"`
  15835. }
  15836. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  15837. type NoMethod RouterStatusBgpPeerStatus
  15838. raw := NoMethod(*s)
  15839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15840. }
  15841. type RouterStatusResponse struct {
  15842. // Kind: Type of resource.
  15843. Kind string `json:"kind,omitempty"`
  15844. Result *RouterStatus `json:"result,omitempty"`
  15845. // ServerResponse contains the HTTP response code and headers from the
  15846. // server.
  15847. googleapi.ServerResponse `json:"-"`
  15848. // ForceSendFields is a list of field names (e.g. "Kind") to
  15849. // unconditionally include in API requests. By default, fields with
  15850. // empty values are omitted from API requests. However, any non-pointer,
  15851. // non-interface field appearing in ForceSendFields will be sent to the
  15852. // server regardless of whether the field is empty or not. This may be
  15853. // used to include empty fields in Patch requests.
  15854. ForceSendFields []string `json:"-"`
  15855. // NullFields is a list of field names (e.g. "Kind") to include in API
  15856. // requests with the JSON null value. By default, fields with empty
  15857. // values are omitted from API requests. However, any field with an
  15858. // empty value appearing in NullFields will be sent to the server as
  15859. // null. It is an error if a field in this list has a non-empty value.
  15860. // This may be used to include null fields in Patch requests.
  15861. NullFields []string `json:"-"`
  15862. }
  15863. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  15864. type NoMethod RouterStatusResponse
  15865. raw := NoMethod(*s)
  15866. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15867. }
  15868. type RoutersPreviewResponse struct {
  15869. // Resource: Preview of given router.
  15870. Resource *Router `json:"resource,omitempty"`
  15871. // ServerResponse contains the HTTP response code and headers from the
  15872. // server.
  15873. googleapi.ServerResponse `json:"-"`
  15874. // ForceSendFields is a list of field names (e.g. "Resource") to
  15875. // unconditionally include in API requests. By default, fields with
  15876. // empty values are omitted from API requests. However, any non-pointer,
  15877. // non-interface field appearing in ForceSendFields will be sent to the
  15878. // server regardless of whether the field is empty or not. This may be
  15879. // used to include empty fields in Patch requests.
  15880. ForceSendFields []string `json:"-"`
  15881. // NullFields is a list of field names (e.g. "Resource") to include in
  15882. // API requests with the JSON null value. By default, fields with empty
  15883. // values are omitted from API requests. However, any field with an
  15884. // empty value appearing in NullFields will be sent to the server as
  15885. // null. It is an error if a field in this list has a non-empty value.
  15886. // This may be used to include null fields in Patch requests.
  15887. NullFields []string `json:"-"`
  15888. }
  15889. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  15890. type NoMethod RoutersPreviewResponse
  15891. raw := NoMethod(*s)
  15892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15893. }
  15894. type RoutersScopedList struct {
  15895. // Routers: A list of routers contained in this scope.
  15896. Routers []*Router `json:"routers,omitempty"`
  15897. // Warning: Informational warning which replaces the list of routers
  15898. // when the list is empty.
  15899. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  15900. // ForceSendFields is a list of field names (e.g. "Routers") to
  15901. // unconditionally include in API requests. By default, fields with
  15902. // empty values are omitted from API requests. However, any non-pointer,
  15903. // non-interface field appearing in ForceSendFields will be sent to the
  15904. // server regardless of whether the field is empty or not. This may be
  15905. // used to include empty fields in Patch requests.
  15906. ForceSendFields []string `json:"-"`
  15907. // NullFields is a list of field names (e.g. "Routers") to include in
  15908. // API requests with the JSON null value. By default, fields with empty
  15909. // values are omitted from API requests. However, any field with an
  15910. // empty value appearing in NullFields will be sent to the server as
  15911. // null. It is an error if a field in this list has a non-empty value.
  15912. // This may be used to include null fields in Patch requests.
  15913. NullFields []string `json:"-"`
  15914. }
  15915. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  15916. type NoMethod RoutersScopedList
  15917. raw := NoMethod(*s)
  15918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15919. }
  15920. // RoutersScopedListWarning: Informational warning which replaces the
  15921. // list of routers when the list is empty.
  15922. type RoutersScopedListWarning struct {
  15923. // Code: [Output Only] A warning code, if applicable. For example,
  15924. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15925. // the response.
  15926. //
  15927. // Possible values:
  15928. // "CLEANUP_FAILED"
  15929. // "DEPRECATED_RESOURCE_USED"
  15930. // "DEPRECATED_TYPE_USED"
  15931. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15932. // "EXPERIMENTAL_TYPE_USED"
  15933. // "EXTERNAL_API_WARNING"
  15934. // "FIELD_VALUE_OVERRIDEN"
  15935. // "INJECTED_KERNELS_DEPRECATED"
  15936. // "MISSING_TYPE_DEPENDENCY"
  15937. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15938. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15939. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15940. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15941. // "NEXT_HOP_NOT_RUNNING"
  15942. // "NOT_CRITICAL_ERROR"
  15943. // "NO_RESULTS_ON_PAGE"
  15944. // "REQUIRED_TOS_AGREEMENT"
  15945. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15946. // "RESOURCE_NOT_DELETED"
  15947. // "SCHEMA_VALIDATION_IGNORED"
  15948. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15949. // "UNDECLARED_PROPERTIES"
  15950. // "UNREACHABLE"
  15951. Code string `json:"code,omitempty"`
  15952. // Data: [Output Only] Metadata about this warning in key: value format.
  15953. // For example:
  15954. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15955. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  15956. // Message: [Output Only] A human-readable description of the warning
  15957. // code.
  15958. Message string `json:"message,omitempty"`
  15959. // ForceSendFields is a list of field names (e.g. "Code") to
  15960. // unconditionally include in API requests. By default, fields with
  15961. // empty values are omitted from API requests. However, any non-pointer,
  15962. // non-interface field appearing in ForceSendFields will be sent to the
  15963. // server regardless of whether the field is empty or not. This may be
  15964. // used to include empty fields in Patch requests.
  15965. ForceSendFields []string `json:"-"`
  15966. // NullFields is a list of field names (e.g. "Code") to include in API
  15967. // requests with the JSON null value. By default, fields with empty
  15968. // values are omitted from API requests. However, any field with an
  15969. // empty value appearing in NullFields will be sent to the server as
  15970. // null. It is an error if a field in this list has a non-empty value.
  15971. // This may be used to include null fields in Patch requests.
  15972. NullFields []string `json:"-"`
  15973. }
  15974. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  15975. type NoMethod RoutersScopedListWarning
  15976. raw := NoMethod(*s)
  15977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15978. }
  15979. type RoutersScopedListWarningData struct {
  15980. // Key: [Output Only] A key that provides more detail on the warning
  15981. // being returned. For example, for warnings where there are no results
  15982. // in a list request for a particular zone, this key might be scope and
  15983. // the key value might be the zone name. Other examples might be a key
  15984. // indicating a deprecated resource and a suggested replacement, or a
  15985. // warning about invalid network settings (for example, if an instance
  15986. // attempts to perform IP forwarding but is not enabled for IP
  15987. // forwarding).
  15988. Key string `json:"key,omitempty"`
  15989. // Value: [Output Only] A warning data value corresponding to the key.
  15990. Value string `json:"value,omitempty"`
  15991. // ForceSendFields is a list of field names (e.g. "Key") to
  15992. // unconditionally include in API requests. By default, fields with
  15993. // empty values are omitted from API requests. However, any non-pointer,
  15994. // non-interface field appearing in ForceSendFields will be sent to the
  15995. // server regardless of whether the field is empty or not. This may be
  15996. // used to include empty fields in Patch requests.
  15997. ForceSendFields []string `json:"-"`
  15998. // NullFields is a list of field names (e.g. "Key") to include in API
  15999. // requests with the JSON null value. By default, fields with empty
  16000. // values are omitted from API requests. However, any field with an
  16001. // empty value appearing in NullFields will be sent to the server as
  16002. // null. It is an error if a field in this list has a non-empty value.
  16003. // This may be used to include null fields in Patch requests.
  16004. NullFields []string `json:"-"`
  16005. }
  16006. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  16007. type NoMethod RoutersScopedListWarningData
  16008. raw := NoMethod(*s)
  16009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16010. }
  16011. type SSLHealthCheck struct {
  16012. // Port: The TCP port number for the health check request. The default
  16013. // value is 443. Valid values are 1 through 65535.
  16014. Port int64 `json:"port,omitempty"`
  16015. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  16016. // both port and port_name are defined, port takes precedence.
  16017. PortName string `json:"portName,omitempty"`
  16018. // ProxyHeader: Specifies the type of proxy header to append before
  16019. // sending data to the backend, either NONE or PROXY_V1. The default is
  16020. // NONE.
  16021. //
  16022. // Possible values:
  16023. // "NONE"
  16024. // "PROXY_V1"
  16025. ProxyHeader string `json:"proxyHeader,omitempty"`
  16026. // Request: The application data to send once the SSL connection has
  16027. // been established (default value is empty). If both request and
  16028. // response are empty, the connection establishment alone will indicate
  16029. // health. The request data can only be ASCII.
  16030. Request string `json:"request,omitempty"`
  16031. // Response: The bytes to match against the beginning of the response
  16032. // data. If left empty (the default value), any response will indicate
  16033. // health. The response data can only be ASCII.
  16034. Response string `json:"response,omitempty"`
  16035. // ForceSendFields is a list of field names (e.g. "Port") to
  16036. // unconditionally include in API requests. By default, fields with
  16037. // empty values are omitted from API requests. However, any non-pointer,
  16038. // non-interface field appearing in ForceSendFields will be sent to the
  16039. // server regardless of whether the field is empty or not. This may be
  16040. // used to include empty fields in Patch requests.
  16041. ForceSendFields []string `json:"-"`
  16042. // NullFields is a list of field names (e.g. "Port") to include in API
  16043. // requests with the JSON null value. By default, fields with empty
  16044. // values are omitted from API requests. However, any field with an
  16045. // empty value appearing in NullFields will be sent to the server as
  16046. // null. It is an error if a field in this list has a non-empty value.
  16047. // This may be used to include null fields in Patch requests.
  16048. NullFields []string `json:"-"`
  16049. }
  16050. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  16051. type NoMethod SSLHealthCheck
  16052. raw := NoMethod(*s)
  16053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16054. }
  16055. // Scheduling: Sets the scheduling options for an Instance.
  16056. type Scheduling struct {
  16057. // AutomaticRestart: Specifies whether the instance should be
  16058. // automatically restarted if it is terminated by Compute Engine (not
  16059. // terminated by a user). You can only set the automatic restart option
  16060. // for standard instances. Preemptible instances cannot be automatically
  16061. // restarted.
  16062. //
  16063. // By default, this is set to true so an instance is automatically
  16064. // restarted if it is terminated by Compute Engine.
  16065. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  16066. // OnHostMaintenance: Defines the maintenance behavior for this
  16067. // instance. For standard instances, the default behavior is MIGRATE.
  16068. // For preemptible instances, the default and only possible behavior is
  16069. // TERMINATE. For more information, see Setting Instance Scheduling
  16070. // Options.
  16071. //
  16072. // Possible values:
  16073. // "MIGRATE"
  16074. // "TERMINATE"
  16075. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  16076. // Preemptible: Defines whether the instance is preemptible. This can
  16077. // only be set during instance creation, it cannot be set or changed
  16078. // after the instance has been created.
  16079. Preemptible bool `json:"preemptible,omitempty"`
  16080. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  16081. // unconditionally include in API requests. By default, fields with
  16082. // empty values are omitted from API requests. However, any non-pointer,
  16083. // non-interface field appearing in ForceSendFields will be sent to the
  16084. // server regardless of whether the field is empty or not. This may be
  16085. // used to include empty fields in Patch requests.
  16086. ForceSendFields []string `json:"-"`
  16087. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  16088. // include in API requests with the JSON null value. By default, fields
  16089. // with empty values are omitted from API requests. However, any field
  16090. // with an empty value appearing in NullFields will be sent to the
  16091. // server as null. It is an error if a field in this list has a
  16092. // non-empty value. This may be used to include null fields in Patch
  16093. // requests.
  16094. NullFields []string `json:"-"`
  16095. }
  16096. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  16097. type NoMethod Scheduling
  16098. raw := NoMethod(*s)
  16099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16100. }
  16101. // SerialPortOutput: An instance's serial console output.
  16102. type SerialPortOutput struct {
  16103. // Contents: [Output Only] The contents of the console output.
  16104. Contents string `json:"contents,omitempty"`
  16105. // Kind: [Output Only] Type of the resource. Always
  16106. // compute#serialPortOutput for serial port output.
  16107. Kind string `json:"kind,omitempty"`
  16108. // Next: [Output Only] The position of the next byte of content from the
  16109. // serial console output. Use this value in the next request as the
  16110. // start parameter.
  16111. Next int64 `json:"next,omitempty,string"`
  16112. // SelfLink: [Output Only] Server-defined URL for this resource.
  16113. SelfLink string `json:"selfLink,omitempty"`
  16114. // Start: The starting byte position of the output that was returned.
  16115. // This should match the start parameter sent with the request. If the
  16116. // serial console output exceeds the size of the buffer, older output
  16117. // will be overwritten by newer content and the start values will be
  16118. // mismatched.
  16119. Start int64 `json:"start,omitempty,string"`
  16120. // ServerResponse contains the HTTP response code and headers from the
  16121. // server.
  16122. googleapi.ServerResponse `json:"-"`
  16123. // ForceSendFields is a list of field names (e.g. "Contents") to
  16124. // unconditionally include in API requests. By default, fields with
  16125. // empty values are omitted from API requests. However, any non-pointer,
  16126. // non-interface field appearing in ForceSendFields will be sent to the
  16127. // server regardless of whether the field is empty or not. This may be
  16128. // used to include empty fields in Patch requests.
  16129. ForceSendFields []string `json:"-"`
  16130. // NullFields is a list of field names (e.g. "Contents") to include in
  16131. // API requests with the JSON null value. By default, fields with empty
  16132. // values are omitted from API requests. However, any field with an
  16133. // empty value appearing in NullFields will be sent to the server as
  16134. // null. It is an error if a field in this list has a non-empty value.
  16135. // This may be used to include null fields in Patch requests.
  16136. NullFields []string `json:"-"`
  16137. }
  16138. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  16139. type NoMethod SerialPortOutput
  16140. raw := NoMethod(*s)
  16141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16142. }
  16143. // ServiceAccount: A service account.
  16144. type ServiceAccount struct {
  16145. // Email: Email address of the service account.
  16146. Email string `json:"email,omitempty"`
  16147. // Scopes: The list of scopes to be made available for this service
  16148. // account.
  16149. Scopes []string `json:"scopes,omitempty"`
  16150. // ForceSendFields is a list of field names (e.g. "Email") to
  16151. // unconditionally include in API requests. By default, fields with
  16152. // empty values are omitted from API requests. However, any non-pointer,
  16153. // non-interface field appearing in ForceSendFields will be sent to the
  16154. // server regardless of whether the field is empty or not. This may be
  16155. // used to include empty fields in Patch requests.
  16156. ForceSendFields []string `json:"-"`
  16157. // NullFields is a list of field names (e.g. "Email") to include in API
  16158. // requests with the JSON null value. By default, fields with empty
  16159. // values are omitted from API requests. However, any field with an
  16160. // empty value appearing in NullFields will be sent to the server as
  16161. // null. It is an error if a field in this list has a non-empty value.
  16162. // This may be used to include null fields in Patch requests.
  16163. NullFields []string `json:"-"`
  16164. }
  16165. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  16166. type NoMethod ServiceAccount
  16167. raw := NoMethod(*s)
  16168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16169. }
  16170. // Snapshot: A persistent disk snapshot resource. (== resource_for
  16171. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  16172. type Snapshot struct {
  16173. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16174. // format.
  16175. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16176. // Description: An optional description of this resource. Provide this
  16177. // property when you create the resource.
  16178. Description string `json:"description,omitempty"`
  16179. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  16180. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  16181. // Id: [Output Only] The unique identifier for the resource. This
  16182. // identifier is defined by the server.
  16183. Id uint64 `json:"id,omitempty,string"`
  16184. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  16185. // Snapshot resources.
  16186. Kind string `json:"kind,omitempty"`
  16187. // LabelFingerprint: A fingerprint for the labels being applied to this
  16188. // snapshot, which is essentially a hash of the labels set used for
  16189. // optimistic locking. The fingerprint is initially generated by Compute
  16190. // Engine and changes after every request to modify or update labels.
  16191. // You must always provide an up-to-date fingerprint hash in order to
  16192. // update or change labels.
  16193. //
  16194. // To see the latest fingerprint, make a get() request to retrieve a
  16195. // snapshot.
  16196. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  16197. // Labels: Labels to apply to this snapshot. These can be later modified
  16198. // by the setLabels method. Label values may be empty.
  16199. Labels map[string]string `json:"labels,omitempty"`
  16200. // LicenseCodes: [Output Only] Integer license codes indicating which
  16201. // licenses are attached to this snapshot.
  16202. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  16203. // Licenses: [Output Only] A list of public visible licenses that apply
  16204. // to this snapshot. This can be because the original image had licenses
  16205. // attached (such as a Windows image).
  16206. Licenses []string `json:"licenses,omitempty"`
  16207. // Name: Name of the resource; provided by the client when the resource
  16208. // is created. The name must be 1-63 characters long, and comply with
  16209. // RFC1035. Specifically, the name must be 1-63 characters long and
  16210. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  16211. // the first character must be a lowercase letter, and all following
  16212. // characters must be a dash, lowercase letter, or digit, except the
  16213. // last character, which cannot be a dash.
  16214. Name string `json:"name,omitempty"`
  16215. // SelfLink: [Output Only] Server-defined URL for the resource.
  16216. SelfLink string `json:"selfLink,omitempty"`
  16217. // SnapshotEncryptionKey: Encrypts the snapshot using a
  16218. // customer-supplied encryption key.
  16219. //
  16220. // After you encrypt a snapshot using a customer-supplied key, you must
  16221. // provide the same key if you use the image later For example, you must
  16222. // provide the encryption key when you create a disk from the encrypted
  16223. // snapshot in a future request.
  16224. //
  16225. // Customer-supplied encryption keys do not protect access to metadata
  16226. // of the disk.
  16227. //
  16228. // If you do not provide an encryption key when creating the snapshot,
  16229. // then the snapshot will be encrypted using an automatically generated
  16230. // key and you do not need to provide a key to use the snapshot later.
  16231. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  16232. // SourceDisk: [Output Only] The source disk used to create this
  16233. // snapshot.
  16234. SourceDisk string `json:"sourceDisk,omitempty"`
  16235. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  16236. // source disk. Required if the source disk is protected by a
  16237. // customer-supplied encryption key.
  16238. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  16239. // SourceDiskId: [Output Only] The ID value of the disk used to create
  16240. // this snapshot. This value may be used to determine whether the
  16241. // snapshot was taken from the current or a previous instance of a given
  16242. // disk name.
  16243. SourceDiskId string `json:"sourceDiskId,omitempty"`
  16244. // Status: [Output Only] The status of the snapshot. This can be
  16245. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  16246. //
  16247. // Possible values:
  16248. // "CREATING"
  16249. // "DELETING"
  16250. // "FAILED"
  16251. // "READY"
  16252. // "UPLOADING"
  16253. Status string `json:"status,omitempty"`
  16254. // StorageBytes: [Output Only] A size of the storage used by the
  16255. // snapshot. As snapshots share storage, this number is expected to
  16256. // change with snapshot creation/deletion.
  16257. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  16258. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  16259. // is in a stable state or it is being adjusted as a result of shared
  16260. // storage reallocation. This status can either be UPDATING, meaning the
  16261. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  16262. // size of the snapshot is up-to-date.
  16263. //
  16264. // Possible values:
  16265. // "UPDATING"
  16266. // "UP_TO_DATE"
  16267. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  16268. // ServerResponse contains the HTTP response code and headers from the
  16269. // server.
  16270. googleapi.ServerResponse `json:"-"`
  16271. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  16272. // to unconditionally include in API requests. By default, fields with
  16273. // empty values are omitted from API requests. However, any non-pointer,
  16274. // non-interface field appearing in ForceSendFields will be sent to the
  16275. // server regardless of whether the field is empty or not. This may be
  16276. // used to include empty fields in Patch requests.
  16277. ForceSendFields []string `json:"-"`
  16278. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  16279. // include in API requests with the JSON null value. By default, fields
  16280. // with empty values are omitted from API requests. However, any field
  16281. // with an empty value appearing in NullFields will be sent to the
  16282. // server as null. It is an error if a field in this list has a
  16283. // non-empty value. This may be used to include null fields in Patch
  16284. // requests.
  16285. NullFields []string `json:"-"`
  16286. }
  16287. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  16288. type NoMethod Snapshot
  16289. raw := NoMethod(*s)
  16290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16291. }
  16292. // SnapshotList: Contains a list of Snapshot resources.
  16293. type SnapshotList struct {
  16294. // Id: [Output Only] Unique identifier for the resource; defined by the
  16295. // server.
  16296. Id string `json:"id,omitempty"`
  16297. // Items: A list of Snapshot resources.
  16298. Items []*Snapshot `json:"items,omitempty"`
  16299. // Kind: Type of resource.
  16300. Kind string `json:"kind,omitempty"`
  16301. // NextPageToken: [Output Only] This token allows you to get the next
  16302. // page of results for list requests. If the number of results is larger
  16303. // than maxResults, use the nextPageToken as a value for the query
  16304. // parameter pageToken in the next list request. Subsequent list
  16305. // requests will have their own nextPageToken to continue paging through
  16306. // the results.
  16307. NextPageToken string `json:"nextPageToken,omitempty"`
  16308. // SelfLink: [Output Only] Server-defined URL for this resource.
  16309. SelfLink string `json:"selfLink,omitempty"`
  16310. // Warning: [Output Only] Informational warning message.
  16311. Warning *SnapshotListWarning `json:"warning,omitempty"`
  16312. // ServerResponse contains the HTTP response code and headers from the
  16313. // server.
  16314. googleapi.ServerResponse `json:"-"`
  16315. // ForceSendFields is a list of field names (e.g. "Id") to
  16316. // unconditionally include in API requests. By default, fields with
  16317. // empty values are omitted from API requests. However, any non-pointer,
  16318. // non-interface field appearing in ForceSendFields will be sent to the
  16319. // server regardless of whether the field is empty or not. This may be
  16320. // used to include empty fields in Patch requests.
  16321. ForceSendFields []string `json:"-"`
  16322. // NullFields is a list of field names (e.g. "Id") to include in API
  16323. // requests with the JSON null value. By default, fields with empty
  16324. // values are omitted from API requests. However, any field with an
  16325. // empty value appearing in NullFields will be sent to the server as
  16326. // null. It is an error if a field in this list has a non-empty value.
  16327. // This may be used to include null fields in Patch requests.
  16328. NullFields []string `json:"-"`
  16329. }
  16330. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  16331. type NoMethod SnapshotList
  16332. raw := NoMethod(*s)
  16333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16334. }
  16335. // SnapshotListWarning: [Output Only] Informational warning message.
  16336. type SnapshotListWarning struct {
  16337. // Code: [Output Only] A warning code, if applicable. For example,
  16338. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16339. // the response.
  16340. //
  16341. // Possible values:
  16342. // "CLEANUP_FAILED"
  16343. // "DEPRECATED_RESOURCE_USED"
  16344. // "DEPRECATED_TYPE_USED"
  16345. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16346. // "EXPERIMENTAL_TYPE_USED"
  16347. // "EXTERNAL_API_WARNING"
  16348. // "FIELD_VALUE_OVERRIDEN"
  16349. // "INJECTED_KERNELS_DEPRECATED"
  16350. // "MISSING_TYPE_DEPENDENCY"
  16351. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16352. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16353. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16354. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16355. // "NEXT_HOP_NOT_RUNNING"
  16356. // "NOT_CRITICAL_ERROR"
  16357. // "NO_RESULTS_ON_PAGE"
  16358. // "REQUIRED_TOS_AGREEMENT"
  16359. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16360. // "RESOURCE_NOT_DELETED"
  16361. // "SCHEMA_VALIDATION_IGNORED"
  16362. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16363. // "UNDECLARED_PROPERTIES"
  16364. // "UNREACHABLE"
  16365. Code string `json:"code,omitempty"`
  16366. // Data: [Output Only] Metadata about this warning in key: value format.
  16367. // For example:
  16368. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16369. Data []*SnapshotListWarningData `json:"data,omitempty"`
  16370. // Message: [Output Only] A human-readable description of the warning
  16371. // code.
  16372. Message string `json:"message,omitempty"`
  16373. // ForceSendFields is a list of field names (e.g. "Code") to
  16374. // unconditionally include in API requests. By default, fields with
  16375. // empty values are omitted from API requests. However, any non-pointer,
  16376. // non-interface field appearing in ForceSendFields will be sent to the
  16377. // server regardless of whether the field is empty or not. This may be
  16378. // used to include empty fields in Patch requests.
  16379. ForceSendFields []string `json:"-"`
  16380. // NullFields is a list of field names (e.g. "Code") to include in API
  16381. // requests with the JSON null value. By default, fields with empty
  16382. // values are omitted from API requests. However, any field with an
  16383. // empty value appearing in NullFields will be sent to the server as
  16384. // null. It is an error if a field in this list has a non-empty value.
  16385. // This may be used to include null fields in Patch requests.
  16386. NullFields []string `json:"-"`
  16387. }
  16388. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  16389. type NoMethod SnapshotListWarning
  16390. raw := NoMethod(*s)
  16391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16392. }
  16393. type SnapshotListWarningData struct {
  16394. // Key: [Output Only] A key that provides more detail on the warning
  16395. // being returned. For example, for warnings where there are no results
  16396. // in a list request for a particular zone, this key might be scope and
  16397. // the key value might be the zone name. Other examples might be a key
  16398. // indicating a deprecated resource and a suggested replacement, or a
  16399. // warning about invalid network settings (for example, if an instance
  16400. // attempts to perform IP forwarding but is not enabled for IP
  16401. // forwarding).
  16402. Key string `json:"key,omitempty"`
  16403. // Value: [Output Only] A warning data value corresponding to the key.
  16404. Value string `json:"value,omitempty"`
  16405. // ForceSendFields is a list of field names (e.g. "Key") to
  16406. // unconditionally include in API requests. By default, fields with
  16407. // empty values are omitted from API requests. However, any non-pointer,
  16408. // non-interface field appearing in ForceSendFields will be sent to the
  16409. // server regardless of whether the field is empty or not. This may be
  16410. // used to include empty fields in Patch requests.
  16411. ForceSendFields []string `json:"-"`
  16412. // NullFields is a list of field names (e.g. "Key") to include in API
  16413. // requests with the JSON null value. By default, fields with empty
  16414. // values are omitted from API requests. However, any field with an
  16415. // empty value appearing in NullFields will be sent to the server as
  16416. // null. It is an error if a field in this list has a non-empty value.
  16417. // This may be used to include null fields in Patch requests.
  16418. NullFields []string `json:"-"`
  16419. }
  16420. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  16421. type NoMethod SnapshotListWarningData
  16422. raw := NoMethod(*s)
  16423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16424. }
  16425. // SourceInstanceParams: A specification of the parameters to use when
  16426. // creating the instance template from a source instance.
  16427. type SourceInstanceParams struct {
  16428. // DiskConfigs: Attached disks configuration. If not provided, defaults
  16429. // are applied: For boot disk and any other R/W disks, new custom images
  16430. // will be created from each disk. For read-only disks, they will be
  16431. // attached in read-only mode. Local SSD disks will be created as blank
  16432. // volumes.
  16433. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  16434. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  16435. // unconditionally include in API requests. By default, fields with
  16436. // empty values are omitted from API requests. However, any non-pointer,
  16437. // non-interface field appearing in ForceSendFields will be sent to the
  16438. // server regardless of whether the field is empty or not. This may be
  16439. // used to include empty fields in Patch requests.
  16440. ForceSendFields []string `json:"-"`
  16441. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  16442. // in API requests with the JSON null value. By default, fields with
  16443. // empty values are omitted from API requests. However, any field with
  16444. // an empty value appearing in NullFields will be sent to the server as
  16445. // null. It is an error if a field in this list has a non-empty value.
  16446. // This may be used to include null fields in Patch requests.
  16447. NullFields []string `json:"-"`
  16448. }
  16449. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  16450. type NoMethod SourceInstanceParams
  16451. raw := NoMethod(*s)
  16452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16453. }
  16454. // SslCertificate: An SslCertificate resource. This resource provides a
  16455. // mechanism to upload an SSL key and certificate to the load balancer
  16456. // to serve secure connections from the user. (== resource_for
  16457. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  16458. type SslCertificate struct {
  16459. // Certificate: A local certificate file. The certificate must be in PEM
  16460. // format. The certificate chain must be no greater than 5 certs long.
  16461. // The chain must include at least one intermediate cert.
  16462. Certificate string `json:"certificate,omitempty"`
  16463. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16464. // format.
  16465. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16466. // Description: An optional description of this resource. Provide this
  16467. // property when you create the resource.
  16468. Description string `json:"description,omitempty"`
  16469. // Id: [Output Only] The unique identifier for the resource. This
  16470. // identifier is defined by the server.
  16471. Id uint64 `json:"id,omitempty,string"`
  16472. // Kind: [Output Only] Type of the resource. Always
  16473. // compute#sslCertificate for SSL certificates.
  16474. Kind string `json:"kind,omitempty"`
  16475. // Name: Name of the resource. Provided by the client when the resource
  16476. // is created. The name must be 1-63 characters long, and comply with
  16477. // RFC1035. Specifically, the name must be 1-63 characters long and
  16478. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  16479. // the first character must be a lowercase letter, and all following
  16480. // characters must be a dash, lowercase letter, or digit, except the
  16481. // last character, which cannot be a dash.
  16482. Name string `json:"name,omitempty"`
  16483. // PrivateKey: A write-only private key in PEM format. Only insert
  16484. // requests will include this field.
  16485. PrivateKey string `json:"privateKey,omitempty"`
  16486. // SelfLink: [Output only] Server-defined URL for the resource.
  16487. SelfLink string `json:"selfLink,omitempty"`
  16488. // ServerResponse contains the HTTP response code and headers from the
  16489. // server.
  16490. googleapi.ServerResponse `json:"-"`
  16491. // ForceSendFields is a list of field names (e.g. "Certificate") to
  16492. // unconditionally include in API requests. By default, fields with
  16493. // empty values are omitted from API requests. However, any non-pointer,
  16494. // non-interface field appearing in ForceSendFields will be sent to the
  16495. // server regardless of whether the field is empty or not. This may be
  16496. // used to include empty fields in Patch requests.
  16497. ForceSendFields []string `json:"-"`
  16498. // NullFields is a list of field names (e.g. "Certificate") to include
  16499. // in API requests with the JSON null value. By default, fields with
  16500. // empty values are omitted from API requests. However, any field with
  16501. // an empty value appearing in NullFields will be sent to the server as
  16502. // null. It is an error if a field in this list has a non-empty value.
  16503. // This may be used to include null fields in Patch requests.
  16504. NullFields []string `json:"-"`
  16505. }
  16506. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  16507. type NoMethod SslCertificate
  16508. raw := NoMethod(*s)
  16509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16510. }
  16511. // SslCertificateList: Contains a list of SslCertificate resources.
  16512. type SslCertificateList struct {
  16513. // Id: [Output Only] Unique identifier for the resource; defined by the
  16514. // server.
  16515. Id string `json:"id,omitempty"`
  16516. // Items: A list of SslCertificate resources.
  16517. Items []*SslCertificate `json:"items,omitempty"`
  16518. // Kind: Type of resource.
  16519. Kind string `json:"kind,omitempty"`
  16520. // NextPageToken: [Output Only] This token allows you to get the next
  16521. // page of results for list requests. If the number of results is larger
  16522. // than maxResults, use the nextPageToken as a value for the query
  16523. // parameter pageToken in the next list request. Subsequent list
  16524. // requests will have their own nextPageToken to continue paging through
  16525. // the results.
  16526. NextPageToken string `json:"nextPageToken,omitempty"`
  16527. // SelfLink: [Output Only] Server-defined URL for this resource.
  16528. SelfLink string `json:"selfLink,omitempty"`
  16529. // Warning: [Output Only] Informational warning message.
  16530. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  16531. // ServerResponse contains the HTTP response code and headers from the
  16532. // server.
  16533. googleapi.ServerResponse `json:"-"`
  16534. // ForceSendFields is a list of field names (e.g. "Id") to
  16535. // unconditionally include in API requests. By default, fields with
  16536. // empty values are omitted from API requests. However, any non-pointer,
  16537. // non-interface field appearing in ForceSendFields will be sent to the
  16538. // server regardless of whether the field is empty or not. This may be
  16539. // used to include empty fields in Patch requests.
  16540. ForceSendFields []string `json:"-"`
  16541. // NullFields is a list of field names (e.g. "Id") to include in API
  16542. // requests with the JSON null value. By default, fields with empty
  16543. // values are omitted from API requests. However, any field with an
  16544. // empty value appearing in NullFields will be sent to the server as
  16545. // null. It is an error if a field in this list has a non-empty value.
  16546. // This may be used to include null fields in Patch requests.
  16547. NullFields []string `json:"-"`
  16548. }
  16549. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  16550. type NoMethod SslCertificateList
  16551. raw := NoMethod(*s)
  16552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16553. }
  16554. // SslCertificateListWarning: [Output Only] Informational warning
  16555. // message.
  16556. type SslCertificateListWarning struct {
  16557. // Code: [Output Only] A warning code, if applicable. For example,
  16558. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16559. // the response.
  16560. //
  16561. // Possible values:
  16562. // "CLEANUP_FAILED"
  16563. // "DEPRECATED_RESOURCE_USED"
  16564. // "DEPRECATED_TYPE_USED"
  16565. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16566. // "EXPERIMENTAL_TYPE_USED"
  16567. // "EXTERNAL_API_WARNING"
  16568. // "FIELD_VALUE_OVERRIDEN"
  16569. // "INJECTED_KERNELS_DEPRECATED"
  16570. // "MISSING_TYPE_DEPENDENCY"
  16571. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16572. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16573. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16574. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16575. // "NEXT_HOP_NOT_RUNNING"
  16576. // "NOT_CRITICAL_ERROR"
  16577. // "NO_RESULTS_ON_PAGE"
  16578. // "REQUIRED_TOS_AGREEMENT"
  16579. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16580. // "RESOURCE_NOT_DELETED"
  16581. // "SCHEMA_VALIDATION_IGNORED"
  16582. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16583. // "UNDECLARED_PROPERTIES"
  16584. // "UNREACHABLE"
  16585. Code string `json:"code,omitempty"`
  16586. // Data: [Output Only] Metadata about this warning in key: value format.
  16587. // For example:
  16588. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16589. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  16590. // Message: [Output Only] A human-readable description of the warning
  16591. // code.
  16592. Message string `json:"message,omitempty"`
  16593. // ForceSendFields is a list of field names (e.g. "Code") to
  16594. // unconditionally include in API requests. By default, fields with
  16595. // empty values are omitted from API requests. However, any non-pointer,
  16596. // non-interface field appearing in ForceSendFields will be sent to the
  16597. // server regardless of whether the field is empty or not. This may be
  16598. // used to include empty fields in Patch requests.
  16599. ForceSendFields []string `json:"-"`
  16600. // NullFields is a list of field names (e.g. "Code") to include in API
  16601. // requests with the JSON null value. By default, fields with empty
  16602. // values are omitted from API requests. However, any field with an
  16603. // empty value appearing in NullFields will be sent to the server as
  16604. // null. It is an error if a field in this list has a non-empty value.
  16605. // This may be used to include null fields in Patch requests.
  16606. NullFields []string `json:"-"`
  16607. }
  16608. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  16609. type NoMethod SslCertificateListWarning
  16610. raw := NoMethod(*s)
  16611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16612. }
  16613. type SslCertificateListWarningData struct {
  16614. // Key: [Output Only] A key that provides more detail on the warning
  16615. // being returned. For example, for warnings where there are no results
  16616. // in a list request for a particular zone, this key might be scope and
  16617. // the key value might be the zone name. Other examples might be a key
  16618. // indicating a deprecated resource and a suggested replacement, or a
  16619. // warning about invalid network settings (for example, if an instance
  16620. // attempts to perform IP forwarding but is not enabled for IP
  16621. // forwarding).
  16622. Key string `json:"key,omitempty"`
  16623. // Value: [Output Only] A warning data value corresponding to the key.
  16624. Value string `json:"value,omitempty"`
  16625. // ForceSendFields is a list of field names (e.g. "Key") to
  16626. // unconditionally include in API requests. By default, fields with
  16627. // empty values are omitted from API requests. However, any non-pointer,
  16628. // non-interface field appearing in ForceSendFields will be sent to the
  16629. // server regardless of whether the field is empty or not. This may be
  16630. // used to include empty fields in Patch requests.
  16631. ForceSendFields []string `json:"-"`
  16632. // NullFields is a list of field names (e.g. "Key") to include in API
  16633. // requests with the JSON null value. By default, fields with empty
  16634. // values are omitted from API requests. However, any field with an
  16635. // empty value appearing in NullFields will be sent to the server as
  16636. // null. It is an error if a field in this list has a non-empty value.
  16637. // This may be used to include null fields in Patch requests.
  16638. NullFields []string `json:"-"`
  16639. }
  16640. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  16641. type NoMethod SslCertificateListWarningData
  16642. raw := NoMethod(*s)
  16643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16644. }
  16645. type SslPoliciesList struct {
  16646. // Id: [Output Only] Unique identifier for the resource; defined by the
  16647. // server.
  16648. Id string `json:"id,omitempty"`
  16649. // Items: A list of SslPolicy resources.
  16650. Items []*SslPolicy `json:"items,omitempty"`
  16651. // Kind: [Output Only] Type of the resource. Always
  16652. // compute#sslPoliciesList for lists of sslPolicies.
  16653. Kind string `json:"kind,omitempty"`
  16654. // NextPageToken: [Output Only] This token allows you to get the next
  16655. // page of results for list requests. If the number of results is larger
  16656. // than maxResults, use the nextPageToken as a value for the query
  16657. // parameter pageToken in the next list request. Subsequent list
  16658. // requests will have their own nextPageToken to continue paging through
  16659. // the results.
  16660. NextPageToken string `json:"nextPageToken,omitempty"`
  16661. // SelfLink: [Output Only] Server-defined URL for this resource.
  16662. SelfLink string `json:"selfLink,omitempty"`
  16663. // Warning: [Output Only] Informational warning message.
  16664. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  16665. // ServerResponse contains the HTTP response code and headers from the
  16666. // server.
  16667. googleapi.ServerResponse `json:"-"`
  16668. // ForceSendFields is a list of field names (e.g. "Id") to
  16669. // unconditionally include in API requests. By default, fields with
  16670. // empty values are omitted from API requests. However, any non-pointer,
  16671. // non-interface field appearing in ForceSendFields will be sent to the
  16672. // server regardless of whether the field is empty or not. This may be
  16673. // used to include empty fields in Patch requests.
  16674. ForceSendFields []string `json:"-"`
  16675. // NullFields is a list of field names (e.g. "Id") to include in API
  16676. // requests with the JSON null value. By default, fields with empty
  16677. // values are omitted from API requests. However, any field with an
  16678. // empty value appearing in NullFields will be sent to the server as
  16679. // null. It is an error if a field in this list has a non-empty value.
  16680. // This may be used to include null fields in Patch requests.
  16681. NullFields []string `json:"-"`
  16682. }
  16683. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  16684. type NoMethod SslPoliciesList
  16685. raw := NoMethod(*s)
  16686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16687. }
  16688. // SslPoliciesListWarning: [Output Only] Informational warning message.
  16689. type SslPoliciesListWarning struct {
  16690. // Code: [Output Only] A warning code, if applicable. For example,
  16691. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16692. // the response.
  16693. //
  16694. // Possible values:
  16695. // "CLEANUP_FAILED"
  16696. // "DEPRECATED_RESOURCE_USED"
  16697. // "DEPRECATED_TYPE_USED"
  16698. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16699. // "EXPERIMENTAL_TYPE_USED"
  16700. // "EXTERNAL_API_WARNING"
  16701. // "FIELD_VALUE_OVERRIDEN"
  16702. // "INJECTED_KERNELS_DEPRECATED"
  16703. // "MISSING_TYPE_DEPENDENCY"
  16704. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16705. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16706. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16707. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16708. // "NEXT_HOP_NOT_RUNNING"
  16709. // "NOT_CRITICAL_ERROR"
  16710. // "NO_RESULTS_ON_PAGE"
  16711. // "REQUIRED_TOS_AGREEMENT"
  16712. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16713. // "RESOURCE_NOT_DELETED"
  16714. // "SCHEMA_VALIDATION_IGNORED"
  16715. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16716. // "UNDECLARED_PROPERTIES"
  16717. // "UNREACHABLE"
  16718. Code string `json:"code,omitempty"`
  16719. // Data: [Output Only] Metadata about this warning in key: value format.
  16720. // For example:
  16721. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16722. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  16723. // Message: [Output Only] A human-readable description of the warning
  16724. // code.
  16725. Message string `json:"message,omitempty"`
  16726. // ForceSendFields is a list of field names (e.g. "Code") to
  16727. // unconditionally include in API requests. By default, fields with
  16728. // empty values are omitted from API requests. However, any non-pointer,
  16729. // non-interface field appearing in ForceSendFields will be sent to the
  16730. // server regardless of whether the field is empty or not. This may be
  16731. // used to include empty fields in Patch requests.
  16732. ForceSendFields []string `json:"-"`
  16733. // NullFields is a list of field names (e.g. "Code") to include in API
  16734. // requests with the JSON null value. By default, fields with empty
  16735. // values are omitted from API requests. However, any field with an
  16736. // empty value appearing in NullFields will be sent to the server as
  16737. // null. It is an error if a field in this list has a non-empty value.
  16738. // This may be used to include null fields in Patch requests.
  16739. NullFields []string `json:"-"`
  16740. }
  16741. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  16742. type NoMethod SslPoliciesListWarning
  16743. raw := NoMethod(*s)
  16744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16745. }
  16746. type SslPoliciesListWarningData struct {
  16747. // Key: [Output Only] A key that provides more detail on the warning
  16748. // being returned. For example, for warnings where there are no results
  16749. // in a list request for a particular zone, this key might be scope and
  16750. // the key value might be the zone name. Other examples might be a key
  16751. // indicating a deprecated resource and a suggested replacement, or a
  16752. // warning about invalid network settings (for example, if an instance
  16753. // attempts to perform IP forwarding but is not enabled for IP
  16754. // forwarding).
  16755. Key string `json:"key,omitempty"`
  16756. // Value: [Output Only] A warning data value corresponding to the key.
  16757. Value string `json:"value,omitempty"`
  16758. // ForceSendFields is a list of field names (e.g. "Key") to
  16759. // unconditionally include in API requests. By default, fields with
  16760. // empty values are omitted from API requests. However, any non-pointer,
  16761. // non-interface field appearing in ForceSendFields will be sent to the
  16762. // server regardless of whether the field is empty or not. This may be
  16763. // used to include empty fields in Patch requests.
  16764. ForceSendFields []string `json:"-"`
  16765. // NullFields is a list of field names (e.g. "Key") to include in API
  16766. // requests with the JSON null value. By default, fields with empty
  16767. // values are omitted from API requests. However, any field with an
  16768. // empty value appearing in NullFields will be sent to the server as
  16769. // null. It is an error if a field in this list has a non-empty value.
  16770. // This may be used to include null fields in Patch requests.
  16771. NullFields []string `json:"-"`
  16772. }
  16773. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  16774. type NoMethod SslPoliciesListWarningData
  16775. raw := NoMethod(*s)
  16776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16777. }
  16778. type SslPoliciesListAvailableFeaturesResponse struct {
  16779. Features []string `json:"features,omitempty"`
  16780. // ServerResponse contains the HTTP response code and headers from the
  16781. // server.
  16782. googleapi.ServerResponse `json:"-"`
  16783. // ForceSendFields is a list of field names (e.g. "Features") to
  16784. // unconditionally include in API requests. By default, fields with
  16785. // empty values are omitted from API requests. However, any non-pointer,
  16786. // non-interface field appearing in ForceSendFields will be sent to the
  16787. // server regardless of whether the field is empty or not. This may be
  16788. // used to include empty fields in Patch requests.
  16789. ForceSendFields []string `json:"-"`
  16790. // NullFields is a list of field names (e.g. "Features") to include in
  16791. // API requests with the JSON null value. By default, fields with empty
  16792. // values are omitted from API requests. However, any field with an
  16793. // empty value appearing in NullFields will be sent to the server as
  16794. // null. It is an error if a field in this list has a non-empty value.
  16795. // This may be used to include null fields in Patch requests.
  16796. NullFields []string `json:"-"`
  16797. }
  16798. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  16799. type NoMethod SslPoliciesListAvailableFeaturesResponse
  16800. raw := NoMethod(*s)
  16801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16802. }
  16803. // SslPolicy: A SSL policy specifies the server-side support for SSL
  16804. // features. This can be attached to a TargetHttpsProxy or a
  16805. // TargetSslProxy. This affects connections between clients and the
  16806. // HTTPS or SSL proxy load balancer. They do not affect the connection
  16807. // between the load balancers and the backends.
  16808. type SslPolicy struct {
  16809. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16810. // format.
  16811. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16812. // CustomFeatures: A list of features enabled when the selected profile
  16813. // is CUSTOM. The
  16814. // - method returns the set of features that can be specified in this
  16815. // list. This field must be empty if the profile is not CUSTOM.
  16816. CustomFeatures []string `json:"customFeatures,omitempty"`
  16817. // Description: An optional description of this resource. Provide this
  16818. // property when you create the resource.
  16819. Description string `json:"description,omitempty"`
  16820. // EnabledFeatures: [Output Only] The list of features enabled in the
  16821. // SSL policy.
  16822. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  16823. // Fingerprint: Fingerprint of this resource. A hash of the contents
  16824. // stored in this object. This field is used in optimistic locking. This
  16825. // field will be ignored when inserting a SslPolicy. An up-to-date
  16826. // fingerprint must be provided in order to update the SslPolicy.
  16827. Fingerprint string `json:"fingerprint,omitempty"`
  16828. // Id: [Output Only] The unique identifier for the resource. This
  16829. // identifier is defined by the server.
  16830. Id uint64 `json:"id,omitempty,string"`
  16831. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  16832. // SSL policies.
  16833. Kind string `json:"kind,omitempty"`
  16834. // MinTlsVersion: The minimum version of SSL protocol that can be used
  16835. // by the clients to establish a connection with the load balancer. This
  16836. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  16837. //
  16838. // Possible values:
  16839. // "TLS_1_0"
  16840. // "TLS_1_1"
  16841. // "TLS_1_2"
  16842. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  16843. // Name: Name of the resource. The name must be 1-63 characters long,
  16844. // and comply with RFC1035. Specifically, the name must be 1-63
  16845. // characters long and match the regular expression
  16846. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  16847. // a lowercase letter, and all following characters must be a dash,
  16848. // lowercase letter, or digit, except the last character, which cannot
  16849. // be a dash.
  16850. Name string `json:"name,omitempty"`
  16851. // Profile: Profile specifies the set of SSL features that can be used
  16852. // by the load balancer when negotiating SSL with clients. This can be
  16853. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  16854. // the set of SSL features to enable must be specified in the
  16855. // customFeatures field.
  16856. //
  16857. // Possible values:
  16858. // "COMPATIBLE"
  16859. // "CUSTOM"
  16860. // "MODERN"
  16861. // "RESTRICTED"
  16862. Profile string `json:"profile,omitempty"`
  16863. // SelfLink: [Output Only] Server-defined URL for the resource.
  16864. SelfLink string `json:"selfLink,omitempty"`
  16865. // Warnings: [Output Only] If potential misconfigurations are detected
  16866. // for this SSL policy, this field will be populated with warning
  16867. // messages.
  16868. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  16869. // ServerResponse contains the HTTP response code and headers from the
  16870. // server.
  16871. googleapi.ServerResponse `json:"-"`
  16872. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  16873. // to unconditionally include in API requests. By default, fields with
  16874. // empty values are omitted from API requests. However, any non-pointer,
  16875. // non-interface field appearing in ForceSendFields will be sent to the
  16876. // server regardless of whether the field is empty or not. This may be
  16877. // used to include empty fields in Patch requests.
  16878. ForceSendFields []string `json:"-"`
  16879. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  16880. // include in API requests with the JSON null value. By default, fields
  16881. // with empty values are omitted from API requests. However, any field
  16882. // with an empty value appearing in NullFields will be sent to the
  16883. // server as null. It is an error if a field in this list has a
  16884. // non-empty value. This may be used to include null fields in Patch
  16885. // requests.
  16886. NullFields []string `json:"-"`
  16887. }
  16888. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  16889. type NoMethod SslPolicy
  16890. raw := NoMethod(*s)
  16891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16892. }
  16893. type SslPolicyWarnings struct {
  16894. // Code: [Output Only] A warning code, if applicable. For example,
  16895. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16896. // the response.
  16897. //
  16898. // Possible values:
  16899. // "CLEANUP_FAILED"
  16900. // "DEPRECATED_RESOURCE_USED"
  16901. // "DEPRECATED_TYPE_USED"
  16902. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16903. // "EXPERIMENTAL_TYPE_USED"
  16904. // "EXTERNAL_API_WARNING"
  16905. // "FIELD_VALUE_OVERRIDEN"
  16906. // "INJECTED_KERNELS_DEPRECATED"
  16907. // "MISSING_TYPE_DEPENDENCY"
  16908. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16909. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16910. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16911. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16912. // "NEXT_HOP_NOT_RUNNING"
  16913. // "NOT_CRITICAL_ERROR"
  16914. // "NO_RESULTS_ON_PAGE"
  16915. // "REQUIRED_TOS_AGREEMENT"
  16916. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16917. // "RESOURCE_NOT_DELETED"
  16918. // "SCHEMA_VALIDATION_IGNORED"
  16919. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16920. // "UNDECLARED_PROPERTIES"
  16921. // "UNREACHABLE"
  16922. Code string `json:"code,omitempty"`
  16923. // Data: [Output Only] Metadata about this warning in key: value format.
  16924. // For example:
  16925. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16926. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  16927. // Message: [Output Only] A human-readable description of the warning
  16928. // code.
  16929. Message string `json:"message,omitempty"`
  16930. // ForceSendFields is a list of field names (e.g. "Code") to
  16931. // unconditionally include in API requests. By default, fields with
  16932. // empty values are omitted from API requests. However, any non-pointer,
  16933. // non-interface field appearing in ForceSendFields will be sent to the
  16934. // server regardless of whether the field is empty or not. This may be
  16935. // used to include empty fields in Patch requests.
  16936. ForceSendFields []string `json:"-"`
  16937. // NullFields is a list of field names (e.g. "Code") to include in API
  16938. // requests with the JSON null value. By default, fields with empty
  16939. // values are omitted from API requests. However, any field with an
  16940. // empty value appearing in NullFields will be sent to the server as
  16941. // null. It is an error if a field in this list has a non-empty value.
  16942. // This may be used to include null fields in Patch requests.
  16943. NullFields []string `json:"-"`
  16944. }
  16945. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  16946. type NoMethod SslPolicyWarnings
  16947. raw := NoMethod(*s)
  16948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16949. }
  16950. type SslPolicyWarningsData struct {
  16951. // Key: [Output Only] A key that provides more detail on the warning
  16952. // being returned. For example, for warnings where there are no results
  16953. // in a list request for a particular zone, this key might be scope and
  16954. // the key value might be the zone name. Other examples might be a key
  16955. // indicating a deprecated resource and a suggested replacement, or a
  16956. // warning about invalid network settings (for example, if an instance
  16957. // attempts to perform IP forwarding but is not enabled for IP
  16958. // forwarding).
  16959. Key string `json:"key,omitempty"`
  16960. // Value: [Output Only] A warning data value corresponding to the key.
  16961. Value string `json:"value,omitempty"`
  16962. // ForceSendFields is a list of field names (e.g. "Key") to
  16963. // unconditionally include in API requests. By default, fields with
  16964. // empty values are omitted from API requests. However, any non-pointer,
  16965. // non-interface field appearing in ForceSendFields will be sent to the
  16966. // server regardless of whether the field is empty or not. This may be
  16967. // used to include empty fields in Patch requests.
  16968. ForceSendFields []string `json:"-"`
  16969. // NullFields is a list of field names (e.g. "Key") to include in API
  16970. // requests with the JSON null value. By default, fields with empty
  16971. // values are omitted from API requests. However, any field with an
  16972. // empty value appearing in NullFields will be sent to the server as
  16973. // null. It is an error if a field in this list has a non-empty value.
  16974. // This may be used to include null fields in Patch requests.
  16975. NullFields []string `json:"-"`
  16976. }
  16977. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  16978. type NoMethod SslPolicyWarningsData
  16979. raw := NoMethod(*s)
  16980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16981. }
  16982. type SslPolicyReference struct {
  16983. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  16984. // to clear any existing SSL policy associated with the target proxy
  16985. // resource.
  16986. SslPolicy string `json:"sslPolicy,omitempty"`
  16987. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  16988. // unconditionally include in API requests. By default, fields with
  16989. // empty values are omitted from API requests. However, any non-pointer,
  16990. // non-interface field appearing in ForceSendFields will be sent to the
  16991. // server regardless of whether the field is empty or not. This may be
  16992. // used to include empty fields in Patch requests.
  16993. ForceSendFields []string `json:"-"`
  16994. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  16995. // API requests with the JSON null value. By default, fields with empty
  16996. // values are omitted from API requests. However, any field with an
  16997. // empty value appearing in NullFields will be sent to the server as
  16998. // null. It is an error if a field in this list has a non-empty value.
  16999. // This may be used to include null fields in Patch requests.
  17000. NullFields []string `json:"-"`
  17001. }
  17002. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  17003. type NoMethod SslPolicyReference
  17004. raw := NoMethod(*s)
  17005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17006. }
  17007. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  17008. // ==) (== resource_for v1.subnetworks ==)
  17009. type Subnetwork struct {
  17010. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17011. // format.
  17012. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17013. // Description: An optional description of this resource. Provide this
  17014. // property when you create the resource. This field can be set only at
  17015. // resource creation time.
  17016. Description string `json:"description,omitempty"`
  17017. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  17018. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  17019. // Fingerprint: Fingerprint of this resource. A hash of the contents
  17020. // stored in this object. This field is used in optimistic locking. This
  17021. // field will be ignored when inserting a Subnetwork. An up-to-date
  17022. // fingerprint must be provided in order to update the Subnetwork.
  17023. Fingerprint string `json:"fingerprint,omitempty"`
  17024. // GatewayAddress: [Output Only] The gateway address for default routes
  17025. // to reach destination addresses outside this subnetwork.
  17026. GatewayAddress string `json:"gatewayAddress,omitempty"`
  17027. // Id: [Output Only] The unique identifier for the resource. This
  17028. // identifier is defined by the server.
  17029. Id uint64 `json:"id,omitempty,string"`
  17030. // IpCidrRange: The range of internal addresses that are owned by this
  17031. // subnetwork. Provide this property when you create the subnetwork. For
  17032. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  17033. // non-overlapping within a network. Only IPv4 is supported. This field
  17034. // can be set only at resource creation time.
  17035. IpCidrRange string `json:"ipCidrRange,omitempty"`
  17036. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  17037. // for Subnetwork resources.
  17038. Kind string `json:"kind,omitempty"`
  17039. // Name: The name of the resource, provided by the client when initially
  17040. // creating the resource. The name must be 1-63 characters long, and
  17041. // comply with RFC1035. Specifically, the name must be 1-63 characters
  17042. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  17043. // which means the first character must be a lowercase letter, and all
  17044. // following characters must be a dash, lowercase letter, or digit,
  17045. // except the last character, which cannot be a dash.
  17046. Name string `json:"name,omitempty"`
  17047. // Network: The URL of the network to which this subnetwork belongs,
  17048. // provided by the client when initially creating the subnetwork. Only
  17049. // networks that are in the distributed mode can have subnetworks. This
  17050. // field can be set only at resource creation time.
  17051. Network string `json:"network,omitempty"`
  17052. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  17053. // Google services without assigned external IP addresses. This field
  17054. // can be both set at resource creation time and updated using
  17055. // setPrivateIpGoogleAccess.
  17056. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  17057. // Region: URL of the region where the Subnetwork resides. This field
  17058. // can be set only at resource creation time.
  17059. Region string `json:"region,omitempty"`
  17060. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  17061. // for VM instances contained in this subnetwork. The primary IP of such
  17062. // VM must belong to the primary ipCidrRange of the subnetwork. The
  17063. // alias IPs may belong to either primary or secondary ranges.
  17064. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  17065. // SelfLink: [Output Only] Server-defined URL for the resource.
  17066. SelfLink string `json:"selfLink,omitempty"`
  17067. // ServerResponse contains the HTTP response code and headers from the
  17068. // server.
  17069. googleapi.ServerResponse `json:"-"`
  17070. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17071. // to unconditionally include in API requests. By default, fields with
  17072. // empty values are omitted from API requests. However, any non-pointer,
  17073. // non-interface field appearing in ForceSendFields will be sent to the
  17074. // server regardless of whether the field is empty or not. This may be
  17075. // used to include empty fields in Patch requests.
  17076. ForceSendFields []string `json:"-"`
  17077. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17078. // include in API requests with the JSON null value. By default, fields
  17079. // with empty values are omitted from API requests. However, any field
  17080. // with an empty value appearing in NullFields will be sent to the
  17081. // server as null. It is an error if a field in this list has a
  17082. // non-empty value. This may be used to include null fields in Patch
  17083. // requests.
  17084. NullFields []string `json:"-"`
  17085. }
  17086. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  17087. type NoMethod Subnetwork
  17088. raw := NoMethod(*s)
  17089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17090. }
  17091. type SubnetworkAggregatedList 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 SubnetworksScopedList resources.
  17096. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  17097. // Kind: [Output Only] Type of resource. Always
  17098. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  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 *SubnetworkAggregatedListWarning `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 *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  17130. type NoMethod SubnetworkAggregatedList
  17131. raw := NoMethod(*s)
  17132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17133. }
  17134. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  17135. // message.
  17136. type SubnetworkAggregatedListWarning 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 []*SubnetworkAggregatedListWarningData `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 *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  17189. type NoMethod SubnetworkAggregatedListWarning
  17190. raw := NoMethod(*s)
  17191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17192. }
  17193. type SubnetworkAggregatedListWarningData 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 *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  17221. type NoMethod SubnetworkAggregatedListWarningData
  17222. raw := NoMethod(*s)
  17223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17224. }
  17225. // SubnetworkList: Contains a list of Subnetwork resources.
  17226. type SubnetworkList struct {
  17227. // Id: [Output Only] Unique identifier for the resource; defined by the
  17228. // server.
  17229. Id string `json:"id,omitempty"`
  17230. // Items: A list of Subnetwork resources.
  17231. Items []*Subnetwork `json:"items,omitempty"`
  17232. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  17233. // for lists of subnetworks.
  17234. Kind string `json:"kind,omitempty"`
  17235. // NextPageToken: [Output Only] This token allows you to get the next
  17236. // page of results for list requests. If the number of results is larger
  17237. // than maxResults, use the nextPageToken as a value for the query
  17238. // parameter pageToken in the next list request. Subsequent list
  17239. // requests will have their own nextPageToken to continue paging through
  17240. // the results.
  17241. NextPageToken string `json:"nextPageToken,omitempty"`
  17242. // SelfLink: [Output Only] Server-defined URL for this resource.
  17243. SelfLink string `json:"selfLink,omitempty"`
  17244. // Warning: [Output Only] Informational warning message.
  17245. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  17246. // ServerResponse contains the HTTP response code and headers from the
  17247. // server.
  17248. googleapi.ServerResponse `json:"-"`
  17249. // ForceSendFields is a list of field names (e.g. "Id") to
  17250. // unconditionally include in API requests. By default, fields with
  17251. // empty values are omitted from API requests. However, any non-pointer,
  17252. // non-interface field appearing in ForceSendFields will be sent to the
  17253. // server regardless of whether the field is empty or not. This may be
  17254. // used to include empty fields in Patch requests.
  17255. ForceSendFields []string `json:"-"`
  17256. // NullFields is a list of field names (e.g. "Id") to include in API
  17257. // requests with the JSON null value. By default, fields with empty
  17258. // values are omitted from API requests. However, any field with an
  17259. // empty value appearing in NullFields will be sent to the server as
  17260. // null. It is an error if a field in this list has a non-empty value.
  17261. // This may be used to include null fields in Patch requests.
  17262. NullFields []string `json:"-"`
  17263. }
  17264. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  17265. type NoMethod SubnetworkList
  17266. raw := NoMethod(*s)
  17267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17268. }
  17269. // SubnetworkListWarning: [Output Only] Informational warning message.
  17270. type SubnetworkListWarning struct {
  17271. // Code: [Output Only] A warning code, if applicable. For example,
  17272. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17273. // the response.
  17274. //
  17275. // Possible values:
  17276. // "CLEANUP_FAILED"
  17277. // "DEPRECATED_RESOURCE_USED"
  17278. // "DEPRECATED_TYPE_USED"
  17279. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17280. // "EXPERIMENTAL_TYPE_USED"
  17281. // "EXTERNAL_API_WARNING"
  17282. // "FIELD_VALUE_OVERRIDEN"
  17283. // "INJECTED_KERNELS_DEPRECATED"
  17284. // "MISSING_TYPE_DEPENDENCY"
  17285. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17286. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17287. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17288. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17289. // "NEXT_HOP_NOT_RUNNING"
  17290. // "NOT_CRITICAL_ERROR"
  17291. // "NO_RESULTS_ON_PAGE"
  17292. // "REQUIRED_TOS_AGREEMENT"
  17293. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17294. // "RESOURCE_NOT_DELETED"
  17295. // "SCHEMA_VALIDATION_IGNORED"
  17296. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17297. // "UNDECLARED_PROPERTIES"
  17298. // "UNREACHABLE"
  17299. Code string `json:"code,omitempty"`
  17300. // Data: [Output Only] Metadata about this warning in key: value format.
  17301. // For example:
  17302. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17303. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  17304. // Message: [Output Only] A human-readable description of the warning
  17305. // code.
  17306. Message string `json:"message,omitempty"`
  17307. // ForceSendFields is a list of field names (e.g. "Code") to
  17308. // unconditionally include in API requests. By default, fields with
  17309. // empty values are omitted from API requests. However, any non-pointer,
  17310. // non-interface field appearing in ForceSendFields will be sent to the
  17311. // server regardless of whether the field is empty or not. This may be
  17312. // used to include empty fields in Patch requests.
  17313. ForceSendFields []string `json:"-"`
  17314. // NullFields is a list of field names (e.g. "Code") to include in API
  17315. // requests with the JSON null value. By default, fields with empty
  17316. // values are omitted from API requests. However, any field with an
  17317. // empty value appearing in NullFields will be sent to the server as
  17318. // null. It is an error if a field in this list has a non-empty value.
  17319. // This may be used to include null fields in Patch requests.
  17320. NullFields []string `json:"-"`
  17321. }
  17322. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  17323. type NoMethod SubnetworkListWarning
  17324. raw := NoMethod(*s)
  17325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17326. }
  17327. type SubnetworkListWarningData struct {
  17328. // Key: [Output Only] A key that provides more detail on the warning
  17329. // being returned. For example, for warnings where there are no results
  17330. // in a list request for a particular zone, this key might be scope and
  17331. // the key value might be the zone name. Other examples might be a key
  17332. // indicating a deprecated resource and a suggested replacement, or a
  17333. // warning about invalid network settings (for example, if an instance
  17334. // attempts to perform IP forwarding but is not enabled for IP
  17335. // forwarding).
  17336. Key string `json:"key,omitempty"`
  17337. // Value: [Output Only] A warning data value corresponding to the key.
  17338. Value string `json:"value,omitempty"`
  17339. // ForceSendFields is a list of field names (e.g. "Key") to
  17340. // unconditionally include in API requests. By default, fields with
  17341. // empty values are omitted from API requests. However, any non-pointer,
  17342. // non-interface field appearing in ForceSendFields will be sent to the
  17343. // server regardless of whether the field is empty or not. This may be
  17344. // used to include empty fields in Patch requests.
  17345. ForceSendFields []string `json:"-"`
  17346. // NullFields is a list of field names (e.g. "Key") to include in API
  17347. // requests with the JSON null value. By default, fields with empty
  17348. // values are omitted from API requests. However, any field with an
  17349. // empty value appearing in NullFields will be sent to the server as
  17350. // null. It is an error if a field in this list has a non-empty value.
  17351. // This may be used to include null fields in Patch requests.
  17352. NullFields []string `json:"-"`
  17353. }
  17354. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  17355. type NoMethod SubnetworkListWarningData
  17356. raw := NoMethod(*s)
  17357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17358. }
  17359. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  17360. // subnetwork.
  17361. type SubnetworkSecondaryRange struct {
  17362. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  17363. // secondary range. Provide this property when you create the
  17364. // subnetwork. Ranges must be unique and non-overlapping with all
  17365. // primary and secondary IP ranges within a network. Only IPv4 is
  17366. // supported.
  17367. IpCidrRange string `json:"ipCidrRange,omitempty"`
  17368. // RangeName: The name associated with this subnetwork secondary range,
  17369. // used when adding an alias IP range to a VM instance. The name must be
  17370. // 1-63 characters long, and comply with RFC1035. The name must be
  17371. // unique within the subnetwork.
  17372. RangeName string `json:"rangeName,omitempty"`
  17373. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  17374. // unconditionally include in API requests. By default, fields with
  17375. // empty values are omitted from API requests. However, any non-pointer,
  17376. // non-interface field appearing in ForceSendFields will be sent to the
  17377. // server regardless of whether the field is empty or not. This may be
  17378. // used to include empty fields in Patch requests.
  17379. ForceSendFields []string `json:"-"`
  17380. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  17381. // in API requests with the JSON null value. By default, fields with
  17382. // empty values are omitted from API requests. However, any field with
  17383. // an empty value appearing in NullFields will be sent to the server as
  17384. // null. It is an error if a field in this list has a non-empty value.
  17385. // This may be used to include null fields in Patch requests.
  17386. NullFields []string `json:"-"`
  17387. }
  17388. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  17389. type NoMethod SubnetworkSecondaryRange
  17390. raw := NoMethod(*s)
  17391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17392. }
  17393. type SubnetworksExpandIpCidrRangeRequest struct {
  17394. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  17395. // that are legal on this Subnetwork. This range should be disjoint from
  17396. // other subnetworks within this network. This range can only be larger
  17397. // than (i.e. a superset of) the range previously defined before the
  17398. // update.
  17399. IpCidrRange string `json:"ipCidrRange,omitempty"`
  17400. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  17401. // unconditionally include in API requests. By default, fields with
  17402. // empty values are omitted from API requests. However, any non-pointer,
  17403. // non-interface field appearing in ForceSendFields will be sent to the
  17404. // server regardless of whether the field is empty or not. This may be
  17405. // used to include empty fields in Patch requests.
  17406. ForceSendFields []string `json:"-"`
  17407. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  17408. // in API requests with the JSON null value. By default, fields with
  17409. // empty values are omitted from API requests. However, any field with
  17410. // an empty value appearing in NullFields will be sent to the server as
  17411. // null. It is an error if a field in this list has a non-empty value.
  17412. // This may be used to include null fields in Patch requests.
  17413. NullFields []string `json:"-"`
  17414. }
  17415. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  17416. type NoMethod SubnetworksExpandIpCidrRangeRequest
  17417. raw := NoMethod(*s)
  17418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17419. }
  17420. type SubnetworksScopedList struct {
  17421. // Subnetworks: A list of subnetworks contained in this scope.
  17422. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  17423. // Warning: An informational warning that appears when the list of
  17424. // addresses is empty.
  17425. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  17426. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  17427. // unconditionally include in API requests. By default, fields with
  17428. // empty values are omitted from API requests. However, any non-pointer,
  17429. // non-interface field appearing in ForceSendFields will be sent to the
  17430. // server regardless of whether the field is empty or not. This may be
  17431. // used to include empty fields in Patch requests.
  17432. ForceSendFields []string `json:"-"`
  17433. // NullFields is a list of field names (e.g. "Subnetworks") to include
  17434. // in API requests with the JSON null value. By default, fields with
  17435. // empty values are omitted from API requests. However, any field with
  17436. // an empty value appearing in NullFields will be sent to the server as
  17437. // null. It is an error if a field in this list has a non-empty value.
  17438. // This may be used to include null fields in Patch requests.
  17439. NullFields []string `json:"-"`
  17440. }
  17441. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  17442. type NoMethod SubnetworksScopedList
  17443. raw := NoMethod(*s)
  17444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17445. }
  17446. // SubnetworksScopedListWarning: An informational warning that appears
  17447. // when the list of addresses is empty.
  17448. type SubnetworksScopedListWarning struct {
  17449. // Code: [Output Only] A warning code, if applicable. For example,
  17450. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17451. // the response.
  17452. //
  17453. // Possible values:
  17454. // "CLEANUP_FAILED"
  17455. // "DEPRECATED_RESOURCE_USED"
  17456. // "DEPRECATED_TYPE_USED"
  17457. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17458. // "EXPERIMENTAL_TYPE_USED"
  17459. // "EXTERNAL_API_WARNING"
  17460. // "FIELD_VALUE_OVERRIDEN"
  17461. // "INJECTED_KERNELS_DEPRECATED"
  17462. // "MISSING_TYPE_DEPENDENCY"
  17463. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17464. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17465. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17466. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17467. // "NEXT_HOP_NOT_RUNNING"
  17468. // "NOT_CRITICAL_ERROR"
  17469. // "NO_RESULTS_ON_PAGE"
  17470. // "REQUIRED_TOS_AGREEMENT"
  17471. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17472. // "RESOURCE_NOT_DELETED"
  17473. // "SCHEMA_VALIDATION_IGNORED"
  17474. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17475. // "UNDECLARED_PROPERTIES"
  17476. // "UNREACHABLE"
  17477. Code string `json:"code,omitempty"`
  17478. // Data: [Output Only] Metadata about this warning in key: value format.
  17479. // For example:
  17480. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17481. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  17482. // Message: [Output Only] A human-readable description of the warning
  17483. // code.
  17484. Message string `json:"message,omitempty"`
  17485. // ForceSendFields is a list of field names (e.g. "Code") to
  17486. // unconditionally include in API requests. By default, fields with
  17487. // empty values are omitted from API requests. However, any non-pointer,
  17488. // non-interface field appearing in ForceSendFields will be sent to the
  17489. // server regardless of whether the field is empty or not. This may be
  17490. // used to include empty fields in Patch requests.
  17491. ForceSendFields []string `json:"-"`
  17492. // NullFields is a list of field names (e.g. "Code") to include in API
  17493. // requests with the JSON null value. By default, fields with empty
  17494. // values are omitted from API requests. However, any field with an
  17495. // empty value appearing in NullFields will be sent to the server as
  17496. // null. It is an error if a field in this list has a non-empty value.
  17497. // This may be used to include null fields in Patch requests.
  17498. NullFields []string `json:"-"`
  17499. }
  17500. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  17501. type NoMethod SubnetworksScopedListWarning
  17502. raw := NoMethod(*s)
  17503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17504. }
  17505. type SubnetworksScopedListWarningData struct {
  17506. // Key: [Output Only] A key that provides more detail on the warning
  17507. // being returned. For example, for warnings where there are no results
  17508. // in a list request for a particular zone, this key might be scope and
  17509. // the key value might be the zone name. Other examples might be a key
  17510. // indicating a deprecated resource and a suggested replacement, or a
  17511. // warning about invalid network settings (for example, if an instance
  17512. // attempts to perform IP forwarding but is not enabled for IP
  17513. // forwarding).
  17514. Key string `json:"key,omitempty"`
  17515. // Value: [Output Only] A warning data value corresponding to the key.
  17516. Value string `json:"value,omitempty"`
  17517. // ForceSendFields is a list of field names (e.g. "Key") to
  17518. // unconditionally include in API requests. By default, fields with
  17519. // empty values are omitted from API requests. However, any non-pointer,
  17520. // non-interface field appearing in ForceSendFields will be sent to the
  17521. // server regardless of whether the field is empty or not. This may be
  17522. // used to include empty fields in Patch requests.
  17523. ForceSendFields []string `json:"-"`
  17524. // NullFields is a list of field names (e.g. "Key") to include in API
  17525. // requests with the JSON null value. By default, fields with empty
  17526. // values are omitted from API requests. However, any field with an
  17527. // empty value appearing in NullFields will be sent to the server as
  17528. // null. It is an error if a field in this list has a non-empty value.
  17529. // This may be used to include null fields in Patch requests.
  17530. NullFields []string `json:"-"`
  17531. }
  17532. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  17533. type NoMethod SubnetworksScopedListWarningData
  17534. raw := NoMethod(*s)
  17535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17536. }
  17537. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  17538. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  17539. // ForceSendFields is a list of field names (e.g.
  17540. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  17541. // By default, fields with empty values are omitted from API requests.
  17542. // However, any non-pointer, non-interface field appearing in
  17543. // ForceSendFields will be sent to the server regardless of whether the
  17544. // field is empty or not. This may be used to include empty fields in
  17545. // Patch requests.
  17546. ForceSendFields []string `json:"-"`
  17547. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  17548. // include in API requests with the JSON null value. By default, fields
  17549. // with empty values are omitted from API requests. However, any field
  17550. // with an empty value appearing in NullFields will be sent to the
  17551. // server as null. It is an error if a field in this list has a
  17552. // non-empty value. This may be used to include null fields in Patch
  17553. // requests.
  17554. NullFields []string `json:"-"`
  17555. }
  17556. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  17557. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  17558. raw := NoMethod(*s)
  17559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17560. }
  17561. type TCPHealthCheck struct {
  17562. // Port: The TCP port number for the health check request. The default
  17563. // value is 80. Valid values are 1 through 65535.
  17564. Port int64 `json:"port,omitempty"`
  17565. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  17566. // both port and port_name are defined, port takes precedence.
  17567. PortName string `json:"portName,omitempty"`
  17568. // ProxyHeader: Specifies the type of proxy header to append before
  17569. // sending data to the backend, either NONE or PROXY_V1. The default is
  17570. // NONE.
  17571. //
  17572. // Possible values:
  17573. // "NONE"
  17574. // "PROXY_V1"
  17575. ProxyHeader string `json:"proxyHeader,omitempty"`
  17576. // Request: The application data to send once the TCP connection has
  17577. // been established (default value is empty). If both request and
  17578. // response are empty, the connection establishment alone will indicate
  17579. // health. The request data can only be ASCII.
  17580. Request string `json:"request,omitempty"`
  17581. // Response: The bytes to match against the beginning of the response
  17582. // data. If left empty (the default value), any response will indicate
  17583. // health. The response data can only be ASCII.
  17584. Response string `json:"response,omitempty"`
  17585. // ForceSendFields is a list of field names (e.g. "Port") to
  17586. // unconditionally include in API requests. By default, fields with
  17587. // empty values are omitted from API requests. However, any non-pointer,
  17588. // non-interface field appearing in ForceSendFields will be sent to the
  17589. // server regardless of whether the field is empty or not. This may be
  17590. // used to include empty fields in Patch requests.
  17591. ForceSendFields []string `json:"-"`
  17592. // NullFields is a list of field names (e.g. "Port") to include in API
  17593. // requests with the JSON null value. By default, fields with empty
  17594. // values are omitted from API requests. However, any field with an
  17595. // empty value appearing in NullFields will be sent to the server as
  17596. // null. It is an error if a field in this list has a non-empty value.
  17597. // This may be used to include null fields in Patch requests.
  17598. NullFields []string `json:"-"`
  17599. }
  17600. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  17601. type NoMethod TCPHealthCheck
  17602. raw := NoMethod(*s)
  17603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17604. }
  17605. // Tags: A set of instance tags.
  17606. type Tags struct {
  17607. // Fingerprint: Specifies a fingerprint for this request, which is
  17608. // essentially a hash of the tags' contents and used for optimistic
  17609. // locking. The fingerprint is initially generated by Compute Engine and
  17610. // changes after every request to modify or update tags. You must always
  17611. // provide an up-to-date fingerprint hash in order to update or change
  17612. // tags.
  17613. //
  17614. // To see the latest fingerprint, make get() request to the instance.
  17615. Fingerprint string `json:"fingerprint,omitempty"`
  17616. // Items: An array of tags. Each tag must be 1-63 characters long, and
  17617. // comply with RFC1035.
  17618. Items []string `json:"items,omitempty"`
  17619. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  17620. // unconditionally include in API requests. By default, fields with
  17621. // empty values are omitted from API requests. However, any non-pointer,
  17622. // non-interface field appearing in ForceSendFields will be sent to the
  17623. // server regardless of whether the field is empty or not. This may be
  17624. // used to include empty fields in Patch requests.
  17625. ForceSendFields []string `json:"-"`
  17626. // NullFields is a list of field names (e.g. "Fingerprint") to include
  17627. // in API requests with the JSON null value. By default, fields with
  17628. // empty values are omitted from API requests. However, any field with
  17629. // an empty value appearing in NullFields will be sent to the server as
  17630. // null. It is an error if a field in this list has a non-empty value.
  17631. // This may be used to include null fields in Patch requests.
  17632. NullFields []string `json:"-"`
  17633. }
  17634. func (s *Tags) MarshalJSON() ([]byte, error) {
  17635. type NoMethod Tags
  17636. raw := NoMethod(*s)
  17637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17638. }
  17639. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  17640. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  17641. // resource_for v1.targetHttpProxies ==)
  17642. type TargetHttpProxy struct {
  17643. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17644. // format.
  17645. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17646. // Description: An optional description of this resource. Provide this
  17647. // property when you create the resource.
  17648. Description string `json:"description,omitempty"`
  17649. // Id: [Output Only] The unique identifier for the resource. This
  17650. // identifier is defined by the server.
  17651. Id uint64 `json:"id,omitempty,string"`
  17652. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  17653. // for target HTTP proxies.
  17654. Kind string `json:"kind,omitempty"`
  17655. // Name: Name of the resource. Provided by the client when the resource
  17656. // is created. The name must be 1-63 characters long, and comply with
  17657. // RFC1035. Specifically, the name must be 1-63 characters long and
  17658. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  17659. // the first character must be a lowercase letter, and all following
  17660. // characters must be a dash, lowercase letter, or digit, except the
  17661. // last character, which cannot be a dash.
  17662. Name string `json:"name,omitempty"`
  17663. // SelfLink: [Output Only] Server-defined URL for the resource.
  17664. SelfLink string `json:"selfLink,omitempty"`
  17665. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  17666. // to the BackendService.
  17667. UrlMap string `json:"urlMap,omitempty"`
  17668. // ServerResponse contains the HTTP response code and headers from the
  17669. // server.
  17670. googleapi.ServerResponse `json:"-"`
  17671. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17672. // to unconditionally include in API requests. By default, fields with
  17673. // empty values are omitted from API requests. However, any non-pointer,
  17674. // non-interface field appearing in ForceSendFields will be sent to the
  17675. // server regardless of whether the field is empty or not. This may be
  17676. // used to include empty fields in Patch requests.
  17677. ForceSendFields []string `json:"-"`
  17678. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17679. // include in API requests with the JSON null value. By default, fields
  17680. // with empty values are omitted from API requests. However, any field
  17681. // with an empty value appearing in NullFields will be sent to the
  17682. // server as null. It is an error if a field in this list has a
  17683. // non-empty value. This may be used to include null fields in Patch
  17684. // requests.
  17685. NullFields []string `json:"-"`
  17686. }
  17687. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  17688. type NoMethod TargetHttpProxy
  17689. raw := NoMethod(*s)
  17690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17691. }
  17692. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  17693. type TargetHttpProxyList struct {
  17694. // Id: [Output Only] Unique identifier for the resource; defined by the
  17695. // server.
  17696. Id string `json:"id,omitempty"`
  17697. // Items: A list of TargetHttpProxy resources.
  17698. Items []*TargetHttpProxy `json:"items,omitempty"`
  17699. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  17700. // of target HTTP proxies.
  17701. Kind string `json:"kind,omitempty"`
  17702. // NextPageToken: [Output Only] This token allows you to get the next
  17703. // page of results for list requests. If the number of results is larger
  17704. // than maxResults, use the nextPageToken as a value for the query
  17705. // parameter pageToken in the next list request. Subsequent list
  17706. // requests will have their own nextPageToken to continue paging through
  17707. // the results.
  17708. NextPageToken string `json:"nextPageToken,omitempty"`
  17709. // SelfLink: [Output Only] Server-defined URL for this resource.
  17710. SelfLink string `json:"selfLink,omitempty"`
  17711. // Warning: [Output Only] Informational warning message.
  17712. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  17713. // ServerResponse contains the HTTP response code and headers from the
  17714. // server.
  17715. googleapi.ServerResponse `json:"-"`
  17716. // ForceSendFields is a list of field names (e.g. "Id") to
  17717. // unconditionally include in API requests. By default, fields with
  17718. // empty values are omitted from API requests. However, any non-pointer,
  17719. // non-interface field appearing in ForceSendFields will be sent to the
  17720. // server regardless of whether the field is empty or not. This may be
  17721. // used to include empty fields in Patch requests.
  17722. ForceSendFields []string `json:"-"`
  17723. // NullFields is a list of field names (e.g. "Id") to include in API
  17724. // requests with the JSON null value. By default, fields with empty
  17725. // values are omitted from API requests. However, any field with an
  17726. // empty value appearing in NullFields will be sent to the server as
  17727. // null. It is an error if a field in this list has a non-empty value.
  17728. // This may be used to include null fields in Patch requests.
  17729. NullFields []string `json:"-"`
  17730. }
  17731. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  17732. type NoMethod TargetHttpProxyList
  17733. raw := NoMethod(*s)
  17734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17735. }
  17736. // TargetHttpProxyListWarning: [Output Only] Informational warning
  17737. // message.
  17738. type TargetHttpProxyListWarning struct {
  17739. // Code: [Output Only] A warning code, if applicable. For example,
  17740. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17741. // the response.
  17742. //
  17743. // Possible values:
  17744. // "CLEANUP_FAILED"
  17745. // "DEPRECATED_RESOURCE_USED"
  17746. // "DEPRECATED_TYPE_USED"
  17747. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17748. // "EXPERIMENTAL_TYPE_USED"
  17749. // "EXTERNAL_API_WARNING"
  17750. // "FIELD_VALUE_OVERRIDEN"
  17751. // "INJECTED_KERNELS_DEPRECATED"
  17752. // "MISSING_TYPE_DEPENDENCY"
  17753. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17754. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17755. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17756. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17757. // "NEXT_HOP_NOT_RUNNING"
  17758. // "NOT_CRITICAL_ERROR"
  17759. // "NO_RESULTS_ON_PAGE"
  17760. // "REQUIRED_TOS_AGREEMENT"
  17761. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17762. // "RESOURCE_NOT_DELETED"
  17763. // "SCHEMA_VALIDATION_IGNORED"
  17764. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17765. // "UNDECLARED_PROPERTIES"
  17766. // "UNREACHABLE"
  17767. Code string `json:"code,omitempty"`
  17768. // Data: [Output Only] Metadata about this warning in key: value format.
  17769. // For example:
  17770. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17771. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  17772. // Message: [Output Only] A human-readable description of the warning
  17773. // code.
  17774. Message string `json:"message,omitempty"`
  17775. // ForceSendFields is a list of field names (e.g. "Code") to
  17776. // unconditionally include in API requests. By default, fields with
  17777. // empty values are omitted from API requests. However, any non-pointer,
  17778. // non-interface field appearing in ForceSendFields will be sent to the
  17779. // server regardless of whether the field is empty or not. This may be
  17780. // used to include empty fields in Patch requests.
  17781. ForceSendFields []string `json:"-"`
  17782. // NullFields is a list of field names (e.g. "Code") to include in API
  17783. // requests with the JSON null value. By default, fields with empty
  17784. // values are omitted from API requests. However, any field with an
  17785. // empty value appearing in NullFields will be sent to the server as
  17786. // null. It is an error if a field in this list has a non-empty value.
  17787. // This may be used to include null fields in Patch requests.
  17788. NullFields []string `json:"-"`
  17789. }
  17790. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  17791. type NoMethod TargetHttpProxyListWarning
  17792. raw := NoMethod(*s)
  17793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17794. }
  17795. type TargetHttpProxyListWarningData struct {
  17796. // Key: [Output Only] A key that provides more detail on the warning
  17797. // being returned. For example, for warnings where there are no results
  17798. // in a list request for a particular zone, this key might be scope and
  17799. // the key value might be the zone name. Other examples might be a key
  17800. // indicating a deprecated resource and a suggested replacement, or a
  17801. // warning about invalid network settings (for example, if an instance
  17802. // attempts to perform IP forwarding but is not enabled for IP
  17803. // forwarding).
  17804. Key string `json:"key,omitempty"`
  17805. // Value: [Output Only] A warning data value corresponding to the key.
  17806. Value string `json:"value,omitempty"`
  17807. // ForceSendFields is a list of field names (e.g. "Key") to
  17808. // unconditionally include in API requests. By default, fields with
  17809. // empty values are omitted from API requests. However, any non-pointer,
  17810. // non-interface field appearing in ForceSendFields will be sent to the
  17811. // server regardless of whether the field is empty or not. This may be
  17812. // used to include empty fields in Patch requests.
  17813. ForceSendFields []string `json:"-"`
  17814. // NullFields is a list of field names (e.g. "Key") to include in API
  17815. // requests with the JSON null value. By default, fields with empty
  17816. // values are omitted from API requests. However, any field with an
  17817. // empty value appearing in NullFields will be sent to the server as
  17818. // null. It is an error if a field in this list has a non-empty value.
  17819. // This may be used to include null fields in Patch requests.
  17820. NullFields []string `json:"-"`
  17821. }
  17822. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  17823. type NoMethod TargetHttpProxyListWarningData
  17824. raw := NoMethod(*s)
  17825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17826. }
  17827. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  17828. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  17829. //
  17830. // Possible values:
  17831. // "DISABLE"
  17832. // "ENABLE"
  17833. // "NONE"
  17834. QuicOverride string `json:"quicOverride,omitempty"`
  17835. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  17836. // unconditionally include in API requests. By default, fields with
  17837. // empty values are omitted from API requests. However, any non-pointer,
  17838. // non-interface field appearing in ForceSendFields will be sent to the
  17839. // server regardless of whether the field is empty or not. This may be
  17840. // used to include empty fields in Patch requests.
  17841. ForceSendFields []string `json:"-"`
  17842. // NullFields is a list of field names (e.g. "QuicOverride") to include
  17843. // in API requests with the JSON null value. By default, fields with
  17844. // empty values are omitted from API requests. However, any field with
  17845. // an empty value appearing in NullFields will be sent to the server as
  17846. // null. It is an error if a field in this list has a non-empty value.
  17847. // This may be used to include null fields in Patch requests.
  17848. NullFields []string `json:"-"`
  17849. }
  17850. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  17851. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  17852. raw := NoMethod(*s)
  17853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17854. }
  17855. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  17856. // SslCertificates: New set of SslCertificate resources to associate
  17857. // with this TargetHttpsProxy resource. Currently exactly one
  17858. // SslCertificate resource must be specified.
  17859. SslCertificates []string `json:"sslCertificates,omitempty"`
  17860. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  17861. // unconditionally include in API requests. By default, fields with
  17862. // empty values are omitted from API requests. However, any non-pointer,
  17863. // non-interface field appearing in ForceSendFields will be sent to the
  17864. // server regardless of whether the field is empty or not. This may be
  17865. // used to include empty fields in Patch requests.
  17866. ForceSendFields []string `json:"-"`
  17867. // NullFields is a list of field names (e.g. "SslCertificates") to
  17868. // include in API requests with the JSON null value. By default, fields
  17869. // with empty values are omitted from API requests. However, any field
  17870. // with an empty value appearing in NullFields will be sent to the
  17871. // server as null. It is an error if a field in this list has a
  17872. // non-empty value. This may be used to include null fields in Patch
  17873. // requests.
  17874. NullFields []string `json:"-"`
  17875. }
  17876. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  17877. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  17878. raw := NoMethod(*s)
  17879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17880. }
  17881. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  17882. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  17883. // resource_for v1.targetHttpsProxies ==)
  17884. type TargetHttpsProxy struct {
  17885. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17886. // format.
  17887. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17888. // Description: An optional description of this resource. Provide this
  17889. // property when you create the resource.
  17890. Description string `json:"description,omitempty"`
  17891. // Id: [Output Only] The unique identifier for the resource. This
  17892. // identifier is defined by the server.
  17893. Id uint64 `json:"id,omitempty,string"`
  17894. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  17895. // for target HTTPS proxies.
  17896. Kind string `json:"kind,omitempty"`
  17897. // Name: Name of the resource. Provided by the client when the resource
  17898. // is created. The name must be 1-63 characters long, and comply with
  17899. // RFC1035. Specifically, the name must be 1-63 characters long and
  17900. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  17901. // the first character must be a lowercase letter, and all following
  17902. // characters must be a dash, lowercase letter, or digit, except the
  17903. // last character, which cannot be a dash.
  17904. Name string `json:"name,omitempty"`
  17905. // QuicOverride: Specifies the QUIC override policy for this
  17906. // TargetHttpsProxy resource. This determines whether the load balancer
  17907. // will attempt to negotiate QUIC with clients or not. Can specify one
  17908. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  17909. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  17910. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  17911. // overrides, which is equivalent to DISABLE. Not specifying this field
  17912. // is equivalent to specifying NONE.
  17913. //
  17914. // Possible values:
  17915. // "DISABLE"
  17916. // "ENABLE"
  17917. // "NONE"
  17918. QuicOverride string `json:"quicOverride,omitempty"`
  17919. // SelfLink: [Output Only] Server-defined URL for the resource.
  17920. SelfLink string `json:"selfLink,omitempty"`
  17921. // SslCertificates: URLs to SslCertificate resources that are used to
  17922. // authenticate connections between users and the load balancer.
  17923. // Currently, exactly one SSL certificate must be specified.
  17924. SslCertificates []string `json:"sslCertificates,omitempty"`
  17925. // SslPolicy: URL of SslPolicy resource that will be associated with the
  17926. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  17927. // will not have any SSL policy configured.
  17928. SslPolicy string `json:"sslPolicy,omitempty"`
  17929. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  17930. // that defines the mapping from URL to the BackendService. For example,
  17931. // the following are all valid URLs for specifying a URL map:
  17932. // -
  17933. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  17934. // - projects/project/global/urlMaps/url-map
  17935. // - global/urlMaps/url-map
  17936. UrlMap string `json:"urlMap,omitempty"`
  17937. // ServerResponse contains the HTTP response code and headers from the
  17938. // server.
  17939. googleapi.ServerResponse `json:"-"`
  17940. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17941. // to unconditionally include in API requests. By default, fields with
  17942. // empty values are omitted from API requests. However, any non-pointer,
  17943. // non-interface field appearing in ForceSendFields will be sent to the
  17944. // server regardless of whether the field is empty or not. This may be
  17945. // used to include empty fields in Patch requests.
  17946. ForceSendFields []string `json:"-"`
  17947. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17948. // include in API requests with the JSON null value. By default, fields
  17949. // with empty values are omitted from API requests. However, any field
  17950. // with an empty value appearing in NullFields will be sent to the
  17951. // server as null. It is an error if a field in this list has a
  17952. // non-empty value. This may be used to include null fields in Patch
  17953. // requests.
  17954. NullFields []string `json:"-"`
  17955. }
  17956. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  17957. type NoMethod TargetHttpsProxy
  17958. raw := NoMethod(*s)
  17959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17960. }
  17961. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  17962. type TargetHttpsProxyList struct {
  17963. // Id: [Output Only] Unique identifier for the resource; defined by the
  17964. // server.
  17965. Id string `json:"id,omitempty"`
  17966. // Items: A list of TargetHttpsProxy resources.
  17967. Items []*TargetHttpsProxy `json:"items,omitempty"`
  17968. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  17969. // of target HTTPS proxies.
  17970. Kind string `json:"kind,omitempty"`
  17971. // NextPageToken: [Output Only] This token allows you to get the next
  17972. // page of results for list requests. If the number of results is larger
  17973. // than maxResults, use the nextPageToken as a value for the query
  17974. // parameter pageToken in the next list request. Subsequent list
  17975. // requests will have their own nextPageToken to continue paging through
  17976. // the results.
  17977. NextPageToken string `json:"nextPageToken,omitempty"`
  17978. // SelfLink: [Output Only] Server-defined URL for this resource.
  17979. SelfLink string `json:"selfLink,omitempty"`
  17980. // Warning: [Output Only] Informational warning message.
  17981. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  17982. // ServerResponse contains the HTTP response code and headers from the
  17983. // server.
  17984. googleapi.ServerResponse `json:"-"`
  17985. // ForceSendFields is a list of field names (e.g. "Id") to
  17986. // unconditionally include in API requests. By default, fields with
  17987. // empty values are omitted from API requests. However, any non-pointer,
  17988. // non-interface field appearing in ForceSendFields will be sent to the
  17989. // server regardless of whether the field is empty or not. This may be
  17990. // used to include empty fields in Patch requests.
  17991. ForceSendFields []string `json:"-"`
  17992. // NullFields is a list of field names (e.g. "Id") to include in API
  17993. // requests with the JSON null value. By default, fields with empty
  17994. // values are omitted from API requests. However, any field with an
  17995. // empty value appearing in NullFields will be sent to the server as
  17996. // null. It is an error if a field in this list has a non-empty value.
  17997. // This may be used to include null fields in Patch requests.
  17998. NullFields []string `json:"-"`
  17999. }
  18000. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  18001. type NoMethod TargetHttpsProxyList
  18002. raw := NoMethod(*s)
  18003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18004. }
  18005. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  18006. // message.
  18007. type TargetHttpsProxyListWarning struct {
  18008. // Code: [Output Only] A warning code, if applicable. For example,
  18009. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18010. // the response.
  18011. //
  18012. // Possible values:
  18013. // "CLEANUP_FAILED"
  18014. // "DEPRECATED_RESOURCE_USED"
  18015. // "DEPRECATED_TYPE_USED"
  18016. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18017. // "EXPERIMENTAL_TYPE_USED"
  18018. // "EXTERNAL_API_WARNING"
  18019. // "FIELD_VALUE_OVERRIDEN"
  18020. // "INJECTED_KERNELS_DEPRECATED"
  18021. // "MISSING_TYPE_DEPENDENCY"
  18022. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18023. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18024. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18025. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18026. // "NEXT_HOP_NOT_RUNNING"
  18027. // "NOT_CRITICAL_ERROR"
  18028. // "NO_RESULTS_ON_PAGE"
  18029. // "REQUIRED_TOS_AGREEMENT"
  18030. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18031. // "RESOURCE_NOT_DELETED"
  18032. // "SCHEMA_VALIDATION_IGNORED"
  18033. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18034. // "UNDECLARED_PROPERTIES"
  18035. // "UNREACHABLE"
  18036. Code string `json:"code,omitempty"`
  18037. // Data: [Output Only] Metadata about this warning in key: value format.
  18038. // For example:
  18039. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18040. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  18041. // Message: [Output Only] A human-readable description of the warning
  18042. // code.
  18043. Message string `json:"message,omitempty"`
  18044. // ForceSendFields is a list of field names (e.g. "Code") to
  18045. // unconditionally include in API requests. By default, fields with
  18046. // empty values are omitted from API requests. However, any non-pointer,
  18047. // non-interface field appearing in ForceSendFields will be sent to the
  18048. // server regardless of whether the field is empty or not. This may be
  18049. // used to include empty fields in Patch requests.
  18050. ForceSendFields []string `json:"-"`
  18051. // NullFields is a list of field names (e.g. "Code") to include in API
  18052. // requests with the JSON null value. By default, fields with empty
  18053. // values are omitted from API requests. However, any field with an
  18054. // empty value appearing in NullFields will be sent to the server as
  18055. // null. It is an error if a field in this list has a non-empty value.
  18056. // This may be used to include null fields in Patch requests.
  18057. NullFields []string `json:"-"`
  18058. }
  18059. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  18060. type NoMethod TargetHttpsProxyListWarning
  18061. raw := NoMethod(*s)
  18062. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18063. }
  18064. type TargetHttpsProxyListWarningData struct {
  18065. // Key: [Output Only] A key that provides more detail on the warning
  18066. // being returned. For example, for warnings where there are no results
  18067. // in a list request for a particular zone, this key might be scope and
  18068. // the key value might be the zone name. Other examples might be a key
  18069. // indicating a deprecated resource and a suggested replacement, or a
  18070. // warning about invalid network settings (for example, if an instance
  18071. // attempts to perform IP forwarding but is not enabled for IP
  18072. // forwarding).
  18073. Key string `json:"key,omitempty"`
  18074. // Value: [Output Only] A warning data value corresponding to the key.
  18075. Value string `json:"value,omitempty"`
  18076. // ForceSendFields is a list of field names (e.g. "Key") to
  18077. // unconditionally include in API requests. By default, fields with
  18078. // empty values are omitted from API requests. However, any non-pointer,
  18079. // non-interface field appearing in ForceSendFields will be sent to the
  18080. // server regardless of whether the field is empty or not. This may be
  18081. // used to include empty fields in Patch requests.
  18082. ForceSendFields []string `json:"-"`
  18083. // NullFields is a list of field names (e.g. "Key") to include in API
  18084. // requests with the JSON null value. By default, fields with empty
  18085. // values are omitted from API requests. However, any field with an
  18086. // empty value appearing in NullFields will be sent to the server as
  18087. // null. It is an error if a field in this list has a non-empty value.
  18088. // This may be used to include null fields in Patch requests.
  18089. NullFields []string `json:"-"`
  18090. }
  18091. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  18092. type NoMethod TargetHttpsProxyListWarningData
  18093. raw := NoMethod(*s)
  18094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18095. }
  18096. // TargetInstance: A TargetInstance resource. This resource defines an
  18097. // endpoint instance that terminates traffic of certain protocols. (==
  18098. // resource_for beta.targetInstances ==) (== resource_for
  18099. // v1.targetInstances ==)
  18100. type TargetInstance struct {
  18101. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18102. // format.
  18103. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18104. // Description: An optional description of this resource. Provide this
  18105. // property when you create the resource.
  18106. Description string `json:"description,omitempty"`
  18107. // Id: [Output Only] The unique identifier for the resource. This
  18108. // identifier is defined by the server.
  18109. Id uint64 `json:"id,omitempty,string"`
  18110. // Instance: A URL to the virtual machine instance that handles traffic
  18111. // for this target instance. When creating a target instance, you can
  18112. // provide the fully-qualified URL or a valid partial URL to the desired
  18113. // virtual machine. For example, the following are all valid URLs:
  18114. // -
  18115. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  18116. // - projects/project/zones/zone/instances/instance
  18117. // - zones/zone/instances/instance
  18118. Instance string `json:"instance,omitempty"`
  18119. // Kind: [Output Only] The type of the resource. Always
  18120. // compute#targetInstance for target instances.
  18121. Kind string `json:"kind,omitempty"`
  18122. // Name: Name of the resource. Provided by the client when the resource
  18123. // is created. The name must be 1-63 characters long, and comply with
  18124. // RFC1035. Specifically, the name must be 1-63 characters long and
  18125. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  18126. // the first character must be a lowercase letter, and all following
  18127. // characters must be a dash, lowercase letter, or digit, except the
  18128. // last character, which cannot be a dash.
  18129. Name string `json:"name,omitempty"`
  18130. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  18131. // Currently only NO_NAT (default value) is supported.
  18132. //
  18133. // Possible values:
  18134. // "NO_NAT"
  18135. NatPolicy string `json:"natPolicy,omitempty"`
  18136. // SelfLink: [Output Only] Server-defined URL for the resource.
  18137. SelfLink string `json:"selfLink,omitempty"`
  18138. // Zone: [Output Only] URL of the zone where the target instance
  18139. // resides. You must specify this field as part of the HTTP request URL.
  18140. // It is not settable as a field in the request body.
  18141. Zone string `json:"zone,omitempty"`
  18142. // ServerResponse contains the HTTP response code and headers from the
  18143. // server.
  18144. googleapi.ServerResponse `json:"-"`
  18145. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  18146. // to unconditionally include in API requests. By default, fields with
  18147. // empty values are omitted from API requests. However, any non-pointer,
  18148. // non-interface field appearing in ForceSendFields will be sent to the
  18149. // server regardless of whether the field is empty or not. This may be
  18150. // used to include empty fields in Patch requests.
  18151. ForceSendFields []string `json:"-"`
  18152. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  18153. // include in API requests with the JSON null value. By default, fields
  18154. // with empty values are omitted from API requests. However, any field
  18155. // with an empty value appearing in NullFields will be sent to the
  18156. // server as null. It is an error if a field in this list has a
  18157. // non-empty value. This may be used to include null fields in Patch
  18158. // requests.
  18159. NullFields []string `json:"-"`
  18160. }
  18161. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  18162. type NoMethod TargetInstance
  18163. raw := NoMethod(*s)
  18164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18165. }
  18166. type TargetInstanceAggregatedList struct {
  18167. // Id: [Output Only] Unique identifier for the resource; defined by the
  18168. // server.
  18169. Id string `json:"id,omitempty"`
  18170. // Items: A list of TargetInstance resources.
  18171. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  18172. // Kind: Type of resource.
  18173. Kind string `json:"kind,omitempty"`
  18174. // NextPageToken: [Output Only] This token allows you to get the next
  18175. // page of results for list requests. If the number of results is larger
  18176. // than maxResults, use the nextPageToken as a value for the query
  18177. // parameter pageToken in the next list request. Subsequent list
  18178. // requests will have their own nextPageToken to continue paging through
  18179. // the results.
  18180. NextPageToken string `json:"nextPageToken,omitempty"`
  18181. // SelfLink: [Output Only] Server-defined URL for this resource.
  18182. SelfLink string `json:"selfLink,omitempty"`
  18183. // Warning: [Output Only] Informational warning message.
  18184. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  18185. // ServerResponse contains the HTTP response code and headers from the
  18186. // server.
  18187. googleapi.ServerResponse `json:"-"`
  18188. // ForceSendFields is a list of field names (e.g. "Id") to
  18189. // unconditionally include in API requests. By default, fields with
  18190. // empty values are omitted from API requests. However, any non-pointer,
  18191. // non-interface field appearing in ForceSendFields will be sent to the
  18192. // server regardless of whether the field is empty or not. This may be
  18193. // used to include empty fields in Patch requests.
  18194. ForceSendFields []string `json:"-"`
  18195. // NullFields is a list of field names (e.g. "Id") to include in API
  18196. // requests with the JSON null value. By default, fields with empty
  18197. // values are omitted from API requests. However, any field with an
  18198. // empty value appearing in NullFields will be sent to the server as
  18199. // null. It is an error if a field in this list has a non-empty value.
  18200. // This may be used to include null fields in Patch requests.
  18201. NullFields []string `json:"-"`
  18202. }
  18203. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  18204. type NoMethod TargetInstanceAggregatedList
  18205. raw := NoMethod(*s)
  18206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18207. }
  18208. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  18209. // warning message.
  18210. type TargetInstanceAggregatedListWarning struct {
  18211. // Code: [Output Only] A warning code, if applicable. For example,
  18212. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18213. // the response.
  18214. //
  18215. // Possible values:
  18216. // "CLEANUP_FAILED"
  18217. // "DEPRECATED_RESOURCE_USED"
  18218. // "DEPRECATED_TYPE_USED"
  18219. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18220. // "EXPERIMENTAL_TYPE_USED"
  18221. // "EXTERNAL_API_WARNING"
  18222. // "FIELD_VALUE_OVERRIDEN"
  18223. // "INJECTED_KERNELS_DEPRECATED"
  18224. // "MISSING_TYPE_DEPENDENCY"
  18225. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18226. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18227. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18228. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18229. // "NEXT_HOP_NOT_RUNNING"
  18230. // "NOT_CRITICAL_ERROR"
  18231. // "NO_RESULTS_ON_PAGE"
  18232. // "REQUIRED_TOS_AGREEMENT"
  18233. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18234. // "RESOURCE_NOT_DELETED"
  18235. // "SCHEMA_VALIDATION_IGNORED"
  18236. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18237. // "UNDECLARED_PROPERTIES"
  18238. // "UNREACHABLE"
  18239. Code string `json:"code,omitempty"`
  18240. // Data: [Output Only] Metadata about this warning in key: value format.
  18241. // For example:
  18242. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18243. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  18244. // Message: [Output Only] A human-readable description of the warning
  18245. // code.
  18246. Message string `json:"message,omitempty"`
  18247. // ForceSendFields is a list of field names (e.g. "Code") to
  18248. // unconditionally include in API requests. By default, fields with
  18249. // empty values are omitted from API requests. However, any non-pointer,
  18250. // non-interface field appearing in ForceSendFields will be sent to the
  18251. // server regardless of whether the field is empty or not. This may be
  18252. // used to include empty fields in Patch requests.
  18253. ForceSendFields []string `json:"-"`
  18254. // NullFields is a list of field names (e.g. "Code") to include in API
  18255. // requests with the JSON null value. By default, fields with empty
  18256. // values are omitted from API requests. However, any field with an
  18257. // empty value appearing in NullFields will be sent to the server as
  18258. // null. It is an error if a field in this list has a non-empty value.
  18259. // This may be used to include null fields in Patch requests.
  18260. NullFields []string `json:"-"`
  18261. }
  18262. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18263. type NoMethod TargetInstanceAggregatedListWarning
  18264. raw := NoMethod(*s)
  18265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18266. }
  18267. type TargetInstanceAggregatedListWarningData struct {
  18268. // Key: [Output Only] A key that provides more detail on the warning
  18269. // being returned. For example, for warnings where there are no results
  18270. // in a list request for a particular zone, this key might be scope and
  18271. // the key value might be the zone name. Other examples might be a key
  18272. // indicating a deprecated resource and a suggested replacement, or a
  18273. // warning about invalid network settings (for example, if an instance
  18274. // attempts to perform IP forwarding but is not enabled for IP
  18275. // forwarding).
  18276. Key string `json:"key,omitempty"`
  18277. // Value: [Output Only] A warning data value corresponding to the key.
  18278. Value string `json:"value,omitempty"`
  18279. // ForceSendFields is a list of field names (e.g. "Key") to
  18280. // unconditionally include in API requests. By default, fields with
  18281. // empty values are omitted from API requests. However, any non-pointer,
  18282. // non-interface field appearing in ForceSendFields will be sent to the
  18283. // server regardless of whether the field is empty or not. This may be
  18284. // used to include empty fields in Patch requests.
  18285. ForceSendFields []string `json:"-"`
  18286. // NullFields is a list of field names (e.g. "Key") to include in API
  18287. // requests with the JSON null value. By default, fields with empty
  18288. // values are omitted from API requests. However, any field with an
  18289. // empty value appearing in NullFields will be sent to the server as
  18290. // null. It is an error if a field in this list has a non-empty value.
  18291. // This may be used to include null fields in Patch requests.
  18292. NullFields []string `json:"-"`
  18293. }
  18294. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18295. type NoMethod TargetInstanceAggregatedListWarningData
  18296. raw := NoMethod(*s)
  18297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18298. }
  18299. // TargetInstanceList: Contains a list of TargetInstance resources.
  18300. type TargetInstanceList struct {
  18301. // Id: [Output Only] Unique identifier for the resource; defined by the
  18302. // server.
  18303. Id string `json:"id,omitempty"`
  18304. // Items: A list of TargetInstance resources.
  18305. Items []*TargetInstance `json:"items,omitempty"`
  18306. // Kind: Type of resource.
  18307. Kind string `json:"kind,omitempty"`
  18308. // NextPageToken: [Output Only] This token allows you to get the next
  18309. // page of results for list requests. If the number of results is larger
  18310. // than maxResults, use the nextPageToken as a value for the query
  18311. // parameter pageToken in the next list request. Subsequent list
  18312. // requests will have their own nextPageToken to continue paging through
  18313. // the results.
  18314. NextPageToken string `json:"nextPageToken,omitempty"`
  18315. // SelfLink: [Output Only] Server-defined URL for this resource.
  18316. SelfLink string `json:"selfLink,omitempty"`
  18317. // Warning: [Output Only] Informational warning message.
  18318. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  18319. // ServerResponse contains the HTTP response code and headers from the
  18320. // server.
  18321. googleapi.ServerResponse `json:"-"`
  18322. // ForceSendFields is a list of field names (e.g. "Id") to
  18323. // unconditionally include in API requests. By default, fields with
  18324. // empty values are omitted from API requests. However, any non-pointer,
  18325. // non-interface field appearing in ForceSendFields will be sent to the
  18326. // server regardless of whether the field is empty or not. This may be
  18327. // used to include empty fields in Patch requests.
  18328. ForceSendFields []string `json:"-"`
  18329. // NullFields is a list of field names (e.g. "Id") to include in API
  18330. // requests with the JSON null value. By default, fields with empty
  18331. // values are omitted from API requests. However, any field with an
  18332. // empty value appearing in NullFields will be sent to the server as
  18333. // null. It is an error if a field in this list has a non-empty value.
  18334. // This may be used to include null fields in Patch requests.
  18335. NullFields []string `json:"-"`
  18336. }
  18337. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  18338. type NoMethod TargetInstanceList
  18339. raw := NoMethod(*s)
  18340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18341. }
  18342. // TargetInstanceListWarning: [Output Only] Informational warning
  18343. // message.
  18344. type TargetInstanceListWarning struct {
  18345. // Code: [Output Only] A warning code, if applicable. For example,
  18346. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18347. // the response.
  18348. //
  18349. // Possible values:
  18350. // "CLEANUP_FAILED"
  18351. // "DEPRECATED_RESOURCE_USED"
  18352. // "DEPRECATED_TYPE_USED"
  18353. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18354. // "EXPERIMENTAL_TYPE_USED"
  18355. // "EXTERNAL_API_WARNING"
  18356. // "FIELD_VALUE_OVERRIDEN"
  18357. // "INJECTED_KERNELS_DEPRECATED"
  18358. // "MISSING_TYPE_DEPENDENCY"
  18359. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18360. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18361. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18362. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18363. // "NEXT_HOP_NOT_RUNNING"
  18364. // "NOT_CRITICAL_ERROR"
  18365. // "NO_RESULTS_ON_PAGE"
  18366. // "REQUIRED_TOS_AGREEMENT"
  18367. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18368. // "RESOURCE_NOT_DELETED"
  18369. // "SCHEMA_VALIDATION_IGNORED"
  18370. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18371. // "UNDECLARED_PROPERTIES"
  18372. // "UNREACHABLE"
  18373. Code string `json:"code,omitempty"`
  18374. // Data: [Output Only] Metadata about this warning in key: value format.
  18375. // For example:
  18376. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18377. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  18378. // Message: [Output Only] A human-readable description of the warning
  18379. // code.
  18380. Message string `json:"message,omitempty"`
  18381. // ForceSendFields is a list of field names (e.g. "Code") to
  18382. // unconditionally include in API requests. By default, fields with
  18383. // empty values are omitted from API requests. However, any non-pointer,
  18384. // non-interface field appearing in ForceSendFields will be sent to the
  18385. // server regardless of whether the field is empty or not. This may be
  18386. // used to include empty fields in Patch requests.
  18387. ForceSendFields []string `json:"-"`
  18388. // NullFields is a list of field names (e.g. "Code") to include in API
  18389. // requests with the JSON null value. By default, fields with empty
  18390. // values are omitted from API requests. However, any field with an
  18391. // empty value appearing in NullFields will be sent to the server as
  18392. // null. It is an error if a field in this list has a non-empty value.
  18393. // This may be used to include null fields in Patch requests.
  18394. NullFields []string `json:"-"`
  18395. }
  18396. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  18397. type NoMethod TargetInstanceListWarning
  18398. raw := NoMethod(*s)
  18399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18400. }
  18401. type TargetInstanceListWarningData struct {
  18402. // Key: [Output Only] A key that provides more detail on the warning
  18403. // being returned. For example, for warnings where there are no results
  18404. // in a list request for a particular zone, this key might be scope and
  18405. // the key value might be the zone name. Other examples might be a key
  18406. // indicating a deprecated resource and a suggested replacement, or a
  18407. // warning about invalid network settings (for example, if an instance
  18408. // attempts to perform IP forwarding but is not enabled for IP
  18409. // forwarding).
  18410. Key string `json:"key,omitempty"`
  18411. // Value: [Output Only] A warning data value corresponding to the key.
  18412. Value string `json:"value,omitempty"`
  18413. // ForceSendFields is a list of field names (e.g. "Key") to
  18414. // unconditionally include in API requests. By default, fields with
  18415. // empty values are omitted from API requests. However, any non-pointer,
  18416. // non-interface field appearing in ForceSendFields will be sent to the
  18417. // server regardless of whether the field is empty or not. This may be
  18418. // used to include empty fields in Patch requests.
  18419. ForceSendFields []string `json:"-"`
  18420. // NullFields is a list of field names (e.g. "Key") to include in API
  18421. // requests with the JSON null value. By default, fields with empty
  18422. // values are omitted from API requests. However, any field with an
  18423. // empty value appearing in NullFields will be sent to the server as
  18424. // null. It is an error if a field in this list has a non-empty value.
  18425. // This may be used to include null fields in Patch requests.
  18426. NullFields []string `json:"-"`
  18427. }
  18428. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  18429. type NoMethod TargetInstanceListWarningData
  18430. raw := NoMethod(*s)
  18431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18432. }
  18433. type TargetInstancesScopedList struct {
  18434. // TargetInstances: A list of target instances contained in this scope.
  18435. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  18436. // Warning: Informational warning which replaces the list of addresses
  18437. // when the list is empty.
  18438. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  18439. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  18440. // unconditionally include in API requests. By default, fields with
  18441. // empty values are omitted from API requests. However, any non-pointer,
  18442. // non-interface field appearing in ForceSendFields will be sent to the
  18443. // server regardless of whether the field is empty or not. This may be
  18444. // used to include empty fields in Patch requests.
  18445. ForceSendFields []string `json:"-"`
  18446. // NullFields is a list of field names (e.g. "TargetInstances") to
  18447. // include in API requests with the JSON null value. By default, fields
  18448. // with empty values are omitted from API requests. However, any field
  18449. // with an empty value appearing in NullFields will be sent to the
  18450. // server as null. It is an error if a field in this list has a
  18451. // non-empty value. This may be used to include null fields in Patch
  18452. // requests.
  18453. NullFields []string `json:"-"`
  18454. }
  18455. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  18456. type NoMethod TargetInstancesScopedList
  18457. raw := NoMethod(*s)
  18458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18459. }
  18460. // TargetInstancesScopedListWarning: Informational warning which
  18461. // replaces the list of addresses when the list is empty.
  18462. type TargetInstancesScopedListWarning struct {
  18463. // Code: [Output Only] A warning code, if applicable. For example,
  18464. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18465. // the response.
  18466. //
  18467. // Possible values:
  18468. // "CLEANUP_FAILED"
  18469. // "DEPRECATED_RESOURCE_USED"
  18470. // "DEPRECATED_TYPE_USED"
  18471. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18472. // "EXPERIMENTAL_TYPE_USED"
  18473. // "EXTERNAL_API_WARNING"
  18474. // "FIELD_VALUE_OVERRIDEN"
  18475. // "INJECTED_KERNELS_DEPRECATED"
  18476. // "MISSING_TYPE_DEPENDENCY"
  18477. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18478. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18479. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18480. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18481. // "NEXT_HOP_NOT_RUNNING"
  18482. // "NOT_CRITICAL_ERROR"
  18483. // "NO_RESULTS_ON_PAGE"
  18484. // "REQUIRED_TOS_AGREEMENT"
  18485. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18486. // "RESOURCE_NOT_DELETED"
  18487. // "SCHEMA_VALIDATION_IGNORED"
  18488. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18489. // "UNDECLARED_PROPERTIES"
  18490. // "UNREACHABLE"
  18491. Code string `json:"code,omitempty"`
  18492. // Data: [Output Only] Metadata about this warning in key: value format.
  18493. // For example:
  18494. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18495. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  18496. // Message: [Output Only] A human-readable description of the warning
  18497. // code.
  18498. Message string `json:"message,omitempty"`
  18499. // ForceSendFields is a list of field names (e.g. "Code") to
  18500. // unconditionally include in API requests. By default, fields with
  18501. // empty values are omitted from API requests. However, any non-pointer,
  18502. // non-interface field appearing in ForceSendFields will be sent to the
  18503. // server regardless of whether the field is empty or not. This may be
  18504. // used to include empty fields in Patch requests.
  18505. ForceSendFields []string `json:"-"`
  18506. // NullFields is a list of field names (e.g. "Code") to include in API
  18507. // requests with the JSON null value. By default, fields with empty
  18508. // values are omitted from API requests. However, any field with an
  18509. // empty value appearing in NullFields will be sent to the server as
  18510. // null. It is an error if a field in this list has a non-empty value.
  18511. // This may be used to include null fields in Patch requests.
  18512. NullFields []string `json:"-"`
  18513. }
  18514. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  18515. type NoMethod TargetInstancesScopedListWarning
  18516. raw := NoMethod(*s)
  18517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18518. }
  18519. type TargetInstancesScopedListWarningData struct {
  18520. // Key: [Output Only] A key that provides more detail on the warning
  18521. // being returned. For example, for warnings where there are no results
  18522. // in a list request for a particular zone, this key might be scope and
  18523. // the key value might be the zone name. Other examples might be a key
  18524. // indicating a deprecated resource and a suggested replacement, or a
  18525. // warning about invalid network settings (for example, if an instance
  18526. // attempts to perform IP forwarding but is not enabled for IP
  18527. // forwarding).
  18528. Key string `json:"key,omitempty"`
  18529. // Value: [Output Only] A warning data value corresponding to the key.
  18530. Value string `json:"value,omitempty"`
  18531. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  18539. // requests with the JSON null value. By default, fields with empty
  18540. // values are omitted from API requests. However, any field with an
  18541. // 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 *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  18547. type NoMethod TargetInstancesScopedListWarningData
  18548. raw := NoMethod(*s)
  18549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18550. }
  18551. // TargetPool: A TargetPool resource. This resource defines a pool of
  18552. // instances, an associated HttpHealthCheck resource, and the fallback
  18553. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  18554. // v1.targetPools ==)
  18555. type TargetPool struct {
  18556. // BackupPool: This field is applicable only when the containing target
  18557. // pool is serving a forwarding rule as the primary pool, and its
  18558. // failoverRatio field is properly set to a value between [0,
  18559. // 1].
  18560. //
  18561. // backupPool and failoverRatio together define the fallback behavior of
  18562. // the primary target pool: if the ratio of the healthy instances in the
  18563. // primary pool is at or below failoverRatio, traffic arriving at the
  18564. // load-balanced IP will be directed to the backup pool.
  18565. //
  18566. // In case where failoverRatio and backupPool are not set, or all the
  18567. // instances in the backup pool are unhealthy, the traffic will be
  18568. // directed back to the primary pool in the "force" mode, where traffic
  18569. // will be spread to the healthy instances with the best effort, or to
  18570. // all instances when no instance is healthy.
  18571. BackupPool string `json:"backupPool,omitempty"`
  18572. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18573. // format.
  18574. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18575. // Description: An optional description of this resource. Provide this
  18576. // property when you create the resource.
  18577. Description string `json:"description,omitempty"`
  18578. // FailoverRatio: This field is applicable only when the containing
  18579. // target pool is serving a forwarding rule as the primary pool (i.e.,
  18580. // not as a backup pool to some other target pool). The value of the
  18581. // field must be in [0, 1].
  18582. //
  18583. // If set, backupPool must also be set. They together define the
  18584. // fallback behavior of the primary target pool: if the ratio of the
  18585. // healthy instances in the primary pool is at or below this number,
  18586. // traffic arriving at the load-balanced IP will be directed to the
  18587. // backup pool.
  18588. //
  18589. // In case where failoverRatio is not set or all the instances in the
  18590. // backup pool are unhealthy, the traffic will be directed back to the
  18591. // primary pool in the "force" mode, where traffic will be spread to the
  18592. // healthy instances with the best effort, or to all instances when no
  18593. // instance is healthy.
  18594. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  18595. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  18596. // instance in this pool is considered healthy if and only if the health
  18597. // checks pass. An empty list means all member instances will be
  18598. // considered healthy at all times. Only HttpHealthChecks are supported.
  18599. // Only one health check may be specified.
  18600. HealthChecks []string `json:"healthChecks,omitempty"`
  18601. // Id: [Output Only] The unique identifier for the resource. This
  18602. // identifier is defined by the server.
  18603. Id uint64 `json:"id,omitempty,string"`
  18604. // Instances: A list of resource URLs to the virtual machine instances
  18605. // serving this pool. They must live in zones contained in the same
  18606. // region as this pool.
  18607. Instances []string `json:"instances,omitempty"`
  18608. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  18609. // for target pools.
  18610. Kind string `json:"kind,omitempty"`
  18611. // Name: Name of the resource. Provided by the client when the resource
  18612. // is created. The name must be 1-63 characters long, and comply with
  18613. // RFC1035. Specifically, the name must be 1-63 characters long and
  18614. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  18615. // the first character must be a lowercase letter, and all following
  18616. // characters must be a dash, lowercase letter, or digit, except the
  18617. // last character, which cannot be a dash.
  18618. Name string `json:"name,omitempty"`
  18619. // Region: [Output Only] URL of the region where the target pool
  18620. // resides.
  18621. Region string `json:"region,omitempty"`
  18622. // SelfLink: [Output Only] Server-defined URL for the resource.
  18623. SelfLink string `json:"selfLink,omitempty"`
  18624. // SessionAffinity: Sesssion affinity option, must be one of the
  18625. // following values:
  18626. // NONE: Connections from the same client IP may go to any instance in
  18627. // the pool.
  18628. // CLIENT_IP: Connections from the same client IP will go to the same
  18629. // instance in the pool while that instance remains
  18630. // healthy.
  18631. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  18632. // protocol will go to the same instance in the pool while that instance
  18633. // remains healthy.
  18634. //
  18635. // Possible values:
  18636. // "CLIENT_IP"
  18637. // "CLIENT_IP_PORT_PROTO"
  18638. // "CLIENT_IP_PROTO"
  18639. // "GENERATED_COOKIE"
  18640. // "NONE"
  18641. SessionAffinity string `json:"sessionAffinity,omitempty"`
  18642. // ServerResponse contains the HTTP response code and headers from the
  18643. // server.
  18644. googleapi.ServerResponse `json:"-"`
  18645. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  18646. // unconditionally include in API requests. By default, fields with
  18647. // empty values are omitted from API requests. However, any non-pointer,
  18648. // non-interface field appearing in ForceSendFields will be sent to the
  18649. // server regardless of whether the field is empty or not. This may be
  18650. // used to include empty fields in Patch requests.
  18651. ForceSendFields []string `json:"-"`
  18652. // NullFields is a list of field names (e.g. "BackupPool") to include in
  18653. // API requests with the JSON null value. By default, fields with empty
  18654. // values are omitted from API requests. However, any field with an
  18655. // empty value appearing in NullFields will be sent to the server as
  18656. // null. It is an error if a field in this list has a non-empty value.
  18657. // This may be used to include null fields in Patch requests.
  18658. NullFields []string `json:"-"`
  18659. }
  18660. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  18661. type NoMethod TargetPool
  18662. raw := NoMethod(*s)
  18663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18664. }
  18665. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  18666. type NoMethod TargetPool
  18667. var s1 struct {
  18668. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  18669. *NoMethod
  18670. }
  18671. s1.NoMethod = (*NoMethod)(s)
  18672. if err := json.Unmarshal(data, &s1); err != nil {
  18673. return err
  18674. }
  18675. s.FailoverRatio = float64(s1.FailoverRatio)
  18676. return nil
  18677. }
  18678. type TargetPoolAggregatedList struct {
  18679. // Id: [Output Only] Unique identifier for the resource; defined by the
  18680. // server.
  18681. Id string `json:"id,omitempty"`
  18682. // Items: A list of TargetPool resources.
  18683. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  18684. // Kind: [Output Only] Type of resource. Always
  18685. // compute#targetPoolAggregatedList for aggregated lists of target
  18686. // pools.
  18687. Kind string `json:"kind,omitempty"`
  18688. // NextPageToken: [Output Only] This token allows you to get the next
  18689. // page of results for list requests. If the number of results is larger
  18690. // than maxResults, use the nextPageToken as a value for the query
  18691. // parameter pageToken in the next list request. Subsequent list
  18692. // requests will have their own nextPageToken to continue paging through
  18693. // the results.
  18694. NextPageToken string `json:"nextPageToken,omitempty"`
  18695. // SelfLink: [Output Only] Server-defined URL for this resource.
  18696. SelfLink string `json:"selfLink,omitempty"`
  18697. // Warning: [Output Only] Informational warning message.
  18698. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  18699. // ServerResponse contains the HTTP response code and headers from the
  18700. // server.
  18701. googleapi.ServerResponse `json:"-"`
  18702. // ForceSendFields is a list of field names (e.g. "Id") to
  18703. // unconditionally include in API requests. By default, fields with
  18704. // empty values are omitted from API requests. However, any non-pointer,
  18705. // non-interface field appearing in ForceSendFields will be sent to the
  18706. // server regardless of whether the field is empty or not. This may be
  18707. // used to include empty fields in Patch requests.
  18708. ForceSendFields []string `json:"-"`
  18709. // NullFields is a list of field names (e.g. "Id") to include in API
  18710. // requests with the JSON null value. By default, fields with empty
  18711. // values are omitted from API requests. However, any field with an
  18712. // empty value appearing in NullFields will be sent to the server as
  18713. // null. It is an error if a field in this list has a non-empty value.
  18714. // This may be used to include null fields in Patch requests.
  18715. NullFields []string `json:"-"`
  18716. }
  18717. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  18718. type NoMethod TargetPoolAggregatedList
  18719. raw := NoMethod(*s)
  18720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18721. }
  18722. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  18723. // message.
  18724. type TargetPoolAggregatedListWarning struct {
  18725. // Code: [Output Only] A warning code, if applicable. For example,
  18726. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18727. // the response.
  18728. //
  18729. // Possible values:
  18730. // "CLEANUP_FAILED"
  18731. // "DEPRECATED_RESOURCE_USED"
  18732. // "DEPRECATED_TYPE_USED"
  18733. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18734. // "EXPERIMENTAL_TYPE_USED"
  18735. // "EXTERNAL_API_WARNING"
  18736. // "FIELD_VALUE_OVERRIDEN"
  18737. // "INJECTED_KERNELS_DEPRECATED"
  18738. // "MISSING_TYPE_DEPENDENCY"
  18739. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18740. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18741. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18742. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18743. // "NEXT_HOP_NOT_RUNNING"
  18744. // "NOT_CRITICAL_ERROR"
  18745. // "NO_RESULTS_ON_PAGE"
  18746. // "REQUIRED_TOS_AGREEMENT"
  18747. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18748. // "RESOURCE_NOT_DELETED"
  18749. // "SCHEMA_VALIDATION_IGNORED"
  18750. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18751. // "UNDECLARED_PROPERTIES"
  18752. // "UNREACHABLE"
  18753. Code string `json:"code,omitempty"`
  18754. // Data: [Output Only] Metadata about this warning in key: value format.
  18755. // For example:
  18756. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18757. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  18758. // Message: [Output Only] A human-readable description of the warning
  18759. // code.
  18760. Message string `json:"message,omitempty"`
  18761. // ForceSendFields is a list of field names (e.g. "Code") to
  18762. // unconditionally include in API requests. By default, fields with
  18763. // empty values are omitted from API requests. However, any non-pointer,
  18764. // non-interface field appearing in ForceSendFields will be sent to the
  18765. // server regardless of whether the field is empty or not. This may be
  18766. // used to include empty fields in Patch requests.
  18767. ForceSendFields []string `json:"-"`
  18768. // NullFields is a list of field names (e.g. "Code") to include in API
  18769. // requests with the JSON null value. By default, fields with empty
  18770. // values are omitted from API requests. However, any field with an
  18771. // empty value appearing in NullFields will be sent to the server as
  18772. // null. It is an error if a field in this list has a non-empty value.
  18773. // This may be used to include null fields in Patch requests.
  18774. NullFields []string `json:"-"`
  18775. }
  18776. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18777. type NoMethod TargetPoolAggregatedListWarning
  18778. raw := NoMethod(*s)
  18779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18780. }
  18781. type TargetPoolAggregatedListWarningData struct {
  18782. // Key: [Output Only] A key that provides more detail on the warning
  18783. // being returned. For example, for warnings where there are no results
  18784. // in a list request for a particular zone, this key might be scope and
  18785. // the key value might be the zone name. Other examples might be a key
  18786. // indicating a deprecated resource and a suggested replacement, or a
  18787. // warning about invalid network settings (for example, if an instance
  18788. // attempts to perform IP forwarding but is not enabled for IP
  18789. // forwarding).
  18790. Key string `json:"key,omitempty"`
  18791. // Value: [Output Only] A warning data value corresponding to the key.
  18792. Value string `json:"value,omitempty"`
  18793. // ForceSendFields is a list of field names (e.g. "Key") to
  18794. // unconditionally include in API requests. By default, fields with
  18795. // empty values are omitted from API requests. However, any non-pointer,
  18796. // non-interface field appearing in ForceSendFields will be sent to the
  18797. // server regardless of whether the field is empty or not. This may be
  18798. // used to include empty fields in Patch requests.
  18799. ForceSendFields []string `json:"-"`
  18800. // NullFields is a list of field names (e.g. "Key") to include in API
  18801. // requests with the JSON null value. By default, fields with empty
  18802. // values are omitted from API requests. However, any field with an
  18803. // empty value appearing in NullFields will be sent to the server as
  18804. // null. It is an error if a field in this list has a non-empty value.
  18805. // This may be used to include null fields in Patch requests.
  18806. NullFields []string `json:"-"`
  18807. }
  18808. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18809. type NoMethod TargetPoolAggregatedListWarningData
  18810. raw := NoMethod(*s)
  18811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18812. }
  18813. type TargetPoolInstanceHealth struct {
  18814. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  18815. // Kind: [Output Only] Type of resource. Always
  18816. // compute#targetPoolInstanceHealth when checking the health of an
  18817. // instance.
  18818. Kind string `json:"kind,omitempty"`
  18819. // ServerResponse contains the HTTP response code and headers from the
  18820. // server.
  18821. googleapi.ServerResponse `json:"-"`
  18822. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  18823. // unconditionally include in API requests. By default, fields with
  18824. // empty values are omitted from API requests. However, any non-pointer,
  18825. // non-interface field appearing in ForceSendFields will be sent to the
  18826. // server regardless of whether the field is empty or not. This may be
  18827. // used to include empty fields in Patch requests.
  18828. ForceSendFields []string `json:"-"`
  18829. // NullFields is a list of field names (e.g. "HealthStatus") to include
  18830. // in API requests with the JSON null value. By default, fields with
  18831. // empty values are omitted from API requests. However, any field with
  18832. // an empty value appearing in NullFields will be sent to the server as
  18833. // null. It is an error if a field in this list has a non-empty value.
  18834. // This may be used to include null fields in Patch requests.
  18835. NullFields []string `json:"-"`
  18836. }
  18837. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  18838. type NoMethod TargetPoolInstanceHealth
  18839. raw := NoMethod(*s)
  18840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18841. }
  18842. // TargetPoolList: Contains a list of TargetPool resources.
  18843. type TargetPoolList struct {
  18844. // Id: [Output Only] Unique identifier for the resource; defined by the
  18845. // server.
  18846. Id string `json:"id,omitempty"`
  18847. // Items: A list of TargetPool resources.
  18848. Items []*TargetPool `json:"items,omitempty"`
  18849. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  18850. // for lists of target pools.
  18851. Kind string `json:"kind,omitempty"`
  18852. // NextPageToken: [Output Only] This token allows you to get the next
  18853. // page of results for list requests. If the number of results is larger
  18854. // than maxResults, use the nextPageToken as a value for the query
  18855. // parameter pageToken in the next list request. Subsequent list
  18856. // requests will have their own nextPageToken to continue paging through
  18857. // the results.
  18858. NextPageToken string `json:"nextPageToken,omitempty"`
  18859. // SelfLink: [Output Only] Server-defined URL for this resource.
  18860. SelfLink string `json:"selfLink,omitempty"`
  18861. // Warning: [Output Only] Informational warning message.
  18862. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  18863. // ServerResponse contains the HTTP response code and headers from the
  18864. // server.
  18865. googleapi.ServerResponse `json:"-"`
  18866. // ForceSendFields is a list of field names (e.g. "Id") to
  18867. // unconditionally include in API requests. By default, fields with
  18868. // empty values are omitted from API requests. However, any non-pointer,
  18869. // non-interface field appearing in ForceSendFields will be sent to the
  18870. // server regardless of whether the field is empty or not. This may be
  18871. // used to include empty fields in Patch requests.
  18872. ForceSendFields []string `json:"-"`
  18873. // NullFields is a list of field names (e.g. "Id") to include in API
  18874. // requests with the JSON null value. By default, fields with empty
  18875. // values are omitted from API requests. However, any field with an
  18876. // empty value appearing in NullFields will be sent to the server as
  18877. // null. It is an error if a field in this list has a non-empty value.
  18878. // This may be used to include null fields in Patch requests.
  18879. NullFields []string `json:"-"`
  18880. }
  18881. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  18882. type NoMethod TargetPoolList
  18883. raw := NoMethod(*s)
  18884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18885. }
  18886. // TargetPoolListWarning: [Output Only] Informational warning message.
  18887. type TargetPoolListWarning struct {
  18888. // Code: [Output Only] A warning code, if applicable. For example,
  18889. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18890. // the response.
  18891. //
  18892. // Possible values:
  18893. // "CLEANUP_FAILED"
  18894. // "DEPRECATED_RESOURCE_USED"
  18895. // "DEPRECATED_TYPE_USED"
  18896. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18897. // "EXPERIMENTAL_TYPE_USED"
  18898. // "EXTERNAL_API_WARNING"
  18899. // "FIELD_VALUE_OVERRIDEN"
  18900. // "INJECTED_KERNELS_DEPRECATED"
  18901. // "MISSING_TYPE_DEPENDENCY"
  18902. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18903. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18904. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18905. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18906. // "NEXT_HOP_NOT_RUNNING"
  18907. // "NOT_CRITICAL_ERROR"
  18908. // "NO_RESULTS_ON_PAGE"
  18909. // "REQUIRED_TOS_AGREEMENT"
  18910. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18911. // "RESOURCE_NOT_DELETED"
  18912. // "SCHEMA_VALIDATION_IGNORED"
  18913. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18914. // "UNDECLARED_PROPERTIES"
  18915. // "UNREACHABLE"
  18916. Code string `json:"code,omitempty"`
  18917. // Data: [Output Only] Metadata about this warning in key: value format.
  18918. // For example:
  18919. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18920. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  18921. // Message: [Output Only] A human-readable description of the warning
  18922. // code.
  18923. Message string `json:"message,omitempty"`
  18924. // ForceSendFields is a list of field names (e.g. "Code") to
  18925. // unconditionally include in API requests. By default, fields with
  18926. // empty values are omitted from API requests. However, any non-pointer,
  18927. // non-interface field appearing in ForceSendFields will be sent to the
  18928. // server regardless of whether the field is empty or not. This may be
  18929. // used to include empty fields in Patch requests.
  18930. ForceSendFields []string `json:"-"`
  18931. // NullFields is a list of field names (e.g. "Code") to include in API
  18932. // requests with the JSON null value. By default, fields with empty
  18933. // values are omitted from API requests. However, any field with an
  18934. // empty value appearing in NullFields will be sent to the server as
  18935. // null. It is an error if a field in this list has a non-empty value.
  18936. // This may be used to include null fields in Patch requests.
  18937. NullFields []string `json:"-"`
  18938. }
  18939. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  18940. type NoMethod TargetPoolListWarning
  18941. raw := NoMethod(*s)
  18942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18943. }
  18944. type TargetPoolListWarningData struct {
  18945. // Key: [Output Only] A key that provides more detail on the warning
  18946. // being returned. For example, for warnings where there are no results
  18947. // in a list request for a particular zone, this key might be scope and
  18948. // the key value might be the zone name. Other examples might be a key
  18949. // indicating a deprecated resource and a suggested replacement, or a
  18950. // warning about invalid network settings (for example, if an instance
  18951. // attempts to perform IP forwarding but is not enabled for IP
  18952. // forwarding).
  18953. Key string `json:"key,omitempty"`
  18954. // Value: [Output Only] A warning data value corresponding to the key.
  18955. Value string `json:"value,omitempty"`
  18956. // ForceSendFields is a list of field names (e.g. "Key") to
  18957. // unconditionally include in API requests. By default, fields with
  18958. // empty values are omitted from API requests. However, any non-pointer,
  18959. // non-interface field appearing in ForceSendFields will be sent to the
  18960. // server regardless of whether the field is empty or not. This may be
  18961. // used to include empty fields in Patch requests.
  18962. ForceSendFields []string `json:"-"`
  18963. // NullFields is a list of field names (e.g. "Key") to include in API
  18964. // requests with the JSON null value. By default, fields with empty
  18965. // values are omitted from API requests. However, any field with an
  18966. // empty value appearing in NullFields will be sent to the server as
  18967. // null. It is an error if a field in this list has a non-empty value.
  18968. // This may be used to include null fields in Patch requests.
  18969. NullFields []string `json:"-"`
  18970. }
  18971. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  18972. type NoMethod TargetPoolListWarningData
  18973. raw := NoMethod(*s)
  18974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18975. }
  18976. type TargetPoolsAddHealthCheckRequest struct {
  18977. // HealthChecks: The HttpHealthCheck to add to the target pool.
  18978. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  18979. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  18980. // unconditionally include in API requests. By default, fields with
  18981. // empty values are omitted from API requests. However, any non-pointer,
  18982. // non-interface field appearing in ForceSendFields will be sent to the
  18983. // server regardless of whether the field is empty or not. This may be
  18984. // used to include empty fields in Patch requests.
  18985. ForceSendFields []string `json:"-"`
  18986. // NullFields is a list of field names (e.g. "HealthChecks") to include
  18987. // in API requests with the JSON null value. By default, fields with
  18988. // empty values are omitted from API requests. However, any field with
  18989. // an empty value appearing in NullFields will be sent to the server as
  18990. // null. It is an error if a field in this list has a non-empty value.
  18991. // This may be used to include null fields in Patch requests.
  18992. NullFields []string `json:"-"`
  18993. }
  18994. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  18995. type NoMethod TargetPoolsAddHealthCheckRequest
  18996. raw := NoMethod(*s)
  18997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18998. }
  18999. type TargetPoolsAddInstanceRequest struct {
  19000. // Instances: A full or partial URL to an instance to add to this target
  19001. // pool. This can be a full or partial URL. For example, the following
  19002. // are valid URLs:
  19003. // -
  19004. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  19005. // - projects/project-id/zones/zone/instances/instance-name
  19006. // - zones/zone/instances/instance-name
  19007. Instances []*InstanceReference `json:"instances,omitempty"`
  19008. // ForceSendFields is a list of field names (e.g. "Instances") to
  19009. // unconditionally include in API requests. By default, fields with
  19010. // empty values are omitted from API requests. However, any non-pointer,
  19011. // non-interface field appearing in ForceSendFields will be sent to the
  19012. // server regardless of whether the field is empty or not. This may be
  19013. // used to include empty fields in Patch requests.
  19014. ForceSendFields []string `json:"-"`
  19015. // NullFields is a list of field names (e.g. "Instances") to include in
  19016. // API requests with the JSON null value. By default, fields with empty
  19017. // values are omitted from API requests. However, any field with an
  19018. // empty value appearing in NullFields will be sent to the server as
  19019. // null. It is an error if a field in this list has a non-empty value.
  19020. // This may be used to include null fields in Patch requests.
  19021. NullFields []string `json:"-"`
  19022. }
  19023. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  19024. type NoMethod TargetPoolsAddInstanceRequest
  19025. raw := NoMethod(*s)
  19026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19027. }
  19028. type TargetPoolsRemoveHealthCheckRequest struct {
  19029. // HealthChecks: Health check URL to be removed. This can be a full or
  19030. // valid partial URL. For example, the following are valid URLs:
  19031. // -
  19032. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  19033. // - projects/project/global/httpHealthChecks/health-check
  19034. // - global/httpHealthChecks/health-check
  19035. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  19036. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  19037. // unconditionally include in API requests. By default, fields with
  19038. // empty values are omitted from API requests. However, any non-pointer,
  19039. // non-interface field appearing in ForceSendFields will be sent to the
  19040. // server regardless of whether the field is empty or not. This may be
  19041. // used to include empty fields in Patch requests.
  19042. ForceSendFields []string `json:"-"`
  19043. // NullFields is a list of field names (e.g. "HealthChecks") to include
  19044. // in API requests with the JSON null value. By default, fields with
  19045. // empty values are omitted from API requests. However, any field with
  19046. // an empty value appearing in NullFields will be sent to the server as
  19047. // null. It is an error if a field in this list has a non-empty value.
  19048. // This may be used to include null fields in Patch requests.
  19049. NullFields []string `json:"-"`
  19050. }
  19051. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  19052. type NoMethod TargetPoolsRemoveHealthCheckRequest
  19053. raw := NoMethod(*s)
  19054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19055. }
  19056. type TargetPoolsRemoveInstanceRequest struct {
  19057. // Instances: URLs of the instances to be removed from target pool.
  19058. Instances []*InstanceReference `json:"instances,omitempty"`
  19059. // ForceSendFields is a list of field names (e.g. "Instances") to
  19060. // unconditionally include in API requests. By default, fields with
  19061. // empty values are omitted from API requests. However, any non-pointer,
  19062. // non-interface field appearing in ForceSendFields will be sent to the
  19063. // server regardless of whether the field is empty or not. This may be
  19064. // used to include empty fields in Patch requests.
  19065. ForceSendFields []string `json:"-"`
  19066. // NullFields is a list of field names (e.g. "Instances") to include in
  19067. // API requests with the JSON null value. By default, fields with empty
  19068. // values are omitted from API requests. However, any field with an
  19069. // empty value appearing in NullFields will be sent to the server as
  19070. // null. It is an error if a field in this list has a non-empty value.
  19071. // This may be used to include null fields in Patch requests.
  19072. NullFields []string `json:"-"`
  19073. }
  19074. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  19075. type NoMethod TargetPoolsRemoveInstanceRequest
  19076. raw := NoMethod(*s)
  19077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19078. }
  19079. type TargetPoolsScopedList struct {
  19080. // TargetPools: A list of target pools contained in this scope.
  19081. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  19082. // Warning: Informational warning which replaces the list of addresses
  19083. // when the list is empty.
  19084. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  19085. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  19086. // unconditionally include in API requests. By default, fields with
  19087. // empty values are omitted from API requests. However, any non-pointer,
  19088. // non-interface field appearing in ForceSendFields will be sent to the
  19089. // server regardless of whether the field is empty or not. This may be
  19090. // used to include empty fields in Patch requests.
  19091. ForceSendFields []string `json:"-"`
  19092. // NullFields is a list of field names (e.g. "TargetPools") to include
  19093. // in API requests with the JSON null value. By default, fields with
  19094. // empty values are omitted from API requests. However, any field with
  19095. // an empty value appearing in NullFields will be sent to the server as
  19096. // null. It is an error if a field in this list has a non-empty value.
  19097. // This may be used to include null fields in Patch requests.
  19098. NullFields []string `json:"-"`
  19099. }
  19100. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  19101. type NoMethod TargetPoolsScopedList
  19102. raw := NoMethod(*s)
  19103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19104. }
  19105. // TargetPoolsScopedListWarning: Informational warning which replaces
  19106. // the list of addresses when the list is empty.
  19107. type TargetPoolsScopedListWarning struct {
  19108. // Code: [Output Only] A warning code, if applicable. For example,
  19109. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19110. // the response.
  19111. //
  19112. // Possible values:
  19113. // "CLEANUP_FAILED"
  19114. // "DEPRECATED_RESOURCE_USED"
  19115. // "DEPRECATED_TYPE_USED"
  19116. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19117. // "EXPERIMENTAL_TYPE_USED"
  19118. // "EXTERNAL_API_WARNING"
  19119. // "FIELD_VALUE_OVERRIDEN"
  19120. // "INJECTED_KERNELS_DEPRECATED"
  19121. // "MISSING_TYPE_DEPENDENCY"
  19122. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19123. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19124. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19125. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19126. // "NEXT_HOP_NOT_RUNNING"
  19127. // "NOT_CRITICAL_ERROR"
  19128. // "NO_RESULTS_ON_PAGE"
  19129. // "REQUIRED_TOS_AGREEMENT"
  19130. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19131. // "RESOURCE_NOT_DELETED"
  19132. // "SCHEMA_VALIDATION_IGNORED"
  19133. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19134. // "UNDECLARED_PROPERTIES"
  19135. // "UNREACHABLE"
  19136. Code string `json:"code,omitempty"`
  19137. // Data: [Output Only] Metadata about this warning in key: value format.
  19138. // For example:
  19139. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19140. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  19141. // Message: [Output Only] A human-readable description of the warning
  19142. // code.
  19143. Message string `json:"message,omitempty"`
  19144. // ForceSendFields is a list of field names (e.g. "Code") to
  19145. // unconditionally include in API requests. By default, fields with
  19146. // empty values are omitted from API requests. However, any non-pointer,
  19147. // non-interface field appearing in ForceSendFields will be sent to the
  19148. // server regardless of whether the field is empty or not. This may be
  19149. // used to include empty fields in Patch requests.
  19150. ForceSendFields []string `json:"-"`
  19151. // NullFields is a list of field names (e.g. "Code") to include in API
  19152. // requests with the JSON null value. By default, fields with empty
  19153. // values are omitted from API requests. However, any field with an
  19154. // empty value appearing in NullFields will be sent to the server as
  19155. // null. It is an error if a field in this list has a non-empty value.
  19156. // This may be used to include null fields in Patch requests.
  19157. NullFields []string `json:"-"`
  19158. }
  19159. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  19160. type NoMethod TargetPoolsScopedListWarning
  19161. raw := NoMethod(*s)
  19162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19163. }
  19164. type TargetPoolsScopedListWarningData struct {
  19165. // Key: [Output Only] A key that provides more detail on the warning
  19166. // being returned. For example, for warnings where there are no results
  19167. // in a list request for a particular zone, this key might be scope and
  19168. // the key value might be the zone name. Other examples might be a key
  19169. // indicating a deprecated resource and a suggested replacement, or a
  19170. // warning about invalid network settings (for example, if an instance
  19171. // attempts to perform IP forwarding but is not enabled for IP
  19172. // forwarding).
  19173. Key string `json:"key,omitempty"`
  19174. // Value: [Output Only] A warning data value corresponding to the key.
  19175. Value string `json:"value,omitempty"`
  19176. // ForceSendFields is a list of field names (e.g. "Key") to
  19177. // unconditionally include in API requests. By default, fields with
  19178. // empty values are omitted from API requests. However, any non-pointer,
  19179. // non-interface field appearing in ForceSendFields will be sent to the
  19180. // server regardless of whether the field is empty or not. This may be
  19181. // used to include empty fields in Patch requests.
  19182. ForceSendFields []string `json:"-"`
  19183. // NullFields is a list of field names (e.g. "Key") to include in API
  19184. // requests with the JSON null value. By default, fields with empty
  19185. // values are omitted from API requests. However, any field with an
  19186. // empty value appearing in NullFields will be sent to the server as
  19187. // null. It is an error if a field in this list has a non-empty value.
  19188. // This may be used to include null fields in Patch requests.
  19189. NullFields []string `json:"-"`
  19190. }
  19191. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  19192. type NoMethod TargetPoolsScopedListWarningData
  19193. raw := NoMethod(*s)
  19194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19195. }
  19196. type TargetReference struct {
  19197. Target string `json:"target,omitempty"`
  19198. // ForceSendFields is a list of field names (e.g. "Target") to
  19199. // unconditionally include in API requests. By default, fields with
  19200. // empty values are omitted from API requests. However, any non-pointer,
  19201. // non-interface field appearing in ForceSendFields will be sent to the
  19202. // server regardless of whether the field is empty or not. This may be
  19203. // used to include empty fields in Patch requests.
  19204. ForceSendFields []string `json:"-"`
  19205. // NullFields is a list of field names (e.g. "Target") to include in API
  19206. // requests with the JSON null value. By default, fields with empty
  19207. // values are omitted from API requests. However, any field with an
  19208. // empty value appearing in NullFields will be sent to the server as
  19209. // null. It is an error if a field in this list has a non-empty value.
  19210. // This may be used to include null fields in Patch requests.
  19211. NullFields []string `json:"-"`
  19212. }
  19213. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  19214. type NoMethod TargetReference
  19215. raw := NoMethod(*s)
  19216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19217. }
  19218. type TargetSslProxiesSetBackendServiceRequest struct {
  19219. // Service: The URL of the new BackendService resource for the
  19220. // targetSslProxy.
  19221. Service string `json:"service,omitempty"`
  19222. // ForceSendFields is a list of field names (e.g. "Service") to
  19223. // unconditionally include in API requests. By default, fields with
  19224. // empty values are omitted from API requests. However, any non-pointer,
  19225. // non-interface field appearing in ForceSendFields will be sent to the
  19226. // server regardless of whether the field is empty or not. This may be
  19227. // used to include empty fields in Patch requests.
  19228. ForceSendFields []string `json:"-"`
  19229. // NullFields is a list of field names (e.g. "Service") to include in
  19230. // API requests with the JSON null value. By default, fields with empty
  19231. // values are omitted from API requests. However, any field with an
  19232. // empty value appearing in NullFields will be sent to the server as
  19233. // null. It is an error if a field in this list has a non-empty value.
  19234. // This may be used to include null fields in Patch requests.
  19235. NullFields []string `json:"-"`
  19236. }
  19237. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  19238. type NoMethod TargetSslProxiesSetBackendServiceRequest
  19239. raw := NoMethod(*s)
  19240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19241. }
  19242. type TargetSslProxiesSetProxyHeaderRequest struct {
  19243. // ProxyHeader: The new type of proxy header to append before sending
  19244. // data to the backend. NONE or PROXY_V1 are allowed.
  19245. //
  19246. // Possible values:
  19247. // "NONE"
  19248. // "PROXY_V1"
  19249. ProxyHeader string `json:"proxyHeader,omitempty"`
  19250. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  19251. // unconditionally include in API requests. By default, fields with
  19252. // empty values are omitted from API requests. However, any non-pointer,
  19253. // non-interface field appearing in ForceSendFields will be sent to the
  19254. // server regardless of whether the field is empty or not. This may be
  19255. // used to include empty fields in Patch requests.
  19256. ForceSendFields []string `json:"-"`
  19257. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  19258. // in API requests with the JSON null value. By default, fields with
  19259. // empty values are omitted from API requests. However, any field with
  19260. // an empty value appearing in NullFields will be sent to the server as
  19261. // null. It is an error if a field in this list has a non-empty value.
  19262. // This may be used to include null fields in Patch requests.
  19263. NullFields []string `json:"-"`
  19264. }
  19265. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  19266. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  19267. raw := NoMethod(*s)
  19268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19269. }
  19270. type TargetSslProxiesSetSslCertificatesRequest struct {
  19271. // SslCertificates: New set of URLs to SslCertificate resources to
  19272. // associate with this TargetSslProxy. Currently exactly one ssl
  19273. // certificate must be specified.
  19274. SslCertificates []string `json:"sslCertificates,omitempty"`
  19275. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  19276. // unconditionally include in API requests. By default, fields with
  19277. // empty values are omitted from API requests. However, any non-pointer,
  19278. // non-interface field appearing in ForceSendFields will be sent to the
  19279. // server regardless of whether the field is empty or not. This may be
  19280. // used to include empty fields in Patch requests.
  19281. ForceSendFields []string `json:"-"`
  19282. // NullFields is a list of field names (e.g. "SslCertificates") to
  19283. // include in API requests with the JSON null value. By default, fields
  19284. // with empty values are omitted from API requests. However, any field
  19285. // with an empty value appearing in NullFields will be sent to the
  19286. // server as null. It is an error if a field in this list has a
  19287. // non-empty value. This may be used to include null fields in Patch
  19288. // requests.
  19289. NullFields []string `json:"-"`
  19290. }
  19291. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  19292. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  19293. raw := NoMethod(*s)
  19294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19295. }
  19296. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  19297. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  19298. // resource_for v1.targetSslProxies ==)
  19299. type TargetSslProxy struct {
  19300. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19301. // format.
  19302. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19303. // Description: An optional description of this resource. Provide this
  19304. // property when you create the resource.
  19305. Description string `json:"description,omitempty"`
  19306. // Id: [Output Only] The unique identifier for the resource. This
  19307. // identifier is defined by the server.
  19308. Id uint64 `json:"id,omitempty,string"`
  19309. // Kind: [Output Only] Type of the resource. Always
  19310. // compute#targetSslProxy for target SSL proxies.
  19311. Kind string `json:"kind,omitempty"`
  19312. // Name: Name of the resource. Provided by the client when the resource
  19313. // is created. The name must be 1-63 characters long, and comply with
  19314. // RFC1035. Specifically, the name must be 1-63 characters long and
  19315. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19316. // the first character must be a lowercase letter, and all following
  19317. // characters must be a dash, lowercase letter, or digit, except the
  19318. // last character, which cannot be a dash.
  19319. Name string `json:"name,omitempty"`
  19320. // ProxyHeader: Specifies the type of proxy header to append before
  19321. // sending data to the backend, either NONE or PROXY_V1. The default is
  19322. // NONE.
  19323. //
  19324. // Possible values:
  19325. // "NONE"
  19326. // "PROXY_V1"
  19327. ProxyHeader string `json:"proxyHeader,omitempty"`
  19328. // SelfLink: [Output Only] Server-defined URL for the resource.
  19329. SelfLink string `json:"selfLink,omitempty"`
  19330. // Service: URL to the BackendService resource.
  19331. Service string `json:"service,omitempty"`
  19332. // SslCertificates: URLs to SslCertificate resources that are used to
  19333. // authenticate connections to Backends. Currently exactly one SSL
  19334. // certificate must be specified.
  19335. SslCertificates []string `json:"sslCertificates,omitempty"`
  19336. // SslPolicy: URL of SslPolicy resource that will be associated with the
  19337. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  19338. // not have any SSL policy configured.
  19339. SslPolicy string `json:"sslPolicy,omitempty"`
  19340. // ServerResponse contains the HTTP response code and headers from the
  19341. // server.
  19342. googleapi.ServerResponse `json:"-"`
  19343. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19344. // to unconditionally include in API requests. By default, fields with
  19345. // empty values are omitted from API requests. However, any non-pointer,
  19346. // non-interface field appearing in ForceSendFields will be sent to the
  19347. // server regardless of whether the field is empty or not. This may be
  19348. // used to include empty fields in Patch requests.
  19349. ForceSendFields []string `json:"-"`
  19350. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19351. // include in API requests with the JSON null value. By default, fields
  19352. // with empty values are omitted from API requests. However, any field
  19353. // with an empty value appearing in NullFields will be sent to the
  19354. // server as null. It is an error if a field in this list has a
  19355. // non-empty value. This may be used to include null fields in Patch
  19356. // requests.
  19357. NullFields []string `json:"-"`
  19358. }
  19359. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  19360. type NoMethod TargetSslProxy
  19361. raw := NoMethod(*s)
  19362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19363. }
  19364. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  19365. type TargetSslProxyList struct {
  19366. // Id: [Output Only] Unique identifier for the resource; defined by the
  19367. // server.
  19368. Id string `json:"id,omitempty"`
  19369. // Items: A list of TargetSslProxy resources.
  19370. Items []*TargetSslProxy `json:"items,omitempty"`
  19371. // Kind: Type of resource.
  19372. Kind string `json:"kind,omitempty"`
  19373. // NextPageToken: [Output Only] This token allows you to get the next
  19374. // page of results for list requests. If the number of results is larger
  19375. // than maxResults, use the nextPageToken as a value for the query
  19376. // parameter pageToken in the next list request. Subsequent list
  19377. // requests will have their own nextPageToken to continue paging through
  19378. // the results.
  19379. NextPageToken string `json:"nextPageToken,omitempty"`
  19380. // SelfLink: [Output Only] Server-defined URL for this resource.
  19381. SelfLink string `json:"selfLink,omitempty"`
  19382. // Warning: [Output Only] Informational warning message.
  19383. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  19384. // ServerResponse contains the HTTP response code and headers from the
  19385. // server.
  19386. googleapi.ServerResponse `json:"-"`
  19387. // ForceSendFields is a list of field names (e.g. "Id") to
  19388. // unconditionally include in API requests. By default, fields with
  19389. // empty values are omitted from API requests. However, any non-pointer,
  19390. // non-interface field appearing in ForceSendFields will be sent to the
  19391. // server regardless of whether the field is empty or not. This may be
  19392. // used to include empty fields in Patch requests.
  19393. ForceSendFields []string `json:"-"`
  19394. // NullFields is a list of field names (e.g. "Id") to include in API
  19395. // requests with the JSON null value. By default, fields with empty
  19396. // values are omitted from API requests. However, any field with an
  19397. // empty value appearing in NullFields will be sent to the server as
  19398. // null. It is an error if a field in this list has a non-empty value.
  19399. // This may be used to include null fields in Patch requests.
  19400. NullFields []string `json:"-"`
  19401. }
  19402. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  19403. type NoMethod TargetSslProxyList
  19404. raw := NoMethod(*s)
  19405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19406. }
  19407. // TargetSslProxyListWarning: [Output Only] Informational warning
  19408. // message.
  19409. type TargetSslProxyListWarning struct {
  19410. // Code: [Output Only] A warning code, if applicable. For example,
  19411. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19412. // the response.
  19413. //
  19414. // Possible values:
  19415. // "CLEANUP_FAILED"
  19416. // "DEPRECATED_RESOURCE_USED"
  19417. // "DEPRECATED_TYPE_USED"
  19418. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19419. // "EXPERIMENTAL_TYPE_USED"
  19420. // "EXTERNAL_API_WARNING"
  19421. // "FIELD_VALUE_OVERRIDEN"
  19422. // "INJECTED_KERNELS_DEPRECATED"
  19423. // "MISSING_TYPE_DEPENDENCY"
  19424. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19425. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19426. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19427. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19428. // "NEXT_HOP_NOT_RUNNING"
  19429. // "NOT_CRITICAL_ERROR"
  19430. // "NO_RESULTS_ON_PAGE"
  19431. // "REQUIRED_TOS_AGREEMENT"
  19432. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19433. // "RESOURCE_NOT_DELETED"
  19434. // "SCHEMA_VALIDATION_IGNORED"
  19435. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19436. // "UNDECLARED_PROPERTIES"
  19437. // "UNREACHABLE"
  19438. Code string `json:"code,omitempty"`
  19439. // Data: [Output Only] Metadata about this warning in key: value format.
  19440. // For example:
  19441. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19442. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  19443. // Message: [Output Only] A human-readable description of the warning
  19444. // code.
  19445. Message string `json:"message,omitempty"`
  19446. // ForceSendFields is a list of field names (e.g. "Code") to
  19447. // unconditionally include in API requests. By default, fields with
  19448. // empty values are omitted from API requests. However, any non-pointer,
  19449. // non-interface field appearing in ForceSendFields will be sent to the
  19450. // server regardless of whether the field is empty or not. This may be
  19451. // used to include empty fields in Patch requests.
  19452. ForceSendFields []string `json:"-"`
  19453. // NullFields is a list of field names (e.g. "Code") to include in API
  19454. // requests with the JSON null value. By default, fields with empty
  19455. // values are omitted from API requests. However, any field with an
  19456. // empty value appearing in NullFields will be sent to the server as
  19457. // null. It is an error if a field in this list has a non-empty value.
  19458. // This may be used to include null fields in Patch requests.
  19459. NullFields []string `json:"-"`
  19460. }
  19461. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  19462. type NoMethod TargetSslProxyListWarning
  19463. raw := NoMethod(*s)
  19464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19465. }
  19466. type TargetSslProxyListWarningData struct {
  19467. // Key: [Output Only] A key that provides more detail on the warning
  19468. // being returned. For example, for warnings where there are no results
  19469. // in a list request for a particular zone, this key might be scope and
  19470. // the key value might be the zone name. Other examples might be a key
  19471. // indicating a deprecated resource and a suggested replacement, or a
  19472. // warning about invalid network settings (for example, if an instance
  19473. // attempts to perform IP forwarding but is not enabled for IP
  19474. // forwarding).
  19475. Key string `json:"key,omitempty"`
  19476. // Value: [Output Only] A warning data value corresponding to the key.
  19477. Value string `json:"value,omitempty"`
  19478. // ForceSendFields is a list of field names (e.g. "Key") to
  19479. // unconditionally include in API requests. By default, fields with
  19480. // empty values are omitted from API requests. However, any non-pointer,
  19481. // non-interface field appearing in ForceSendFields will be sent to the
  19482. // server regardless of whether the field is empty or not. This may be
  19483. // used to include empty fields in Patch requests.
  19484. ForceSendFields []string `json:"-"`
  19485. // NullFields is a list of field names (e.g. "Key") to include in API
  19486. // requests with the JSON null value. By default, fields with empty
  19487. // values are omitted from API requests. However, any field with an
  19488. // empty value appearing in NullFields will be sent to the server as
  19489. // null. It is an error if a field in this list has a non-empty value.
  19490. // This may be used to include null fields in Patch requests.
  19491. NullFields []string `json:"-"`
  19492. }
  19493. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  19494. type NoMethod TargetSslProxyListWarningData
  19495. raw := NoMethod(*s)
  19496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19497. }
  19498. type TargetTcpProxiesSetBackendServiceRequest struct {
  19499. // Service: The URL of the new BackendService resource for the
  19500. // targetTcpProxy.
  19501. Service string `json:"service,omitempty"`
  19502. // ForceSendFields is a list of field names (e.g. "Service") to
  19503. // unconditionally include in API requests. By default, fields with
  19504. // empty values are omitted from API requests. However, any non-pointer,
  19505. // non-interface field appearing in ForceSendFields will be sent to the
  19506. // server regardless of whether the field is empty or not. This may be
  19507. // used to include empty fields in Patch requests.
  19508. ForceSendFields []string `json:"-"`
  19509. // NullFields is a list of field names (e.g. "Service") to include in
  19510. // API requests with the JSON null value. By default, fields with empty
  19511. // values are omitted from API requests. However, any field with an
  19512. // empty value appearing in NullFields will be sent to the server as
  19513. // null. It is an error if a field in this list has a non-empty value.
  19514. // This may be used to include null fields in Patch requests.
  19515. NullFields []string `json:"-"`
  19516. }
  19517. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  19518. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  19519. raw := NoMethod(*s)
  19520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19521. }
  19522. type TargetTcpProxiesSetProxyHeaderRequest struct {
  19523. // ProxyHeader: The new type of proxy header to append before sending
  19524. // data to the backend. NONE or PROXY_V1 are allowed.
  19525. //
  19526. // Possible values:
  19527. // "NONE"
  19528. // "PROXY_V1"
  19529. ProxyHeader string `json:"proxyHeader,omitempty"`
  19530. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  19531. // unconditionally include in API requests. By default, fields with
  19532. // empty values are omitted from API requests. However, any non-pointer,
  19533. // non-interface field appearing in ForceSendFields will be sent to the
  19534. // server regardless of whether the field is empty or not. This may be
  19535. // used to include empty fields in Patch requests.
  19536. ForceSendFields []string `json:"-"`
  19537. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  19538. // in API requests with the JSON null value. By default, fields with
  19539. // empty values are omitted from API requests. However, any field with
  19540. // an empty value appearing in NullFields will be sent to the server as
  19541. // null. It is an error if a field in this list has a non-empty value.
  19542. // This may be used to include null fields in Patch requests.
  19543. NullFields []string `json:"-"`
  19544. }
  19545. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  19546. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  19547. raw := NoMethod(*s)
  19548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19549. }
  19550. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  19551. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  19552. // resource_for v1.targetTcpProxies ==)
  19553. type TargetTcpProxy struct {
  19554. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19555. // format.
  19556. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19557. // Description: An optional description of this resource. Provide this
  19558. // property when you create the resource.
  19559. Description string `json:"description,omitempty"`
  19560. // Id: [Output Only] The unique identifier for the resource. This
  19561. // identifier is defined by the server.
  19562. Id uint64 `json:"id,omitempty,string"`
  19563. // Kind: [Output Only] Type of the resource. Always
  19564. // compute#targetTcpProxy for target TCP proxies.
  19565. Kind string `json:"kind,omitempty"`
  19566. // Name: Name of the resource. Provided by the client when the resource
  19567. // is created. The name must be 1-63 characters long, and comply with
  19568. // RFC1035. Specifically, the name must be 1-63 characters long and
  19569. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19570. // the first character must be a lowercase letter, and all following
  19571. // characters must be a dash, lowercase letter, or digit, except the
  19572. // last character, which cannot be a dash.
  19573. Name string `json:"name,omitempty"`
  19574. // ProxyHeader: Specifies the type of proxy header to append before
  19575. // sending data to the backend, either NONE or PROXY_V1. The default is
  19576. // NONE.
  19577. //
  19578. // Possible values:
  19579. // "NONE"
  19580. // "PROXY_V1"
  19581. ProxyHeader string `json:"proxyHeader,omitempty"`
  19582. // SelfLink: [Output Only] Server-defined URL for the resource.
  19583. SelfLink string `json:"selfLink,omitempty"`
  19584. // Service: URL to the BackendService resource.
  19585. Service string `json:"service,omitempty"`
  19586. // ServerResponse contains the HTTP response code and headers from the
  19587. // server.
  19588. googleapi.ServerResponse `json:"-"`
  19589. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19590. // to unconditionally include in API requests. By default, fields with
  19591. // empty values are omitted from API requests. However, any non-pointer,
  19592. // non-interface field appearing in ForceSendFields will be sent to the
  19593. // server regardless of whether the field is empty or not. This may be
  19594. // used to include empty fields in Patch requests.
  19595. ForceSendFields []string `json:"-"`
  19596. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19597. // include in API requests with the JSON null value. By default, fields
  19598. // with empty values are omitted from API requests. However, any field
  19599. // with an empty value appearing in NullFields will be sent to the
  19600. // server as null. It is an error if a field in this list has a
  19601. // non-empty value. This may be used to include null fields in Patch
  19602. // requests.
  19603. NullFields []string `json:"-"`
  19604. }
  19605. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  19606. type NoMethod TargetTcpProxy
  19607. raw := NoMethod(*s)
  19608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19609. }
  19610. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  19611. type TargetTcpProxyList struct {
  19612. // Id: [Output Only] Unique identifier for the resource; defined by the
  19613. // server.
  19614. Id string `json:"id,omitempty"`
  19615. // Items: A list of TargetTcpProxy resources.
  19616. Items []*TargetTcpProxy `json:"items,omitempty"`
  19617. // Kind: Type of resource.
  19618. Kind string `json:"kind,omitempty"`
  19619. // NextPageToken: [Output Only] This token allows you to get the next
  19620. // page of results for list requests. If the number of results is larger
  19621. // than maxResults, use the nextPageToken as a value for the query
  19622. // parameter pageToken in the next list request. Subsequent list
  19623. // requests will have their own nextPageToken to continue paging through
  19624. // the results.
  19625. NextPageToken string `json:"nextPageToken,omitempty"`
  19626. // SelfLink: [Output Only] Server-defined URL for this resource.
  19627. SelfLink string `json:"selfLink,omitempty"`
  19628. // Warning: [Output Only] Informational warning message.
  19629. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  19630. // ServerResponse contains the HTTP response code and headers from the
  19631. // server.
  19632. googleapi.ServerResponse `json:"-"`
  19633. // ForceSendFields is a list of field names (e.g. "Id") to
  19634. // unconditionally include in API requests. By default, fields with
  19635. // empty values are omitted from API requests. However, any non-pointer,
  19636. // non-interface field appearing in ForceSendFields will be sent to the
  19637. // server regardless of whether the field is empty or not. This may be
  19638. // used to include empty fields in Patch requests.
  19639. ForceSendFields []string `json:"-"`
  19640. // NullFields is a list of field names (e.g. "Id") to include in API
  19641. // requests with the JSON null value. By default, fields with empty
  19642. // values are omitted from API requests. However, any field with an
  19643. // empty value appearing in NullFields will be sent to the server as
  19644. // null. It is an error if a field in this list has a non-empty value.
  19645. // This may be used to include null fields in Patch requests.
  19646. NullFields []string `json:"-"`
  19647. }
  19648. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  19649. type NoMethod TargetTcpProxyList
  19650. raw := NoMethod(*s)
  19651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19652. }
  19653. // TargetTcpProxyListWarning: [Output Only] Informational warning
  19654. // message.
  19655. type TargetTcpProxyListWarning struct {
  19656. // Code: [Output Only] A warning code, if applicable. For example,
  19657. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19658. // the response.
  19659. //
  19660. // Possible values:
  19661. // "CLEANUP_FAILED"
  19662. // "DEPRECATED_RESOURCE_USED"
  19663. // "DEPRECATED_TYPE_USED"
  19664. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19665. // "EXPERIMENTAL_TYPE_USED"
  19666. // "EXTERNAL_API_WARNING"
  19667. // "FIELD_VALUE_OVERRIDEN"
  19668. // "INJECTED_KERNELS_DEPRECATED"
  19669. // "MISSING_TYPE_DEPENDENCY"
  19670. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19671. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19672. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19673. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19674. // "NEXT_HOP_NOT_RUNNING"
  19675. // "NOT_CRITICAL_ERROR"
  19676. // "NO_RESULTS_ON_PAGE"
  19677. // "REQUIRED_TOS_AGREEMENT"
  19678. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19679. // "RESOURCE_NOT_DELETED"
  19680. // "SCHEMA_VALIDATION_IGNORED"
  19681. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19682. // "UNDECLARED_PROPERTIES"
  19683. // "UNREACHABLE"
  19684. Code string `json:"code,omitempty"`
  19685. // Data: [Output Only] Metadata about this warning in key: value format.
  19686. // For example:
  19687. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19688. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  19689. // Message: [Output Only] A human-readable description of the warning
  19690. // code.
  19691. Message string `json:"message,omitempty"`
  19692. // ForceSendFields is a list of field names (e.g. "Code") to
  19693. // unconditionally include in API requests. By default, fields with
  19694. // empty values are omitted from API requests. However, any non-pointer,
  19695. // non-interface field appearing in ForceSendFields will be sent to the
  19696. // server regardless of whether the field is empty or not. This may be
  19697. // used to include empty fields in Patch requests.
  19698. ForceSendFields []string `json:"-"`
  19699. // NullFields is a list of field names (e.g. "Code") to include in API
  19700. // requests with the JSON null value. By default, fields with empty
  19701. // values are omitted from API requests. However, any field with an
  19702. // empty value appearing in NullFields will be sent to the server as
  19703. // null. It is an error if a field in this list has a non-empty value.
  19704. // This may be used to include null fields in Patch requests.
  19705. NullFields []string `json:"-"`
  19706. }
  19707. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  19708. type NoMethod TargetTcpProxyListWarning
  19709. raw := NoMethod(*s)
  19710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19711. }
  19712. type TargetTcpProxyListWarningData struct {
  19713. // Key: [Output Only] A key that provides more detail on the warning
  19714. // being returned. For example, for warnings where there are no results
  19715. // in a list request for a particular zone, this key might be scope and
  19716. // the key value might be the zone name. Other examples might be a key
  19717. // indicating a deprecated resource and a suggested replacement, or a
  19718. // warning about invalid network settings (for example, if an instance
  19719. // attempts to perform IP forwarding but is not enabled for IP
  19720. // forwarding).
  19721. Key string `json:"key,omitempty"`
  19722. // Value: [Output Only] A warning data value corresponding to the key.
  19723. Value string `json:"value,omitempty"`
  19724. // ForceSendFields is a list of field names (e.g. "Key") to
  19725. // unconditionally include in API requests. By default, fields with
  19726. // empty values are omitted from API requests. However, any non-pointer,
  19727. // non-interface field appearing in ForceSendFields will be sent to the
  19728. // server regardless of whether the field is empty or not. This may be
  19729. // used to include empty fields in Patch requests.
  19730. ForceSendFields []string `json:"-"`
  19731. // NullFields is a list of field names (e.g. "Key") to include in API
  19732. // requests with the JSON null value. By default, fields with empty
  19733. // values are omitted from API requests. However, any field with an
  19734. // empty value appearing in NullFields will be sent to the server as
  19735. // null. It is an error if a field in this list has a non-empty value.
  19736. // This may be used to include null fields in Patch requests.
  19737. NullFields []string `json:"-"`
  19738. }
  19739. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  19740. type NoMethod TargetTcpProxyListWarningData
  19741. raw := NoMethod(*s)
  19742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19743. }
  19744. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  19745. // resource_for beta.targetVpnGateways ==) (== resource_for
  19746. // v1.targetVpnGateways ==)
  19747. type TargetVpnGateway struct {
  19748. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19749. // format.
  19750. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19751. // Description: An optional description of this resource. Provide this
  19752. // property when you create the resource.
  19753. Description string `json:"description,omitempty"`
  19754. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  19755. // resources. ForwardingRules are created using
  19756. // compute.forwardingRules.insert and associated to a VPN gateway.
  19757. ForwardingRules []string `json:"forwardingRules,omitempty"`
  19758. // Id: [Output Only] The unique identifier for the resource. This
  19759. // identifier is defined by the server.
  19760. Id uint64 `json:"id,omitempty,string"`
  19761. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  19762. // for target VPN gateways.
  19763. Kind string `json:"kind,omitempty"`
  19764. // Name: Name of the resource. Provided by the client when the resource
  19765. // is created. The name must be 1-63 characters long, and comply with
  19766. // RFC1035. Specifically, the name must be 1-63 characters long and
  19767. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19768. // the first character must be a lowercase letter, and all following
  19769. // characters must be a dash, lowercase letter, or digit, except the
  19770. // last character, which cannot be a dash.
  19771. Name string `json:"name,omitempty"`
  19772. // Network: URL of the network to which this VPN gateway is attached.
  19773. // Provided by the client when the VPN gateway is created.
  19774. Network string `json:"network,omitempty"`
  19775. // Region: [Output Only] URL of the region where the target VPN gateway
  19776. // resides. You must specify this field as part of the HTTP request URL.
  19777. // It is not settable as a field in the request body.
  19778. Region string `json:"region,omitempty"`
  19779. // SelfLink: [Output Only] Server-defined URL for the resource.
  19780. SelfLink string `json:"selfLink,omitempty"`
  19781. // Status: [Output Only] The status of the VPN gateway.
  19782. //
  19783. // Possible values:
  19784. // "CREATING"
  19785. // "DELETING"
  19786. // "FAILED"
  19787. // "READY"
  19788. Status string `json:"status,omitempty"`
  19789. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  19790. // VpnTunnels are created using compute.vpntunnels.insert method and
  19791. // associated to a VPN gateway.
  19792. Tunnels []string `json:"tunnels,omitempty"`
  19793. // ServerResponse contains the HTTP response code and headers from the
  19794. // server.
  19795. googleapi.ServerResponse `json:"-"`
  19796. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19797. // to unconditionally include in API requests. By default, fields with
  19798. // empty values are omitted from API requests. However, any non-pointer,
  19799. // non-interface field appearing in ForceSendFields will be sent to the
  19800. // server regardless of whether the field is empty or not. This may be
  19801. // used to include empty fields in Patch requests.
  19802. ForceSendFields []string `json:"-"`
  19803. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19804. // include in API requests with the JSON null value. By default, fields
  19805. // with empty values are omitted from API requests. However, any field
  19806. // with an empty value appearing in NullFields will be sent to the
  19807. // server as null. It is an error if a field in this list has a
  19808. // non-empty value. This may be used to include null fields in Patch
  19809. // requests.
  19810. NullFields []string `json:"-"`
  19811. }
  19812. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  19813. type NoMethod TargetVpnGateway
  19814. raw := NoMethod(*s)
  19815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19816. }
  19817. type TargetVpnGatewayAggregatedList struct {
  19818. // Id: [Output Only] Unique identifier for the resource; defined by the
  19819. // server.
  19820. Id string `json:"id,omitempty"`
  19821. // Items: A list of TargetVpnGateway resources.
  19822. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  19823. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  19824. // for target VPN gateways.
  19825. Kind string `json:"kind,omitempty"`
  19826. // NextPageToken: [Output Only] This token allows you to get the next
  19827. // page of results for list requests. If the number of results is larger
  19828. // than maxResults, use the nextPageToken as a value for the query
  19829. // parameter pageToken in the next list request. Subsequent list
  19830. // requests will have their own nextPageToken to continue paging through
  19831. // the results.
  19832. NextPageToken string `json:"nextPageToken,omitempty"`
  19833. // SelfLink: [Output Only] Server-defined URL for this resource.
  19834. SelfLink string `json:"selfLink,omitempty"`
  19835. // Warning: [Output Only] Informational warning message.
  19836. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  19837. // ServerResponse contains the HTTP response code and headers from the
  19838. // server.
  19839. googleapi.ServerResponse `json:"-"`
  19840. // ForceSendFields is a list of field names (e.g. "Id") to
  19841. // unconditionally include in API requests. By default, fields with
  19842. // empty values are omitted from API requests. However, any non-pointer,
  19843. // non-interface field appearing in ForceSendFields will be sent to the
  19844. // server regardless of whether the field is empty or not. This may be
  19845. // used to include empty fields in Patch requests.
  19846. ForceSendFields []string `json:"-"`
  19847. // NullFields is a list of field names (e.g. "Id") to include in API
  19848. // requests with the JSON null value. By default, fields with empty
  19849. // values are omitted from API requests. However, any field with an
  19850. // empty value appearing in NullFields will be sent to the server as
  19851. // null. It is an error if a field in this list has a non-empty value.
  19852. // This may be used to include null fields in Patch requests.
  19853. NullFields []string `json:"-"`
  19854. }
  19855. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  19856. type NoMethod TargetVpnGatewayAggregatedList
  19857. raw := NoMethod(*s)
  19858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19859. }
  19860. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  19861. // warning message.
  19862. type TargetVpnGatewayAggregatedListWarning struct {
  19863. // Code: [Output Only] A warning code, if applicable. For example,
  19864. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19865. // the response.
  19866. //
  19867. // Possible values:
  19868. // "CLEANUP_FAILED"
  19869. // "DEPRECATED_RESOURCE_USED"
  19870. // "DEPRECATED_TYPE_USED"
  19871. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19872. // "EXPERIMENTAL_TYPE_USED"
  19873. // "EXTERNAL_API_WARNING"
  19874. // "FIELD_VALUE_OVERRIDEN"
  19875. // "INJECTED_KERNELS_DEPRECATED"
  19876. // "MISSING_TYPE_DEPENDENCY"
  19877. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19878. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19879. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19880. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19881. // "NEXT_HOP_NOT_RUNNING"
  19882. // "NOT_CRITICAL_ERROR"
  19883. // "NO_RESULTS_ON_PAGE"
  19884. // "REQUIRED_TOS_AGREEMENT"
  19885. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19886. // "RESOURCE_NOT_DELETED"
  19887. // "SCHEMA_VALIDATION_IGNORED"
  19888. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19889. // "UNDECLARED_PROPERTIES"
  19890. // "UNREACHABLE"
  19891. Code string `json:"code,omitempty"`
  19892. // Data: [Output Only] Metadata about this warning in key: value format.
  19893. // For example:
  19894. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19895. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  19896. // Message: [Output Only] A human-readable description of the warning
  19897. // code.
  19898. Message string `json:"message,omitempty"`
  19899. // ForceSendFields is a list of field names (e.g. "Code") to
  19900. // unconditionally include in API requests. By default, fields with
  19901. // empty values are omitted from API requests. However, any non-pointer,
  19902. // non-interface field appearing in ForceSendFields will be sent to the
  19903. // server regardless of whether the field is empty or not. This may be
  19904. // used to include empty fields in Patch requests.
  19905. ForceSendFields []string `json:"-"`
  19906. // NullFields is a list of field names (e.g. "Code") to include in API
  19907. // requests with the JSON null value. By default, fields with empty
  19908. // values are omitted from API requests. However, any field with an
  19909. // empty value appearing in NullFields will be sent to the server as
  19910. // null. It is an error if a field in this list has a non-empty value.
  19911. // This may be used to include null fields in Patch requests.
  19912. NullFields []string `json:"-"`
  19913. }
  19914. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  19915. type NoMethod TargetVpnGatewayAggregatedListWarning
  19916. raw := NoMethod(*s)
  19917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19918. }
  19919. type TargetVpnGatewayAggregatedListWarningData struct {
  19920. // Key: [Output Only] A key that provides more detail on the warning
  19921. // being returned. For example, for warnings where there are no results
  19922. // in a list request for a particular zone, this key might be scope and
  19923. // the key value might be the zone name. Other examples might be a key
  19924. // indicating a deprecated resource and a suggested replacement, or a
  19925. // warning about invalid network settings (for example, if an instance
  19926. // attempts to perform IP forwarding but is not enabled for IP
  19927. // forwarding).
  19928. Key string `json:"key,omitempty"`
  19929. // Value: [Output Only] A warning data value corresponding to the key.
  19930. Value string `json:"value,omitempty"`
  19931. // ForceSendFields is a list of field names (e.g. "Key") to
  19932. // unconditionally include in API requests. By default, fields with
  19933. // empty values are omitted from API requests. However, any non-pointer,
  19934. // non-interface field appearing in ForceSendFields will be sent to the
  19935. // server regardless of whether the field is empty or not. This may be
  19936. // used to include empty fields in Patch requests.
  19937. ForceSendFields []string `json:"-"`
  19938. // NullFields is a list of field names (e.g. "Key") to include in API
  19939. // requests with the JSON null value. By default, fields with empty
  19940. // values are omitted from API requests. However, any field with an
  19941. // empty value appearing in NullFields will be sent to the server as
  19942. // null. It is an error if a field in this list has a non-empty value.
  19943. // This may be used to include null fields in Patch requests.
  19944. NullFields []string `json:"-"`
  19945. }
  19946. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  19947. type NoMethod TargetVpnGatewayAggregatedListWarningData
  19948. raw := NoMethod(*s)
  19949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19950. }
  19951. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  19952. type TargetVpnGatewayList struct {
  19953. // Id: [Output Only] Unique identifier for the resource; defined by the
  19954. // server.
  19955. Id string `json:"id,omitempty"`
  19956. // Items: A list of TargetVpnGateway resources.
  19957. Items []*TargetVpnGateway `json:"items,omitempty"`
  19958. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  19959. // for target VPN gateways.
  19960. Kind string `json:"kind,omitempty"`
  19961. // NextPageToken: [Output Only] This token allows you to get the next
  19962. // page of results for list requests. If the number of results is larger
  19963. // than maxResults, use the nextPageToken as a value for the query
  19964. // parameter pageToken in the next list request. Subsequent list
  19965. // requests will have their own nextPageToken to continue paging through
  19966. // the results.
  19967. NextPageToken string `json:"nextPageToken,omitempty"`
  19968. // SelfLink: [Output Only] Server-defined URL for this resource.
  19969. SelfLink string `json:"selfLink,omitempty"`
  19970. // Warning: [Output Only] Informational warning message.
  19971. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  19972. // ServerResponse contains the HTTP response code and headers from the
  19973. // server.
  19974. googleapi.ServerResponse `json:"-"`
  19975. // ForceSendFields is a list of field names (e.g. "Id") to
  19976. // unconditionally include in API requests. By default, fields with
  19977. // empty values are omitted from API requests. However, any non-pointer,
  19978. // non-interface field appearing in ForceSendFields will be sent to the
  19979. // server regardless of whether the field is empty or not. This may be
  19980. // used to include empty fields in Patch requests.
  19981. ForceSendFields []string `json:"-"`
  19982. // NullFields is a list of field names (e.g. "Id") to include in API
  19983. // requests with the JSON null value. By default, fields with empty
  19984. // values are omitted from API requests. However, any field with an
  19985. // empty value appearing in NullFields will be sent to the server as
  19986. // null. It is an error if a field in this list has a non-empty value.
  19987. // This may be used to include null fields in Patch requests.
  19988. NullFields []string `json:"-"`
  19989. }
  19990. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  19991. type NoMethod TargetVpnGatewayList
  19992. raw := NoMethod(*s)
  19993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19994. }
  19995. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  19996. // message.
  19997. type TargetVpnGatewayListWarning struct {
  19998. // Code: [Output Only] A warning code, if applicable. For example,
  19999. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20000. // the response.
  20001. //
  20002. // Possible values:
  20003. // "CLEANUP_FAILED"
  20004. // "DEPRECATED_RESOURCE_USED"
  20005. // "DEPRECATED_TYPE_USED"
  20006. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20007. // "EXPERIMENTAL_TYPE_USED"
  20008. // "EXTERNAL_API_WARNING"
  20009. // "FIELD_VALUE_OVERRIDEN"
  20010. // "INJECTED_KERNELS_DEPRECATED"
  20011. // "MISSING_TYPE_DEPENDENCY"
  20012. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20013. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20014. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20015. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20016. // "NEXT_HOP_NOT_RUNNING"
  20017. // "NOT_CRITICAL_ERROR"
  20018. // "NO_RESULTS_ON_PAGE"
  20019. // "REQUIRED_TOS_AGREEMENT"
  20020. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20021. // "RESOURCE_NOT_DELETED"
  20022. // "SCHEMA_VALIDATION_IGNORED"
  20023. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20024. // "UNDECLARED_PROPERTIES"
  20025. // "UNREACHABLE"
  20026. Code string `json:"code,omitempty"`
  20027. // Data: [Output Only] Metadata about this warning in key: value format.
  20028. // For example:
  20029. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20030. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  20031. // Message: [Output Only] A human-readable description of the warning
  20032. // code.
  20033. Message string `json:"message,omitempty"`
  20034. // ForceSendFields is a list of field names (e.g. "Code") to
  20035. // unconditionally include in API requests. By default, fields with
  20036. // empty values are omitted from API requests. However, any non-pointer,
  20037. // non-interface field appearing in ForceSendFields will be sent to the
  20038. // server regardless of whether the field is empty or not. This may be
  20039. // used to include empty fields in Patch requests.
  20040. ForceSendFields []string `json:"-"`
  20041. // NullFields is a list of field names (e.g. "Code") to include in API
  20042. // requests with the JSON null value. By default, fields with empty
  20043. // values are omitted from API requests. However, any field with an
  20044. // empty value appearing in NullFields will be sent to the server as
  20045. // null. It is an error if a field in this list has a non-empty value.
  20046. // This may be used to include null fields in Patch requests.
  20047. NullFields []string `json:"-"`
  20048. }
  20049. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  20050. type NoMethod TargetVpnGatewayListWarning
  20051. raw := NoMethod(*s)
  20052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20053. }
  20054. type TargetVpnGatewayListWarningData struct {
  20055. // Key: [Output Only] A key that provides more detail on the warning
  20056. // being returned. For example, for warnings where there are no results
  20057. // in a list request for a particular zone, this key might be scope and
  20058. // the key value might be the zone name. Other examples might be a key
  20059. // indicating a deprecated resource and a suggested replacement, or a
  20060. // warning about invalid network settings (for example, if an instance
  20061. // attempts to perform IP forwarding but is not enabled for IP
  20062. // forwarding).
  20063. Key string `json:"key,omitempty"`
  20064. // Value: [Output Only] A warning data value corresponding to the key.
  20065. Value string `json:"value,omitempty"`
  20066. // ForceSendFields is a list of field names (e.g. "Key") to
  20067. // unconditionally include in API requests. By default, fields with
  20068. // empty values are omitted from API requests. However, any non-pointer,
  20069. // non-interface field appearing in ForceSendFields will be sent to the
  20070. // server regardless of whether the field is empty or not. This may be
  20071. // used to include empty fields in Patch requests.
  20072. ForceSendFields []string `json:"-"`
  20073. // NullFields is a list of field names (e.g. "Key") to include in API
  20074. // requests with the JSON null value. By default, fields with empty
  20075. // values are omitted from API requests. However, any field with an
  20076. // empty value appearing in NullFields will be sent to the server as
  20077. // null. It is an error if a field in this list has a non-empty value.
  20078. // This may be used to include null fields in Patch requests.
  20079. NullFields []string `json:"-"`
  20080. }
  20081. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  20082. type NoMethod TargetVpnGatewayListWarningData
  20083. raw := NoMethod(*s)
  20084. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20085. }
  20086. type TargetVpnGatewaysScopedList struct {
  20087. // TargetVpnGateways: [Output Only] A list of target vpn gateways
  20088. // contained in this scope.
  20089. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  20090. // Warning: [Output Only] Informational warning which replaces the list
  20091. // of addresses when the list is empty.
  20092. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  20093. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  20094. // to unconditionally include in API requests. By default, fields with
  20095. // empty values are omitted from API requests. However, any non-pointer,
  20096. // non-interface field appearing in ForceSendFields will be sent to the
  20097. // server regardless of whether the field is empty or not. This may be
  20098. // used to include empty fields in Patch requests.
  20099. ForceSendFields []string `json:"-"`
  20100. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  20101. // include in API requests with the JSON null value. By default, fields
  20102. // with empty values are omitted from API requests. However, any field
  20103. // with an empty value appearing in NullFields will be sent to the
  20104. // server as null. It is an error if a field in this list has a
  20105. // non-empty value. This may be used to include null fields in Patch
  20106. // requests.
  20107. NullFields []string `json:"-"`
  20108. }
  20109. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  20110. type NoMethod TargetVpnGatewaysScopedList
  20111. raw := NoMethod(*s)
  20112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20113. }
  20114. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  20115. // warning which replaces the list of addresses when the list is empty.
  20116. type TargetVpnGatewaysScopedListWarning struct {
  20117. // Code: [Output Only] A warning code, if applicable. For example,
  20118. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20119. // the response.
  20120. //
  20121. // Possible values:
  20122. // "CLEANUP_FAILED"
  20123. // "DEPRECATED_RESOURCE_USED"
  20124. // "DEPRECATED_TYPE_USED"
  20125. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20126. // "EXPERIMENTAL_TYPE_USED"
  20127. // "EXTERNAL_API_WARNING"
  20128. // "FIELD_VALUE_OVERRIDEN"
  20129. // "INJECTED_KERNELS_DEPRECATED"
  20130. // "MISSING_TYPE_DEPENDENCY"
  20131. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20132. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20133. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20134. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20135. // "NEXT_HOP_NOT_RUNNING"
  20136. // "NOT_CRITICAL_ERROR"
  20137. // "NO_RESULTS_ON_PAGE"
  20138. // "REQUIRED_TOS_AGREEMENT"
  20139. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20140. // "RESOURCE_NOT_DELETED"
  20141. // "SCHEMA_VALIDATION_IGNORED"
  20142. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20143. // "UNDECLARED_PROPERTIES"
  20144. // "UNREACHABLE"
  20145. Code string `json:"code,omitempty"`
  20146. // Data: [Output Only] Metadata about this warning in key: value format.
  20147. // For example:
  20148. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20149. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  20150. // Message: [Output Only] A human-readable description of the warning
  20151. // code.
  20152. Message string `json:"message,omitempty"`
  20153. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  20169. type NoMethod TargetVpnGatewaysScopedListWarning
  20170. raw := NoMethod(*s)
  20171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20172. }
  20173. type TargetVpnGatewaysScopedListWarningData struct {
  20174. // Key: [Output Only] A key that provides more detail on the warning
  20175. // being returned. For example, for warnings where there are no results
  20176. // in a list request for a particular zone, this key might be scope and
  20177. // the key value might be the zone name. Other examples might be a key
  20178. // indicating a deprecated resource and a suggested replacement, or a
  20179. // warning about invalid network settings (for example, if an instance
  20180. // attempts to perform IP forwarding but is not enabled for IP
  20181. // forwarding).
  20182. Key string `json:"key,omitempty"`
  20183. // Value: [Output Only] A warning data value corresponding to the key.
  20184. Value string `json:"value,omitempty"`
  20185. // ForceSendFields is a list of field names (e.g. "Key") to
  20186. // unconditionally include in API requests. By default, fields with
  20187. // empty values are omitted from API requests. However, any non-pointer,
  20188. // non-interface field appearing in ForceSendFields will be sent to the
  20189. // server regardless of whether the field is empty or not. This may be
  20190. // used to include empty fields in Patch requests.
  20191. ForceSendFields []string `json:"-"`
  20192. // NullFields is a list of field names (e.g. "Key") to include in API
  20193. // requests with the JSON null value. By default, fields with empty
  20194. // values are omitted from API requests. However, any field with an
  20195. // empty value appearing in NullFields will be sent to the server as
  20196. // null. It is an error if a field in this list has a non-empty value.
  20197. // This may be used to include null fields in Patch requests.
  20198. NullFields []string `json:"-"`
  20199. }
  20200. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  20201. type NoMethod TargetVpnGatewaysScopedListWarningData
  20202. raw := NoMethod(*s)
  20203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20204. }
  20205. type TestFailure struct {
  20206. ActualService string `json:"actualService,omitempty"`
  20207. ExpectedService string `json:"expectedService,omitempty"`
  20208. Host string `json:"host,omitempty"`
  20209. Path string `json:"path,omitempty"`
  20210. // ForceSendFields is a list of field names (e.g. "ActualService") to
  20211. // unconditionally include in API requests. By default, fields with
  20212. // empty values are omitted from API requests. However, any non-pointer,
  20213. // non-interface field appearing in ForceSendFields will be sent to the
  20214. // server regardless of whether the field is empty or not. This may be
  20215. // used to include empty fields in Patch requests.
  20216. ForceSendFields []string `json:"-"`
  20217. // NullFields is a list of field names (e.g. "ActualService") to include
  20218. // in API requests with the JSON null value. By default, fields with
  20219. // empty values are omitted from API requests. However, any field with
  20220. // an empty value appearing in NullFields will be sent to the server as
  20221. // null. It is an error if a field in this list has a non-empty value.
  20222. // This may be used to include null fields in Patch requests.
  20223. NullFields []string `json:"-"`
  20224. }
  20225. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  20226. type NoMethod TestFailure
  20227. raw := NoMethod(*s)
  20228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20229. }
  20230. type TestPermissionsRequest struct {
  20231. // Permissions: The set of permissions to check for the 'resource'.
  20232. // Permissions with wildcards (such as '*' or 'storage.*') are not
  20233. // allowed.
  20234. Permissions []string `json:"permissions,omitempty"`
  20235. // ForceSendFields is a list of field names (e.g. "Permissions") to
  20236. // unconditionally include in API requests. By default, fields with
  20237. // empty values are omitted from API requests. However, any non-pointer,
  20238. // non-interface field appearing in ForceSendFields will be sent to the
  20239. // server regardless of whether the field is empty or not. This may be
  20240. // used to include empty fields in Patch requests.
  20241. ForceSendFields []string `json:"-"`
  20242. // NullFields is a list of field names (e.g. "Permissions") to include
  20243. // in API requests with the JSON null value. By default, fields with
  20244. // empty values are omitted from API requests. However, any field with
  20245. // an empty value appearing in NullFields will be sent to the server as
  20246. // null. It is an error if a field in this list has a non-empty value.
  20247. // This may be used to include null fields in Patch requests.
  20248. NullFields []string `json:"-"`
  20249. }
  20250. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  20251. type NoMethod TestPermissionsRequest
  20252. raw := NoMethod(*s)
  20253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20254. }
  20255. type TestPermissionsResponse struct {
  20256. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  20257. // the caller is allowed.
  20258. Permissions []string `json:"permissions,omitempty"`
  20259. // ServerResponse contains the HTTP response code and headers from the
  20260. // server.
  20261. googleapi.ServerResponse `json:"-"`
  20262. // ForceSendFields is a list of field names (e.g. "Permissions") to
  20263. // unconditionally include in API requests. By default, fields with
  20264. // empty values are omitted from API requests. However, any non-pointer,
  20265. // non-interface field appearing in ForceSendFields will be sent to the
  20266. // server regardless of whether the field is empty or not. This may be
  20267. // used to include empty fields in Patch requests.
  20268. ForceSendFields []string `json:"-"`
  20269. // NullFields is a list of field names (e.g. "Permissions") to include
  20270. // in API requests with the JSON null value. By default, fields with
  20271. // empty values are omitted from API requests. However, any field with
  20272. // an empty value appearing in NullFields will be sent to the server as
  20273. // null. It is an error if a field in this list has a non-empty value.
  20274. // This may be used to include null fields in Patch requests.
  20275. NullFields []string `json:"-"`
  20276. }
  20277. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  20278. type NoMethod TestPermissionsResponse
  20279. raw := NoMethod(*s)
  20280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20281. }
  20282. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  20283. // to the BackendService resource, based on the "longest-match" of the
  20284. // URL's host and path.
  20285. type UrlMap struct {
  20286. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20287. // format.
  20288. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20289. // DefaultService: The URL of the BackendService resource if none of the
  20290. // hostRules match.
  20291. DefaultService string `json:"defaultService,omitempty"`
  20292. // Description: An optional description of this resource. Provide this
  20293. // property when you create the resource.
  20294. Description string `json:"description,omitempty"`
  20295. // Fingerprint: Fingerprint of this resource. A hash of the contents
  20296. // stored in this object. This field is used in optimistic locking. This
  20297. // field will be ignored when inserting a UrlMap. An up-to-date
  20298. // fingerprint must be provided in order to update the UrlMap.
  20299. Fingerprint string `json:"fingerprint,omitempty"`
  20300. // HostRules: The list of HostRules to use against the URL.
  20301. HostRules []*HostRule `json:"hostRules,omitempty"`
  20302. // Id: [Output Only] The unique identifier for the resource. This
  20303. // identifier is defined by the server.
  20304. Id uint64 `json:"id,omitempty,string"`
  20305. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  20306. // url maps.
  20307. Kind string `json:"kind,omitempty"`
  20308. // Name: Name of the resource. Provided by the client when the resource
  20309. // is created. The name must be 1-63 characters long, and comply with
  20310. // RFC1035. Specifically, the name must be 1-63 characters long and
  20311. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  20312. // the first character must be a lowercase letter, and all following
  20313. // characters must be a dash, lowercase letter, or digit, except the
  20314. // last character, which cannot be a dash.
  20315. Name string `json:"name,omitempty"`
  20316. // PathMatchers: The list of named PathMatchers to use against the URL.
  20317. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  20318. // SelfLink: [Output Only] Server-defined URL for the resource.
  20319. SelfLink string `json:"selfLink,omitempty"`
  20320. // Tests: The list of expected URL mapping tests. Request to update this
  20321. // UrlMap will succeed only if all of the test cases pass. You can
  20322. // specify a maximum of 100 tests per UrlMap.
  20323. Tests []*UrlMapTest `json:"tests,omitempty"`
  20324. // ServerResponse contains the HTTP response code and headers from the
  20325. // server.
  20326. googleapi.ServerResponse `json:"-"`
  20327. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20328. // to unconditionally include in API requests. By default, fields with
  20329. // empty values are omitted from API requests. However, any non-pointer,
  20330. // non-interface field appearing in ForceSendFields will be sent to the
  20331. // server regardless of whether the field is empty or not. This may be
  20332. // used to include empty fields in Patch requests.
  20333. ForceSendFields []string `json:"-"`
  20334. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20335. // include in API requests with the JSON null value. By default, fields
  20336. // with empty values are omitted from API requests. However, any field
  20337. // with an empty value appearing in NullFields will be sent to the
  20338. // server as null. It is an error if a field in this list has a
  20339. // non-empty value. This may be used to include null fields in Patch
  20340. // requests.
  20341. NullFields []string `json:"-"`
  20342. }
  20343. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  20344. type NoMethod UrlMap
  20345. raw := NoMethod(*s)
  20346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20347. }
  20348. // UrlMapList: Contains a list of UrlMap resources.
  20349. type UrlMapList struct {
  20350. // Id: [Output Only] Unique identifier for the resource; defined by the
  20351. // server.
  20352. Id string `json:"id,omitempty"`
  20353. // Items: A list of UrlMap resources.
  20354. Items []*UrlMap `json:"items,omitempty"`
  20355. // Kind: Type of resource.
  20356. Kind string `json:"kind,omitempty"`
  20357. // NextPageToken: [Output Only] This token allows you to get the next
  20358. // page of results for list requests. If the number of results is larger
  20359. // than maxResults, use the nextPageToken as a value for the query
  20360. // parameter pageToken in the next list request. Subsequent list
  20361. // requests will have their own nextPageToken to continue paging through
  20362. // the results.
  20363. NextPageToken string `json:"nextPageToken,omitempty"`
  20364. // SelfLink: [Output Only] Server-defined URL for this resource.
  20365. SelfLink string `json:"selfLink,omitempty"`
  20366. // Warning: [Output Only] Informational warning message.
  20367. Warning *UrlMapListWarning `json:"warning,omitempty"`
  20368. // ServerResponse contains the HTTP response code and headers from the
  20369. // server.
  20370. googleapi.ServerResponse `json:"-"`
  20371. // ForceSendFields is a list of field names (e.g. "Id") to
  20372. // unconditionally include in API requests. By default, fields with
  20373. // empty values are omitted from API requests. However, any non-pointer,
  20374. // non-interface field appearing in ForceSendFields will be sent to the
  20375. // server regardless of whether the field is empty or not. This may be
  20376. // used to include empty fields in Patch requests.
  20377. ForceSendFields []string `json:"-"`
  20378. // NullFields is a list of field names (e.g. "Id") to include in API
  20379. // requests with the JSON null value. By default, fields with empty
  20380. // values are omitted from API requests. However, any field with an
  20381. // empty value appearing in NullFields will be sent to the server as
  20382. // null. It is an error if a field in this list has a non-empty value.
  20383. // This may be used to include null fields in Patch requests.
  20384. NullFields []string `json:"-"`
  20385. }
  20386. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  20387. type NoMethod UrlMapList
  20388. raw := NoMethod(*s)
  20389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20390. }
  20391. // UrlMapListWarning: [Output Only] Informational warning message.
  20392. type UrlMapListWarning struct {
  20393. // Code: [Output Only] A warning code, if applicable. For example,
  20394. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20395. // the response.
  20396. //
  20397. // Possible values:
  20398. // "CLEANUP_FAILED"
  20399. // "DEPRECATED_RESOURCE_USED"
  20400. // "DEPRECATED_TYPE_USED"
  20401. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20402. // "EXPERIMENTAL_TYPE_USED"
  20403. // "EXTERNAL_API_WARNING"
  20404. // "FIELD_VALUE_OVERRIDEN"
  20405. // "INJECTED_KERNELS_DEPRECATED"
  20406. // "MISSING_TYPE_DEPENDENCY"
  20407. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20408. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20409. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20410. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20411. // "NEXT_HOP_NOT_RUNNING"
  20412. // "NOT_CRITICAL_ERROR"
  20413. // "NO_RESULTS_ON_PAGE"
  20414. // "REQUIRED_TOS_AGREEMENT"
  20415. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20416. // "RESOURCE_NOT_DELETED"
  20417. // "SCHEMA_VALIDATION_IGNORED"
  20418. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20419. // "UNDECLARED_PROPERTIES"
  20420. // "UNREACHABLE"
  20421. Code string `json:"code,omitempty"`
  20422. // Data: [Output Only] Metadata about this warning in key: value format.
  20423. // For example:
  20424. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20425. Data []*UrlMapListWarningData `json:"data,omitempty"`
  20426. // Message: [Output Only] A human-readable description of the warning
  20427. // code.
  20428. Message string `json:"message,omitempty"`
  20429. // ForceSendFields is a list of field names (e.g. "Code") to
  20430. // unconditionally include in API requests. By default, fields with
  20431. // empty values are omitted from API requests. However, any non-pointer,
  20432. // non-interface field appearing in ForceSendFields will be sent to the
  20433. // server regardless of whether the field is empty or not. This may be
  20434. // used to include empty fields in Patch requests.
  20435. ForceSendFields []string `json:"-"`
  20436. // NullFields is a list of field names (e.g. "Code") to include in API
  20437. // requests with the JSON null value. By default, fields with empty
  20438. // values are omitted from API requests. However, any field with an
  20439. // empty value appearing in NullFields will be sent to the server as
  20440. // null. It is an error if a field in this list has a non-empty value.
  20441. // This may be used to include null fields in Patch requests.
  20442. NullFields []string `json:"-"`
  20443. }
  20444. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  20445. type NoMethod UrlMapListWarning
  20446. raw := NoMethod(*s)
  20447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20448. }
  20449. type UrlMapListWarningData struct {
  20450. // Key: [Output Only] A key that provides more detail on the warning
  20451. // being returned. For example, for warnings where there are no results
  20452. // in a list request for a particular zone, this key might be scope and
  20453. // the key value might be the zone name. Other examples might be a key
  20454. // indicating a deprecated resource and a suggested replacement, or a
  20455. // warning about invalid network settings (for example, if an instance
  20456. // attempts to perform IP forwarding but is not enabled for IP
  20457. // forwarding).
  20458. Key string `json:"key,omitempty"`
  20459. // Value: [Output Only] A warning data value corresponding to the key.
  20460. Value string `json:"value,omitempty"`
  20461. // ForceSendFields is a list of field names (e.g. "Key") to
  20462. // unconditionally include in API requests. By default, fields with
  20463. // empty values are omitted from API requests. However, any non-pointer,
  20464. // non-interface field appearing in ForceSendFields will be sent to the
  20465. // server regardless of whether the field is empty or not. This may be
  20466. // used to include empty fields in Patch requests.
  20467. ForceSendFields []string `json:"-"`
  20468. // NullFields is a list of field names (e.g. "Key") to include in API
  20469. // requests with the JSON null value. By default, fields with empty
  20470. // values are omitted from API requests. However, any field with an
  20471. // empty value appearing in NullFields will be sent to the server as
  20472. // null. It is an error if a field in this list has a non-empty value.
  20473. // This may be used to include null fields in Patch requests.
  20474. NullFields []string `json:"-"`
  20475. }
  20476. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  20477. type NoMethod UrlMapListWarningData
  20478. raw := NoMethod(*s)
  20479. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20480. }
  20481. type UrlMapReference struct {
  20482. UrlMap string `json:"urlMap,omitempty"`
  20483. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  20484. // unconditionally include in API requests. By default, fields with
  20485. // empty values are omitted from API requests. However, any non-pointer,
  20486. // non-interface field appearing in ForceSendFields will be sent to the
  20487. // server regardless of whether the field is empty or not. This may be
  20488. // used to include empty fields in Patch requests.
  20489. ForceSendFields []string `json:"-"`
  20490. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  20491. // requests with the JSON null value. By default, fields with empty
  20492. // values are omitted from API requests. However, any field with an
  20493. // empty value appearing in NullFields will be sent to the server as
  20494. // null. It is an error if a field in this list has a non-empty value.
  20495. // This may be used to include null fields in Patch requests.
  20496. NullFields []string `json:"-"`
  20497. }
  20498. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  20499. type NoMethod UrlMapReference
  20500. raw := NoMethod(*s)
  20501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20502. }
  20503. // UrlMapTest: Message for the expected URL mappings.
  20504. type UrlMapTest struct {
  20505. // Description: Description of this test case.
  20506. Description string `json:"description,omitempty"`
  20507. // Host: Host portion of the URL.
  20508. Host string `json:"host,omitempty"`
  20509. // Path: Path portion of the URL.
  20510. Path string `json:"path,omitempty"`
  20511. // Service: Expected BackendService resource the given URL should be
  20512. // mapped to.
  20513. Service string `json:"service,omitempty"`
  20514. // ForceSendFields is a list of field names (e.g. "Description") to
  20515. // unconditionally include in API requests. By default, fields with
  20516. // empty values are omitted from API requests. However, any non-pointer,
  20517. // non-interface field appearing in ForceSendFields will be sent to the
  20518. // server regardless of whether the field is empty or not. This may be
  20519. // used to include empty fields in Patch requests.
  20520. ForceSendFields []string `json:"-"`
  20521. // NullFields is a list of field names (e.g. "Description") to include
  20522. // in API requests with the JSON null value. By default, fields with
  20523. // empty values are omitted from API requests. However, any field with
  20524. // an empty value appearing in NullFields will be sent to the server as
  20525. // null. It is an error if a field in this list has a non-empty value.
  20526. // This may be used to include null fields in Patch requests.
  20527. NullFields []string `json:"-"`
  20528. }
  20529. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  20530. type NoMethod UrlMapTest
  20531. raw := NoMethod(*s)
  20532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20533. }
  20534. // UrlMapValidationResult: Message representing the validation result
  20535. // for a UrlMap.
  20536. type UrlMapValidationResult struct {
  20537. LoadErrors []string `json:"loadErrors,omitempty"`
  20538. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  20539. // If false, 'loadErrors' indicates the reasons.
  20540. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  20541. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  20542. // TestPassed: If successfully loaded, this field indicates whether the
  20543. // test passed. If false, 'testFailures's indicate the reason of
  20544. // failure.
  20545. TestPassed bool `json:"testPassed,omitempty"`
  20546. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  20547. // unconditionally include in API requests. By default, fields with
  20548. // empty values are omitted from API requests. However, any non-pointer,
  20549. // non-interface field appearing in ForceSendFields will be sent to the
  20550. // server regardless of whether the field is empty or not. This may be
  20551. // used to include empty fields in Patch requests.
  20552. ForceSendFields []string `json:"-"`
  20553. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  20554. // API requests with the JSON null value. By default, fields with empty
  20555. // values are omitted from API requests. However, any field with an
  20556. // empty value appearing in NullFields will be sent to the server as
  20557. // null. It is an error if a field in this list has a non-empty value.
  20558. // This may be used to include null fields in Patch requests.
  20559. NullFields []string `json:"-"`
  20560. }
  20561. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  20562. type NoMethod UrlMapValidationResult
  20563. raw := NoMethod(*s)
  20564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20565. }
  20566. type UrlMapsValidateRequest struct {
  20567. // Resource: Content of the UrlMap to be validated.
  20568. Resource *UrlMap `json:"resource,omitempty"`
  20569. // ForceSendFields is a list of field names (e.g. "Resource") to
  20570. // unconditionally include in API requests. By default, fields with
  20571. // empty values are omitted from API requests. However, any non-pointer,
  20572. // non-interface field appearing in ForceSendFields will be sent to the
  20573. // server regardless of whether the field is empty or not. This may be
  20574. // used to include empty fields in Patch requests.
  20575. ForceSendFields []string `json:"-"`
  20576. // NullFields is a list of field names (e.g. "Resource") to include in
  20577. // API requests with the JSON null value. By default, fields with empty
  20578. // values are omitted from API requests. However, any field with an
  20579. // empty value appearing in NullFields will be sent to the server as
  20580. // null. It is an error if a field in this list has a non-empty value.
  20581. // This may be used to include null fields in Patch requests.
  20582. NullFields []string `json:"-"`
  20583. }
  20584. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  20585. type NoMethod UrlMapsValidateRequest
  20586. raw := NoMethod(*s)
  20587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20588. }
  20589. type UrlMapsValidateResponse struct {
  20590. Result *UrlMapValidationResult `json:"result,omitempty"`
  20591. // ServerResponse contains the HTTP response code and headers from the
  20592. // server.
  20593. googleapi.ServerResponse `json:"-"`
  20594. // ForceSendFields is a list of field names (e.g. "Result") to
  20595. // unconditionally include in API requests. By default, fields with
  20596. // empty values are omitted from API requests. However, any non-pointer,
  20597. // non-interface field appearing in ForceSendFields will be sent to the
  20598. // server regardless of whether the field is empty or not. This may be
  20599. // used to include empty fields in Patch requests.
  20600. ForceSendFields []string `json:"-"`
  20601. // NullFields is a list of field names (e.g. "Result") to include in API
  20602. // requests with the JSON null value. By default, fields with empty
  20603. // values are omitted from API requests. However, any field with an
  20604. // empty value appearing in NullFields will be sent to the server as
  20605. // null. It is an error if a field in this list has a non-empty value.
  20606. // This may be used to include null fields in Patch requests.
  20607. NullFields []string `json:"-"`
  20608. }
  20609. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  20610. type NoMethod UrlMapsValidateResponse
  20611. raw := NoMethod(*s)
  20612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20613. }
  20614. // UsageExportLocation: The location in Cloud Storage and naming method
  20615. // of the daily usage report. Contains bucket_name and report_name
  20616. // prefix.
  20617. type UsageExportLocation struct {
  20618. // BucketName: The name of an existing bucket in Cloud Storage where the
  20619. // usage report object is stored. The Google Service Account is granted
  20620. // write access to this bucket. This can either be the bucket name by
  20621. // itself, such as example-bucket, or the bucket name with gs:// or
  20622. // https://storage.googleapis.com/ in front of it, such as
  20623. // gs://example-bucket.
  20624. BucketName string `json:"bucketName,omitempty"`
  20625. // ReportNamePrefix: An optional prefix for the name of the usage report
  20626. // object stored in bucketName. If not supplied, defaults to usage. The
  20627. // report is stored as a CSV file named
  20628. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  20629. // usage according to Pacific Time. If you supply a prefix, it should
  20630. // conform to Cloud Storage object naming conventions.
  20631. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  20632. // ForceSendFields is a list of field names (e.g. "BucketName") to
  20633. // unconditionally include in API requests. By default, fields with
  20634. // empty values are omitted from API requests. However, any non-pointer,
  20635. // non-interface field appearing in ForceSendFields will be sent to the
  20636. // server regardless of whether the field is empty or not. This may be
  20637. // used to include empty fields in Patch requests.
  20638. ForceSendFields []string `json:"-"`
  20639. // NullFields is a list of field names (e.g. "BucketName") to include in
  20640. // API requests with the JSON null value. By default, fields with empty
  20641. // values are omitted from API requests. However, any field with an
  20642. // empty value appearing in NullFields will be sent to the server as
  20643. // null. It is an error if a field in this list has a non-empty value.
  20644. // This may be used to include null fields in Patch requests.
  20645. NullFields []string `json:"-"`
  20646. }
  20647. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  20648. type NoMethod UsageExportLocation
  20649. raw := NoMethod(*s)
  20650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20651. }
  20652. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  20653. // (== resource_for v1.vpnTunnels ==)
  20654. type VpnTunnel struct {
  20655. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20656. // format.
  20657. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20658. // Description: An optional description of this resource. Provide this
  20659. // property when you create the resource.
  20660. Description string `json:"description,omitempty"`
  20661. // DetailedStatus: [Output Only] Detailed status message for the VPN
  20662. // tunnel.
  20663. DetailedStatus string `json:"detailedStatus,omitempty"`
  20664. // Id: [Output Only] The unique identifier for the resource. This
  20665. // identifier is defined by the server.
  20666. Id uint64 `json:"id,omitempty,string"`
  20667. // IkeVersion: IKE protocol version to use when establishing the VPN
  20668. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  20669. // Default version is 2.
  20670. IkeVersion int64 `json:"ikeVersion,omitempty"`
  20671. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  20672. // VPN tunnels.
  20673. Kind string `json:"kind,omitempty"`
  20674. // LocalTrafficSelector: Local traffic selector to use when establishing
  20675. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  20676. // formatted string, for example: 192.168.0.0/16. The ranges should be
  20677. // disjoint. Only IPv4 is supported.
  20678. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  20679. // Name: Name of the resource. Provided by the client when the resource
  20680. // is created. The name must be 1-63 characters long, and comply with
  20681. // RFC1035. Specifically, the name must be 1-63 characters long and
  20682. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  20683. // the first character must be a lowercase letter, and all following
  20684. // characters must be a dash, lowercase letter, or digit, except the
  20685. // last character, which cannot be a dash.
  20686. Name string `json:"name,omitempty"`
  20687. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  20688. PeerIp string `json:"peerIp,omitempty"`
  20689. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  20690. // You must specify this field as part of the HTTP request URL. It is
  20691. // not settable as a field in the request body.
  20692. Region string `json:"region,omitempty"`
  20693. // RemoteTrafficSelector: Remote traffic selectors to use when
  20694. // establishing the VPN tunnel with peer VPN gateway. The value should
  20695. // be a CIDR formatted string, for example: 192.168.0.0/16. The ranges
  20696. // should be disjoint. Only IPv4 is supported.
  20697. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  20698. // Router: URL of router resource to be used for dynamic routing.
  20699. Router string `json:"router,omitempty"`
  20700. // SelfLink: [Output Only] Server-defined URL for the resource.
  20701. SelfLink string `json:"selfLink,omitempty"`
  20702. // SharedSecret: Shared secret used to set the secure session between
  20703. // the Cloud VPN gateway and the peer VPN gateway.
  20704. SharedSecret string `json:"sharedSecret,omitempty"`
  20705. // SharedSecretHash: Hash of the shared secret.
  20706. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  20707. // Status: [Output Only] The status of the VPN tunnel.
  20708. //
  20709. // Possible values:
  20710. // "ALLOCATING_RESOURCES"
  20711. // "AUTHORIZATION_ERROR"
  20712. // "DEPROVISIONING"
  20713. // "ESTABLISHED"
  20714. // "FAILED"
  20715. // "FIRST_HANDSHAKE"
  20716. // "NEGOTIATION_FAILURE"
  20717. // "NETWORK_ERROR"
  20718. // "NO_INCOMING_PACKETS"
  20719. // "PROVISIONING"
  20720. // "REJECTED"
  20721. // "WAITING_FOR_FULL_CONFIG"
  20722. Status string `json:"status,omitempty"`
  20723. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  20724. // tunnel is associated. Provided by the client when the VPN tunnel is
  20725. // created.
  20726. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  20727. // ServerResponse contains the HTTP response code and headers from the
  20728. // server.
  20729. googleapi.ServerResponse `json:"-"`
  20730. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20731. // to unconditionally include in API requests. By default, fields with
  20732. // empty values are omitted from API requests. However, any non-pointer,
  20733. // non-interface field appearing in ForceSendFields will be sent to the
  20734. // server regardless of whether the field is empty or not. This may be
  20735. // used to include empty fields in Patch requests.
  20736. ForceSendFields []string `json:"-"`
  20737. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20738. // include in API requests with the JSON null value. By default, fields
  20739. // with empty values are omitted from API requests. However, any field
  20740. // with an empty value appearing in NullFields will be sent to the
  20741. // server as null. It is an error if a field in this list has a
  20742. // non-empty value. This may be used to include null fields in Patch
  20743. // requests.
  20744. NullFields []string `json:"-"`
  20745. }
  20746. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  20747. type NoMethod VpnTunnel
  20748. raw := NoMethod(*s)
  20749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20750. }
  20751. type VpnTunnelAggregatedList struct {
  20752. // Id: [Output Only] Unique identifier for the resource; defined by the
  20753. // server.
  20754. Id string `json:"id,omitempty"`
  20755. // Items: A list of VpnTunnelsScopedList resources.
  20756. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  20757. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  20758. // VPN tunnels.
  20759. Kind string `json:"kind,omitempty"`
  20760. // NextPageToken: [Output Only] This token allows you to get the next
  20761. // page of results for list requests. If the number of results is larger
  20762. // than maxResults, use the nextPageToken as a value for the query
  20763. // parameter pageToken in the next list request. Subsequent list
  20764. // requests will have their own nextPageToken to continue paging through
  20765. // the results.
  20766. NextPageToken string `json:"nextPageToken,omitempty"`
  20767. // SelfLink: [Output Only] Server-defined URL for this resource.
  20768. SelfLink string `json:"selfLink,omitempty"`
  20769. // Warning: [Output Only] Informational warning message.
  20770. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  20771. // ServerResponse contains the HTTP response code and headers from the
  20772. // server.
  20773. googleapi.ServerResponse `json:"-"`
  20774. // ForceSendFields is a list of field names (e.g. "Id") to
  20775. // unconditionally include in API requests. By default, fields with
  20776. // empty values are omitted from API requests. However, any non-pointer,
  20777. // non-interface field appearing in ForceSendFields will be sent to the
  20778. // server regardless of whether the field is empty or not. This may be
  20779. // used to include empty fields in Patch requests.
  20780. ForceSendFields []string `json:"-"`
  20781. // NullFields is a list of field names (e.g. "Id") to include in API
  20782. // requests with the JSON null value. By default, fields with empty
  20783. // values are omitted from API requests. However, any field with an
  20784. // empty value appearing in NullFields will be sent to the server as
  20785. // null. It is an error if a field in this list has a non-empty value.
  20786. // This may be used to include null fields in Patch requests.
  20787. NullFields []string `json:"-"`
  20788. }
  20789. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  20790. type NoMethod VpnTunnelAggregatedList
  20791. raw := NoMethod(*s)
  20792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20793. }
  20794. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  20795. // message.
  20796. type VpnTunnelAggregatedListWarning struct {
  20797. // Code: [Output Only] A warning code, if applicable. For example,
  20798. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20799. // the response.
  20800. //
  20801. // Possible values:
  20802. // "CLEANUP_FAILED"
  20803. // "DEPRECATED_RESOURCE_USED"
  20804. // "DEPRECATED_TYPE_USED"
  20805. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20806. // "EXPERIMENTAL_TYPE_USED"
  20807. // "EXTERNAL_API_WARNING"
  20808. // "FIELD_VALUE_OVERRIDEN"
  20809. // "INJECTED_KERNELS_DEPRECATED"
  20810. // "MISSING_TYPE_DEPENDENCY"
  20811. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20812. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20813. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20814. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20815. // "NEXT_HOP_NOT_RUNNING"
  20816. // "NOT_CRITICAL_ERROR"
  20817. // "NO_RESULTS_ON_PAGE"
  20818. // "REQUIRED_TOS_AGREEMENT"
  20819. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20820. // "RESOURCE_NOT_DELETED"
  20821. // "SCHEMA_VALIDATION_IGNORED"
  20822. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20823. // "UNDECLARED_PROPERTIES"
  20824. // "UNREACHABLE"
  20825. Code string `json:"code,omitempty"`
  20826. // Data: [Output Only] Metadata about this warning in key: value format.
  20827. // For example:
  20828. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20829. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  20830. // Message: [Output Only] A human-readable description of the warning
  20831. // code.
  20832. Message string `json:"message,omitempty"`
  20833. // ForceSendFields is a list of field names (e.g. "Code") to
  20834. // unconditionally include in API requests. By default, fields with
  20835. // empty values are omitted from API requests. However, any non-pointer,
  20836. // non-interface field appearing in ForceSendFields will be sent to the
  20837. // server regardless of whether the field is empty or not. This may be
  20838. // used to include empty fields in Patch requests.
  20839. ForceSendFields []string `json:"-"`
  20840. // NullFields is a list of field names (e.g. "Code") to include in API
  20841. // requests with the JSON null value. By default, fields with empty
  20842. // values are omitted from API requests. However, any field with an
  20843. // empty value appearing in NullFields will be sent to the server as
  20844. // null. It is an error if a field in this list has a non-empty value.
  20845. // This may be used to include null fields in Patch requests.
  20846. NullFields []string `json:"-"`
  20847. }
  20848. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  20849. type NoMethod VpnTunnelAggregatedListWarning
  20850. raw := NoMethod(*s)
  20851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20852. }
  20853. type VpnTunnelAggregatedListWarningData struct {
  20854. // Key: [Output Only] A key that provides more detail on the warning
  20855. // being returned. For example, for warnings where there are no results
  20856. // in a list request for a particular zone, this key might be scope and
  20857. // the key value might be the zone name. Other examples might be a key
  20858. // indicating a deprecated resource and a suggested replacement, or a
  20859. // warning about invalid network settings (for example, if an instance
  20860. // attempts to perform IP forwarding but is not enabled for IP
  20861. // forwarding).
  20862. Key string `json:"key,omitempty"`
  20863. // Value: [Output Only] A warning data value corresponding to the key.
  20864. Value string `json:"value,omitempty"`
  20865. // ForceSendFields is a list of field names (e.g. "Key") to
  20866. // unconditionally include in API requests. By default, fields with
  20867. // empty values are omitted from API requests. However, any non-pointer,
  20868. // non-interface field appearing in ForceSendFields will be sent to the
  20869. // server regardless of whether the field is empty or not. This may be
  20870. // used to include empty fields in Patch requests.
  20871. ForceSendFields []string `json:"-"`
  20872. // NullFields is a list of field names (e.g. "Key") to include in API
  20873. // requests with the JSON null value. By default, fields with empty
  20874. // values are omitted from API requests. However, any field with an
  20875. // empty value appearing in NullFields will be sent to the server as
  20876. // null. It is an error if a field in this list has a non-empty value.
  20877. // This may be used to include null fields in Patch requests.
  20878. NullFields []string `json:"-"`
  20879. }
  20880. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  20881. type NoMethod VpnTunnelAggregatedListWarningData
  20882. raw := NoMethod(*s)
  20883. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20884. }
  20885. // VpnTunnelList: Contains a list of VpnTunnel resources.
  20886. type VpnTunnelList struct {
  20887. // Id: [Output Only] Unique identifier for the resource; defined by the
  20888. // server.
  20889. Id string `json:"id,omitempty"`
  20890. // Items: A list of VpnTunnel resources.
  20891. Items []*VpnTunnel `json:"items,omitempty"`
  20892. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  20893. // VPN tunnels.
  20894. Kind string `json:"kind,omitempty"`
  20895. // NextPageToken: [Output Only] This token allows you to get the next
  20896. // page of results for list requests. If the number of results is larger
  20897. // than maxResults, use the nextPageToken as a value for the query
  20898. // parameter pageToken in the next list request. Subsequent list
  20899. // requests will have their own nextPageToken to continue paging through
  20900. // the results.
  20901. NextPageToken string `json:"nextPageToken,omitempty"`
  20902. // SelfLink: [Output Only] Server-defined URL for this resource.
  20903. SelfLink string `json:"selfLink,omitempty"`
  20904. // Warning: [Output Only] Informational warning message.
  20905. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  20906. // ServerResponse contains the HTTP response code and headers from the
  20907. // server.
  20908. googleapi.ServerResponse `json:"-"`
  20909. // ForceSendFields is a list of field names (e.g. "Id") to
  20910. // unconditionally include in API requests. By default, fields with
  20911. // empty values are omitted from API requests. However, any non-pointer,
  20912. // non-interface field appearing in ForceSendFields will be sent to the
  20913. // server regardless of whether the field is empty or not. This may be
  20914. // used to include empty fields in Patch requests.
  20915. ForceSendFields []string `json:"-"`
  20916. // NullFields is a list of field names (e.g. "Id") to include in API
  20917. // requests with the JSON null value. By default, fields with empty
  20918. // values are omitted from API requests. However, any field with an
  20919. // empty value appearing in NullFields will be sent to the server as
  20920. // null. It is an error if a field in this list has a non-empty value.
  20921. // This may be used to include null fields in Patch requests.
  20922. NullFields []string `json:"-"`
  20923. }
  20924. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  20925. type NoMethod VpnTunnelList
  20926. raw := NoMethod(*s)
  20927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20928. }
  20929. // VpnTunnelListWarning: [Output Only] Informational warning message.
  20930. type VpnTunnelListWarning struct {
  20931. // Code: [Output Only] A warning code, if applicable. For example,
  20932. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20933. // the response.
  20934. //
  20935. // Possible values:
  20936. // "CLEANUP_FAILED"
  20937. // "DEPRECATED_RESOURCE_USED"
  20938. // "DEPRECATED_TYPE_USED"
  20939. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20940. // "EXPERIMENTAL_TYPE_USED"
  20941. // "EXTERNAL_API_WARNING"
  20942. // "FIELD_VALUE_OVERRIDEN"
  20943. // "INJECTED_KERNELS_DEPRECATED"
  20944. // "MISSING_TYPE_DEPENDENCY"
  20945. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20946. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20947. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20948. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20949. // "NEXT_HOP_NOT_RUNNING"
  20950. // "NOT_CRITICAL_ERROR"
  20951. // "NO_RESULTS_ON_PAGE"
  20952. // "REQUIRED_TOS_AGREEMENT"
  20953. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20954. // "RESOURCE_NOT_DELETED"
  20955. // "SCHEMA_VALIDATION_IGNORED"
  20956. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20957. // "UNDECLARED_PROPERTIES"
  20958. // "UNREACHABLE"
  20959. Code string `json:"code,omitempty"`
  20960. // Data: [Output Only] Metadata about this warning in key: value format.
  20961. // For example:
  20962. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20963. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  20964. // Message: [Output Only] A human-readable description of the warning
  20965. // code.
  20966. Message string `json:"message,omitempty"`
  20967. // ForceSendFields is a list of field names (e.g. "Code") to
  20968. // unconditionally include in API requests. By default, fields with
  20969. // empty values are omitted from API requests. However, any non-pointer,
  20970. // non-interface field appearing in ForceSendFields will be sent to the
  20971. // server regardless of whether the field is empty or not. This may be
  20972. // used to include empty fields in Patch requests.
  20973. ForceSendFields []string `json:"-"`
  20974. // NullFields is a list of field names (e.g. "Code") to include in API
  20975. // requests with the JSON null value. By default, fields with empty
  20976. // values are omitted from API requests. However, any field with an
  20977. // empty value appearing in NullFields will be sent to the server as
  20978. // null. It is an error if a field in this list has a non-empty value.
  20979. // This may be used to include null fields in Patch requests.
  20980. NullFields []string `json:"-"`
  20981. }
  20982. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  20983. type NoMethod VpnTunnelListWarning
  20984. raw := NoMethod(*s)
  20985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20986. }
  20987. type VpnTunnelListWarningData struct {
  20988. // Key: [Output Only] A key that provides more detail on the warning
  20989. // being returned. For example, for warnings where there are no results
  20990. // in a list request for a particular zone, this key might be scope and
  20991. // the key value might be the zone name. Other examples might be a key
  20992. // indicating a deprecated resource and a suggested replacement, or a
  20993. // warning about invalid network settings (for example, if an instance
  20994. // attempts to perform IP forwarding but is not enabled for IP
  20995. // forwarding).
  20996. Key string `json:"key,omitempty"`
  20997. // Value: [Output Only] A warning data value corresponding to the key.
  20998. Value string `json:"value,omitempty"`
  20999. // ForceSendFields is a list of field names (e.g. "Key") to
  21000. // unconditionally include in API requests. By default, fields with
  21001. // empty values are omitted from API requests. However, any non-pointer,
  21002. // non-interface field appearing in ForceSendFields will be sent to the
  21003. // server regardless of whether the field is empty or not. This may be
  21004. // used to include empty fields in Patch requests.
  21005. ForceSendFields []string `json:"-"`
  21006. // NullFields is a list of field names (e.g. "Key") to include in API
  21007. // requests with the JSON null value. By default, fields with empty
  21008. // values are omitted from API requests. However, any field with an
  21009. // empty value appearing in NullFields will be sent to the server as
  21010. // null. It is an error if a field in this list has a non-empty value.
  21011. // This may be used to include null fields in Patch requests.
  21012. NullFields []string `json:"-"`
  21013. }
  21014. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  21015. type NoMethod VpnTunnelListWarningData
  21016. raw := NoMethod(*s)
  21017. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21018. }
  21019. type VpnTunnelsScopedList struct {
  21020. // VpnTunnels: A list of vpn tunnels contained in this scope.
  21021. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  21022. // Warning: Informational warning which replaces the list of addresses
  21023. // when the list is empty.
  21024. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  21025. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  21026. // unconditionally include in API requests. By default, fields with
  21027. // empty values are omitted from API requests. However, any non-pointer,
  21028. // non-interface field appearing in ForceSendFields will be sent to the
  21029. // server regardless of whether the field is empty or not. This may be
  21030. // used to include empty fields in Patch requests.
  21031. ForceSendFields []string `json:"-"`
  21032. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  21033. // API requests with the JSON null value. By default, fields with empty
  21034. // values are omitted from API requests. However, any field with an
  21035. // empty value appearing in NullFields will be sent to the server as
  21036. // null. It is an error if a field in this list has a non-empty value.
  21037. // This may be used to include null fields in Patch requests.
  21038. NullFields []string `json:"-"`
  21039. }
  21040. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  21041. type NoMethod VpnTunnelsScopedList
  21042. raw := NoMethod(*s)
  21043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21044. }
  21045. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  21046. // list of addresses when the list is empty.
  21047. type VpnTunnelsScopedListWarning struct {
  21048. // Code: [Output Only] A warning code, if applicable. For example,
  21049. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21050. // the response.
  21051. //
  21052. // Possible values:
  21053. // "CLEANUP_FAILED"
  21054. // "DEPRECATED_RESOURCE_USED"
  21055. // "DEPRECATED_TYPE_USED"
  21056. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21057. // "EXPERIMENTAL_TYPE_USED"
  21058. // "EXTERNAL_API_WARNING"
  21059. // "FIELD_VALUE_OVERRIDEN"
  21060. // "INJECTED_KERNELS_DEPRECATED"
  21061. // "MISSING_TYPE_DEPENDENCY"
  21062. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21063. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21064. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21065. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21066. // "NEXT_HOP_NOT_RUNNING"
  21067. // "NOT_CRITICAL_ERROR"
  21068. // "NO_RESULTS_ON_PAGE"
  21069. // "REQUIRED_TOS_AGREEMENT"
  21070. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21071. // "RESOURCE_NOT_DELETED"
  21072. // "SCHEMA_VALIDATION_IGNORED"
  21073. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21074. // "UNDECLARED_PROPERTIES"
  21075. // "UNREACHABLE"
  21076. Code string `json:"code,omitempty"`
  21077. // Data: [Output Only] Metadata about this warning in key: value format.
  21078. // For example:
  21079. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21080. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  21081. // Message: [Output Only] A human-readable description of the warning
  21082. // code.
  21083. Message string `json:"message,omitempty"`
  21084. // ForceSendFields is a list of field names (e.g. "Code") to
  21085. // unconditionally include in API requests. By default, fields with
  21086. // empty values are omitted from API requests. However, any non-pointer,
  21087. // non-interface field appearing in ForceSendFields will be sent to the
  21088. // server regardless of whether the field is empty or not. This may be
  21089. // used to include empty fields in Patch requests.
  21090. ForceSendFields []string `json:"-"`
  21091. // NullFields is a list of field names (e.g. "Code") to include in API
  21092. // requests with the JSON null value. By default, fields with empty
  21093. // values are omitted from API requests. However, any field with an
  21094. // empty value appearing in NullFields will be sent to the server as
  21095. // null. It is an error if a field in this list has a non-empty value.
  21096. // This may be used to include null fields in Patch requests.
  21097. NullFields []string `json:"-"`
  21098. }
  21099. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  21100. type NoMethod VpnTunnelsScopedListWarning
  21101. raw := NoMethod(*s)
  21102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21103. }
  21104. type VpnTunnelsScopedListWarningData struct {
  21105. // Key: [Output Only] A key that provides more detail on the warning
  21106. // being returned. For example, for warnings where there are no results
  21107. // in a list request for a particular zone, this key might be scope and
  21108. // the key value might be the zone name. Other examples might be a key
  21109. // indicating a deprecated resource and a suggested replacement, or a
  21110. // warning about invalid network settings (for example, if an instance
  21111. // attempts to perform IP forwarding but is not enabled for IP
  21112. // forwarding).
  21113. Key string `json:"key,omitempty"`
  21114. // Value: [Output Only] A warning data value corresponding to the key.
  21115. Value string `json:"value,omitempty"`
  21116. // ForceSendFields is a list of field names (e.g. "Key") to
  21117. // unconditionally include in API requests. By default, fields with
  21118. // empty values are omitted from API requests. However, any non-pointer,
  21119. // non-interface field appearing in ForceSendFields will be sent to the
  21120. // server regardless of whether the field is empty or not. This may be
  21121. // used to include empty fields in Patch requests.
  21122. ForceSendFields []string `json:"-"`
  21123. // NullFields is a list of field names (e.g. "Key") to include in API
  21124. // requests with the JSON null value. By default, fields with empty
  21125. // values are omitted from API requests. However, any field with an
  21126. // empty value appearing in NullFields will be sent to the server as
  21127. // null. It is an error if a field in this list has a non-empty value.
  21128. // This may be used to include null fields in Patch requests.
  21129. NullFields []string `json:"-"`
  21130. }
  21131. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  21132. type NoMethod VpnTunnelsScopedListWarningData
  21133. raw := NoMethod(*s)
  21134. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21135. }
  21136. type XpnHostList struct {
  21137. // Id: [Output Only] Unique identifier for the resource; defined by the
  21138. // server.
  21139. Id string `json:"id,omitempty"`
  21140. // Items: [Output Only] A list of shared VPC host project URLs.
  21141. Items []*Project `json:"items,omitempty"`
  21142. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  21143. // lists of shared VPC hosts.
  21144. Kind string `json:"kind,omitempty"`
  21145. // NextPageToken: [Output Only] This token allows you to get the next
  21146. // page of results for list requests. If the number of results is larger
  21147. // than maxResults, use the nextPageToken as a value for the query
  21148. // parameter pageToken in the next list request. Subsequent list
  21149. // requests will have their own nextPageToken to continue paging through
  21150. // the results.
  21151. NextPageToken string `json:"nextPageToken,omitempty"`
  21152. // SelfLink: [Output Only] Server-defined URL for this resource.
  21153. SelfLink string `json:"selfLink,omitempty"`
  21154. // Warning: [Output Only] Informational warning message.
  21155. Warning *XpnHostListWarning `json:"warning,omitempty"`
  21156. // ServerResponse contains the HTTP response code and headers from the
  21157. // server.
  21158. googleapi.ServerResponse `json:"-"`
  21159. // ForceSendFields is a list of field names (e.g. "Id") to
  21160. // unconditionally include in API requests. By default, fields with
  21161. // empty values are omitted from API requests. However, any non-pointer,
  21162. // non-interface field appearing in ForceSendFields will be sent to the
  21163. // server regardless of whether the field is empty or not. This may be
  21164. // used to include empty fields in Patch requests.
  21165. ForceSendFields []string `json:"-"`
  21166. // NullFields is a list of field names (e.g. "Id") to include in API
  21167. // requests with the JSON null value. By default, fields with empty
  21168. // values are omitted from API requests. However, any field with an
  21169. // empty value appearing in NullFields will be sent to the server as
  21170. // null. It is an error if a field in this list has a non-empty value.
  21171. // This may be used to include null fields in Patch requests.
  21172. NullFields []string `json:"-"`
  21173. }
  21174. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  21175. type NoMethod XpnHostList
  21176. raw := NoMethod(*s)
  21177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21178. }
  21179. // XpnHostListWarning: [Output Only] Informational warning message.
  21180. type XpnHostListWarning struct {
  21181. // Code: [Output Only] A warning code, if applicable. For example,
  21182. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21183. // the response.
  21184. //
  21185. // Possible values:
  21186. // "CLEANUP_FAILED"
  21187. // "DEPRECATED_RESOURCE_USED"
  21188. // "DEPRECATED_TYPE_USED"
  21189. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21190. // "EXPERIMENTAL_TYPE_USED"
  21191. // "EXTERNAL_API_WARNING"
  21192. // "FIELD_VALUE_OVERRIDEN"
  21193. // "INJECTED_KERNELS_DEPRECATED"
  21194. // "MISSING_TYPE_DEPENDENCY"
  21195. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21196. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21197. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21198. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21199. // "NEXT_HOP_NOT_RUNNING"
  21200. // "NOT_CRITICAL_ERROR"
  21201. // "NO_RESULTS_ON_PAGE"
  21202. // "REQUIRED_TOS_AGREEMENT"
  21203. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21204. // "RESOURCE_NOT_DELETED"
  21205. // "SCHEMA_VALIDATION_IGNORED"
  21206. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21207. // "UNDECLARED_PROPERTIES"
  21208. // "UNREACHABLE"
  21209. Code string `json:"code,omitempty"`
  21210. // Data: [Output Only] Metadata about this warning in key: value format.
  21211. // For example:
  21212. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21213. Data []*XpnHostListWarningData `json:"data,omitempty"`
  21214. // Message: [Output Only] A human-readable description of the warning
  21215. // code.
  21216. Message string `json:"message,omitempty"`
  21217. // ForceSendFields is a list of field names (e.g. "Code") to
  21218. // unconditionally include in API requests. By default, fields with
  21219. // empty values are omitted from API requests. However, any non-pointer,
  21220. // non-interface field appearing in ForceSendFields will be sent to the
  21221. // server regardless of whether the field is empty or not. This may be
  21222. // used to include empty fields in Patch requests.
  21223. ForceSendFields []string `json:"-"`
  21224. // NullFields is a list of field names (e.g. "Code") to include in API
  21225. // requests with the JSON null value. By default, fields with empty
  21226. // values are omitted from API requests. However, any field with an
  21227. // empty value appearing in NullFields will be sent to the server as
  21228. // null. It is an error if a field in this list has a non-empty value.
  21229. // This may be used to include null fields in Patch requests.
  21230. NullFields []string `json:"-"`
  21231. }
  21232. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  21233. type NoMethod XpnHostListWarning
  21234. raw := NoMethod(*s)
  21235. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21236. }
  21237. type XpnHostListWarningData struct {
  21238. // Key: [Output Only] A key that provides more detail on the warning
  21239. // being returned. For example, for warnings where there are no results
  21240. // in a list request for a particular zone, this key might be scope and
  21241. // the key value might be the zone name. Other examples might be a key
  21242. // indicating a deprecated resource and a suggested replacement, or a
  21243. // warning about invalid network settings (for example, if an instance
  21244. // attempts to perform IP forwarding but is not enabled for IP
  21245. // forwarding).
  21246. Key string `json:"key,omitempty"`
  21247. // Value: [Output Only] A warning data value corresponding to the key.
  21248. Value string `json:"value,omitempty"`
  21249. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  21257. // requests with the JSON null value. By default, fields with empty
  21258. // values are omitted from API requests. However, any field with an
  21259. // 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 *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  21265. type NoMethod XpnHostListWarningData
  21266. raw := NoMethod(*s)
  21267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21268. }
  21269. // XpnResourceId: Service resource (a.k.a service project) ID.
  21270. type XpnResourceId struct {
  21271. // Id: The ID of the service resource. In the case of projects, this
  21272. // field matches the project ID (e.g., my-project), not the project
  21273. // number (e.g., 12345678).
  21274. Id string `json:"id,omitempty"`
  21275. // Type: The type of the service resource.
  21276. //
  21277. // Possible values:
  21278. // "PROJECT"
  21279. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  21280. Type string `json:"type,omitempty"`
  21281. // ForceSendFields is a list of field names (e.g. "Id") to
  21282. // unconditionally include in API requests. By default, fields with
  21283. // empty values are omitted from API requests. However, any non-pointer,
  21284. // non-interface field appearing in ForceSendFields will be sent to the
  21285. // server regardless of whether the field is empty or not. This may be
  21286. // used to include empty fields in Patch requests.
  21287. ForceSendFields []string `json:"-"`
  21288. // NullFields is a list of field names (e.g. "Id") to include in API
  21289. // requests with the JSON null value. By default, fields with empty
  21290. // values are omitted from API requests. However, any field with an
  21291. // empty value appearing in NullFields will be sent to the server as
  21292. // null. It is an error if a field in this list has a non-empty value.
  21293. // This may be used to include null fields in Patch requests.
  21294. NullFields []string `json:"-"`
  21295. }
  21296. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  21297. type NoMethod XpnResourceId
  21298. raw := NoMethod(*s)
  21299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21300. }
  21301. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  21302. // resource_for v1.zones ==)
  21303. type Zone struct {
  21304. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  21305. // selections for the zone.
  21306. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  21307. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21308. // format.
  21309. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21310. // Deprecated: [Output Only] The deprecation status associated with this
  21311. // zone.
  21312. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  21313. // Description: [Output Only] Textual description of the resource.
  21314. Description string `json:"description,omitempty"`
  21315. // Id: [Output Only] The unique identifier for the resource. This
  21316. // identifier is defined by the server.
  21317. Id uint64 `json:"id,omitempty,string"`
  21318. // Kind: [Output Only] Type of the resource. Always compute#zone for
  21319. // zones.
  21320. Kind string `json:"kind,omitempty"`
  21321. // Name: [Output Only] Name of the resource.
  21322. Name string `json:"name,omitempty"`
  21323. // Region: [Output Only] Full URL reference to the region which hosts
  21324. // the zone.
  21325. Region string `json:"region,omitempty"`
  21326. // SelfLink: [Output Only] Server-defined URL for the resource.
  21327. SelfLink string `json:"selfLink,omitempty"`
  21328. // Status: [Output Only] Status of the zone, either UP or DOWN.
  21329. //
  21330. // Possible values:
  21331. // "DOWN"
  21332. // "UP"
  21333. Status string `json:"status,omitempty"`
  21334. // ServerResponse contains the HTTP response code and headers from the
  21335. // server.
  21336. googleapi.ServerResponse `json:"-"`
  21337. // ForceSendFields is a list of field names (e.g.
  21338. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  21339. // By default, fields with empty values are omitted from API requests.
  21340. // However, any non-pointer, non-interface field appearing in
  21341. // ForceSendFields will be sent to the server regardless of whether the
  21342. // field is empty or not. This may be used to include empty fields in
  21343. // Patch requests.
  21344. ForceSendFields []string `json:"-"`
  21345. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  21346. // include in API requests with the JSON null value. By default, fields
  21347. // with empty values are omitted from API requests. However, any field
  21348. // with an empty value appearing in NullFields will be sent to the
  21349. // server as null. It is an error if a field in this list has a
  21350. // non-empty value. This may be used to include null fields in Patch
  21351. // requests.
  21352. NullFields []string `json:"-"`
  21353. }
  21354. func (s *Zone) MarshalJSON() ([]byte, error) {
  21355. type NoMethod Zone
  21356. raw := NoMethod(*s)
  21357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21358. }
  21359. // ZoneList: Contains a list of zone resources.
  21360. type ZoneList struct {
  21361. // Id: [Output Only] Unique identifier for the resource; defined by the
  21362. // server.
  21363. Id string `json:"id,omitempty"`
  21364. // Items: A list of Zone resources.
  21365. Items []*Zone `json:"items,omitempty"`
  21366. // Kind: Type of resource.
  21367. Kind string `json:"kind,omitempty"`
  21368. // NextPageToken: [Output Only] This token allows you to get the next
  21369. // page of results for list requests. If the number of results is larger
  21370. // than maxResults, use the nextPageToken as a value for the query
  21371. // parameter pageToken in the next list request. Subsequent list
  21372. // requests will have their own nextPageToken to continue paging through
  21373. // the results.
  21374. NextPageToken string `json:"nextPageToken,omitempty"`
  21375. // SelfLink: [Output Only] Server-defined URL for this resource.
  21376. SelfLink string `json:"selfLink,omitempty"`
  21377. // Warning: [Output Only] Informational warning message.
  21378. Warning *ZoneListWarning `json:"warning,omitempty"`
  21379. // ServerResponse contains the HTTP response code and headers from the
  21380. // server.
  21381. googleapi.ServerResponse `json:"-"`
  21382. // ForceSendFields is a list of field names (e.g. "Id") to
  21383. // unconditionally include in API requests. By default, fields with
  21384. // empty values are omitted from API requests. However, any non-pointer,
  21385. // non-interface field appearing in ForceSendFields will be sent to the
  21386. // server regardless of whether the field is empty or not. This may be
  21387. // used to include empty fields in Patch requests.
  21388. ForceSendFields []string `json:"-"`
  21389. // NullFields is a list of field names (e.g. "Id") to include in API
  21390. // requests with the JSON null value. By default, fields with empty
  21391. // values are omitted from API requests. However, any field with an
  21392. // empty value appearing in NullFields will be sent to the server as
  21393. // null. It is an error if a field in this list has a non-empty value.
  21394. // This may be used to include null fields in Patch requests.
  21395. NullFields []string `json:"-"`
  21396. }
  21397. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  21398. type NoMethod ZoneList
  21399. raw := NoMethod(*s)
  21400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21401. }
  21402. // ZoneListWarning: [Output Only] Informational warning message.
  21403. type ZoneListWarning struct {
  21404. // Code: [Output Only] A warning code, if applicable. For example,
  21405. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21406. // the response.
  21407. //
  21408. // Possible values:
  21409. // "CLEANUP_FAILED"
  21410. // "DEPRECATED_RESOURCE_USED"
  21411. // "DEPRECATED_TYPE_USED"
  21412. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21413. // "EXPERIMENTAL_TYPE_USED"
  21414. // "EXTERNAL_API_WARNING"
  21415. // "FIELD_VALUE_OVERRIDEN"
  21416. // "INJECTED_KERNELS_DEPRECATED"
  21417. // "MISSING_TYPE_DEPENDENCY"
  21418. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21419. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21420. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21421. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21422. // "NEXT_HOP_NOT_RUNNING"
  21423. // "NOT_CRITICAL_ERROR"
  21424. // "NO_RESULTS_ON_PAGE"
  21425. // "REQUIRED_TOS_AGREEMENT"
  21426. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21427. // "RESOURCE_NOT_DELETED"
  21428. // "SCHEMA_VALIDATION_IGNORED"
  21429. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21430. // "UNDECLARED_PROPERTIES"
  21431. // "UNREACHABLE"
  21432. Code string `json:"code,omitempty"`
  21433. // Data: [Output Only] Metadata about this warning in key: value format.
  21434. // For example:
  21435. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21436. Data []*ZoneListWarningData `json:"data,omitempty"`
  21437. // Message: [Output Only] A human-readable description of the warning
  21438. // code.
  21439. Message string `json:"message,omitempty"`
  21440. // ForceSendFields is a list of field names (e.g. "Code") to
  21441. // unconditionally include in API requests. By default, fields with
  21442. // empty values are omitted from API requests. However, any non-pointer,
  21443. // non-interface field appearing in ForceSendFields will be sent to the
  21444. // server regardless of whether the field is empty or not. This may be
  21445. // used to include empty fields in Patch requests.
  21446. ForceSendFields []string `json:"-"`
  21447. // NullFields is a list of field names (e.g. "Code") to include in API
  21448. // requests with the JSON null value. By default, fields with empty
  21449. // values are omitted from API requests. However, any field with an
  21450. // empty value appearing in NullFields will be sent to the server as
  21451. // null. It is an error if a field in this list has a non-empty value.
  21452. // This may be used to include null fields in Patch requests.
  21453. NullFields []string `json:"-"`
  21454. }
  21455. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  21456. type NoMethod ZoneListWarning
  21457. raw := NoMethod(*s)
  21458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21459. }
  21460. type ZoneListWarningData struct {
  21461. // Key: [Output Only] A key that provides more detail on the warning
  21462. // being returned. For example, for warnings where there are no results
  21463. // in a list request for a particular zone, this key might be scope and
  21464. // the key value might be the zone name. Other examples might be a key
  21465. // indicating a deprecated resource and a suggested replacement, or a
  21466. // warning about invalid network settings (for example, if an instance
  21467. // attempts to perform IP forwarding but is not enabled for IP
  21468. // forwarding).
  21469. Key string `json:"key,omitempty"`
  21470. // Value: [Output Only] A warning data value corresponding to the key.
  21471. Value string `json:"value,omitempty"`
  21472. // ForceSendFields is a list of field names (e.g. "Key") to
  21473. // unconditionally include in API requests. By default, fields with
  21474. // empty values are omitted from API requests. However, any non-pointer,
  21475. // non-interface field appearing in ForceSendFields will be sent to the
  21476. // server regardless of whether the field is empty or not. This may be
  21477. // used to include empty fields in Patch requests.
  21478. ForceSendFields []string `json:"-"`
  21479. // NullFields is a list of field names (e.g. "Key") to include in API
  21480. // requests with the JSON null value. By default, fields with empty
  21481. // values are omitted from API requests. However, any field with an
  21482. // empty value appearing in NullFields will be sent to the server as
  21483. // null. It is an error if a field in this list has a non-empty value.
  21484. // This may be used to include null fields in Patch requests.
  21485. NullFields []string `json:"-"`
  21486. }
  21487. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  21488. type NoMethod ZoneListWarningData
  21489. raw := NoMethod(*s)
  21490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21491. }
  21492. type ZoneSetLabelsRequest struct {
  21493. // LabelFingerprint: The fingerprint of the previous set of labels for
  21494. // this resource, used to detect conflicts. The fingerprint is initially
  21495. // generated by Compute Engine and changes after every request to modify
  21496. // or update labels. You must always provide an up-to-date fingerprint
  21497. // hash in order to update or change labels. Make a get() request to the
  21498. // resource to get the latest fingerprint.
  21499. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  21500. // Labels: The labels to set for this resource.
  21501. Labels map[string]string `json:"labels,omitempty"`
  21502. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  21503. // unconditionally include in API requests. By default, fields with
  21504. // empty values are omitted from API requests. However, any non-pointer,
  21505. // non-interface field appearing in ForceSendFields will be sent to the
  21506. // server regardless of whether the field is empty or not. This may be
  21507. // used to include empty fields in Patch requests.
  21508. ForceSendFields []string `json:"-"`
  21509. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  21510. // include in API requests with the JSON null value. By default, fields
  21511. // with empty values are omitted from API requests. However, any field
  21512. // with an empty value appearing in NullFields will be sent to the
  21513. // server as null. It is an error if a field in this list has a
  21514. // non-empty value. This may be used to include null fields in Patch
  21515. // requests.
  21516. NullFields []string `json:"-"`
  21517. }
  21518. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  21519. type NoMethod ZoneSetLabelsRequest
  21520. raw := NoMethod(*s)
  21521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21522. }
  21523. // method id "compute.acceleratorTypes.aggregatedList":
  21524. type AcceleratorTypesAggregatedListCall struct {
  21525. s *Service
  21526. project string
  21527. urlParams_ gensupport.URLParams
  21528. ifNoneMatch_ string
  21529. ctx_ context.Context
  21530. header_ http.Header
  21531. }
  21532. // AggregatedList: Retrieves an aggregated list of accelerator types.
  21533. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  21534. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21535. c.project = project
  21536. return c
  21537. }
  21538. // Filter sets the optional parameter "filter": A filter expression that
  21539. // filters resources listed in the response. The expression must specify
  21540. // the field name, a comparison operator, and the value that you want to
  21541. // use for filtering. The value must be a string, a number, or a
  21542. // boolean. The comparison operator must be either =, !=, >, or <.
  21543. //
  21544. // For example, if you are filtering Compute Engine instances, you can
  21545. // exclude instances named example-instance by specifying name !=
  21546. // example-instance.
  21547. //
  21548. // You can also filter nested fields. For example, you could specify
  21549. // scheduling.automaticRestart = false to include instances only if they
  21550. // are not scheduled for automatic restarts. You can use filtering on
  21551. // nested fields to filter based on resource labels.
  21552. //
  21553. // To filter on multiple expressions, provide each separate expression
  21554. // within parentheses. For example, (scheduling.automaticRestart = true)
  21555. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  21556. // AND expression. However, you can include AND and OR expressions
  21557. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  21558. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  21559. // true).
  21560. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  21561. c.urlParams_.Set("filter", filter)
  21562. return c
  21563. }
  21564. // MaxResults sets the optional parameter "maxResults": The maximum
  21565. // number of results per page that should be returned. If the number of
  21566. // available results is larger than maxResults, Compute Engine returns a
  21567. // nextPageToken that can be used to get the next page of results in
  21568. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  21569. // (Default: 500)
  21570. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  21571. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21572. return c
  21573. }
  21574. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  21575. // a certain order. By default, results are returned in alphanumerical
  21576. // order based on the resource name.
  21577. //
  21578. // You can also sort results in descending order based on the creation
  21579. // timestamp using orderBy="creationTimestamp desc". This sorts results
  21580. // based on the creationTimestamp field in reverse chronological order
  21581. // (newest result first). Use this to sort resources like operations so
  21582. // that the newest operation is returned first.
  21583. //
  21584. // Currently, only sorting by name or creationTimestamp desc is
  21585. // supported.
  21586. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  21587. c.urlParams_.Set("orderBy", orderBy)
  21588. return c
  21589. }
  21590. // PageToken sets the optional parameter "pageToken": Specifies a page
  21591. // token to use. Set pageToken to the nextPageToken returned by a
  21592. // previous list request to get the next page of results.
  21593. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  21594. c.urlParams_.Set("pageToken", pageToken)
  21595. return c
  21596. }
  21597. // Fields allows partial responses to be retrieved. See
  21598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21599. // for more information.
  21600. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  21601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21602. return c
  21603. }
  21604. // IfNoneMatch sets the optional parameter which makes the operation
  21605. // fail if the object's ETag matches the given value. This is useful for
  21606. // getting updates only after the object has changed since the last
  21607. // request. Use googleapi.IsNotModified to check whether the response
  21608. // error from Do is the result of In-None-Match.
  21609. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  21610. c.ifNoneMatch_ = entityTag
  21611. return c
  21612. }
  21613. // Context sets the context to be used in this call's Do method. Any
  21614. // pending HTTP request will be aborted if the provided context is
  21615. // canceled.
  21616. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  21617. c.ctx_ = ctx
  21618. return c
  21619. }
  21620. // Header returns an http.Header that can be modified by the caller to
  21621. // add HTTP headers to the request.
  21622. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  21623. if c.header_ == nil {
  21624. c.header_ = make(http.Header)
  21625. }
  21626. return c.header_
  21627. }
  21628. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  21629. reqHeaders := make(http.Header)
  21630. for k, v := range c.header_ {
  21631. reqHeaders[k] = v
  21632. }
  21633. reqHeaders.Set("User-Agent", c.s.userAgent())
  21634. if c.ifNoneMatch_ != "" {
  21635. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21636. }
  21637. var body io.Reader = nil
  21638. c.urlParams_.Set("alt", alt)
  21639. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  21640. urls += "?" + c.urlParams_.Encode()
  21641. req, _ := http.NewRequest("GET", urls, body)
  21642. req.Header = reqHeaders
  21643. googleapi.Expand(req.URL, map[string]string{
  21644. "project": c.project,
  21645. })
  21646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21647. }
  21648. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  21649. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  21650. // non-nil. Any non-2xx status code is an error. Response headers are in
  21651. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  21652. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21653. // googleapi.IsNotModified to check whether the returned error was
  21654. // because http.StatusNotModified was returned.
  21655. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  21656. gensupport.SetOptions(c.urlParams_, opts...)
  21657. res, err := c.doRequest("json")
  21658. if res != nil && res.StatusCode == http.StatusNotModified {
  21659. if res.Body != nil {
  21660. res.Body.Close()
  21661. }
  21662. return nil, &googleapi.Error{
  21663. Code: res.StatusCode,
  21664. Header: res.Header,
  21665. }
  21666. }
  21667. if err != nil {
  21668. return nil, err
  21669. }
  21670. defer googleapi.CloseBody(res)
  21671. if err := googleapi.CheckResponse(res); err != nil {
  21672. return nil, err
  21673. }
  21674. ret := &AcceleratorTypeAggregatedList{
  21675. ServerResponse: googleapi.ServerResponse{
  21676. Header: res.Header,
  21677. HTTPStatusCode: res.StatusCode,
  21678. },
  21679. }
  21680. target := &ret
  21681. if err := gensupport.DecodeResponse(target, res); err != nil {
  21682. return nil, err
  21683. }
  21684. return ret, nil
  21685. // {
  21686. // "description": "Retrieves an aggregated list of accelerator types.",
  21687. // "httpMethod": "GET",
  21688. // "id": "compute.acceleratorTypes.aggregatedList",
  21689. // "parameterOrder": [
  21690. // "project"
  21691. // ],
  21692. // "parameters": {
  21693. // "filter": {
  21694. // "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).",
  21695. // "location": "query",
  21696. // "type": "string"
  21697. // },
  21698. // "maxResults": {
  21699. // "default": "500",
  21700. // "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)",
  21701. // "format": "uint32",
  21702. // "location": "query",
  21703. // "minimum": "0",
  21704. // "type": "integer"
  21705. // },
  21706. // "orderBy": {
  21707. // "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.",
  21708. // "location": "query",
  21709. // "type": "string"
  21710. // },
  21711. // "pageToken": {
  21712. // "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.",
  21713. // "location": "query",
  21714. // "type": "string"
  21715. // },
  21716. // "project": {
  21717. // "description": "Project ID for this request.",
  21718. // "location": "path",
  21719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21720. // "required": true,
  21721. // "type": "string"
  21722. // }
  21723. // },
  21724. // "path": "{project}/aggregated/acceleratorTypes",
  21725. // "response": {
  21726. // "$ref": "AcceleratorTypeAggregatedList"
  21727. // },
  21728. // "scopes": [
  21729. // "https://www.googleapis.com/auth/cloud-platform",
  21730. // "https://www.googleapis.com/auth/compute",
  21731. // "https://www.googleapis.com/auth/compute.readonly"
  21732. // ]
  21733. // }
  21734. }
  21735. // Pages invokes f for each page of results.
  21736. // A non-nil error returned from f will halt the iteration.
  21737. // The provided context supersedes any context provided to the Context method.
  21738. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  21739. c.ctx_ = ctx
  21740. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21741. for {
  21742. x, err := c.Do()
  21743. if err != nil {
  21744. return err
  21745. }
  21746. if err := f(x); err != nil {
  21747. return err
  21748. }
  21749. if x.NextPageToken == "" {
  21750. return nil
  21751. }
  21752. c.PageToken(x.NextPageToken)
  21753. }
  21754. }
  21755. // method id "compute.acceleratorTypes.get":
  21756. type AcceleratorTypesGetCall struct {
  21757. s *Service
  21758. project string
  21759. zone string
  21760. acceleratorType string
  21761. urlParams_ gensupport.URLParams
  21762. ifNoneMatch_ string
  21763. ctx_ context.Context
  21764. header_ http.Header
  21765. }
  21766. // Get: Returns the specified accelerator type.
  21767. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  21768. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21769. c.project = project
  21770. c.zone = zone
  21771. c.acceleratorType = acceleratorType
  21772. return c
  21773. }
  21774. // Fields allows partial responses to be retrieved. See
  21775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21776. // for more information.
  21777. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  21778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21779. return c
  21780. }
  21781. // IfNoneMatch sets the optional parameter which makes the operation
  21782. // fail if the object's ETag matches the given value. This is useful for
  21783. // getting updates only after the object has changed since the last
  21784. // request. Use googleapi.IsNotModified to check whether the response
  21785. // error from Do is the result of In-None-Match.
  21786. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  21787. c.ifNoneMatch_ = entityTag
  21788. return c
  21789. }
  21790. // Context sets the context to be used in this call's Do method. Any
  21791. // pending HTTP request will be aborted if the provided context is
  21792. // canceled.
  21793. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  21794. c.ctx_ = ctx
  21795. return c
  21796. }
  21797. // Header returns an http.Header that can be modified by the caller to
  21798. // add HTTP headers to the request.
  21799. func (c *AcceleratorTypesGetCall) Header() http.Header {
  21800. if c.header_ == nil {
  21801. c.header_ = make(http.Header)
  21802. }
  21803. return c.header_
  21804. }
  21805. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  21806. reqHeaders := make(http.Header)
  21807. for k, v := range c.header_ {
  21808. reqHeaders[k] = v
  21809. }
  21810. reqHeaders.Set("User-Agent", c.s.userAgent())
  21811. if c.ifNoneMatch_ != "" {
  21812. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21813. }
  21814. var body io.Reader = nil
  21815. c.urlParams_.Set("alt", alt)
  21816. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  21817. urls += "?" + c.urlParams_.Encode()
  21818. req, _ := http.NewRequest("GET", urls, body)
  21819. req.Header = reqHeaders
  21820. googleapi.Expand(req.URL, map[string]string{
  21821. "project": c.project,
  21822. "zone": c.zone,
  21823. "acceleratorType": c.acceleratorType,
  21824. })
  21825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21826. }
  21827. // Do executes the "compute.acceleratorTypes.get" call.
  21828. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  21829. // status code is an error. Response headers are in either
  21830. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  21831. // at all) in error.(*googleapi.Error).Header. Use
  21832. // googleapi.IsNotModified to check whether the returned error was
  21833. // because http.StatusNotModified was returned.
  21834. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  21835. gensupport.SetOptions(c.urlParams_, opts...)
  21836. res, err := c.doRequest("json")
  21837. if res != nil && res.StatusCode == http.StatusNotModified {
  21838. if res.Body != nil {
  21839. res.Body.Close()
  21840. }
  21841. return nil, &googleapi.Error{
  21842. Code: res.StatusCode,
  21843. Header: res.Header,
  21844. }
  21845. }
  21846. if err != nil {
  21847. return nil, err
  21848. }
  21849. defer googleapi.CloseBody(res)
  21850. if err := googleapi.CheckResponse(res); err != nil {
  21851. return nil, err
  21852. }
  21853. ret := &AcceleratorType{
  21854. ServerResponse: googleapi.ServerResponse{
  21855. Header: res.Header,
  21856. HTTPStatusCode: res.StatusCode,
  21857. },
  21858. }
  21859. target := &ret
  21860. if err := gensupport.DecodeResponse(target, res); err != nil {
  21861. return nil, err
  21862. }
  21863. return ret, nil
  21864. // {
  21865. // "description": "Returns the specified accelerator type.",
  21866. // "httpMethod": "GET",
  21867. // "id": "compute.acceleratorTypes.get",
  21868. // "parameterOrder": [
  21869. // "project",
  21870. // "zone",
  21871. // "acceleratorType"
  21872. // ],
  21873. // "parameters": {
  21874. // "acceleratorType": {
  21875. // "description": "Name of the accelerator type to return.",
  21876. // "location": "path",
  21877. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21878. // "required": true,
  21879. // "type": "string"
  21880. // },
  21881. // "project": {
  21882. // "description": "Project ID for this request.",
  21883. // "location": "path",
  21884. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  21885. // "required": true,
  21886. // "type": "string"
  21887. // },
  21888. // "zone": {
  21889. // "description": "The name of the zone for this request.",
  21890. // "location": "path",
  21891. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  21892. // "required": true,
  21893. // "type": "string"
  21894. // }
  21895. // },
  21896. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  21897. // "response": {
  21898. // "$ref": "AcceleratorType"
  21899. // },
  21900. // "scopes": [
  21901. // "https://www.googleapis.com/auth/cloud-platform",
  21902. // "https://www.googleapis.com/auth/compute",
  21903. // "https://www.googleapis.com/auth/compute.readonly"
  21904. // ]
  21905. // }
  21906. }
  21907. // method id "compute.acceleratorTypes.list":
  21908. type AcceleratorTypesListCall struct {
  21909. s *Service
  21910. project string
  21911. zone string
  21912. urlParams_ gensupport.URLParams
  21913. ifNoneMatch_ string
  21914. ctx_ context.Context
  21915. header_ http.Header
  21916. }
  21917. // List: Retrieves a list of accelerator types available to the
  21918. // specified project.
  21919. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  21920. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21921. c.project = project
  21922. c.zone = zone
  21923. return c
  21924. }
  21925. // Filter sets the optional parameter "filter": A filter expression that
  21926. // filters resources listed in the response. The expression must specify
  21927. // the field name, a comparison operator, and the value that you want to
  21928. // use for filtering. The value must be a string, a number, or a
  21929. // boolean. The comparison operator must be either =, !=, >, or <.
  21930. //
  21931. // For example, if you are filtering Compute Engine instances, you can
  21932. // exclude instances named example-instance by specifying name !=
  21933. // example-instance.
  21934. //
  21935. // You can also filter nested fields. For example, you could specify
  21936. // scheduling.automaticRestart = false to include instances only if they
  21937. // are not scheduled for automatic restarts. You can use filtering on
  21938. // nested fields to filter based on resource labels.
  21939. //
  21940. // To filter on multiple expressions, provide each separate expression
  21941. // within parentheses. For example, (scheduling.automaticRestart = true)
  21942. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  21943. // AND expression. However, you can include AND and OR expressions
  21944. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  21945. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  21946. // true).
  21947. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  21948. c.urlParams_.Set("filter", filter)
  21949. return c
  21950. }
  21951. // MaxResults sets the optional parameter "maxResults": The maximum
  21952. // number of results per page that should be returned. If the number of
  21953. // available results is larger than maxResults, Compute Engine returns a
  21954. // nextPageToken that can be used to get the next page of results in
  21955. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  21956. // (Default: 500)
  21957. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  21958. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21959. return c
  21960. }
  21961. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  21962. // a certain order. By default, results are returned in alphanumerical
  21963. // order based on the resource name.
  21964. //
  21965. // You can also sort results in descending order based on the creation
  21966. // timestamp using orderBy="creationTimestamp desc". This sorts results
  21967. // based on the creationTimestamp field in reverse chronological order
  21968. // (newest result first). Use this to sort resources like operations so
  21969. // that the newest operation is returned first.
  21970. //
  21971. // Currently, only sorting by name or creationTimestamp desc is
  21972. // supported.
  21973. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  21974. c.urlParams_.Set("orderBy", orderBy)
  21975. return c
  21976. }
  21977. // PageToken sets the optional parameter "pageToken": Specifies a page
  21978. // token to use. Set pageToken to the nextPageToken returned by a
  21979. // previous list request to get the next page of results.
  21980. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  21981. c.urlParams_.Set("pageToken", pageToken)
  21982. return c
  21983. }
  21984. // Fields allows partial responses to be retrieved. See
  21985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21986. // for more information.
  21987. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  21988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21989. return c
  21990. }
  21991. // IfNoneMatch sets the optional parameter which makes the operation
  21992. // fail if the object's ETag matches the given value. This is useful for
  21993. // getting updates only after the object has changed since the last
  21994. // request. Use googleapi.IsNotModified to check whether the response
  21995. // error from Do is the result of In-None-Match.
  21996. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  21997. c.ifNoneMatch_ = entityTag
  21998. return c
  21999. }
  22000. // Context sets the context to be used in this call's Do method. Any
  22001. // pending HTTP request will be aborted if the provided context is
  22002. // canceled.
  22003. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  22004. c.ctx_ = ctx
  22005. return c
  22006. }
  22007. // Header returns an http.Header that can be modified by the caller to
  22008. // add HTTP headers to the request.
  22009. func (c *AcceleratorTypesListCall) Header() http.Header {
  22010. if c.header_ == nil {
  22011. c.header_ = make(http.Header)
  22012. }
  22013. return c.header_
  22014. }
  22015. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  22016. reqHeaders := make(http.Header)
  22017. for k, v := range c.header_ {
  22018. reqHeaders[k] = v
  22019. }
  22020. reqHeaders.Set("User-Agent", c.s.userAgent())
  22021. if c.ifNoneMatch_ != "" {
  22022. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22023. }
  22024. var body io.Reader = nil
  22025. c.urlParams_.Set("alt", alt)
  22026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  22027. urls += "?" + c.urlParams_.Encode()
  22028. req, _ := http.NewRequest("GET", urls, body)
  22029. req.Header = reqHeaders
  22030. googleapi.Expand(req.URL, map[string]string{
  22031. "project": c.project,
  22032. "zone": c.zone,
  22033. })
  22034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22035. }
  22036. // Do executes the "compute.acceleratorTypes.list" call.
  22037. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  22038. // non-2xx status code is an error. Response headers are in either
  22039. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  22040. // returned at all) in error.(*googleapi.Error).Header. Use
  22041. // googleapi.IsNotModified to check whether the returned error was
  22042. // because http.StatusNotModified was returned.
  22043. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  22044. gensupport.SetOptions(c.urlParams_, opts...)
  22045. res, err := c.doRequest("json")
  22046. if res != nil && res.StatusCode == http.StatusNotModified {
  22047. if res.Body != nil {
  22048. res.Body.Close()
  22049. }
  22050. return nil, &googleapi.Error{
  22051. Code: res.StatusCode,
  22052. Header: res.Header,
  22053. }
  22054. }
  22055. if err != nil {
  22056. return nil, err
  22057. }
  22058. defer googleapi.CloseBody(res)
  22059. if err := googleapi.CheckResponse(res); err != nil {
  22060. return nil, err
  22061. }
  22062. ret := &AcceleratorTypeList{
  22063. ServerResponse: googleapi.ServerResponse{
  22064. Header: res.Header,
  22065. HTTPStatusCode: res.StatusCode,
  22066. },
  22067. }
  22068. target := &ret
  22069. if err := gensupport.DecodeResponse(target, res); err != nil {
  22070. return nil, err
  22071. }
  22072. return ret, nil
  22073. // {
  22074. // "description": "Retrieves a list of accelerator types available to the specified project.",
  22075. // "httpMethod": "GET",
  22076. // "id": "compute.acceleratorTypes.list",
  22077. // "parameterOrder": [
  22078. // "project",
  22079. // "zone"
  22080. // ],
  22081. // "parameters": {
  22082. // "filter": {
  22083. // "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).",
  22084. // "location": "query",
  22085. // "type": "string"
  22086. // },
  22087. // "maxResults": {
  22088. // "default": "500",
  22089. // "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)",
  22090. // "format": "uint32",
  22091. // "location": "query",
  22092. // "minimum": "0",
  22093. // "type": "integer"
  22094. // },
  22095. // "orderBy": {
  22096. // "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.",
  22097. // "location": "query",
  22098. // "type": "string"
  22099. // },
  22100. // "pageToken": {
  22101. // "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.",
  22102. // "location": "query",
  22103. // "type": "string"
  22104. // },
  22105. // "project": {
  22106. // "description": "Project ID for this request.",
  22107. // "location": "path",
  22108. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22109. // "required": true,
  22110. // "type": "string"
  22111. // },
  22112. // "zone": {
  22113. // "description": "The name of the zone for this request.",
  22114. // "location": "path",
  22115. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22116. // "required": true,
  22117. // "type": "string"
  22118. // }
  22119. // },
  22120. // "path": "{project}/zones/{zone}/acceleratorTypes",
  22121. // "response": {
  22122. // "$ref": "AcceleratorTypeList"
  22123. // },
  22124. // "scopes": [
  22125. // "https://www.googleapis.com/auth/cloud-platform",
  22126. // "https://www.googleapis.com/auth/compute",
  22127. // "https://www.googleapis.com/auth/compute.readonly"
  22128. // ]
  22129. // }
  22130. }
  22131. // Pages invokes f for each page of results.
  22132. // A non-nil error returned from f will halt the iteration.
  22133. // The provided context supersedes any context provided to the Context method.
  22134. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  22135. c.ctx_ = ctx
  22136. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22137. for {
  22138. x, err := c.Do()
  22139. if err != nil {
  22140. return err
  22141. }
  22142. if err := f(x); err != nil {
  22143. return err
  22144. }
  22145. if x.NextPageToken == "" {
  22146. return nil
  22147. }
  22148. c.PageToken(x.NextPageToken)
  22149. }
  22150. }
  22151. // method id "compute.addresses.aggregatedList":
  22152. type AddressesAggregatedListCall struct {
  22153. s *Service
  22154. project string
  22155. urlParams_ gensupport.URLParams
  22156. ifNoneMatch_ string
  22157. ctx_ context.Context
  22158. header_ http.Header
  22159. }
  22160. // AggregatedList: Retrieves an aggregated list of addresses.
  22161. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  22162. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  22163. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22164. c.project = project
  22165. return c
  22166. }
  22167. // Filter sets the optional parameter "filter": A filter expression that
  22168. // filters resources listed in the response. The expression must specify
  22169. // the field name, a comparison operator, and the value that you want to
  22170. // use for filtering. The value must be a string, a number, or a
  22171. // boolean. The comparison operator must be either =, !=, >, or <.
  22172. //
  22173. // For example, if you are filtering Compute Engine instances, you can
  22174. // exclude instances named example-instance by specifying name !=
  22175. // example-instance.
  22176. //
  22177. // You can also filter nested fields. For example, you could specify
  22178. // scheduling.automaticRestart = false to include instances only if they
  22179. // are not scheduled for automatic restarts. You can use filtering on
  22180. // nested fields to filter based on resource labels.
  22181. //
  22182. // To filter on multiple expressions, provide each separate expression
  22183. // within parentheses. For example, (scheduling.automaticRestart = true)
  22184. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  22185. // AND expression. However, you can include AND and OR expressions
  22186. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  22187. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  22188. // true).
  22189. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  22190. c.urlParams_.Set("filter", filter)
  22191. return c
  22192. }
  22193. // MaxResults sets the optional parameter "maxResults": The maximum
  22194. // number of results per page that should be returned. If the number of
  22195. // available results is larger than maxResults, Compute Engine returns a
  22196. // nextPageToken that can be used to get the next page of results in
  22197. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  22198. // (Default: 500)
  22199. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  22200. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22201. return c
  22202. }
  22203. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  22204. // a certain order. By default, results are returned in alphanumerical
  22205. // order based on the resource name.
  22206. //
  22207. // You can also sort results in descending order based on the creation
  22208. // timestamp using orderBy="creationTimestamp desc". This sorts results
  22209. // based on the creationTimestamp field in reverse chronological order
  22210. // (newest result first). Use this to sort resources like operations so
  22211. // that the newest operation is returned first.
  22212. //
  22213. // Currently, only sorting by name or creationTimestamp desc is
  22214. // supported.
  22215. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  22216. c.urlParams_.Set("orderBy", orderBy)
  22217. return c
  22218. }
  22219. // PageToken sets the optional parameter "pageToken": Specifies a page
  22220. // token to use. Set pageToken to the nextPageToken returned by a
  22221. // previous list request to get the next page of results.
  22222. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  22223. c.urlParams_.Set("pageToken", pageToken)
  22224. return c
  22225. }
  22226. // Fields allows partial responses to be retrieved. See
  22227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22228. // for more information.
  22229. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  22230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22231. return c
  22232. }
  22233. // IfNoneMatch sets the optional parameter which makes the operation
  22234. // fail if the object's ETag matches the given value. This is useful for
  22235. // getting updates only after the object has changed since the last
  22236. // request. Use googleapi.IsNotModified to check whether the response
  22237. // error from Do is the result of In-None-Match.
  22238. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  22239. c.ifNoneMatch_ = entityTag
  22240. return c
  22241. }
  22242. // Context sets the context to be used in this call's Do method. Any
  22243. // pending HTTP request will be aborted if the provided context is
  22244. // canceled.
  22245. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  22246. c.ctx_ = ctx
  22247. return c
  22248. }
  22249. // Header returns an http.Header that can be modified by the caller to
  22250. // add HTTP headers to the request.
  22251. func (c *AddressesAggregatedListCall) Header() http.Header {
  22252. if c.header_ == nil {
  22253. c.header_ = make(http.Header)
  22254. }
  22255. return c.header_
  22256. }
  22257. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  22258. reqHeaders := make(http.Header)
  22259. for k, v := range c.header_ {
  22260. reqHeaders[k] = v
  22261. }
  22262. reqHeaders.Set("User-Agent", c.s.userAgent())
  22263. if c.ifNoneMatch_ != "" {
  22264. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22265. }
  22266. var body io.Reader = nil
  22267. c.urlParams_.Set("alt", alt)
  22268. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  22269. urls += "?" + c.urlParams_.Encode()
  22270. req, _ := http.NewRequest("GET", urls, body)
  22271. req.Header = reqHeaders
  22272. googleapi.Expand(req.URL, map[string]string{
  22273. "project": c.project,
  22274. })
  22275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22276. }
  22277. // Do executes the "compute.addresses.aggregatedList" call.
  22278. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  22279. // non-2xx status code is an error. Response headers are in either
  22280. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  22281. // returned at all) in error.(*googleapi.Error).Header. Use
  22282. // googleapi.IsNotModified to check whether the returned error was
  22283. // because http.StatusNotModified was returned.
  22284. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  22285. gensupport.SetOptions(c.urlParams_, opts...)
  22286. res, err := c.doRequest("json")
  22287. if res != nil && res.StatusCode == http.StatusNotModified {
  22288. if res.Body != nil {
  22289. res.Body.Close()
  22290. }
  22291. return nil, &googleapi.Error{
  22292. Code: res.StatusCode,
  22293. Header: res.Header,
  22294. }
  22295. }
  22296. if err != nil {
  22297. return nil, err
  22298. }
  22299. defer googleapi.CloseBody(res)
  22300. if err := googleapi.CheckResponse(res); err != nil {
  22301. return nil, err
  22302. }
  22303. ret := &AddressAggregatedList{
  22304. ServerResponse: googleapi.ServerResponse{
  22305. Header: res.Header,
  22306. HTTPStatusCode: res.StatusCode,
  22307. },
  22308. }
  22309. target := &ret
  22310. if err := gensupport.DecodeResponse(target, res); err != nil {
  22311. return nil, err
  22312. }
  22313. return ret, nil
  22314. // {
  22315. // "description": "Retrieves an aggregated list of addresses.",
  22316. // "httpMethod": "GET",
  22317. // "id": "compute.addresses.aggregatedList",
  22318. // "parameterOrder": [
  22319. // "project"
  22320. // ],
  22321. // "parameters": {
  22322. // "filter": {
  22323. // "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).",
  22324. // "location": "query",
  22325. // "type": "string"
  22326. // },
  22327. // "maxResults": {
  22328. // "default": "500",
  22329. // "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)",
  22330. // "format": "uint32",
  22331. // "location": "query",
  22332. // "minimum": "0",
  22333. // "type": "integer"
  22334. // },
  22335. // "orderBy": {
  22336. // "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.",
  22337. // "location": "query",
  22338. // "type": "string"
  22339. // },
  22340. // "pageToken": {
  22341. // "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.",
  22342. // "location": "query",
  22343. // "type": "string"
  22344. // },
  22345. // "project": {
  22346. // "description": "Project ID for this request.",
  22347. // "location": "path",
  22348. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22349. // "required": true,
  22350. // "type": "string"
  22351. // }
  22352. // },
  22353. // "path": "{project}/aggregated/addresses",
  22354. // "response": {
  22355. // "$ref": "AddressAggregatedList"
  22356. // },
  22357. // "scopes": [
  22358. // "https://www.googleapis.com/auth/cloud-platform",
  22359. // "https://www.googleapis.com/auth/compute",
  22360. // "https://www.googleapis.com/auth/compute.readonly"
  22361. // ]
  22362. // }
  22363. }
  22364. // Pages invokes f for each page of results.
  22365. // A non-nil error returned from f will halt the iteration.
  22366. // The provided context supersedes any context provided to the Context method.
  22367. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  22368. c.ctx_ = ctx
  22369. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22370. for {
  22371. x, err := c.Do()
  22372. if err != nil {
  22373. return err
  22374. }
  22375. if err := f(x); err != nil {
  22376. return err
  22377. }
  22378. if x.NextPageToken == "" {
  22379. return nil
  22380. }
  22381. c.PageToken(x.NextPageToken)
  22382. }
  22383. }
  22384. // method id "compute.addresses.delete":
  22385. type AddressesDeleteCall struct {
  22386. s *Service
  22387. project string
  22388. region string
  22389. address string
  22390. urlParams_ gensupport.URLParams
  22391. ctx_ context.Context
  22392. header_ http.Header
  22393. }
  22394. // Delete: Deletes the specified address resource.
  22395. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  22396. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  22397. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22398. c.project = project
  22399. c.region = region
  22400. c.address = address
  22401. return c
  22402. }
  22403. // RequestId sets the optional parameter "requestId": An optional
  22404. // request ID to identify requests. Specify a unique request ID so that
  22405. // if you must retry your request, the server will know to ignore the
  22406. // request if it has already been completed.
  22407. //
  22408. // For example, consider a situation where you make an initial request
  22409. // and the request times out. If you make the request again with the
  22410. // same request ID, the server can check if original operation with the
  22411. // same request ID was received, and if so, will ignore the second
  22412. // request. This prevents clients from accidentally creating duplicate
  22413. // commitments.
  22414. //
  22415. // The request ID must be a valid UUID with the exception that zero UUID
  22416. // is not supported (00000000-0000-0000-0000-000000000000).
  22417. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  22418. c.urlParams_.Set("requestId", requestId)
  22419. return c
  22420. }
  22421. // Fields allows partial responses to be retrieved. See
  22422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22423. // for more information.
  22424. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  22425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22426. return c
  22427. }
  22428. // Context sets the context to be used in this call's Do method. Any
  22429. // pending HTTP request will be aborted if the provided context is
  22430. // canceled.
  22431. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  22432. c.ctx_ = ctx
  22433. return c
  22434. }
  22435. // Header returns an http.Header that can be modified by the caller to
  22436. // add HTTP headers to the request.
  22437. func (c *AddressesDeleteCall) Header() http.Header {
  22438. if c.header_ == nil {
  22439. c.header_ = make(http.Header)
  22440. }
  22441. return c.header_
  22442. }
  22443. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  22444. reqHeaders := make(http.Header)
  22445. for k, v := range c.header_ {
  22446. reqHeaders[k] = v
  22447. }
  22448. reqHeaders.Set("User-Agent", c.s.userAgent())
  22449. var body io.Reader = nil
  22450. c.urlParams_.Set("alt", alt)
  22451. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  22452. urls += "?" + c.urlParams_.Encode()
  22453. req, _ := http.NewRequest("DELETE", urls, body)
  22454. req.Header = reqHeaders
  22455. googleapi.Expand(req.URL, map[string]string{
  22456. "project": c.project,
  22457. "region": c.region,
  22458. "address": c.address,
  22459. })
  22460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22461. }
  22462. // Do executes the "compute.addresses.delete" call.
  22463. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22464. // status code is an error. Response headers are in either
  22465. // *Operation.ServerResponse.Header or (if a response was returned at
  22466. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22467. // to check whether the returned error was because
  22468. // http.StatusNotModified was returned.
  22469. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22470. gensupport.SetOptions(c.urlParams_, opts...)
  22471. res, err := c.doRequest("json")
  22472. if res != nil && res.StatusCode == http.StatusNotModified {
  22473. if res.Body != nil {
  22474. res.Body.Close()
  22475. }
  22476. return nil, &googleapi.Error{
  22477. Code: res.StatusCode,
  22478. Header: res.Header,
  22479. }
  22480. }
  22481. if err != nil {
  22482. return nil, err
  22483. }
  22484. defer googleapi.CloseBody(res)
  22485. if err := googleapi.CheckResponse(res); err != nil {
  22486. return nil, err
  22487. }
  22488. ret := &Operation{
  22489. ServerResponse: googleapi.ServerResponse{
  22490. Header: res.Header,
  22491. HTTPStatusCode: res.StatusCode,
  22492. },
  22493. }
  22494. target := &ret
  22495. if err := gensupport.DecodeResponse(target, res); err != nil {
  22496. return nil, err
  22497. }
  22498. return ret, nil
  22499. // {
  22500. // "description": "Deletes the specified address resource.",
  22501. // "httpMethod": "DELETE",
  22502. // "id": "compute.addresses.delete",
  22503. // "parameterOrder": [
  22504. // "project",
  22505. // "region",
  22506. // "address"
  22507. // ],
  22508. // "parameters": {
  22509. // "address": {
  22510. // "description": "Name of the address resource to delete.",
  22511. // "location": "path",
  22512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22513. // "required": true,
  22514. // "type": "string"
  22515. // },
  22516. // "project": {
  22517. // "description": "Project ID for this request.",
  22518. // "location": "path",
  22519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22520. // "required": true,
  22521. // "type": "string"
  22522. // },
  22523. // "region": {
  22524. // "description": "Name of the region for this request.",
  22525. // "location": "path",
  22526. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22527. // "required": true,
  22528. // "type": "string"
  22529. // },
  22530. // "requestId": {
  22531. // "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).",
  22532. // "location": "query",
  22533. // "type": "string"
  22534. // }
  22535. // },
  22536. // "path": "{project}/regions/{region}/addresses/{address}",
  22537. // "response": {
  22538. // "$ref": "Operation"
  22539. // },
  22540. // "scopes": [
  22541. // "https://www.googleapis.com/auth/cloud-platform",
  22542. // "https://www.googleapis.com/auth/compute"
  22543. // ]
  22544. // }
  22545. }
  22546. // method id "compute.addresses.get":
  22547. type AddressesGetCall struct {
  22548. s *Service
  22549. project string
  22550. region string
  22551. address string
  22552. urlParams_ gensupport.URLParams
  22553. ifNoneMatch_ string
  22554. ctx_ context.Context
  22555. header_ http.Header
  22556. }
  22557. // Get: Returns the specified address resource.
  22558. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  22559. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  22560. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22561. c.project = project
  22562. c.region = region
  22563. c.address = address
  22564. return c
  22565. }
  22566. // Fields allows partial responses to be retrieved. See
  22567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22568. // for more information.
  22569. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  22570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22571. return c
  22572. }
  22573. // IfNoneMatch sets the optional parameter which makes the operation
  22574. // fail if the object's ETag matches the given value. This is useful for
  22575. // getting updates only after the object has changed since the last
  22576. // request. Use googleapi.IsNotModified to check whether the response
  22577. // error from Do is the result of In-None-Match.
  22578. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  22579. c.ifNoneMatch_ = entityTag
  22580. return c
  22581. }
  22582. // Context sets the context to be used in this call's Do method. Any
  22583. // pending HTTP request will be aborted if the provided context is
  22584. // canceled.
  22585. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  22586. c.ctx_ = ctx
  22587. return c
  22588. }
  22589. // Header returns an http.Header that can be modified by the caller to
  22590. // add HTTP headers to the request.
  22591. func (c *AddressesGetCall) Header() http.Header {
  22592. if c.header_ == nil {
  22593. c.header_ = make(http.Header)
  22594. }
  22595. return c.header_
  22596. }
  22597. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  22598. reqHeaders := make(http.Header)
  22599. for k, v := range c.header_ {
  22600. reqHeaders[k] = v
  22601. }
  22602. reqHeaders.Set("User-Agent", c.s.userAgent())
  22603. if c.ifNoneMatch_ != "" {
  22604. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22605. }
  22606. var body io.Reader = nil
  22607. c.urlParams_.Set("alt", alt)
  22608. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  22609. urls += "?" + c.urlParams_.Encode()
  22610. req, _ := http.NewRequest("GET", urls, body)
  22611. req.Header = reqHeaders
  22612. googleapi.Expand(req.URL, map[string]string{
  22613. "project": c.project,
  22614. "region": c.region,
  22615. "address": c.address,
  22616. })
  22617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22618. }
  22619. // Do executes the "compute.addresses.get" call.
  22620. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  22621. // code is an error. Response headers are in either
  22622. // *Address.ServerResponse.Header or (if a response was returned at all)
  22623. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  22624. // check whether the returned error was because http.StatusNotModified
  22625. // was returned.
  22626. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  22627. gensupport.SetOptions(c.urlParams_, opts...)
  22628. res, err := c.doRequest("json")
  22629. if res != nil && res.StatusCode == http.StatusNotModified {
  22630. if res.Body != nil {
  22631. res.Body.Close()
  22632. }
  22633. return nil, &googleapi.Error{
  22634. Code: res.StatusCode,
  22635. Header: res.Header,
  22636. }
  22637. }
  22638. if err != nil {
  22639. return nil, err
  22640. }
  22641. defer googleapi.CloseBody(res)
  22642. if err := googleapi.CheckResponse(res); err != nil {
  22643. return nil, err
  22644. }
  22645. ret := &Address{
  22646. ServerResponse: googleapi.ServerResponse{
  22647. Header: res.Header,
  22648. HTTPStatusCode: res.StatusCode,
  22649. },
  22650. }
  22651. target := &ret
  22652. if err := gensupport.DecodeResponse(target, res); err != nil {
  22653. return nil, err
  22654. }
  22655. return ret, nil
  22656. // {
  22657. // "description": "Returns the specified address resource.",
  22658. // "httpMethod": "GET",
  22659. // "id": "compute.addresses.get",
  22660. // "parameterOrder": [
  22661. // "project",
  22662. // "region",
  22663. // "address"
  22664. // ],
  22665. // "parameters": {
  22666. // "address": {
  22667. // "description": "Name of the address resource to return.",
  22668. // "location": "path",
  22669. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22670. // "required": true,
  22671. // "type": "string"
  22672. // },
  22673. // "project": {
  22674. // "description": "Project ID for this request.",
  22675. // "location": "path",
  22676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22677. // "required": true,
  22678. // "type": "string"
  22679. // },
  22680. // "region": {
  22681. // "description": "Name of the region for this request.",
  22682. // "location": "path",
  22683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22684. // "required": true,
  22685. // "type": "string"
  22686. // }
  22687. // },
  22688. // "path": "{project}/regions/{region}/addresses/{address}",
  22689. // "response": {
  22690. // "$ref": "Address"
  22691. // },
  22692. // "scopes": [
  22693. // "https://www.googleapis.com/auth/cloud-platform",
  22694. // "https://www.googleapis.com/auth/compute",
  22695. // "https://www.googleapis.com/auth/compute.readonly"
  22696. // ]
  22697. // }
  22698. }
  22699. // method id "compute.addresses.insert":
  22700. type AddressesInsertCall struct {
  22701. s *Service
  22702. project string
  22703. region string
  22704. address *Address
  22705. urlParams_ gensupport.URLParams
  22706. ctx_ context.Context
  22707. header_ http.Header
  22708. }
  22709. // Insert: Creates an address resource in the specified project using
  22710. // the data included in the request.
  22711. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  22712. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  22713. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22714. c.project = project
  22715. c.region = region
  22716. c.address = address
  22717. return c
  22718. }
  22719. // RequestId sets the optional parameter "requestId": An optional
  22720. // request ID to identify requests. Specify a unique request ID so that
  22721. // if you must retry your request, the server will know to ignore the
  22722. // request if it has already been completed.
  22723. //
  22724. // For example, consider a situation where you make an initial request
  22725. // and the request times out. If you make the request again with the
  22726. // same request ID, the server can check if original operation with the
  22727. // same request ID was received, and if so, will ignore the second
  22728. // request. This prevents clients from accidentally creating duplicate
  22729. // commitments.
  22730. //
  22731. // The request ID must be a valid UUID with the exception that zero UUID
  22732. // is not supported (00000000-0000-0000-0000-000000000000).
  22733. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  22734. c.urlParams_.Set("requestId", requestId)
  22735. return c
  22736. }
  22737. // Fields allows partial responses to be retrieved. See
  22738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22739. // for more information.
  22740. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  22741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22742. return c
  22743. }
  22744. // Context sets the context to be used in this call's Do method. Any
  22745. // pending HTTP request will be aborted if the provided context is
  22746. // canceled.
  22747. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  22748. c.ctx_ = ctx
  22749. return c
  22750. }
  22751. // Header returns an http.Header that can be modified by the caller to
  22752. // add HTTP headers to the request.
  22753. func (c *AddressesInsertCall) Header() http.Header {
  22754. if c.header_ == nil {
  22755. c.header_ = make(http.Header)
  22756. }
  22757. return c.header_
  22758. }
  22759. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  22760. reqHeaders := make(http.Header)
  22761. for k, v := range c.header_ {
  22762. reqHeaders[k] = v
  22763. }
  22764. reqHeaders.Set("User-Agent", c.s.userAgent())
  22765. var body io.Reader = nil
  22766. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  22767. if err != nil {
  22768. return nil, err
  22769. }
  22770. reqHeaders.Set("Content-Type", "application/json")
  22771. c.urlParams_.Set("alt", alt)
  22772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  22773. urls += "?" + c.urlParams_.Encode()
  22774. req, _ := http.NewRequest("POST", urls, body)
  22775. req.Header = reqHeaders
  22776. googleapi.Expand(req.URL, map[string]string{
  22777. "project": c.project,
  22778. "region": c.region,
  22779. })
  22780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22781. }
  22782. // Do executes the "compute.addresses.insert" call.
  22783. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  22784. // status code is an error. Response headers are in either
  22785. // *Operation.ServerResponse.Header or (if a response was returned at
  22786. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22787. // to check whether the returned error was because
  22788. // http.StatusNotModified was returned.
  22789. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  22790. gensupport.SetOptions(c.urlParams_, opts...)
  22791. res, err := c.doRequest("json")
  22792. if res != nil && res.StatusCode == http.StatusNotModified {
  22793. if res.Body != nil {
  22794. res.Body.Close()
  22795. }
  22796. return nil, &googleapi.Error{
  22797. Code: res.StatusCode,
  22798. Header: res.Header,
  22799. }
  22800. }
  22801. if err != nil {
  22802. return nil, err
  22803. }
  22804. defer googleapi.CloseBody(res)
  22805. if err := googleapi.CheckResponse(res); err != nil {
  22806. return nil, err
  22807. }
  22808. ret := &Operation{
  22809. ServerResponse: googleapi.ServerResponse{
  22810. Header: res.Header,
  22811. HTTPStatusCode: res.StatusCode,
  22812. },
  22813. }
  22814. target := &ret
  22815. if err := gensupport.DecodeResponse(target, res); err != nil {
  22816. return nil, err
  22817. }
  22818. return ret, nil
  22819. // {
  22820. // "description": "Creates an address resource in the specified project using the data included in the request.",
  22821. // "httpMethod": "POST",
  22822. // "id": "compute.addresses.insert",
  22823. // "parameterOrder": [
  22824. // "project",
  22825. // "region"
  22826. // ],
  22827. // "parameters": {
  22828. // "project": {
  22829. // "description": "Project ID for this request.",
  22830. // "location": "path",
  22831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  22832. // "required": true,
  22833. // "type": "string"
  22834. // },
  22835. // "region": {
  22836. // "description": "Name of the region for this request.",
  22837. // "location": "path",
  22838. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  22839. // "required": true,
  22840. // "type": "string"
  22841. // },
  22842. // "requestId": {
  22843. // "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).",
  22844. // "location": "query",
  22845. // "type": "string"
  22846. // }
  22847. // },
  22848. // "path": "{project}/regions/{region}/addresses",
  22849. // "request": {
  22850. // "$ref": "Address"
  22851. // },
  22852. // "response": {
  22853. // "$ref": "Operation"
  22854. // },
  22855. // "scopes": [
  22856. // "https://www.googleapis.com/auth/cloud-platform",
  22857. // "https://www.googleapis.com/auth/compute"
  22858. // ]
  22859. // }
  22860. }
  22861. // method id "compute.addresses.list":
  22862. type AddressesListCall struct {
  22863. s *Service
  22864. project string
  22865. region string
  22866. urlParams_ gensupport.URLParams
  22867. ifNoneMatch_ string
  22868. ctx_ context.Context
  22869. header_ http.Header
  22870. }
  22871. // List: Retrieves a list of addresses contained within the specified
  22872. // region.
  22873. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  22874. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  22875. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22876. c.project = project
  22877. c.region = region
  22878. return c
  22879. }
  22880. // Filter sets the optional parameter "filter": A filter expression that
  22881. // filters resources listed in the response. The expression must specify
  22882. // the field name, a comparison operator, and the value that you want to
  22883. // use for filtering. The value must be a string, a number, or a
  22884. // boolean. The comparison operator must be either =, !=, >, or <.
  22885. //
  22886. // For example, if you are filtering Compute Engine instances, you can
  22887. // exclude instances named example-instance by specifying name !=
  22888. // example-instance.
  22889. //
  22890. // You can also filter nested fields. For example, you could specify
  22891. // scheduling.automaticRestart = false to include instances only if they
  22892. // are not scheduled for automatic restarts. You can use filtering on
  22893. // nested fields to filter based on resource labels.
  22894. //
  22895. // To filter on multiple expressions, provide each separate expression
  22896. // within parentheses. For example, (scheduling.automaticRestart = true)
  22897. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  22898. // AND expression. However, you can include AND and OR expressions
  22899. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  22900. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  22901. // true).
  22902. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  22903. c.urlParams_.Set("filter", filter)
  22904. return c
  22905. }
  22906. // MaxResults sets the optional parameter "maxResults": The maximum
  22907. // number of results per page that should be returned. If the number of
  22908. // available results is larger than maxResults, Compute Engine returns a
  22909. // nextPageToken that can be used to get the next page of results in
  22910. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  22911. // (Default: 500)
  22912. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  22913. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22914. return c
  22915. }
  22916. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  22917. // a certain order. By default, results are returned in alphanumerical
  22918. // order based on the resource name.
  22919. //
  22920. // You can also sort results in descending order based on the creation
  22921. // timestamp using orderBy="creationTimestamp desc". This sorts results
  22922. // based on the creationTimestamp field in reverse chronological order
  22923. // (newest result first). Use this to sort resources like operations so
  22924. // that the newest operation is returned first.
  22925. //
  22926. // Currently, only sorting by name or creationTimestamp desc is
  22927. // supported.
  22928. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  22929. c.urlParams_.Set("orderBy", orderBy)
  22930. return c
  22931. }
  22932. // PageToken sets the optional parameter "pageToken": Specifies a page
  22933. // token to use. Set pageToken to the nextPageToken returned by a
  22934. // previous list request to get the next page of results.
  22935. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  22936. c.urlParams_.Set("pageToken", pageToken)
  22937. return c
  22938. }
  22939. // Fields allows partial responses to be retrieved. See
  22940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22941. // for more information.
  22942. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  22943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22944. return c
  22945. }
  22946. // IfNoneMatch sets the optional parameter which makes the operation
  22947. // fail if the object's ETag matches the given value. This is useful for
  22948. // getting updates only after the object has changed since the last
  22949. // request. Use googleapi.IsNotModified to check whether the response
  22950. // error from Do is the result of In-None-Match.
  22951. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  22952. c.ifNoneMatch_ = entityTag
  22953. return c
  22954. }
  22955. // Context sets the context to be used in this call's Do method. Any
  22956. // pending HTTP request will be aborted if the provided context is
  22957. // canceled.
  22958. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  22959. c.ctx_ = ctx
  22960. return c
  22961. }
  22962. // Header returns an http.Header that can be modified by the caller to
  22963. // add HTTP headers to the request.
  22964. func (c *AddressesListCall) Header() http.Header {
  22965. if c.header_ == nil {
  22966. c.header_ = make(http.Header)
  22967. }
  22968. return c.header_
  22969. }
  22970. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  22971. reqHeaders := make(http.Header)
  22972. for k, v := range c.header_ {
  22973. reqHeaders[k] = v
  22974. }
  22975. reqHeaders.Set("User-Agent", c.s.userAgent())
  22976. if c.ifNoneMatch_ != "" {
  22977. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22978. }
  22979. var body io.Reader = nil
  22980. c.urlParams_.Set("alt", alt)
  22981. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  22982. urls += "?" + c.urlParams_.Encode()
  22983. req, _ := http.NewRequest("GET", urls, body)
  22984. req.Header = reqHeaders
  22985. googleapi.Expand(req.URL, map[string]string{
  22986. "project": c.project,
  22987. "region": c.region,
  22988. })
  22989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22990. }
  22991. // Do executes the "compute.addresses.list" call.
  22992. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  22993. // status code is an error. Response headers are in either
  22994. // *AddressList.ServerResponse.Header or (if a response was returned at
  22995. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  22996. // to check whether the returned error was because
  22997. // http.StatusNotModified was returned.
  22998. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  22999. gensupport.SetOptions(c.urlParams_, opts...)
  23000. res, err := c.doRequest("json")
  23001. if res != nil && res.StatusCode == http.StatusNotModified {
  23002. if res.Body != nil {
  23003. res.Body.Close()
  23004. }
  23005. return nil, &googleapi.Error{
  23006. Code: res.StatusCode,
  23007. Header: res.Header,
  23008. }
  23009. }
  23010. if err != nil {
  23011. return nil, err
  23012. }
  23013. defer googleapi.CloseBody(res)
  23014. if err := googleapi.CheckResponse(res); err != nil {
  23015. return nil, err
  23016. }
  23017. ret := &AddressList{
  23018. ServerResponse: googleapi.ServerResponse{
  23019. Header: res.Header,
  23020. HTTPStatusCode: res.StatusCode,
  23021. },
  23022. }
  23023. target := &ret
  23024. if err := gensupport.DecodeResponse(target, res); err != nil {
  23025. return nil, err
  23026. }
  23027. return ret, nil
  23028. // {
  23029. // "description": "Retrieves a list of addresses contained within the specified region.",
  23030. // "httpMethod": "GET",
  23031. // "id": "compute.addresses.list",
  23032. // "parameterOrder": [
  23033. // "project",
  23034. // "region"
  23035. // ],
  23036. // "parameters": {
  23037. // "filter": {
  23038. // "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).",
  23039. // "location": "query",
  23040. // "type": "string"
  23041. // },
  23042. // "maxResults": {
  23043. // "default": "500",
  23044. // "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)",
  23045. // "format": "uint32",
  23046. // "location": "query",
  23047. // "minimum": "0",
  23048. // "type": "integer"
  23049. // },
  23050. // "orderBy": {
  23051. // "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.",
  23052. // "location": "query",
  23053. // "type": "string"
  23054. // },
  23055. // "pageToken": {
  23056. // "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.",
  23057. // "location": "query",
  23058. // "type": "string"
  23059. // },
  23060. // "project": {
  23061. // "description": "Project ID for this request.",
  23062. // "location": "path",
  23063. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23064. // "required": true,
  23065. // "type": "string"
  23066. // },
  23067. // "region": {
  23068. // "description": "Name of the region for this request.",
  23069. // "location": "path",
  23070. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23071. // "required": true,
  23072. // "type": "string"
  23073. // }
  23074. // },
  23075. // "path": "{project}/regions/{region}/addresses",
  23076. // "response": {
  23077. // "$ref": "AddressList"
  23078. // },
  23079. // "scopes": [
  23080. // "https://www.googleapis.com/auth/cloud-platform",
  23081. // "https://www.googleapis.com/auth/compute",
  23082. // "https://www.googleapis.com/auth/compute.readonly"
  23083. // ]
  23084. // }
  23085. }
  23086. // Pages invokes f for each page of results.
  23087. // A non-nil error returned from f will halt the iteration.
  23088. // The provided context supersedes any context provided to the Context method.
  23089. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  23090. c.ctx_ = ctx
  23091. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23092. for {
  23093. x, err := c.Do()
  23094. if err != nil {
  23095. return err
  23096. }
  23097. if err := f(x); err != nil {
  23098. return err
  23099. }
  23100. if x.NextPageToken == "" {
  23101. return nil
  23102. }
  23103. c.PageToken(x.NextPageToken)
  23104. }
  23105. }
  23106. // method id "compute.autoscalers.aggregatedList":
  23107. type AutoscalersAggregatedListCall struct {
  23108. s *Service
  23109. project string
  23110. urlParams_ gensupport.URLParams
  23111. ifNoneMatch_ string
  23112. ctx_ context.Context
  23113. header_ http.Header
  23114. }
  23115. // AggregatedList: Retrieves an aggregated list of autoscalers.
  23116. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  23117. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23118. c.project = project
  23119. return c
  23120. }
  23121. // Filter sets the optional parameter "filter": A filter expression that
  23122. // filters resources listed in the response. The expression must specify
  23123. // the field name, a comparison operator, and the value that you want to
  23124. // use for filtering. The value must be a string, a number, or a
  23125. // boolean. The comparison operator must be either =, !=, >, or <.
  23126. //
  23127. // For example, if you are filtering Compute Engine instances, you can
  23128. // exclude instances named example-instance by specifying name !=
  23129. // example-instance.
  23130. //
  23131. // You can also filter nested fields. For example, you could specify
  23132. // scheduling.automaticRestart = false to include instances only if they
  23133. // are not scheduled for automatic restarts. You can use filtering on
  23134. // nested fields to filter based on resource labels.
  23135. //
  23136. // To filter on multiple expressions, provide each separate expression
  23137. // within parentheses. For example, (scheduling.automaticRestart = true)
  23138. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  23139. // AND expression. However, you can include AND and OR expressions
  23140. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  23141. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  23142. // true).
  23143. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  23144. c.urlParams_.Set("filter", filter)
  23145. return c
  23146. }
  23147. // MaxResults sets the optional parameter "maxResults": The maximum
  23148. // number of results per page that should be returned. If the number of
  23149. // available results is larger than maxResults, Compute Engine returns a
  23150. // nextPageToken that can be used to get the next page of results in
  23151. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  23152. // (Default: 500)
  23153. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  23154. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23155. return c
  23156. }
  23157. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  23158. // a certain order. By default, results are returned in alphanumerical
  23159. // order based on the resource name.
  23160. //
  23161. // You can also sort results in descending order based on the creation
  23162. // timestamp using orderBy="creationTimestamp desc". This sorts results
  23163. // based on the creationTimestamp field in reverse chronological order
  23164. // (newest result first). Use this to sort resources like operations so
  23165. // that the newest operation is returned first.
  23166. //
  23167. // Currently, only sorting by name or creationTimestamp desc is
  23168. // supported.
  23169. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  23170. c.urlParams_.Set("orderBy", orderBy)
  23171. return c
  23172. }
  23173. // PageToken sets the optional parameter "pageToken": Specifies a page
  23174. // token to use. Set pageToken to the nextPageToken returned by a
  23175. // previous list request to get the next page of results.
  23176. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  23177. c.urlParams_.Set("pageToken", pageToken)
  23178. return c
  23179. }
  23180. // Fields allows partial responses to be retrieved. See
  23181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23182. // for more information.
  23183. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  23184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23185. return c
  23186. }
  23187. // IfNoneMatch sets the optional parameter which makes the operation
  23188. // fail if the object's ETag matches the given value. This is useful for
  23189. // getting updates only after the object has changed since the last
  23190. // request. Use googleapi.IsNotModified to check whether the response
  23191. // error from Do is the result of In-None-Match.
  23192. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  23193. c.ifNoneMatch_ = entityTag
  23194. return c
  23195. }
  23196. // Context sets the context to be used in this call's Do method. Any
  23197. // pending HTTP request will be aborted if the provided context is
  23198. // canceled.
  23199. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  23200. c.ctx_ = ctx
  23201. return c
  23202. }
  23203. // Header returns an http.Header that can be modified by the caller to
  23204. // add HTTP headers to the request.
  23205. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  23206. if c.header_ == nil {
  23207. c.header_ = make(http.Header)
  23208. }
  23209. return c.header_
  23210. }
  23211. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  23212. reqHeaders := make(http.Header)
  23213. for k, v := range c.header_ {
  23214. reqHeaders[k] = v
  23215. }
  23216. reqHeaders.Set("User-Agent", c.s.userAgent())
  23217. if c.ifNoneMatch_ != "" {
  23218. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23219. }
  23220. var body io.Reader = nil
  23221. c.urlParams_.Set("alt", alt)
  23222. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  23223. urls += "?" + c.urlParams_.Encode()
  23224. req, _ := http.NewRequest("GET", urls, body)
  23225. req.Header = reqHeaders
  23226. googleapi.Expand(req.URL, map[string]string{
  23227. "project": c.project,
  23228. })
  23229. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23230. }
  23231. // Do executes the "compute.autoscalers.aggregatedList" call.
  23232. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  23233. // Any non-2xx status code is an error. Response headers are in either
  23234. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  23235. // returned at all) in error.(*googleapi.Error).Header. Use
  23236. // googleapi.IsNotModified to check whether the returned error was
  23237. // because http.StatusNotModified was returned.
  23238. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  23239. gensupport.SetOptions(c.urlParams_, opts...)
  23240. res, err := c.doRequest("json")
  23241. if res != nil && res.StatusCode == http.StatusNotModified {
  23242. if res.Body != nil {
  23243. res.Body.Close()
  23244. }
  23245. return nil, &googleapi.Error{
  23246. Code: res.StatusCode,
  23247. Header: res.Header,
  23248. }
  23249. }
  23250. if err != nil {
  23251. return nil, err
  23252. }
  23253. defer googleapi.CloseBody(res)
  23254. if err := googleapi.CheckResponse(res); err != nil {
  23255. return nil, err
  23256. }
  23257. ret := &AutoscalerAggregatedList{
  23258. ServerResponse: googleapi.ServerResponse{
  23259. Header: res.Header,
  23260. HTTPStatusCode: res.StatusCode,
  23261. },
  23262. }
  23263. target := &ret
  23264. if err := gensupport.DecodeResponse(target, res); err != nil {
  23265. return nil, err
  23266. }
  23267. return ret, nil
  23268. // {
  23269. // "description": "Retrieves an aggregated list of autoscalers.",
  23270. // "httpMethod": "GET",
  23271. // "id": "compute.autoscalers.aggregatedList",
  23272. // "parameterOrder": [
  23273. // "project"
  23274. // ],
  23275. // "parameters": {
  23276. // "filter": {
  23277. // "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).",
  23278. // "location": "query",
  23279. // "type": "string"
  23280. // },
  23281. // "maxResults": {
  23282. // "default": "500",
  23283. // "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)",
  23284. // "format": "uint32",
  23285. // "location": "query",
  23286. // "minimum": "0",
  23287. // "type": "integer"
  23288. // },
  23289. // "orderBy": {
  23290. // "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.",
  23291. // "location": "query",
  23292. // "type": "string"
  23293. // },
  23294. // "pageToken": {
  23295. // "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.",
  23296. // "location": "query",
  23297. // "type": "string"
  23298. // },
  23299. // "project": {
  23300. // "description": "Project ID for this request.",
  23301. // "location": "path",
  23302. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23303. // "required": true,
  23304. // "type": "string"
  23305. // }
  23306. // },
  23307. // "path": "{project}/aggregated/autoscalers",
  23308. // "response": {
  23309. // "$ref": "AutoscalerAggregatedList"
  23310. // },
  23311. // "scopes": [
  23312. // "https://www.googleapis.com/auth/cloud-platform",
  23313. // "https://www.googleapis.com/auth/compute",
  23314. // "https://www.googleapis.com/auth/compute.readonly"
  23315. // ]
  23316. // }
  23317. }
  23318. // Pages invokes f for each page of results.
  23319. // A non-nil error returned from f will halt the iteration.
  23320. // The provided context supersedes any context provided to the Context method.
  23321. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  23322. c.ctx_ = ctx
  23323. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23324. for {
  23325. x, err := c.Do()
  23326. if err != nil {
  23327. return err
  23328. }
  23329. if err := f(x); err != nil {
  23330. return err
  23331. }
  23332. if x.NextPageToken == "" {
  23333. return nil
  23334. }
  23335. c.PageToken(x.NextPageToken)
  23336. }
  23337. }
  23338. // method id "compute.autoscalers.delete":
  23339. type AutoscalersDeleteCall struct {
  23340. s *Service
  23341. project string
  23342. zone string
  23343. autoscaler string
  23344. urlParams_ gensupport.URLParams
  23345. ctx_ context.Context
  23346. header_ http.Header
  23347. }
  23348. // Delete: Deletes the specified autoscaler.
  23349. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  23350. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23351. c.project = project
  23352. c.zone = zone
  23353. c.autoscaler = autoscaler
  23354. return c
  23355. }
  23356. // RequestId sets the optional parameter "requestId": An optional
  23357. // request ID to identify requests. Specify a unique request ID so that
  23358. // if you must retry your request, the server will know to ignore the
  23359. // request if it has already been completed.
  23360. //
  23361. // For example, consider a situation where you make an initial request
  23362. // and the request times out. If you make the request again with the
  23363. // same request ID, the server can check if original operation with the
  23364. // same request ID was received, and if so, will ignore the second
  23365. // request. This prevents clients from accidentally creating duplicate
  23366. // commitments.
  23367. //
  23368. // The request ID must be a valid UUID with the exception that zero UUID
  23369. // is not supported (00000000-0000-0000-0000-000000000000).
  23370. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  23371. c.urlParams_.Set("requestId", requestId)
  23372. return c
  23373. }
  23374. // Fields allows partial responses to be retrieved. See
  23375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23376. // for more information.
  23377. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  23378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23379. return c
  23380. }
  23381. // Context sets the context to be used in this call's Do method. Any
  23382. // pending HTTP request will be aborted if the provided context is
  23383. // canceled.
  23384. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  23385. c.ctx_ = ctx
  23386. return c
  23387. }
  23388. // Header returns an http.Header that can be modified by the caller to
  23389. // add HTTP headers to the request.
  23390. func (c *AutoscalersDeleteCall) Header() http.Header {
  23391. if c.header_ == nil {
  23392. c.header_ = make(http.Header)
  23393. }
  23394. return c.header_
  23395. }
  23396. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  23397. reqHeaders := make(http.Header)
  23398. for k, v := range c.header_ {
  23399. reqHeaders[k] = v
  23400. }
  23401. reqHeaders.Set("User-Agent", c.s.userAgent())
  23402. var body io.Reader = nil
  23403. c.urlParams_.Set("alt", alt)
  23404. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  23405. urls += "?" + c.urlParams_.Encode()
  23406. req, _ := http.NewRequest("DELETE", urls, body)
  23407. req.Header = reqHeaders
  23408. googleapi.Expand(req.URL, map[string]string{
  23409. "project": c.project,
  23410. "zone": c.zone,
  23411. "autoscaler": c.autoscaler,
  23412. })
  23413. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23414. }
  23415. // Do executes the "compute.autoscalers.delete" call.
  23416. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23417. // status code is an error. Response headers are in either
  23418. // *Operation.ServerResponse.Header or (if a response was returned at
  23419. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23420. // to check whether the returned error was because
  23421. // http.StatusNotModified was returned.
  23422. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23423. gensupport.SetOptions(c.urlParams_, opts...)
  23424. res, err := c.doRequest("json")
  23425. if res != nil && res.StatusCode == http.StatusNotModified {
  23426. if res.Body != nil {
  23427. res.Body.Close()
  23428. }
  23429. return nil, &googleapi.Error{
  23430. Code: res.StatusCode,
  23431. Header: res.Header,
  23432. }
  23433. }
  23434. if err != nil {
  23435. return nil, err
  23436. }
  23437. defer googleapi.CloseBody(res)
  23438. if err := googleapi.CheckResponse(res); err != nil {
  23439. return nil, err
  23440. }
  23441. ret := &Operation{
  23442. ServerResponse: googleapi.ServerResponse{
  23443. Header: res.Header,
  23444. HTTPStatusCode: res.StatusCode,
  23445. },
  23446. }
  23447. target := &ret
  23448. if err := gensupport.DecodeResponse(target, res); err != nil {
  23449. return nil, err
  23450. }
  23451. return ret, nil
  23452. // {
  23453. // "description": "Deletes the specified autoscaler.",
  23454. // "httpMethod": "DELETE",
  23455. // "id": "compute.autoscalers.delete",
  23456. // "parameterOrder": [
  23457. // "project",
  23458. // "zone",
  23459. // "autoscaler"
  23460. // ],
  23461. // "parameters": {
  23462. // "autoscaler": {
  23463. // "description": "Name of the autoscaler to delete.",
  23464. // "location": "path",
  23465. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23466. // "required": true,
  23467. // "type": "string"
  23468. // },
  23469. // "project": {
  23470. // "description": "Project ID for this request.",
  23471. // "location": "path",
  23472. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23473. // "required": true,
  23474. // "type": "string"
  23475. // },
  23476. // "requestId": {
  23477. // "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).",
  23478. // "location": "query",
  23479. // "type": "string"
  23480. // },
  23481. // "zone": {
  23482. // "description": "Name of the zone for this request.",
  23483. // "location": "path",
  23484. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23485. // "required": true,
  23486. // "type": "string"
  23487. // }
  23488. // },
  23489. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  23490. // "response": {
  23491. // "$ref": "Operation"
  23492. // },
  23493. // "scopes": [
  23494. // "https://www.googleapis.com/auth/cloud-platform",
  23495. // "https://www.googleapis.com/auth/compute"
  23496. // ]
  23497. // }
  23498. }
  23499. // method id "compute.autoscalers.get":
  23500. type AutoscalersGetCall struct {
  23501. s *Service
  23502. project string
  23503. zone string
  23504. autoscaler string
  23505. urlParams_ gensupport.URLParams
  23506. ifNoneMatch_ string
  23507. ctx_ context.Context
  23508. header_ http.Header
  23509. }
  23510. // Get: Returns the specified autoscaler resource. Gets a list of
  23511. // available autoscalers by making a list() request.
  23512. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  23513. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23514. c.project = project
  23515. c.zone = zone
  23516. c.autoscaler = autoscaler
  23517. return c
  23518. }
  23519. // Fields allows partial responses to be retrieved. See
  23520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23521. // for more information.
  23522. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  23523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23524. return c
  23525. }
  23526. // IfNoneMatch sets the optional parameter which makes the operation
  23527. // fail if the object's ETag matches the given value. This is useful for
  23528. // getting updates only after the object has changed since the last
  23529. // request. Use googleapi.IsNotModified to check whether the response
  23530. // error from Do is the result of In-None-Match.
  23531. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  23532. c.ifNoneMatch_ = entityTag
  23533. return c
  23534. }
  23535. // Context sets the context to be used in this call's Do method. Any
  23536. // pending HTTP request will be aborted if the provided context is
  23537. // canceled.
  23538. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  23539. c.ctx_ = ctx
  23540. return c
  23541. }
  23542. // Header returns an http.Header that can be modified by the caller to
  23543. // add HTTP headers to the request.
  23544. func (c *AutoscalersGetCall) Header() http.Header {
  23545. if c.header_ == nil {
  23546. c.header_ = make(http.Header)
  23547. }
  23548. return c.header_
  23549. }
  23550. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  23551. reqHeaders := make(http.Header)
  23552. for k, v := range c.header_ {
  23553. reqHeaders[k] = v
  23554. }
  23555. reqHeaders.Set("User-Agent", c.s.userAgent())
  23556. if c.ifNoneMatch_ != "" {
  23557. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23558. }
  23559. var body io.Reader = nil
  23560. c.urlParams_.Set("alt", alt)
  23561. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  23562. urls += "?" + c.urlParams_.Encode()
  23563. req, _ := http.NewRequest("GET", urls, body)
  23564. req.Header = reqHeaders
  23565. googleapi.Expand(req.URL, map[string]string{
  23566. "project": c.project,
  23567. "zone": c.zone,
  23568. "autoscaler": c.autoscaler,
  23569. })
  23570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23571. }
  23572. // Do executes the "compute.autoscalers.get" call.
  23573. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  23574. // status code is an error. Response headers are in either
  23575. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  23576. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23577. // to check whether the returned error was because
  23578. // http.StatusNotModified was returned.
  23579. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  23580. gensupport.SetOptions(c.urlParams_, opts...)
  23581. res, err := c.doRequest("json")
  23582. if res != nil && res.StatusCode == http.StatusNotModified {
  23583. if res.Body != nil {
  23584. res.Body.Close()
  23585. }
  23586. return nil, &googleapi.Error{
  23587. Code: res.StatusCode,
  23588. Header: res.Header,
  23589. }
  23590. }
  23591. if err != nil {
  23592. return nil, err
  23593. }
  23594. defer googleapi.CloseBody(res)
  23595. if err := googleapi.CheckResponse(res); err != nil {
  23596. return nil, err
  23597. }
  23598. ret := &Autoscaler{
  23599. ServerResponse: googleapi.ServerResponse{
  23600. Header: res.Header,
  23601. HTTPStatusCode: res.StatusCode,
  23602. },
  23603. }
  23604. target := &ret
  23605. if err := gensupport.DecodeResponse(target, res); err != nil {
  23606. return nil, err
  23607. }
  23608. return ret, nil
  23609. // {
  23610. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  23611. // "httpMethod": "GET",
  23612. // "id": "compute.autoscalers.get",
  23613. // "parameterOrder": [
  23614. // "project",
  23615. // "zone",
  23616. // "autoscaler"
  23617. // ],
  23618. // "parameters": {
  23619. // "autoscaler": {
  23620. // "description": "Name of the autoscaler to return.",
  23621. // "location": "path",
  23622. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23623. // "required": true,
  23624. // "type": "string"
  23625. // },
  23626. // "project": {
  23627. // "description": "Project ID for this request.",
  23628. // "location": "path",
  23629. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23630. // "required": true,
  23631. // "type": "string"
  23632. // },
  23633. // "zone": {
  23634. // "description": "Name of the zone for this request.",
  23635. // "location": "path",
  23636. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23637. // "required": true,
  23638. // "type": "string"
  23639. // }
  23640. // },
  23641. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  23642. // "response": {
  23643. // "$ref": "Autoscaler"
  23644. // },
  23645. // "scopes": [
  23646. // "https://www.googleapis.com/auth/cloud-platform",
  23647. // "https://www.googleapis.com/auth/compute",
  23648. // "https://www.googleapis.com/auth/compute.readonly"
  23649. // ]
  23650. // }
  23651. }
  23652. // method id "compute.autoscalers.insert":
  23653. type AutoscalersInsertCall struct {
  23654. s *Service
  23655. project string
  23656. zone string
  23657. autoscaler *Autoscaler
  23658. urlParams_ gensupport.URLParams
  23659. ctx_ context.Context
  23660. header_ http.Header
  23661. }
  23662. // Insert: Creates an autoscaler in the specified project using the data
  23663. // included in the request.
  23664. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  23665. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23666. c.project = project
  23667. c.zone = zone
  23668. c.autoscaler = autoscaler
  23669. return c
  23670. }
  23671. // RequestId sets the optional parameter "requestId": An optional
  23672. // request ID to identify requests. Specify a unique request ID so that
  23673. // if you must retry your request, the server will know to ignore the
  23674. // request if it has already been completed.
  23675. //
  23676. // For example, consider a situation where you make an initial request
  23677. // and the request times out. If you make the request again with the
  23678. // same request ID, the server can check if original operation with the
  23679. // same request ID was received, and if so, will ignore the second
  23680. // request. This prevents clients from accidentally creating duplicate
  23681. // commitments.
  23682. //
  23683. // The request ID must be a valid UUID with the exception that zero UUID
  23684. // is not supported (00000000-0000-0000-0000-000000000000).
  23685. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  23686. c.urlParams_.Set("requestId", requestId)
  23687. return c
  23688. }
  23689. // Fields allows partial responses to be retrieved. See
  23690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23691. // for more information.
  23692. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  23693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23694. return c
  23695. }
  23696. // Context sets the context to be used in this call's Do method. Any
  23697. // pending HTTP request will be aborted if the provided context is
  23698. // canceled.
  23699. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  23700. c.ctx_ = ctx
  23701. return c
  23702. }
  23703. // Header returns an http.Header that can be modified by the caller to
  23704. // add HTTP headers to the request.
  23705. func (c *AutoscalersInsertCall) Header() http.Header {
  23706. if c.header_ == nil {
  23707. c.header_ = make(http.Header)
  23708. }
  23709. return c.header_
  23710. }
  23711. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  23712. reqHeaders := make(http.Header)
  23713. for k, v := range c.header_ {
  23714. reqHeaders[k] = v
  23715. }
  23716. reqHeaders.Set("User-Agent", c.s.userAgent())
  23717. var body io.Reader = nil
  23718. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  23719. if err != nil {
  23720. return nil, err
  23721. }
  23722. reqHeaders.Set("Content-Type", "application/json")
  23723. c.urlParams_.Set("alt", alt)
  23724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  23725. urls += "?" + c.urlParams_.Encode()
  23726. req, _ := http.NewRequest("POST", urls, body)
  23727. req.Header = reqHeaders
  23728. googleapi.Expand(req.URL, map[string]string{
  23729. "project": c.project,
  23730. "zone": c.zone,
  23731. })
  23732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23733. }
  23734. // Do executes the "compute.autoscalers.insert" call.
  23735. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  23736. // status code is an error. Response headers are in either
  23737. // *Operation.ServerResponse.Header or (if a response was returned at
  23738. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23739. // to check whether the returned error was because
  23740. // http.StatusNotModified was returned.
  23741. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  23742. gensupport.SetOptions(c.urlParams_, opts...)
  23743. res, err := c.doRequest("json")
  23744. if res != nil && res.StatusCode == http.StatusNotModified {
  23745. if res.Body != nil {
  23746. res.Body.Close()
  23747. }
  23748. return nil, &googleapi.Error{
  23749. Code: res.StatusCode,
  23750. Header: res.Header,
  23751. }
  23752. }
  23753. if err != nil {
  23754. return nil, err
  23755. }
  23756. defer googleapi.CloseBody(res)
  23757. if err := googleapi.CheckResponse(res); err != nil {
  23758. return nil, err
  23759. }
  23760. ret := &Operation{
  23761. ServerResponse: googleapi.ServerResponse{
  23762. Header: res.Header,
  23763. HTTPStatusCode: res.StatusCode,
  23764. },
  23765. }
  23766. target := &ret
  23767. if err := gensupport.DecodeResponse(target, res); err != nil {
  23768. return nil, err
  23769. }
  23770. return ret, nil
  23771. // {
  23772. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  23773. // "httpMethod": "POST",
  23774. // "id": "compute.autoscalers.insert",
  23775. // "parameterOrder": [
  23776. // "project",
  23777. // "zone"
  23778. // ],
  23779. // "parameters": {
  23780. // "project": {
  23781. // "description": "Project ID for this request.",
  23782. // "location": "path",
  23783. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  23784. // "required": true,
  23785. // "type": "string"
  23786. // },
  23787. // "requestId": {
  23788. // "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).",
  23789. // "location": "query",
  23790. // "type": "string"
  23791. // },
  23792. // "zone": {
  23793. // "description": "Name of the zone for this request.",
  23794. // "location": "path",
  23795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  23796. // "required": true,
  23797. // "type": "string"
  23798. // }
  23799. // },
  23800. // "path": "{project}/zones/{zone}/autoscalers",
  23801. // "request": {
  23802. // "$ref": "Autoscaler"
  23803. // },
  23804. // "response": {
  23805. // "$ref": "Operation"
  23806. // },
  23807. // "scopes": [
  23808. // "https://www.googleapis.com/auth/cloud-platform",
  23809. // "https://www.googleapis.com/auth/compute"
  23810. // ]
  23811. // }
  23812. }
  23813. // method id "compute.autoscalers.list":
  23814. type AutoscalersListCall struct {
  23815. s *Service
  23816. project string
  23817. zone string
  23818. urlParams_ gensupport.URLParams
  23819. ifNoneMatch_ string
  23820. ctx_ context.Context
  23821. header_ http.Header
  23822. }
  23823. // List: Retrieves a list of autoscalers contained within the specified
  23824. // zone.
  23825. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  23826. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23827. c.project = project
  23828. c.zone = zone
  23829. return c
  23830. }
  23831. // Filter sets the optional parameter "filter": A filter expression that
  23832. // filters resources listed in the response. The expression must specify
  23833. // the field name, a comparison operator, and the value that you want to
  23834. // use for filtering. The value must be a string, a number, or a
  23835. // boolean. The comparison operator must be either =, !=, >, or <.
  23836. //
  23837. // For example, if you are filtering Compute Engine instances, you can
  23838. // exclude instances named example-instance by specifying name !=
  23839. // example-instance.
  23840. //
  23841. // You can also filter nested fields. For example, you could specify
  23842. // scheduling.automaticRestart = false to include instances only if they
  23843. // are not scheduled for automatic restarts. You can use filtering on
  23844. // nested fields to filter based on resource labels.
  23845. //
  23846. // To filter on multiple expressions, provide each separate expression
  23847. // within parentheses. For example, (scheduling.automaticRestart = true)
  23848. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  23849. // AND expression. However, you can include AND and OR expressions
  23850. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  23851. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  23852. // true).
  23853. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  23854. c.urlParams_.Set("filter", filter)
  23855. return c
  23856. }
  23857. // MaxResults sets the optional parameter "maxResults": The maximum
  23858. // number of results per page that should be returned. If the number of
  23859. // available results is larger than maxResults, Compute Engine returns a
  23860. // nextPageToken that can be used to get the next page of results in
  23861. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  23862. // (Default: 500)
  23863. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  23864. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23865. return c
  23866. }
  23867. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  23868. // a certain order. By default, results are returned in alphanumerical
  23869. // order based on the resource name.
  23870. //
  23871. // You can also sort results in descending order based on the creation
  23872. // timestamp using orderBy="creationTimestamp desc". This sorts results
  23873. // based on the creationTimestamp field in reverse chronological order
  23874. // (newest result first). Use this to sort resources like operations so
  23875. // that the newest operation is returned first.
  23876. //
  23877. // Currently, only sorting by name or creationTimestamp desc is
  23878. // supported.
  23879. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  23880. c.urlParams_.Set("orderBy", orderBy)
  23881. return c
  23882. }
  23883. // PageToken sets the optional parameter "pageToken": Specifies a page
  23884. // token to use. Set pageToken to the nextPageToken returned by a
  23885. // previous list request to get the next page of results.
  23886. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  23887. c.urlParams_.Set("pageToken", pageToken)
  23888. return c
  23889. }
  23890. // Fields allows partial responses to be retrieved. See
  23891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23892. // for more information.
  23893. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  23894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23895. return c
  23896. }
  23897. // IfNoneMatch sets the optional parameter which makes the operation
  23898. // fail if the object's ETag matches the given value. This is useful for
  23899. // getting updates only after the object has changed since the last
  23900. // request. Use googleapi.IsNotModified to check whether the response
  23901. // error from Do is the result of In-None-Match.
  23902. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  23903. c.ifNoneMatch_ = entityTag
  23904. return c
  23905. }
  23906. // Context sets the context to be used in this call's Do method. Any
  23907. // pending HTTP request will be aborted if the provided context is
  23908. // canceled.
  23909. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  23910. c.ctx_ = ctx
  23911. return c
  23912. }
  23913. // Header returns an http.Header that can be modified by the caller to
  23914. // add HTTP headers to the request.
  23915. func (c *AutoscalersListCall) Header() http.Header {
  23916. if c.header_ == nil {
  23917. c.header_ = make(http.Header)
  23918. }
  23919. return c.header_
  23920. }
  23921. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  23922. reqHeaders := make(http.Header)
  23923. for k, v := range c.header_ {
  23924. reqHeaders[k] = v
  23925. }
  23926. reqHeaders.Set("User-Agent", c.s.userAgent())
  23927. if c.ifNoneMatch_ != "" {
  23928. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23929. }
  23930. var body io.Reader = nil
  23931. c.urlParams_.Set("alt", alt)
  23932. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  23933. urls += "?" + c.urlParams_.Encode()
  23934. req, _ := http.NewRequest("GET", urls, body)
  23935. req.Header = reqHeaders
  23936. googleapi.Expand(req.URL, map[string]string{
  23937. "project": c.project,
  23938. "zone": c.zone,
  23939. })
  23940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23941. }
  23942. // Do executes the "compute.autoscalers.list" call.
  23943. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  23944. // status code is an error. Response headers are in either
  23945. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  23946. // at all) in error.(*googleapi.Error).Header. Use
  23947. // googleapi.IsNotModified to check whether the returned error was
  23948. // because http.StatusNotModified was returned.
  23949. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  23950. gensupport.SetOptions(c.urlParams_, opts...)
  23951. res, err := c.doRequest("json")
  23952. if res != nil && res.StatusCode == http.StatusNotModified {
  23953. if res.Body != nil {
  23954. res.Body.Close()
  23955. }
  23956. return nil, &googleapi.Error{
  23957. Code: res.StatusCode,
  23958. Header: res.Header,
  23959. }
  23960. }
  23961. if err != nil {
  23962. return nil, err
  23963. }
  23964. defer googleapi.CloseBody(res)
  23965. if err := googleapi.CheckResponse(res); err != nil {
  23966. return nil, err
  23967. }
  23968. ret := &AutoscalerList{
  23969. ServerResponse: googleapi.ServerResponse{
  23970. Header: res.Header,
  23971. HTTPStatusCode: res.StatusCode,
  23972. },
  23973. }
  23974. target := &ret
  23975. if err := gensupport.DecodeResponse(target, res); err != nil {
  23976. return nil, err
  23977. }
  23978. return ret, nil
  23979. // {
  23980. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  23981. // "httpMethod": "GET",
  23982. // "id": "compute.autoscalers.list",
  23983. // "parameterOrder": [
  23984. // "project",
  23985. // "zone"
  23986. // ],
  23987. // "parameters": {
  23988. // "filter": {
  23989. // "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).",
  23990. // "location": "query",
  23991. // "type": "string"
  23992. // },
  23993. // "maxResults": {
  23994. // "default": "500",
  23995. // "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)",
  23996. // "format": "uint32",
  23997. // "location": "query",
  23998. // "minimum": "0",
  23999. // "type": "integer"
  24000. // },
  24001. // "orderBy": {
  24002. // "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.",
  24003. // "location": "query",
  24004. // "type": "string"
  24005. // },
  24006. // "pageToken": {
  24007. // "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.",
  24008. // "location": "query",
  24009. // "type": "string"
  24010. // },
  24011. // "project": {
  24012. // "description": "Project ID for this request.",
  24013. // "location": "path",
  24014. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24015. // "required": true,
  24016. // "type": "string"
  24017. // },
  24018. // "zone": {
  24019. // "description": "Name of the zone for this request.",
  24020. // "location": "path",
  24021. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24022. // "required": true,
  24023. // "type": "string"
  24024. // }
  24025. // },
  24026. // "path": "{project}/zones/{zone}/autoscalers",
  24027. // "response": {
  24028. // "$ref": "AutoscalerList"
  24029. // },
  24030. // "scopes": [
  24031. // "https://www.googleapis.com/auth/cloud-platform",
  24032. // "https://www.googleapis.com/auth/compute",
  24033. // "https://www.googleapis.com/auth/compute.readonly"
  24034. // ]
  24035. // }
  24036. }
  24037. // Pages invokes f for each page of results.
  24038. // A non-nil error returned from f will halt the iteration.
  24039. // The provided context supersedes any context provided to the Context method.
  24040. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  24041. c.ctx_ = ctx
  24042. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24043. for {
  24044. x, err := c.Do()
  24045. if err != nil {
  24046. return err
  24047. }
  24048. if err := f(x); err != nil {
  24049. return err
  24050. }
  24051. if x.NextPageToken == "" {
  24052. return nil
  24053. }
  24054. c.PageToken(x.NextPageToken)
  24055. }
  24056. }
  24057. // method id "compute.autoscalers.patch":
  24058. type AutoscalersPatchCall struct {
  24059. s *Service
  24060. project string
  24061. zone string
  24062. autoscaler *Autoscaler
  24063. urlParams_ gensupport.URLParams
  24064. ctx_ context.Context
  24065. header_ http.Header
  24066. }
  24067. // Patch: Updates an autoscaler in the specified project using the data
  24068. // included in the request. This method supports PATCH semantics and
  24069. // uses the JSON merge patch format and processing rules.
  24070. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  24071. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24072. c.project = project
  24073. c.zone = zone
  24074. c.autoscaler = autoscaler
  24075. return c
  24076. }
  24077. // Autoscaler sets the optional parameter "autoscaler": Name of the
  24078. // autoscaler to patch.
  24079. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  24080. c.urlParams_.Set("autoscaler", autoscaler)
  24081. return c
  24082. }
  24083. // RequestId sets the optional parameter "requestId": An optional
  24084. // request ID to identify requests. Specify a unique request ID so that
  24085. // if you must retry your request, the server will know to ignore the
  24086. // request if it has already been completed.
  24087. //
  24088. // For example, consider a situation where you make an initial request
  24089. // and the request times out. If you make the request again with the
  24090. // same request ID, the server can check if original operation with the
  24091. // same request ID was received, and if so, will ignore the second
  24092. // request. This prevents clients from accidentally creating duplicate
  24093. // commitments.
  24094. //
  24095. // The request ID must be a valid UUID with the exception that zero UUID
  24096. // is not supported (00000000-0000-0000-0000-000000000000).
  24097. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  24098. c.urlParams_.Set("requestId", requestId)
  24099. return c
  24100. }
  24101. // Fields allows partial responses to be retrieved. See
  24102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24103. // for more information.
  24104. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  24105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24106. return c
  24107. }
  24108. // Context sets the context to be used in this call's Do method. Any
  24109. // pending HTTP request will be aborted if the provided context is
  24110. // canceled.
  24111. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  24112. c.ctx_ = ctx
  24113. return c
  24114. }
  24115. // Header returns an http.Header that can be modified by the caller to
  24116. // add HTTP headers to the request.
  24117. func (c *AutoscalersPatchCall) Header() http.Header {
  24118. if c.header_ == nil {
  24119. c.header_ = make(http.Header)
  24120. }
  24121. return c.header_
  24122. }
  24123. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  24124. reqHeaders := make(http.Header)
  24125. for k, v := range c.header_ {
  24126. reqHeaders[k] = v
  24127. }
  24128. reqHeaders.Set("User-Agent", c.s.userAgent())
  24129. var body io.Reader = nil
  24130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  24131. if err != nil {
  24132. return nil, err
  24133. }
  24134. reqHeaders.Set("Content-Type", "application/json")
  24135. c.urlParams_.Set("alt", alt)
  24136. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  24137. urls += "?" + c.urlParams_.Encode()
  24138. req, _ := http.NewRequest("PATCH", urls, body)
  24139. req.Header = reqHeaders
  24140. googleapi.Expand(req.URL, map[string]string{
  24141. "project": c.project,
  24142. "zone": c.zone,
  24143. })
  24144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24145. }
  24146. // Do executes the "compute.autoscalers.patch" call.
  24147. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24148. // status code is an error. Response headers are in either
  24149. // *Operation.ServerResponse.Header or (if a response was returned at
  24150. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24151. // to check whether the returned error was because
  24152. // http.StatusNotModified was returned.
  24153. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24154. gensupport.SetOptions(c.urlParams_, opts...)
  24155. res, err := c.doRequest("json")
  24156. if res != nil && res.StatusCode == http.StatusNotModified {
  24157. if res.Body != nil {
  24158. res.Body.Close()
  24159. }
  24160. return nil, &googleapi.Error{
  24161. Code: res.StatusCode,
  24162. Header: res.Header,
  24163. }
  24164. }
  24165. if err != nil {
  24166. return nil, err
  24167. }
  24168. defer googleapi.CloseBody(res)
  24169. if err := googleapi.CheckResponse(res); err != nil {
  24170. return nil, err
  24171. }
  24172. ret := &Operation{
  24173. ServerResponse: googleapi.ServerResponse{
  24174. Header: res.Header,
  24175. HTTPStatusCode: res.StatusCode,
  24176. },
  24177. }
  24178. target := &ret
  24179. if err := gensupport.DecodeResponse(target, res); err != nil {
  24180. return nil, err
  24181. }
  24182. return ret, nil
  24183. // {
  24184. // "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.",
  24185. // "httpMethod": "PATCH",
  24186. // "id": "compute.autoscalers.patch",
  24187. // "parameterOrder": [
  24188. // "project",
  24189. // "zone"
  24190. // ],
  24191. // "parameters": {
  24192. // "autoscaler": {
  24193. // "description": "Name of the autoscaler to patch.",
  24194. // "location": "query",
  24195. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24196. // "type": "string"
  24197. // },
  24198. // "project": {
  24199. // "description": "Project ID for this request.",
  24200. // "location": "path",
  24201. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24202. // "required": true,
  24203. // "type": "string"
  24204. // },
  24205. // "requestId": {
  24206. // "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).",
  24207. // "location": "query",
  24208. // "type": "string"
  24209. // },
  24210. // "zone": {
  24211. // "description": "Name of the zone for this request.",
  24212. // "location": "path",
  24213. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24214. // "required": true,
  24215. // "type": "string"
  24216. // }
  24217. // },
  24218. // "path": "{project}/zones/{zone}/autoscalers",
  24219. // "request": {
  24220. // "$ref": "Autoscaler"
  24221. // },
  24222. // "response": {
  24223. // "$ref": "Operation"
  24224. // },
  24225. // "scopes": [
  24226. // "https://www.googleapis.com/auth/cloud-platform",
  24227. // "https://www.googleapis.com/auth/compute"
  24228. // ]
  24229. // }
  24230. }
  24231. // method id "compute.autoscalers.update":
  24232. type AutoscalersUpdateCall struct {
  24233. s *Service
  24234. project string
  24235. zone string
  24236. autoscaler *Autoscaler
  24237. urlParams_ gensupport.URLParams
  24238. ctx_ context.Context
  24239. header_ http.Header
  24240. }
  24241. // Update: Updates an autoscaler in the specified project using the data
  24242. // included in the request.
  24243. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  24244. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24245. c.project = project
  24246. c.zone = zone
  24247. c.autoscaler = autoscaler
  24248. return c
  24249. }
  24250. // Autoscaler sets the optional parameter "autoscaler": Name of the
  24251. // autoscaler to update.
  24252. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  24253. c.urlParams_.Set("autoscaler", autoscaler)
  24254. return c
  24255. }
  24256. // RequestId sets the optional parameter "requestId": An optional
  24257. // request ID to identify requests. Specify a unique request ID so that
  24258. // if you must retry your request, the server will know to ignore the
  24259. // request if it has already been completed.
  24260. //
  24261. // For example, consider a situation where you make an initial request
  24262. // and the request times out. If you make the request again with the
  24263. // same request ID, the server can check if original operation with the
  24264. // same request ID was received, and if so, will ignore the second
  24265. // request. This prevents clients from accidentally creating duplicate
  24266. // commitments.
  24267. //
  24268. // The request ID must be a valid UUID with the exception that zero UUID
  24269. // is not supported (00000000-0000-0000-0000-000000000000).
  24270. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  24271. c.urlParams_.Set("requestId", requestId)
  24272. return c
  24273. }
  24274. // Fields allows partial responses to be retrieved. See
  24275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24276. // for more information.
  24277. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  24278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24279. return c
  24280. }
  24281. // Context sets the context to be used in this call's Do method. Any
  24282. // pending HTTP request will be aborted if the provided context is
  24283. // canceled.
  24284. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  24285. c.ctx_ = ctx
  24286. return c
  24287. }
  24288. // Header returns an http.Header that can be modified by the caller to
  24289. // add HTTP headers to the request.
  24290. func (c *AutoscalersUpdateCall) Header() http.Header {
  24291. if c.header_ == nil {
  24292. c.header_ = make(http.Header)
  24293. }
  24294. return c.header_
  24295. }
  24296. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  24297. reqHeaders := make(http.Header)
  24298. for k, v := range c.header_ {
  24299. reqHeaders[k] = v
  24300. }
  24301. reqHeaders.Set("User-Agent", c.s.userAgent())
  24302. var body io.Reader = nil
  24303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  24304. if err != nil {
  24305. return nil, err
  24306. }
  24307. reqHeaders.Set("Content-Type", "application/json")
  24308. c.urlParams_.Set("alt", alt)
  24309. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  24310. urls += "?" + c.urlParams_.Encode()
  24311. req, _ := http.NewRequest("PUT", urls, body)
  24312. req.Header = reqHeaders
  24313. googleapi.Expand(req.URL, map[string]string{
  24314. "project": c.project,
  24315. "zone": c.zone,
  24316. })
  24317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24318. }
  24319. // Do executes the "compute.autoscalers.update" call.
  24320. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24321. // status code is an error. Response headers are in either
  24322. // *Operation.ServerResponse.Header or (if a response was returned at
  24323. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24324. // to check whether the returned error was because
  24325. // http.StatusNotModified was returned.
  24326. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24327. gensupport.SetOptions(c.urlParams_, opts...)
  24328. res, err := c.doRequest("json")
  24329. if res != nil && res.StatusCode == http.StatusNotModified {
  24330. if res.Body != nil {
  24331. res.Body.Close()
  24332. }
  24333. return nil, &googleapi.Error{
  24334. Code: res.StatusCode,
  24335. Header: res.Header,
  24336. }
  24337. }
  24338. if err != nil {
  24339. return nil, err
  24340. }
  24341. defer googleapi.CloseBody(res)
  24342. if err := googleapi.CheckResponse(res); err != nil {
  24343. return nil, err
  24344. }
  24345. ret := &Operation{
  24346. ServerResponse: googleapi.ServerResponse{
  24347. Header: res.Header,
  24348. HTTPStatusCode: res.StatusCode,
  24349. },
  24350. }
  24351. target := &ret
  24352. if err := gensupport.DecodeResponse(target, res); err != nil {
  24353. return nil, err
  24354. }
  24355. return ret, nil
  24356. // {
  24357. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  24358. // "httpMethod": "PUT",
  24359. // "id": "compute.autoscalers.update",
  24360. // "parameterOrder": [
  24361. // "project",
  24362. // "zone"
  24363. // ],
  24364. // "parameters": {
  24365. // "autoscaler": {
  24366. // "description": "Name of the autoscaler to update.",
  24367. // "location": "query",
  24368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24369. // "type": "string"
  24370. // },
  24371. // "project": {
  24372. // "description": "Project ID for this request.",
  24373. // "location": "path",
  24374. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24375. // "required": true,
  24376. // "type": "string"
  24377. // },
  24378. // "requestId": {
  24379. // "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).",
  24380. // "location": "query",
  24381. // "type": "string"
  24382. // },
  24383. // "zone": {
  24384. // "description": "Name of the zone for this request.",
  24385. // "location": "path",
  24386. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24387. // "required": true,
  24388. // "type": "string"
  24389. // }
  24390. // },
  24391. // "path": "{project}/zones/{zone}/autoscalers",
  24392. // "request": {
  24393. // "$ref": "Autoscaler"
  24394. // },
  24395. // "response": {
  24396. // "$ref": "Operation"
  24397. // },
  24398. // "scopes": [
  24399. // "https://www.googleapis.com/auth/cloud-platform",
  24400. // "https://www.googleapis.com/auth/compute"
  24401. // ]
  24402. // }
  24403. }
  24404. // method id "compute.backendBuckets.delete":
  24405. type BackendBucketsDeleteCall struct {
  24406. s *Service
  24407. project string
  24408. backendBucket string
  24409. urlParams_ gensupport.URLParams
  24410. ctx_ context.Context
  24411. header_ http.Header
  24412. }
  24413. // Delete: Deletes the specified BackendBucket resource.
  24414. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  24415. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24416. c.project = project
  24417. c.backendBucket = backendBucket
  24418. return c
  24419. }
  24420. // RequestId sets the optional parameter "requestId": An optional
  24421. // request ID to identify requests. Specify a unique request ID so that
  24422. // if you must retry your request, the server will know to ignore the
  24423. // request if it has already been completed.
  24424. //
  24425. // For example, consider a situation where you make an initial request
  24426. // and the request times out. If you make the request again with the
  24427. // same request ID, the server can check if original operation with the
  24428. // same request ID was received, and if so, will ignore the second
  24429. // request. This prevents clients from accidentally creating duplicate
  24430. // commitments.
  24431. //
  24432. // The request ID must be a valid UUID with the exception that zero UUID
  24433. // is not supported (00000000-0000-0000-0000-000000000000).
  24434. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  24435. c.urlParams_.Set("requestId", requestId)
  24436. return c
  24437. }
  24438. // Fields allows partial responses to be retrieved. See
  24439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24440. // for more information.
  24441. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  24442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24443. return c
  24444. }
  24445. // Context sets the context to be used in this call's Do method. Any
  24446. // pending HTTP request will be aborted if the provided context is
  24447. // canceled.
  24448. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  24449. c.ctx_ = ctx
  24450. return c
  24451. }
  24452. // Header returns an http.Header that can be modified by the caller to
  24453. // add HTTP headers to the request.
  24454. func (c *BackendBucketsDeleteCall) Header() http.Header {
  24455. if c.header_ == nil {
  24456. c.header_ = make(http.Header)
  24457. }
  24458. return c.header_
  24459. }
  24460. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  24461. reqHeaders := make(http.Header)
  24462. for k, v := range c.header_ {
  24463. reqHeaders[k] = v
  24464. }
  24465. reqHeaders.Set("User-Agent", c.s.userAgent())
  24466. var body io.Reader = nil
  24467. c.urlParams_.Set("alt", alt)
  24468. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  24469. urls += "?" + c.urlParams_.Encode()
  24470. req, _ := http.NewRequest("DELETE", urls, body)
  24471. req.Header = reqHeaders
  24472. googleapi.Expand(req.URL, map[string]string{
  24473. "project": c.project,
  24474. "backendBucket": c.backendBucket,
  24475. })
  24476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24477. }
  24478. // Do executes the "compute.backendBuckets.delete" call.
  24479. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24480. // status code is an error. Response headers are in either
  24481. // *Operation.ServerResponse.Header or (if a response was returned at
  24482. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24483. // to check whether the returned error was because
  24484. // http.StatusNotModified was returned.
  24485. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24486. gensupport.SetOptions(c.urlParams_, opts...)
  24487. res, err := c.doRequest("json")
  24488. if res != nil && res.StatusCode == http.StatusNotModified {
  24489. if res.Body != nil {
  24490. res.Body.Close()
  24491. }
  24492. return nil, &googleapi.Error{
  24493. Code: res.StatusCode,
  24494. Header: res.Header,
  24495. }
  24496. }
  24497. if err != nil {
  24498. return nil, err
  24499. }
  24500. defer googleapi.CloseBody(res)
  24501. if err := googleapi.CheckResponse(res); err != nil {
  24502. return nil, err
  24503. }
  24504. ret := &Operation{
  24505. ServerResponse: googleapi.ServerResponse{
  24506. Header: res.Header,
  24507. HTTPStatusCode: res.StatusCode,
  24508. },
  24509. }
  24510. target := &ret
  24511. if err := gensupport.DecodeResponse(target, res); err != nil {
  24512. return nil, err
  24513. }
  24514. return ret, nil
  24515. // {
  24516. // "description": "Deletes the specified BackendBucket resource.",
  24517. // "httpMethod": "DELETE",
  24518. // "id": "compute.backendBuckets.delete",
  24519. // "parameterOrder": [
  24520. // "project",
  24521. // "backendBucket"
  24522. // ],
  24523. // "parameters": {
  24524. // "backendBucket": {
  24525. // "description": "Name of the BackendBucket resource to delete.",
  24526. // "location": "path",
  24527. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24528. // "required": true,
  24529. // "type": "string"
  24530. // },
  24531. // "project": {
  24532. // "description": "Project ID for this request.",
  24533. // "location": "path",
  24534. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24535. // "required": true,
  24536. // "type": "string"
  24537. // },
  24538. // "requestId": {
  24539. // "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).",
  24540. // "location": "query",
  24541. // "type": "string"
  24542. // }
  24543. // },
  24544. // "path": "{project}/global/backendBuckets/{backendBucket}",
  24545. // "response": {
  24546. // "$ref": "Operation"
  24547. // },
  24548. // "scopes": [
  24549. // "https://www.googleapis.com/auth/cloud-platform",
  24550. // "https://www.googleapis.com/auth/compute"
  24551. // ]
  24552. // }
  24553. }
  24554. // method id "compute.backendBuckets.get":
  24555. type BackendBucketsGetCall struct {
  24556. s *Service
  24557. project string
  24558. backendBucket string
  24559. urlParams_ gensupport.URLParams
  24560. ifNoneMatch_ string
  24561. ctx_ context.Context
  24562. header_ http.Header
  24563. }
  24564. // Get: Returns the specified BackendBucket resource. Gets a list of
  24565. // available backend buckets by making a list() request.
  24566. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  24567. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24568. c.project = project
  24569. c.backendBucket = backendBucket
  24570. return c
  24571. }
  24572. // Fields allows partial responses to be retrieved. See
  24573. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24574. // for more information.
  24575. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  24576. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24577. return c
  24578. }
  24579. // IfNoneMatch sets the optional parameter which makes the operation
  24580. // fail if the object's ETag matches the given value. This is useful for
  24581. // getting updates only after the object has changed since the last
  24582. // request. Use googleapi.IsNotModified to check whether the response
  24583. // error from Do is the result of In-None-Match.
  24584. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  24585. c.ifNoneMatch_ = entityTag
  24586. return c
  24587. }
  24588. // Context sets the context to be used in this call's Do method. Any
  24589. // pending HTTP request will be aborted if the provided context is
  24590. // canceled.
  24591. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  24592. c.ctx_ = ctx
  24593. return c
  24594. }
  24595. // Header returns an http.Header that can be modified by the caller to
  24596. // add HTTP headers to the request.
  24597. func (c *BackendBucketsGetCall) Header() http.Header {
  24598. if c.header_ == nil {
  24599. c.header_ = make(http.Header)
  24600. }
  24601. return c.header_
  24602. }
  24603. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  24604. reqHeaders := make(http.Header)
  24605. for k, v := range c.header_ {
  24606. reqHeaders[k] = v
  24607. }
  24608. reqHeaders.Set("User-Agent", c.s.userAgent())
  24609. if c.ifNoneMatch_ != "" {
  24610. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24611. }
  24612. var body io.Reader = nil
  24613. c.urlParams_.Set("alt", alt)
  24614. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  24615. urls += "?" + c.urlParams_.Encode()
  24616. req, _ := http.NewRequest("GET", urls, body)
  24617. req.Header = reqHeaders
  24618. googleapi.Expand(req.URL, map[string]string{
  24619. "project": c.project,
  24620. "backendBucket": c.backendBucket,
  24621. })
  24622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24623. }
  24624. // Do executes the "compute.backendBuckets.get" call.
  24625. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  24626. // status code is an error. Response headers are in either
  24627. // *BackendBucket.ServerResponse.Header or (if a response was returned
  24628. // at all) in error.(*googleapi.Error).Header. Use
  24629. // googleapi.IsNotModified to check whether the returned error was
  24630. // because http.StatusNotModified was returned.
  24631. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  24632. gensupport.SetOptions(c.urlParams_, opts...)
  24633. res, err := c.doRequest("json")
  24634. if res != nil && res.StatusCode == http.StatusNotModified {
  24635. if res.Body != nil {
  24636. res.Body.Close()
  24637. }
  24638. return nil, &googleapi.Error{
  24639. Code: res.StatusCode,
  24640. Header: res.Header,
  24641. }
  24642. }
  24643. if err != nil {
  24644. return nil, err
  24645. }
  24646. defer googleapi.CloseBody(res)
  24647. if err := googleapi.CheckResponse(res); err != nil {
  24648. return nil, err
  24649. }
  24650. ret := &BackendBucket{
  24651. ServerResponse: googleapi.ServerResponse{
  24652. Header: res.Header,
  24653. HTTPStatusCode: res.StatusCode,
  24654. },
  24655. }
  24656. target := &ret
  24657. if err := gensupport.DecodeResponse(target, res); err != nil {
  24658. return nil, err
  24659. }
  24660. return ret, nil
  24661. // {
  24662. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  24663. // "httpMethod": "GET",
  24664. // "id": "compute.backendBuckets.get",
  24665. // "parameterOrder": [
  24666. // "project",
  24667. // "backendBucket"
  24668. // ],
  24669. // "parameters": {
  24670. // "backendBucket": {
  24671. // "description": "Name of the BackendBucket resource to return.",
  24672. // "location": "path",
  24673. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  24674. // "required": true,
  24675. // "type": "string"
  24676. // },
  24677. // "project": {
  24678. // "description": "Project ID for this request.",
  24679. // "location": "path",
  24680. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24681. // "required": true,
  24682. // "type": "string"
  24683. // }
  24684. // },
  24685. // "path": "{project}/global/backendBuckets/{backendBucket}",
  24686. // "response": {
  24687. // "$ref": "BackendBucket"
  24688. // },
  24689. // "scopes": [
  24690. // "https://www.googleapis.com/auth/cloud-platform",
  24691. // "https://www.googleapis.com/auth/compute",
  24692. // "https://www.googleapis.com/auth/compute.readonly"
  24693. // ]
  24694. // }
  24695. }
  24696. // method id "compute.backendBuckets.insert":
  24697. type BackendBucketsInsertCall struct {
  24698. s *Service
  24699. project string
  24700. backendbucket *BackendBucket
  24701. urlParams_ gensupport.URLParams
  24702. ctx_ context.Context
  24703. header_ http.Header
  24704. }
  24705. // Insert: Creates a BackendBucket resource in the specified project
  24706. // using the data included in the request.
  24707. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  24708. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24709. c.project = project
  24710. c.backendbucket = backendbucket
  24711. return c
  24712. }
  24713. // RequestId sets the optional parameter "requestId": An optional
  24714. // request ID to identify requests. Specify a unique request ID so that
  24715. // if you must retry your request, the server will know to ignore the
  24716. // request if it has already been completed.
  24717. //
  24718. // For example, consider a situation where you make an initial request
  24719. // and the request times out. If you make the request again with the
  24720. // same request ID, the server can check if original operation with the
  24721. // same request ID was received, and if so, will ignore the second
  24722. // request. This prevents clients from accidentally creating duplicate
  24723. // commitments.
  24724. //
  24725. // The request ID must be a valid UUID with the exception that zero UUID
  24726. // is not supported (00000000-0000-0000-0000-000000000000).
  24727. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  24728. c.urlParams_.Set("requestId", requestId)
  24729. return c
  24730. }
  24731. // Fields allows partial responses to be retrieved. See
  24732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24733. // for more information.
  24734. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  24735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24736. return c
  24737. }
  24738. // Context sets the context to be used in this call's Do method. Any
  24739. // pending HTTP request will be aborted if the provided context is
  24740. // canceled.
  24741. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  24742. c.ctx_ = ctx
  24743. return c
  24744. }
  24745. // Header returns an http.Header that can be modified by the caller to
  24746. // add HTTP headers to the request.
  24747. func (c *BackendBucketsInsertCall) Header() http.Header {
  24748. if c.header_ == nil {
  24749. c.header_ = make(http.Header)
  24750. }
  24751. return c.header_
  24752. }
  24753. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  24754. reqHeaders := make(http.Header)
  24755. for k, v := range c.header_ {
  24756. reqHeaders[k] = v
  24757. }
  24758. reqHeaders.Set("User-Agent", c.s.userAgent())
  24759. var body io.Reader = nil
  24760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  24761. if err != nil {
  24762. return nil, err
  24763. }
  24764. reqHeaders.Set("Content-Type", "application/json")
  24765. c.urlParams_.Set("alt", alt)
  24766. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  24767. urls += "?" + c.urlParams_.Encode()
  24768. req, _ := http.NewRequest("POST", urls, body)
  24769. req.Header = reqHeaders
  24770. googleapi.Expand(req.URL, map[string]string{
  24771. "project": c.project,
  24772. })
  24773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24774. }
  24775. // Do executes the "compute.backendBuckets.insert" call.
  24776. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  24777. // status code is an error. Response headers are in either
  24778. // *Operation.ServerResponse.Header or (if a response was returned at
  24779. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24780. // to check whether the returned error was because
  24781. // http.StatusNotModified was returned.
  24782. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  24783. gensupport.SetOptions(c.urlParams_, opts...)
  24784. res, err := c.doRequest("json")
  24785. if res != nil && res.StatusCode == http.StatusNotModified {
  24786. if res.Body != nil {
  24787. res.Body.Close()
  24788. }
  24789. return nil, &googleapi.Error{
  24790. Code: res.StatusCode,
  24791. Header: res.Header,
  24792. }
  24793. }
  24794. if err != nil {
  24795. return nil, err
  24796. }
  24797. defer googleapi.CloseBody(res)
  24798. if err := googleapi.CheckResponse(res); err != nil {
  24799. return nil, err
  24800. }
  24801. ret := &Operation{
  24802. ServerResponse: googleapi.ServerResponse{
  24803. Header: res.Header,
  24804. HTTPStatusCode: res.StatusCode,
  24805. },
  24806. }
  24807. target := &ret
  24808. if err := gensupport.DecodeResponse(target, res); err != nil {
  24809. return nil, err
  24810. }
  24811. return ret, nil
  24812. // {
  24813. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  24814. // "httpMethod": "POST",
  24815. // "id": "compute.backendBuckets.insert",
  24816. // "parameterOrder": [
  24817. // "project"
  24818. // ],
  24819. // "parameters": {
  24820. // "project": {
  24821. // "description": "Project ID for this request.",
  24822. // "location": "path",
  24823. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  24824. // "required": true,
  24825. // "type": "string"
  24826. // },
  24827. // "requestId": {
  24828. // "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).",
  24829. // "location": "query",
  24830. // "type": "string"
  24831. // }
  24832. // },
  24833. // "path": "{project}/global/backendBuckets",
  24834. // "request": {
  24835. // "$ref": "BackendBucket"
  24836. // },
  24837. // "response": {
  24838. // "$ref": "Operation"
  24839. // },
  24840. // "scopes": [
  24841. // "https://www.googleapis.com/auth/cloud-platform",
  24842. // "https://www.googleapis.com/auth/compute"
  24843. // ]
  24844. // }
  24845. }
  24846. // method id "compute.backendBuckets.list":
  24847. type BackendBucketsListCall struct {
  24848. s *Service
  24849. project string
  24850. urlParams_ gensupport.URLParams
  24851. ifNoneMatch_ string
  24852. ctx_ context.Context
  24853. header_ http.Header
  24854. }
  24855. // List: Retrieves the list of BackendBucket resources available to the
  24856. // specified project.
  24857. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  24858. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24859. c.project = project
  24860. return c
  24861. }
  24862. // Filter sets the optional parameter "filter": A filter expression that
  24863. // filters resources listed in the response. The expression must specify
  24864. // the field name, a comparison operator, and the value that you want to
  24865. // use for filtering. The value must be a string, a number, or a
  24866. // boolean. The comparison operator must be either =, !=, >, or <.
  24867. //
  24868. // For example, if you are filtering Compute Engine instances, you can
  24869. // exclude instances named example-instance by specifying name !=
  24870. // example-instance.
  24871. //
  24872. // You can also filter nested fields. For example, you could specify
  24873. // scheduling.automaticRestart = false to include instances only if they
  24874. // are not scheduled for automatic restarts. You can use filtering on
  24875. // nested fields to filter based on resource labels.
  24876. //
  24877. // To filter on multiple expressions, provide each separate expression
  24878. // within parentheses. For example, (scheduling.automaticRestart = true)
  24879. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  24880. // AND expression. However, you can include AND and OR expressions
  24881. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  24882. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  24883. // true).
  24884. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  24885. c.urlParams_.Set("filter", filter)
  24886. return c
  24887. }
  24888. // MaxResults sets the optional parameter "maxResults": The maximum
  24889. // number of results per page that should be returned. If the number of
  24890. // available results is larger than maxResults, Compute Engine returns a
  24891. // nextPageToken that can be used to get the next page of results in
  24892. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  24893. // (Default: 500)
  24894. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  24895. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24896. return c
  24897. }
  24898. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  24899. // a certain order. By default, results are returned in alphanumerical
  24900. // order based on the resource name.
  24901. //
  24902. // You can also sort results in descending order based on the creation
  24903. // timestamp using orderBy="creationTimestamp desc". This sorts results
  24904. // based on the creationTimestamp field in reverse chronological order
  24905. // (newest result first). Use this to sort resources like operations so
  24906. // that the newest operation is returned first.
  24907. //
  24908. // Currently, only sorting by name or creationTimestamp desc is
  24909. // supported.
  24910. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  24911. c.urlParams_.Set("orderBy", orderBy)
  24912. return c
  24913. }
  24914. // PageToken sets the optional parameter "pageToken": Specifies a page
  24915. // token to use. Set pageToken to the nextPageToken returned by a
  24916. // previous list request to get the next page of results.
  24917. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  24918. c.urlParams_.Set("pageToken", pageToken)
  24919. return c
  24920. }
  24921. // Fields allows partial responses to be retrieved. See
  24922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24923. // for more information.
  24924. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  24925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24926. return c
  24927. }
  24928. // IfNoneMatch sets the optional parameter which makes the operation
  24929. // fail if the object's ETag matches the given value. This is useful for
  24930. // getting updates only after the object has changed since the last
  24931. // request. Use googleapi.IsNotModified to check whether the response
  24932. // error from Do is the result of In-None-Match.
  24933. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  24934. c.ifNoneMatch_ = entityTag
  24935. return c
  24936. }
  24937. // Context sets the context to be used in this call's Do method. Any
  24938. // pending HTTP request will be aborted if the provided context is
  24939. // canceled.
  24940. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  24941. c.ctx_ = ctx
  24942. return c
  24943. }
  24944. // Header returns an http.Header that can be modified by the caller to
  24945. // add HTTP headers to the request.
  24946. func (c *BackendBucketsListCall) Header() http.Header {
  24947. if c.header_ == nil {
  24948. c.header_ = make(http.Header)
  24949. }
  24950. return c.header_
  24951. }
  24952. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  24953. reqHeaders := make(http.Header)
  24954. for k, v := range c.header_ {
  24955. reqHeaders[k] = v
  24956. }
  24957. reqHeaders.Set("User-Agent", c.s.userAgent())
  24958. if c.ifNoneMatch_ != "" {
  24959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24960. }
  24961. var body io.Reader = nil
  24962. c.urlParams_.Set("alt", alt)
  24963. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  24964. urls += "?" + c.urlParams_.Encode()
  24965. req, _ := http.NewRequest("GET", urls, body)
  24966. req.Header = reqHeaders
  24967. googleapi.Expand(req.URL, map[string]string{
  24968. "project": c.project,
  24969. })
  24970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24971. }
  24972. // Do executes the "compute.backendBuckets.list" call.
  24973. // Exactly one of *BackendBucketList or error will be non-nil. Any
  24974. // non-2xx status code is an error. Response headers are in either
  24975. // *BackendBucketList.ServerResponse.Header or (if a response was
  24976. // returned at all) in error.(*googleapi.Error).Header. Use
  24977. // googleapi.IsNotModified to check whether the returned error was
  24978. // because http.StatusNotModified was returned.
  24979. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  24980. gensupport.SetOptions(c.urlParams_, opts...)
  24981. res, err := c.doRequest("json")
  24982. if res != nil && res.StatusCode == http.StatusNotModified {
  24983. if res.Body != nil {
  24984. res.Body.Close()
  24985. }
  24986. return nil, &googleapi.Error{
  24987. Code: res.StatusCode,
  24988. Header: res.Header,
  24989. }
  24990. }
  24991. if err != nil {
  24992. return nil, err
  24993. }
  24994. defer googleapi.CloseBody(res)
  24995. if err := googleapi.CheckResponse(res); err != nil {
  24996. return nil, err
  24997. }
  24998. ret := &BackendBucketList{
  24999. ServerResponse: googleapi.ServerResponse{
  25000. Header: res.Header,
  25001. HTTPStatusCode: res.StatusCode,
  25002. },
  25003. }
  25004. target := &ret
  25005. if err := gensupport.DecodeResponse(target, res); err != nil {
  25006. return nil, err
  25007. }
  25008. return ret, nil
  25009. // {
  25010. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  25011. // "httpMethod": "GET",
  25012. // "id": "compute.backendBuckets.list",
  25013. // "parameterOrder": [
  25014. // "project"
  25015. // ],
  25016. // "parameters": {
  25017. // "filter": {
  25018. // "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).",
  25019. // "location": "query",
  25020. // "type": "string"
  25021. // },
  25022. // "maxResults": {
  25023. // "default": "500",
  25024. // "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)",
  25025. // "format": "uint32",
  25026. // "location": "query",
  25027. // "minimum": "0",
  25028. // "type": "integer"
  25029. // },
  25030. // "orderBy": {
  25031. // "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.",
  25032. // "location": "query",
  25033. // "type": "string"
  25034. // },
  25035. // "pageToken": {
  25036. // "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.",
  25037. // "location": "query",
  25038. // "type": "string"
  25039. // },
  25040. // "project": {
  25041. // "description": "Project ID for this request.",
  25042. // "location": "path",
  25043. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25044. // "required": true,
  25045. // "type": "string"
  25046. // }
  25047. // },
  25048. // "path": "{project}/global/backendBuckets",
  25049. // "response": {
  25050. // "$ref": "BackendBucketList"
  25051. // },
  25052. // "scopes": [
  25053. // "https://www.googleapis.com/auth/cloud-platform",
  25054. // "https://www.googleapis.com/auth/compute",
  25055. // "https://www.googleapis.com/auth/compute.readonly"
  25056. // ]
  25057. // }
  25058. }
  25059. // Pages invokes f for each page of results.
  25060. // A non-nil error returned from f will halt the iteration.
  25061. // The provided context supersedes any context provided to the Context method.
  25062. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  25063. c.ctx_ = ctx
  25064. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25065. for {
  25066. x, err := c.Do()
  25067. if err != nil {
  25068. return err
  25069. }
  25070. if err := f(x); err != nil {
  25071. return err
  25072. }
  25073. if x.NextPageToken == "" {
  25074. return nil
  25075. }
  25076. c.PageToken(x.NextPageToken)
  25077. }
  25078. }
  25079. // method id "compute.backendBuckets.patch":
  25080. type BackendBucketsPatchCall struct {
  25081. s *Service
  25082. project string
  25083. backendBucket string
  25084. backendbucket *BackendBucket
  25085. urlParams_ gensupport.URLParams
  25086. ctx_ context.Context
  25087. header_ http.Header
  25088. }
  25089. // Patch: Updates the specified BackendBucket resource with the data
  25090. // included in the request. This method supports PATCH semantics and
  25091. // uses the JSON merge patch format and processing rules.
  25092. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  25093. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25094. c.project = project
  25095. c.backendBucket = backendBucket
  25096. c.backendbucket = backendbucket
  25097. return c
  25098. }
  25099. // RequestId sets the optional parameter "requestId": An optional
  25100. // request ID to identify requests. Specify a unique request ID so that
  25101. // if you must retry your request, the server will know to ignore the
  25102. // request if it has already been completed.
  25103. //
  25104. // For example, consider a situation where you make an initial request
  25105. // and the request times out. If you make the request again with the
  25106. // same request ID, the server can check if original operation with the
  25107. // same request ID was received, and if so, will ignore the second
  25108. // request. This prevents clients from accidentally creating duplicate
  25109. // commitments.
  25110. //
  25111. // The request ID must be a valid UUID with the exception that zero UUID
  25112. // is not supported (00000000-0000-0000-0000-000000000000).
  25113. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  25114. c.urlParams_.Set("requestId", requestId)
  25115. return c
  25116. }
  25117. // Fields allows partial responses to be retrieved. See
  25118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25119. // for more information.
  25120. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  25121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25122. return c
  25123. }
  25124. // Context sets the context to be used in this call's Do method. Any
  25125. // pending HTTP request will be aborted if the provided context is
  25126. // canceled.
  25127. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  25128. c.ctx_ = ctx
  25129. return c
  25130. }
  25131. // Header returns an http.Header that can be modified by the caller to
  25132. // add HTTP headers to the request.
  25133. func (c *BackendBucketsPatchCall) Header() http.Header {
  25134. if c.header_ == nil {
  25135. c.header_ = make(http.Header)
  25136. }
  25137. return c.header_
  25138. }
  25139. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  25140. reqHeaders := make(http.Header)
  25141. for k, v := range c.header_ {
  25142. reqHeaders[k] = v
  25143. }
  25144. reqHeaders.Set("User-Agent", c.s.userAgent())
  25145. var body io.Reader = nil
  25146. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  25147. if err != nil {
  25148. return nil, err
  25149. }
  25150. reqHeaders.Set("Content-Type", "application/json")
  25151. c.urlParams_.Set("alt", alt)
  25152. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  25153. urls += "?" + c.urlParams_.Encode()
  25154. req, _ := http.NewRequest("PATCH", urls, body)
  25155. req.Header = reqHeaders
  25156. googleapi.Expand(req.URL, map[string]string{
  25157. "project": c.project,
  25158. "backendBucket": c.backendBucket,
  25159. })
  25160. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25161. }
  25162. // Do executes the "compute.backendBuckets.patch" call.
  25163. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25164. // status code is an error. Response headers are in either
  25165. // *Operation.ServerResponse.Header or (if a response was returned at
  25166. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25167. // to check whether the returned error was because
  25168. // http.StatusNotModified was returned.
  25169. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25170. gensupport.SetOptions(c.urlParams_, opts...)
  25171. res, err := c.doRequest("json")
  25172. if res != nil && res.StatusCode == http.StatusNotModified {
  25173. if res.Body != nil {
  25174. res.Body.Close()
  25175. }
  25176. return nil, &googleapi.Error{
  25177. Code: res.StatusCode,
  25178. Header: res.Header,
  25179. }
  25180. }
  25181. if err != nil {
  25182. return nil, err
  25183. }
  25184. defer googleapi.CloseBody(res)
  25185. if err := googleapi.CheckResponse(res); err != nil {
  25186. return nil, err
  25187. }
  25188. ret := &Operation{
  25189. ServerResponse: googleapi.ServerResponse{
  25190. Header: res.Header,
  25191. HTTPStatusCode: res.StatusCode,
  25192. },
  25193. }
  25194. target := &ret
  25195. if err := gensupport.DecodeResponse(target, res); err != nil {
  25196. return nil, err
  25197. }
  25198. return ret, nil
  25199. // {
  25200. // "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.",
  25201. // "httpMethod": "PATCH",
  25202. // "id": "compute.backendBuckets.patch",
  25203. // "parameterOrder": [
  25204. // "project",
  25205. // "backendBucket"
  25206. // ],
  25207. // "parameters": {
  25208. // "backendBucket": {
  25209. // "description": "Name of the BackendBucket resource to patch.",
  25210. // "location": "path",
  25211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25212. // "required": true,
  25213. // "type": "string"
  25214. // },
  25215. // "project": {
  25216. // "description": "Project ID for this request.",
  25217. // "location": "path",
  25218. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25219. // "required": true,
  25220. // "type": "string"
  25221. // },
  25222. // "requestId": {
  25223. // "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).",
  25224. // "location": "query",
  25225. // "type": "string"
  25226. // }
  25227. // },
  25228. // "path": "{project}/global/backendBuckets/{backendBucket}",
  25229. // "request": {
  25230. // "$ref": "BackendBucket"
  25231. // },
  25232. // "response": {
  25233. // "$ref": "Operation"
  25234. // },
  25235. // "scopes": [
  25236. // "https://www.googleapis.com/auth/cloud-platform",
  25237. // "https://www.googleapis.com/auth/compute"
  25238. // ]
  25239. // }
  25240. }
  25241. // method id "compute.backendBuckets.update":
  25242. type BackendBucketsUpdateCall struct {
  25243. s *Service
  25244. project string
  25245. backendBucket string
  25246. backendbucket *BackendBucket
  25247. urlParams_ gensupport.URLParams
  25248. ctx_ context.Context
  25249. header_ http.Header
  25250. }
  25251. // Update: Updates the specified BackendBucket resource with the data
  25252. // included in the request.
  25253. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  25254. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25255. c.project = project
  25256. c.backendBucket = backendBucket
  25257. c.backendbucket = backendbucket
  25258. return c
  25259. }
  25260. // RequestId sets the optional parameter "requestId": An optional
  25261. // request ID to identify requests. Specify a unique request ID so that
  25262. // if you must retry your request, the server will know to ignore the
  25263. // request if it has already been completed.
  25264. //
  25265. // For example, consider a situation where you make an initial request
  25266. // and the request times out. If you make the request again with the
  25267. // same request ID, the server can check if original operation with the
  25268. // same request ID was received, and if so, will ignore the second
  25269. // request. This prevents clients from accidentally creating duplicate
  25270. // commitments.
  25271. //
  25272. // The request ID must be a valid UUID with the exception that zero UUID
  25273. // is not supported (00000000-0000-0000-0000-000000000000).
  25274. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  25275. c.urlParams_.Set("requestId", requestId)
  25276. return c
  25277. }
  25278. // Fields allows partial responses to be retrieved. See
  25279. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25280. // for more information.
  25281. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  25282. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25283. return c
  25284. }
  25285. // Context sets the context to be used in this call's Do method. Any
  25286. // pending HTTP request will be aborted if the provided context is
  25287. // canceled.
  25288. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  25289. c.ctx_ = ctx
  25290. return c
  25291. }
  25292. // Header returns an http.Header that can be modified by the caller to
  25293. // add HTTP headers to the request.
  25294. func (c *BackendBucketsUpdateCall) Header() http.Header {
  25295. if c.header_ == nil {
  25296. c.header_ = make(http.Header)
  25297. }
  25298. return c.header_
  25299. }
  25300. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  25301. reqHeaders := make(http.Header)
  25302. for k, v := range c.header_ {
  25303. reqHeaders[k] = v
  25304. }
  25305. reqHeaders.Set("User-Agent", c.s.userAgent())
  25306. var body io.Reader = nil
  25307. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  25308. if err != nil {
  25309. return nil, err
  25310. }
  25311. reqHeaders.Set("Content-Type", "application/json")
  25312. c.urlParams_.Set("alt", alt)
  25313. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  25314. urls += "?" + c.urlParams_.Encode()
  25315. req, _ := http.NewRequest("PUT", urls, body)
  25316. req.Header = reqHeaders
  25317. googleapi.Expand(req.URL, map[string]string{
  25318. "project": c.project,
  25319. "backendBucket": c.backendBucket,
  25320. })
  25321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25322. }
  25323. // Do executes the "compute.backendBuckets.update" call.
  25324. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25325. // status code is an error. Response headers are in either
  25326. // *Operation.ServerResponse.Header or (if a response was returned at
  25327. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25328. // to check whether the returned error was because
  25329. // http.StatusNotModified was returned.
  25330. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25331. gensupport.SetOptions(c.urlParams_, opts...)
  25332. res, err := c.doRequest("json")
  25333. if res != nil && res.StatusCode == http.StatusNotModified {
  25334. if res.Body != nil {
  25335. res.Body.Close()
  25336. }
  25337. return nil, &googleapi.Error{
  25338. Code: res.StatusCode,
  25339. Header: res.Header,
  25340. }
  25341. }
  25342. if err != nil {
  25343. return nil, err
  25344. }
  25345. defer googleapi.CloseBody(res)
  25346. if err := googleapi.CheckResponse(res); err != nil {
  25347. return nil, err
  25348. }
  25349. ret := &Operation{
  25350. ServerResponse: googleapi.ServerResponse{
  25351. Header: res.Header,
  25352. HTTPStatusCode: res.StatusCode,
  25353. },
  25354. }
  25355. target := &ret
  25356. if err := gensupport.DecodeResponse(target, res); err != nil {
  25357. return nil, err
  25358. }
  25359. return ret, nil
  25360. // {
  25361. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  25362. // "httpMethod": "PUT",
  25363. // "id": "compute.backendBuckets.update",
  25364. // "parameterOrder": [
  25365. // "project",
  25366. // "backendBucket"
  25367. // ],
  25368. // "parameters": {
  25369. // "backendBucket": {
  25370. // "description": "Name of the BackendBucket resource to update.",
  25371. // "location": "path",
  25372. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25373. // "required": true,
  25374. // "type": "string"
  25375. // },
  25376. // "project": {
  25377. // "description": "Project ID for this request.",
  25378. // "location": "path",
  25379. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25380. // "required": true,
  25381. // "type": "string"
  25382. // },
  25383. // "requestId": {
  25384. // "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).",
  25385. // "location": "query",
  25386. // "type": "string"
  25387. // }
  25388. // },
  25389. // "path": "{project}/global/backendBuckets/{backendBucket}",
  25390. // "request": {
  25391. // "$ref": "BackendBucket"
  25392. // },
  25393. // "response": {
  25394. // "$ref": "Operation"
  25395. // },
  25396. // "scopes": [
  25397. // "https://www.googleapis.com/auth/cloud-platform",
  25398. // "https://www.googleapis.com/auth/compute"
  25399. // ]
  25400. // }
  25401. }
  25402. // method id "compute.backendServices.aggregatedList":
  25403. type BackendServicesAggregatedListCall struct {
  25404. s *Service
  25405. project string
  25406. urlParams_ gensupport.URLParams
  25407. ifNoneMatch_ string
  25408. ctx_ context.Context
  25409. header_ http.Header
  25410. }
  25411. // AggregatedList: Retrieves the list of all BackendService resources,
  25412. // regional and global, available to the specified project.
  25413. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  25414. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25415. c.project = project
  25416. return c
  25417. }
  25418. // Filter sets the optional parameter "filter": A filter expression that
  25419. // filters resources listed in the response. The expression must specify
  25420. // the field name, a comparison operator, and the value that you want to
  25421. // use for filtering. The value must be a string, a number, or a
  25422. // boolean. The comparison operator must be either =, !=, >, or <.
  25423. //
  25424. // For example, if you are filtering Compute Engine instances, you can
  25425. // exclude instances named example-instance by specifying name !=
  25426. // example-instance.
  25427. //
  25428. // You can also filter nested fields. For example, you could specify
  25429. // scheduling.automaticRestart = false to include instances only if they
  25430. // are not scheduled for automatic restarts. You can use filtering on
  25431. // nested fields to filter based on resource labels.
  25432. //
  25433. // To filter on multiple expressions, provide each separate expression
  25434. // within parentheses. For example, (scheduling.automaticRestart = true)
  25435. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  25436. // AND expression. However, you can include AND and OR expressions
  25437. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  25438. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  25439. // true).
  25440. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  25441. c.urlParams_.Set("filter", filter)
  25442. return c
  25443. }
  25444. // MaxResults sets the optional parameter "maxResults": The maximum
  25445. // number of results per page that should be returned. If the number of
  25446. // available results is larger than maxResults, Compute Engine returns a
  25447. // nextPageToken that can be used to get the next page of results in
  25448. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  25449. // (Default: 500)
  25450. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  25451. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25452. return c
  25453. }
  25454. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  25455. // a certain order. By default, results are returned in alphanumerical
  25456. // order based on the resource name.
  25457. //
  25458. // You can also sort results in descending order based on the creation
  25459. // timestamp using orderBy="creationTimestamp desc". This sorts results
  25460. // based on the creationTimestamp field in reverse chronological order
  25461. // (newest result first). Use this to sort resources like operations so
  25462. // that the newest operation is returned first.
  25463. //
  25464. // Currently, only sorting by name or creationTimestamp desc is
  25465. // supported.
  25466. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  25467. c.urlParams_.Set("orderBy", orderBy)
  25468. return c
  25469. }
  25470. // PageToken sets the optional parameter "pageToken": Specifies a page
  25471. // token to use. Set pageToken to the nextPageToken returned by a
  25472. // previous list request to get the next page of results.
  25473. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  25474. c.urlParams_.Set("pageToken", pageToken)
  25475. return c
  25476. }
  25477. // Fields allows partial responses to be retrieved. See
  25478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25479. // for more information.
  25480. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  25481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25482. return c
  25483. }
  25484. // IfNoneMatch sets the optional parameter which makes the operation
  25485. // fail if the object's ETag matches the given value. This is useful for
  25486. // getting updates only after the object has changed since the last
  25487. // request. Use googleapi.IsNotModified to check whether the response
  25488. // error from Do is the result of In-None-Match.
  25489. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  25490. c.ifNoneMatch_ = entityTag
  25491. return c
  25492. }
  25493. // Context sets the context to be used in this call's Do method. Any
  25494. // pending HTTP request will be aborted if the provided context is
  25495. // canceled.
  25496. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  25497. c.ctx_ = ctx
  25498. return c
  25499. }
  25500. // Header returns an http.Header that can be modified by the caller to
  25501. // add HTTP headers to the request.
  25502. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  25503. if c.header_ == nil {
  25504. c.header_ = make(http.Header)
  25505. }
  25506. return c.header_
  25507. }
  25508. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  25509. reqHeaders := make(http.Header)
  25510. for k, v := range c.header_ {
  25511. reqHeaders[k] = v
  25512. }
  25513. reqHeaders.Set("User-Agent", c.s.userAgent())
  25514. if c.ifNoneMatch_ != "" {
  25515. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25516. }
  25517. var body io.Reader = nil
  25518. c.urlParams_.Set("alt", alt)
  25519. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  25520. urls += "?" + c.urlParams_.Encode()
  25521. req, _ := http.NewRequest("GET", urls, body)
  25522. req.Header = reqHeaders
  25523. googleapi.Expand(req.URL, map[string]string{
  25524. "project": c.project,
  25525. })
  25526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25527. }
  25528. // Do executes the "compute.backendServices.aggregatedList" call.
  25529. // Exactly one of *BackendServiceAggregatedList or error will be
  25530. // non-nil. Any non-2xx status code is an error. Response headers are in
  25531. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  25532. // response was returned at all) in error.(*googleapi.Error).Header. Use
  25533. // googleapi.IsNotModified to check whether the returned error was
  25534. // because http.StatusNotModified was returned.
  25535. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  25536. gensupport.SetOptions(c.urlParams_, opts...)
  25537. res, err := c.doRequest("json")
  25538. if res != nil && res.StatusCode == http.StatusNotModified {
  25539. if res.Body != nil {
  25540. res.Body.Close()
  25541. }
  25542. return nil, &googleapi.Error{
  25543. Code: res.StatusCode,
  25544. Header: res.Header,
  25545. }
  25546. }
  25547. if err != nil {
  25548. return nil, err
  25549. }
  25550. defer googleapi.CloseBody(res)
  25551. if err := googleapi.CheckResponse(res); err != nil {
  25552. return nil, err
  25553. }
  25554. ret := &BackendServiceAggregatedList{
  25555. ServerResponse: googleapi.ServerResponse{
  25556. Header: res.Header,
  25557. HTTPStatusCode: res.StatusCode,
  25558. },
  25559. }
  25560. target := &ret
  25561. if err := gensupport.DecodeResponse(target, res); err != nil {
  25562. return nil, err
  25563. }
  25564. return ret, nil
  25565. // {
  25566. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  25567. // "httpMethod": "GET",
  25568. // "id": "compute.backendServices.aggregatedList",
  25569. // "parameterOrder": [
  25570. // "project"
  25571. // ],
  25572. // "parameters": {
  25573. // "filter": {
  25574. // "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).",
  25575. // "location": "query",
  25576. // "type": "string"
  25577. // },
  25578. // "maxResults": {
  25579. // "default": "500",
  25580. // "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)",
  25581. // "format": "uint32",
  25582. // "location": "query",
  25583. // "minimum": "0",
  25584. // "type": "integer"
  25585. // },
  25586. // "orderBy": {
  25587. // "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.",
  25588. // "location": "query",
  25589. // "type": "string"
  25590. // },
  25591. // "pageToken": {
  25592. // "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.",
  25593. // "location": "query",
  25594. // "type": "string"
  25595. // },
  25596. // "project": {
  25597. // "description": "Name of the project scoping this request.",
  25598. // "location": "path",
  25599. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25600. // "required": true,
  25601. // "type": "string"
  25602. // }
  25603. // },
  25604. // "path": "{project}/aggregated/backendServices",
  25605. // "response": {
  25606. // "$ref": "BackendServiceAggregatedList"
  25607. // },
  25608. // "scopes": [
  25609. // "https://www.googleapis.com/auth/cloud-platform",
  25610. // "https://www.googleapis.com/auth/compute",
  25611. // "https://www.googleapis.com/auth/compute.readonly"
  25612. // ]
  25613. // }
  25614. }
  25615. // Pages invokes f for each page of results.
  25616. // A non-nil error returned from f will halt the iteration.
  25617. // The provided context supersedes any context provided to the Context method.
  25618. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  25619. c.ctx_ = ctx
  25620. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25621. for {
  25622. x, err := c.Do()
  25623. if err != nil {
  25624. return err
  25625. }
  25626. if err := f(x); err != nil {
  25627. return err
  25628. }
  25629. if x.NextPageToken == "" {
  25630. return nil
  25631. }
  25632. c.PageToken(x.NextPageToken)
  25633. }
  25634. }
  25635. // method id "compute.backendServices.delete":
  25636. type BackendServicesDeleteCall struct {
  25637. s *Service
  25638. project string
  25639. backendService string
  25640. urlParams_ gensupport.URLParams
  25641. ctx_ context.Context
  25642. header_ http.Header
  25643. }
  25644. // Delete: Deletes the specified BackendService resource.
  25645. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  25646. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  25647. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25648. c.project = project
  25649. c.backendService = backendService
  25650. return c
  25651. }
  25652. // RequestId sets the optional parameter "requestId": An optional
  25653. // request ID to identify requests. Specify a unique request ID so that
  25654. // if you must retry your request, the server will know to ignore the
  25655. // request if it has already been completed.
  25656. //
  25657. // For example, consider a situation where you make an initial request
  25658. // and the request times out. If you make the request again with the
  25659. // same request ID, the server can check if original operation with the
  25660. // same request ID was received, and if so, will ignore the second
  25661. // request. This prevents clients from accidentally creating duplicate
  25662. // commitments.
  25663. //
  25664. // The request ID must be a valid UUID with the exception that zero UUID
  25665. // is not supported (00000000-0000-0000-0000-000000000000).
  25666. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  25667. c.urlParams_.Set("requestId", requestId)
  25668. return c
  25669. }
  25670. // Fields allows partial responses to be retrieved. See
  25671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25672. // for more information.
  25673. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  25674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25675. return c
  25676. }
  25677. // Context sets the context to be used in this call's Do method. Any
  25678. // pending HTTP request will be aborted if the provided context is
  25679. // canceled.
  25680. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  25681. c.ctx_ = ctx
  25682. return c
  25683. }
  25684. // Header returns an http.Header that can be modified by the caller to
  25685. // add HTTP headers to the request.
  25686. func (c *BackendServicesDeleteCall) Header() http.Header {
  25687. if c.header_ == nil {
  25688. c.header_ = make(http.Header)
  25689. }
  25690. return c.header_
  25691. }
  25692. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  25693. reqHeaders := make(http.Header)
  25694. for k, v := range c.header_ {
  25695. reqHeaders[k] = v
  25696. }
  25697. reqHeaders.Set("User-Agent", c.s.userAgent())
  25698. var body io.Reader = nil
  25699. c.urlParams_.Set("alt", alt)
  25700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  25701. urls += "?" + c.urlParams_.Encode()
  25702. req, _ := http.NewRequest("DELETE", urls, body)
  25703. req.Header = reqHeaders
  25704. googleapi.Expand(req.URL, map[string]string{
  25705. "project": c.project,
  25706. "backendService": c.backendService,
  25707. })
  25708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25709. }
  25710. // Do executes the "compute.backendServices.delete" call.
  25711. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  25712. // status code is an error. Response headers are in either
  25713. // *Operation.ServerResponse.Header or (if a response was returned at
  25714. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25715. // to check whether the returned error was because
  25716. // http.StatusNotModified was returned.
  25717. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  25718. gensupport.SetOptions(c.urlParams_, opts...)
  25719. res, err := c.doRequest("json")
  25720. if res != nil && res.StatusCode == http.StatusNotModified {
  25721. if res.Body != nil {
  25722. res.Body.Close()
  25723. }
  25724. return nil, &googleapi.Error{
  25725. Code: res.StatusCode,
  25726. Header: res.Header,
  25727. }
  25728. }
  25729. if err != nil {
  25730. return nil, err
  25731. }
  25732. defer googleapi.CloseBody(res)
  25733. if err := googleapi.CheckResponse(res); err != nil {
  25734. return nil, err
  25735. }
  25736. ret := &Operation{
  25737. ServerResponse: googleapi.ServerResponse{
  25738. Header: res.Header,
  25739. HTTPStatusCode: res.StatusCode,
  25740. },
  25741. }
  25742. target := &ret
  25743. if err := gensupport.DecodeResponse(target, res); err != nil {
  25744. return nil, err
  25745. }
  25746. return ret, nil
  25747. // {
  25748. // "description": "Deletes the specified BackendService resource.",
  25749. // "httpMethod": "DELETE",
  25750. // "id": "compute.backendServices.delete",
  25751. // "parameterOrder": [
  25752. // "project",
  25753. // "backendService"
  25754. // ],
  25755. // "parameters": {
  25756. // "backendService": {
  25757. // "description": "Name of the BackendService resource to delete.",
  25758. // "location": "path",
  25759. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25760. // "required": true,
  25761. // "type": "string"
  25762. // },
  25763. // "project": {
  25764. // "description": "Project ID for this request.",
  25765. // "location": "path",
  25766. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25767. // "required": true,
  25768. // "type": "string"
  25769. // },
  25770. // "requestId": {
  25771. // "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).",
  25772. // "location": "query",
  25773. // "type": "string"
  25774. // }
  25775. // },
  25776. // "path": "{project}/global/backendServices/{backendService}",
  25777. // "response": {
  25778. // "$ref": "Operation"
  25779. // },
  25780. // "scopes": [
  25781. // "https://www.googleapis.com/auth/cloud-platform",
  25782. // "https://www.googleapis.com/auth/compute"
  25783. // ]
  25784. // }
  25785. }
  25786. // method id "compute.backendServices.get":
  25787. type BackendServicesGetCall struct {
  25788. s *Service
  25789. project string
  25790. backendService string
  25791. urlParams_ gensupport.URLParams
  25792. ifNoneMatch_ string
  25793. ctx_ context.Context
  25794. header_ http.Header
  25795. }
  25796. // Get: Returns the specified BackendService resource. Gets a list of
  25797. // available backend services by making a list() request.
  25798. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  25799. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  25800. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25801. c.project = project
  25802. c.backendService = backendService
  25803. return c
  25804. }
  25805. // Fields allows partial responses to be retrieved. See
  25806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25807. // for more information.
  25808. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  25809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25810. return c
  25811. }
  25812. // IfNoneMatch sets the optional parameter which makes the operation
  25813. // fail if the object's ETag matches the given value. This is useful for
  25814. // getting updates only after the object has changed since the last
  25815. // request. Use googleapi.IsNotModified to check whether the response
  25816. // error from Do is the result of In-None-Match.
  25817. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  25818. c.ifNoneMatch_ = entityTag
  25819. return c
  25820. }
  25821. // Context sets the context to be used in this call's Do method. Any
  25822. // pending HTTP request will be aborted if the provided context is
  25823. // canceled.
  25824. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  25825. c.ctx_ = ctx
  25826. return c
  25827. }
  25828. // Header returns an http.Header that can be modified by the caller to
  25829. // add HTTP headers to the request.
  25830. func (c *BackendServicesGetCall) Header() http.Header {
  25831. if c.header_ == nil {
  25832. c.header_ = make(http.Header)
  25833. }
  25834. return c.header_
  25835. }
  25836. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  25837. reqHeaders := make(http.Header)
  25838. for k, v := range c.header_ {
  25839. reqHeaders[k] = v
  25840. }
  25841. reqHeaders.Set("User-Agent", c.s.userAgent())
  25842. if c.ifNoneMatch_ != "" {
  25843. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25844. }
  25845. var body io.Reader = nil
  25846. c.urlParams_.Set("alt", alt)
  25847. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  25848. urls += "?" + c.urlParams_.Encode()
  25849. req, _ := http.NewRequest("GET", urls, body)
  25850. req.Header = reqHeaders
  25851. googleapi.Expand(req.URL, map[string]string{
  25852. "project": c.project,
  25853. "backendService": c.backendService,
  25854. })
  25855. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25856. }
  25857. // Do executes the "compute.backendServices.get" call.
  25858. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  25859. // status code is an error. Response headers are in either
  25860. // *BackendService.ServerResponse.Header or (if a response was returned
  25861. // at all) in error.(*googleapi.Error).Header. Use
  25862. // googleapi.IsNotModified to check whether the returned error was
  25863. // because http.StatusNotModified was returned.
  25864. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  25865. gensupport.SetOptions(c.urlParams_, opts...)
  25866. res, err := c.doRequest("json")
  25867. if res != nil && res.StatusCode == http.StatusNotModified {
  25868. if res.Body != nil {
  25869. res.Body.Close()
  25870. }
  25871. return nil, &googleapi.Error{
  25872. Code: res.StatusCode,
  25873. Header: res.Header,
  25874. }
  25875. }
  25876. if err != nil {
  25877. return nil, err
  25878. }
  25879. defer googleapi.CloseBody(res)
  25880. if err := googleapi.CheckResponse(res); err != nil {
  25881. return nil, err
  25882. }
  25883. ret := &BackendService{
  25884. ServerResponse: googleapi.ServerResponse{
  25885. Header: res.Header,
  25886. HTTPStatusCode: res.StatusCode,
  25887. },
  25888. }
  25889. target := &ret
  25890. if err := gensupport.DecodeResponse(target, res); err != nil {
  25891. return nil, err
  25892. }
  25893. return ret, nil
  25894. // {
  25895. // "description": "Returns the specified BackendService resource. Gets a list of available backend services by making a list() request.",
  25896. // "httpMethod": "GET",
  25897. // "id": "compute.backendServices.get",
  25898. // "parameterOrder": [
  25899. // "project",
  25900. // "backendService"
  25901. // ],
  25902. // "parameters": {
  25903. // "backendService": {
  25904. // "description": "Name of the BackendService resource to return.",
  25905. // "location": "path",
  25906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  25907. // "required": true,
  25908. // "type": "string"
  25909. // },
  25910. // "project": {
  25911. // "description": "Project ID for this request.",
  25912. // "location": "path",
  25913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  25914. // "required": true,
  25915. // "type": "string"
  25916. // }
  25917. // },
  25918. // "path": "{project}/global/backendServices/{backendService}",
  25919. // "response": {
  25920. // "$ref": "BackendService"
  25921. // },
  25922. // "scopes": [
  25923. // "https://www.googleapis.com/auth/cloud-platform",
  25924. // "https://www.googleapis.com/auth/compute",
  25925. // "https://www.googleapis.com/auth/compute.readonly"
  25926. // ]
  25927. // }
  25928. }
  25929. // method id "compute.backendServices.getHealth":
  25930. type BackendServicesGetHealthCall struct {
  25931. s *Service
  25932. project string
  25933. backendService string
  25934. resourcegroupreference *ResourceGroupReference
  25935. urlParams_ gensupport.URLParams
  25936. ctx_ context.Context
  25937. header_ http.Header
  25938. }
  25939. // GetHealth: Gets the most recent health check results for this
  25940. // BackendService.
  25941. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  25942. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  25943. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25944. c.project = project
  25945. c.backendService = backendService
  25946. c.resourcegroupreference = resourcegroupreference
  25947. return c
  25948. }
  25949. // Fields allows partial responses to be retrieved. See
  25950. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25951. // for more information.
  25952. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  25953. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25954. return c
  25955. }
  25956. // Context sets the context to be used in this call's Do method. Any
  25957. // pending HTTP request will be aborted if the provided context is
  25958. // canceled.
  25959. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  25960. c.ctx_ = ctx
  25961. return c
  25962. }
  25963. // Header returns an http.Header that can be modified by the caller to
  25964. // add HTTP headers to the request.
  25965. func (c *BackendServicesGetHealthCall) Header() http.Header {
  25966. if c.header_ == nil {
  25967. c.header_ = make(http.Header)
  25968. }
  25969. return c.header_
  25970. }
  25971. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  25972. reqHeaders := make(http.Header)
  25973. for k, v := range c.header_ {
  25974. reqHeaders[k] = v
  25975. }
  25976. reqHeaders.Set("User-Agent", c.s.userAgent())
  25977. var body io.Reader = nil
  25978. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  25979. if err != nil {
  25980. return nil, err
  25981. }
  25982. reqHeaders.Set("Content-Type", "application/json")
  25983. c.urlParams_.Set("alt", alt)
  25984. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  25985. urls += "?" + c.urlParams_.Encode()
  25986. req, _ := http.NewRequest("POST", urls, body)
  25987. req.Header = reqHeaders
  25988. googleapi.Expand(req.URL, map[string]string{
  25989. "project": c.project,
  25990. "backendService": c.backendService,
  25991. })
  25992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25993. }
  25994. // Do executes the "compute.backendServices.getHealth" call.
  25995. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  25996. // Any non-2xx status code is an error. Response headers are in either
  25997. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  25998. // was returned at all) in error.(*googleapi.Error).Header. Use
  25999. // googleapi.IsNotModified to check whether the returned error was
  26000. // because http.StatusNotModified was returned.
  26001. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  26002. gensupport.SetOptions(c.urlParams_, opts...)
  26003. res, err := c.doRequest("json")
  26004. if res != nil && res.StatusCode == http.StatusNotModified {
  26005. if res.Body != nil {
  26006. res.Body.Close()
  26007. }
  26008. return nil, &googleapi.Error{
  26009. Code: res.StatusCode,
  26010. Header: res.Header,
  26011. }
  26012. }
  26013. if err != nil {
  26014. return nil, err
  26015. }
  26016. defer googleapi.CloseBody(res)
  26017. if err := googleapi.CheckResponse(res); err != nil {
  26018. return nil, err
  26019. }
  26020. ret := &BackendServiceGroupHealth{
  26021. ServerResponse: googleapi.ServerResponse{
  26022. Header: res.Header,
  26023. HTTPStatusCode: res.StatusCode,
  26024. },
  26025. }
  26026. target := &ret
  26027. if err := gensupport.DecodeResponse(target, res); err != nil {
  26028. return nil, err
  26029. }
  26030. return ret, nil
  26031. // {
  26032. // "description": "Gets the most recent health check results for this BackendService.",
  26033. // "httpMethod": "POST",
  26034. // "id": "compute.backendServices.getHealth",
  26035. // "parameterOrder": [
  26036. // "project",
  26037. // "backendService"
  26038. // ],
  26039. // "parameters": {
  26040. // "backendService": {
  26041. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  26042. // "location": "path",
  26043. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26044. // "required": true,
  26045. // "type": "string"
  26046. // },
  26047. // "project": {
  26048. // "location": "path",
  26049. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26050. // "required": true,
  26051. // "type": "string"
  26052. // }
  26053. // },
  26054. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  26055. // "request": {
  26056. // "$ref": "ResourceGroupReference"
  26057. // },
  26058. // "response": {
  26059. // "$ref": "BackendServiceGroupHealth"
  26060. // },
  26061. // "scopes": [
  26062. // "https://www.googleapis.com/auth/cloud-platform",
  26063. // "https://www.googleapis.com/auth/compute",
  26064. // "https://www.googleapis.com/auth/compute.readonly"
  26065. // ]
  26066. // }
  26067. }
  26068. // method id "compute.backendServices.insert":
  26069. type BackendServicesInsertCall struct {
  26070. s *Service
  26071. project string
  26072. backendservice *BackendService
  26073. urlParams_ gensupport.URLParams
  26074. ctx_ context.Context
  26075. header_ http.Header
  26076. }
  26077. // Insert: Creates a BackendService resource in the specified project
  26078. // using the data included in the request. There are several
  26079. // restrictions and guidelines to keep in mind when creating a backend
  26080. // service. Read Restrictions and Guidelines for more information.
  26081. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  26082. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  26083. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26084. c.project = project
  26085. c.backendservice = backendservice
  26086. return c
  26087. }
  26088. // RequestId sets the optional parameter "requestId": An optional
  26089. // request ID to identify requests. Specify a unique request ID so that
  26090. // if you must retry your request, the server will know to ignore the
  26091. // request if it has already been completed.
  26092. //
  26093. // For example, consider a situation where you make an initial request
  26094. // and the request times out. If you make the request again with the
  26095. // same request ID, the server can check if original operation with the
  26096. // same request ID was received, and if so, will ignore the second
  26097. // request. This prevents clients from accidentally creating duplicate
  26098. // commitments.
  26099. //
  26100. // The request ID must be a valid UUID with the exception that zero UUID
  26101. // is not supported (00000000-0000-0000-0000-000000000000).
  26102. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  26103. c.urlParams_.Set("requestId", requestId)
  26104. return c
  26105. }
  26106. // Fields allows partial responses to be retrieved. See
  26107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26108. // for more information.
  26109. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  26110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26111. return c
  26112. }
  26113. // Context sets the context to be used in this call's Do method. Any
  26114. // pending HTTP request will be aborted if the provided context is
  26115. // canceled.
  26116. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  26117. c.ctx_ = ctx
  26118. return c
  26119. }
  26120. // Header returns an http.Header that can be modified by the caller to
  26121. // add HTTP headers to the request.
  26122. func (c *BackendServicesInsertCall) Header() http.Header {
  26123. if c.header_ == nil {
  26124. c.header_ = make(http.Header)
  26125. }
  26126. return c.header_
  26127. }
  26128. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  26129. reqHeaders := make(http.Header)
  26130. for k, v := range c.header_ {
  26131. reqHeaders[k] = v
  26132. }
  26133. reqHeaders.Set("User-Agent", c.s.userAgent())
  26134. var body io.Reader = nil
  26135. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  26136. if err != nil {
  26137. return nil, err
  26138. }
  26139. reqHeaders.Set("Content-Type", "application/json")
  26140. c.urlParams_.Set("alt", alt)
  26141. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  26142. urls += "?" + c.urlParams_.Encode()
  26143. req, _ := http.NewRequest("POST", urls, body)
  26144. req.Header = reqHeaders
  26145. googleapi.Expand(req.URL, map[string]string{
  26146. "project": c.project,
  26147. })
  26148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26149. }
  26150. // Do executes the "compute.backendServices.insert" call.
  26151. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26152. // status code is an error. Response headers are in either
  26153. // *Operation.ServerResponse.Header or (if a response was returned at
  26154. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26155. // to check whether the returned error was because
  26156. // http.StatusNotModified was returned.
  26157. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26158. gensupport.SetOptions(c.urlParams_, opts...)
  26159. res, err := c.doRequest("json")
  26160. if res != nil && res.StatusCode == http.StatusNotModified {
  26161. if res.Body != nil {
  26162. res.Body.Close()
  26163. }
  26164. return nil, &googleapi.Error{
  26165. Code: res.StatusCode,
  26166. Header: res.Header,
  26167. }
  26168. }
  26169. if err != nil {
  26170. return nil, err
  26171. }
  26172. defer googleapi.CloseBody(res)
  26173. if err := googleapi.CheckResponse(res); err != nil {
  26174. return nil, err
  26175. }
  26176. ret := &Operation{
  26177. ServerResponse: googleapi.ServerResponse{
  26178. Header: res.Header,
  26179. HTTPStatusCode: res.StatusCode,
  26180. },
  26181. }
  26182. target := &ret
  26183. if err := gensupport.DecodeResponse(target, res); err != nil {
  26184. return nil, err
  26185. }
  26186. return ret, nil
  26187. // {
  26188. // "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.",
  26189. // "httpMethod": "POST",
  26190. // "id": "compute.backendServices.insert",
  26191. // "parameterOrder": [
  26192. // "project"
  26193. // ],
  26194. // "parameters": {
  26195. // "project": {
  26196. // "description": "Project ID for this request.",
  26197. // "location": "path",
  26198. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26199. // "required": true,
  26200. // "type": "string"
  26201. // },
  26202. // "requestId": {
  26203. // "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).",
  26204. // "location": "query",
  26205. // "type": "string"
  26206. // }
  26207. // },
  26208. // "path": "{project}/global/backendServices",
  26209. // "request": {
  26210. // "$ref": "BackendService"
  26211. // },
  26212. // "response": {
  26213. // "$ref": "Operation"
  26214. // },
  26215. // "scopes": [
  26216. // "https://www.googleapis.com/auth/cloud-platform",
  26217. // "https://www.googleapis.com/auth/compute"
  26218. // ]
  26219. // }
  26220. }
  26221. // method id "compute.backendServices.list":
  26222. type BackendServicesListCall struct {
  26223. s *Service
  26224. project string
  26225. urlParams_ gensupport.URLParams
  26226. ifNoneMatch_ string
  26227. ctx_ context.Context
  26228. header_ http.Header
  26229. }
  26230. // List: Retrieves the list of BackendService resources available to the
  26231. // specified project.
  26232. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  26233. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  26234. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26235. c.project = project
  26236. return c
  26237. }
  26238. // Filter sets the optional parameter "filter": A filter expression that
  26239. // filters resources listed in the response. The expression must specify
  26240. // the field name, a comparison operator, and the value that you want to
  26241. // use for filtering. The value must be a string, a number, or a
  26242. // boolean. The comparison operator must be either =, !=, >, or <.
  26243. //
  26244. // For example, if you are filtering Compute Engine instances, you can
  26245. // exclude instances named example-instance by specifying name !=
  26246. // example-instance.
  26247. //
  26248. // You can also filter nested fields. For example, you could specify
  26249. // scheduling.automaticRestart = false to include instances only if they
  26250. // are not scheduled for automatic restarts. You can use filtering on
  26251. // nested fields to filter based on resource labels.
  26252. //
  26253. // To filter on multiple expressions, provide each separate expression
  26254. // within parentheses. For example, (scheduling.automaticRestart = true)
  26255. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26256. // AND expression. However, you can include AND and OR expressions
  26257. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26258. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26259. // true).
  26260. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  26261. c.urlParams_.Set("filter", filter)
  26262. return c
  26263. }
  26264. // MaxResults sets the optional parameter "maxResults": The maximum
  26265. // number of results per page that should be returned. If the number of
  26266. // available results is larger than maxResults, Compute Engine returns a
  26267. // nextPageToken that can be used to get the next page of results in
  26268. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26269. // (Default: 500)
  26270. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  26271. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26272. return c
  26273. }
  26274. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26275. // a certain order. By default, results are returned in alphanumerical
  26276. // order based on the resource name.
  26277. //
  26278. // You can also sort results in descending order based on the creation
  26279. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26280. // based on the creationTimestamp field in reverse chronological order
  26281. // (newest result first). Use this to sort resources like operations so
  26282. // that the newest operation is returned first.
  26283. //
  26284. // Currently, only sorting by name or creationTimestamp desc is
  26285. // supported.
  26286. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  26287. c.urlParams_.Set("orderBy", orderBy)
  26288. return c
  26289. }
  26290. // PageToken sets the optional parameter "pageToken": Specifies a page
  26291. // token to use. Set pageToken to the nextPageToken returned by a
  26292. // previous list request to get the next page of results.
  26293. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  26294. c.urlParams_.Set("pageToken", pageToken)
  26295. return c
  26296. }
  26297. // Fields allows partial responses to be retrieved. See
  26298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26299. // for more information.
  26300. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  26301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26302. return c
  26303. }
  26304. // IfNoneMatch sets the optional parameter which makes the operation
  26305. // fail if the object's ETag matches the given value. This is useful for
  26306. // getting updates only after the object has changed since the last
  26307. // request. Use googleapi.IsNotModified to check whether the response
  26308. // error from Do is the result of In-None-Match.
  26309. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  26310. c.ifNoneMatch_ = entityTag
  26311. return c
  26312. }
  26313. // Context sets the context to be used in this call's Do method. Any
  26314. // pending HTTP request will be aborted if the provided context is
  26315. // canceled.
  26316. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  26317. c.ctx_ = ctx
  26318. return c
  26319. }
  26320. // Header returns an http.Header that can be modified by the caller to
  26321. // add HTTP headers to the request.
  26322. func (c *BackendServicesListCall) Header() http.Header {
  26323. if c.header_ == nil {
  26324. c.header_ = make(http.Header)
  26325. }
  26326. return c.header_
  26327. }
  26328. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  26329. reqHeaders := make(http.Header)
  26330. for k, v := range c.header_ {
  26331. reqHeaders[k] = v
  26332. }
  26333. reqHeaders.Set("User-Agent", c.s.userAgent())
  26334. if c.ifNoneMatch_ != "" {
  26335. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26336. }
  26337. var body io.Reader = nil
  26338. c.urlParams_.Set("alt", alt)
  26339. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  26340. urls += "?" + c.urlParams_.Encode()
  26341. req, _ := http.NewRequest("GET", urls, body)
  26342. req.Header = reqHeaders
  26343. googleapi.Expand(req.URL, map[string]string{
  26344. "project": c.project,
  26345. })
  26346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26347. }
  26348. // Do executes the "compute.backendServices.list" call.
  26349. // Exactly one of *BackendServiceList or error will be non-nil. Any
  26350. // non-2xx status code is an error. Response headers are in either
  26351. // *BackendServiceList.ServerResponse.Header or (if a response was
  26352. // returned at all) in error.(*googleapi.Error).Header. Use
  26353. // googleapi.IsNotModified to check whether the returned error was
  26354. // because http.StatusNotModified was returned.
  26355. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  26356. gensupport.SetOptions(c.urlParams_, opts...)
  26357. res, err := c.doRequest("json")
  26358. if res != nil && res.StatusCode == http.StatusNotModified {
  26359. if res.Body != nil {
  26360. res.Body.Close()
  26361. }
  26362. return nil, &googleapi.Error{
  26363. Code: res.StatusCode,
  26364. Header: res.Header,
  26365. }
  26366. }
  26367. if err != nil {
  26368. return nil, err
  26369. }
  26370. defer googleapi.CloseBody(res)
  26371. if err := googleapi.CheckResponse(res); err != nil {
  26372. return nil, err
  26373. }
  26374. ret := &BackendServiceList{
  26375. ServerResponse: googleapi.ServerResponse{
  26376. Header: res.Header,
  26377. HTTPStatusCode: res.StatusCode,
  26378. },
  26379. }
  26380. target := &ret
  26381. if err := gensupport.DecodeResponse(target, res); err != nil {
  26382. return nil, err
  26383. }
  26384. return ret, nil
  26385. // {
  26386. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  26387. // "httpMethod": "GET",
  26388. // "id": "compute.backendServices.list",
  26389. // "parameterOrder": [
  26390. // "project"
  26391. // ],
  26392. // "parameters": {
  26393. // "filter": {
  26394. // "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).",
  26395. // "location": "query",
  26396. // "type": "string"
  26397. // },
  26398. // "maxResults": {
  26399. // "default": "500",
  26400. // "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)",
  26401. // "format": "uint32",
  26402. // "location": "query",
  26403. // "minimum": "0",
  26404. // "type": "integer"
  26405. // },
  26406. // "orderBy": {
  26407. // "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.",
  26408. // "location": "query",
  26409. // "type": "string"
  26410. // },
  26411. // "pageToken": {
  26412. // "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.",
  26413. // "location": "query",
  26414. // "type": "string"
  26415. // },
  26416. // "project": {
  26417. // "description": "Project ID for this request.",
  26418. // "location": "path",
  26419. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26420. // "required": true,
  26421. // "type": "string"
  26422. // }
  26423. // },
  26424. // "path": "{project}/global/backendServices",
  26425. // "response": {
  26426. // "$ref": "BackendServiceList"
  26427. // },
  26428. // "scopes": [
  26429. // "https://www.googleapis.com/auth/cloud-platform",
  26430. // "https://www.googleapis.com/auth/compute",
  26431. // "https://www.googleapis.com/auth/compute.readonly"
  26432. // ]
  26433. // }
  26434. }
  26435. // Pages invokes f for each page of results.
  26436. // A non-nil error returned from f will halt the iteration.
  26437. // The provided context supersedes any context provided to the Context method.
  26438. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  26439. c.ctx_ = ctx
  26440. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26441. for {
  26442. x, err := c.Do()
  26443. if err != nil {
  26444. return err
  26445. }
  26446. if err := f(x); err != nil {
  26447. return err
  26448. }
  26449. if x.NextPageToken == "" {
  26450. return nil
  26451. }
  26452. c.PageToken(x.NextPageToken)
  26453. }
  26454. }
  26455. // method id "compute.backendServices.patch":
  26456. type BackendServicesPatchCall struct {
  26457. s *Service
  26458. project string
  26459. backendService string
  26460. backendservice *BackendService
  26461. urlParams_ gensupport.URLParams
  26462. ctx_ context.Context
  26463. header_ http.Header
  26464. }
  26465. // Patch: Patches the specified BackendService resource with the data
  26466. // included in the request. There are several restrictions and
  26467. // guidelines to keep in mind when updating a backend service. Read
  26468. // Restrictions and Guidelines for more information. This method
  26469. // supports PATCH semantics and uses the JSON merge patch format and
  26470. // processing rules.
  26471. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  26472. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  26473. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26474. c.project = project
  26475. c.backendService = backendService
  26476. c.backendservice = backendservice
  26477. return c
  26478. }
  26479. // RequestId sets the optional parameter "requestId": An optional
  26480. // request ID to identify requests. Specify a unique request ID so that
  26481. // if you must retry your request, the server will know to ignore the
  26482. // request if it has already been completed.
  26483. //
  26484. // For example, consider a situation where you make an initial request
  26485. // and the request times out. If you make the request again with the
  26486. // same request ID, the server can check if original operation with the
  26487. // same request ID was received, and if so, will ignore the second
  26488. // request. This prevents clients from accidentally creating duplicate
  26489. // commitments.
  26490. //
  26491. // The request ID must be a valid UUID with the exception that zero UUID
  26492. // is not supported (00000000-0000-0000-0000-000000000000).
  26493. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  26494. c.urlParams_.Set("requestId", requestId)
  26495. return c
  26496. }
  26497. // Fields allows partial responses to be retrieved. See
  26498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26499. // for more information.
  26500. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  26501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26502. return c
  26503. }
  26504. // Context sets the context to be used in this call's Do method. Any
  26505. // pending HTTP request will be aborted if the provided context is
  26506. // canceled.
  26507. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  26508. c.ctx_ = ctx
  26509. return c
  26510. }
  26511. // Header returns an http.Header that can be modified by the caller to
  26512. // add HTTP headers to the request.
  26513. func (c *BackendServicesPatchCall) Header() http.Header {
  26514. if c.header_ == nil {
  26515. c.header_ = make(http.Header)
  26516. }
  26517. return c.header_
  26518. }
  26519. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  26520. reqHeaders := make(http.Header)
  26521. for k, v := range c.header_ {
  26522. reqHeaders[k] = v
  26523. }
  26524. reqHeaders.Set("User-Agent", c.s.userAgent())
  26525. var body io.Reader = nil
  26526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  26527. if err != nil {
  26528. return nil, err
  26529. }
  26530. reqHeaders.Set("Content-Type", "application/json")
  26531. c.urlParams_.Set("alt", alt)
  26532. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  26533. urls += "?" + c.urlParams_.Encode()
  26534. req, _ := http.NewRequest("PATCH", urls, body)
  26535. req.Header = reqHeaders
  26536. googleapi.Expand(req.URL, map[string]string{
  26537. "project": c.project,
  26538. "backendService": c.backendService,
  26539. })
  26540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26541. }
  26542. // Do executes the "compute.backendServices.patch" call.
  26543. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26544. // status code is an error. Response headers are in either
  26545. // *Operation.ServerResponse.Header or (if a response was returned at
  26546. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26547. // to check whether the returned error was because
  26548. // http.StatusNotModified was returned.
  26549. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26550. gensupport.SetOptions(c.urlParams_, opts...)
  26551. res, err := c.doRequest("json")
  26552. if res != nil && res.StatusCode == http.StatusNotModified {
  26553. if res.Body != nil {
  26554. res.Body.Close()
  26555. }
  26556. return nil, &googleapi.Error{
  26557. Code: res.StatusCode,
  26558. Header: res.Header,
  26559. }
  26560. }
  26561. if err != nil {
  26562. return nil, err
  26563. }
  26564. defer googleapi.CloseBody(res)
  26565. if err := googleapi.CheckResponse(res); err != nil {
  26566. return nil, err
  26567. }
  26568. ret := &Operation{
  26569. ServerResponse: googleapi.ServerResponse{
  26570. Header: res.Header,
  26571. HTTPStatusCode: res.StatusCode,
  26572. },
  26573. }
  26574. target := &ret
  26575. if err := gensupport.DecodeResponse(target, res); err != nil {
  26576. return nil, err
  26577. }
  26578. return ret, nil
  26579. // {
  26580. // "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.",
  26581. // "httpMethod": "PATCH",
  26582. // "id": "compute.backendServices.patch",
  26583. // "parameterOrder": [
  26584. // "project",
  26585. // "backendService"
  26586. // ],
  26587. // "parameters": {
  26588. // "backendService": {
  26589. // "description": "Name of the BackendService resource to patch.",
  26590. // "location": "path",
  26591. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26592. // "required": true,
  26593. // "type": "string"
  26594. // },
  26595. // "project": {
  26596. // "description": "Project ID for this request.",
  26597. // "location": "path",
  26598. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26599. // "required": true,
  26600. // "type": "string"
  26601. // },
  26602. // "requestId": {
  26603. // "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).",
  26604. // "location": "query",
  26605. // "type": "string"
  26606. // }
  26607. // },
  26608. // "path": "{project}/global/backendServices/{backendService}",
  26609. // "request": {
  26610. // "$ref": "BackendService"
  26611. // },
  26612. // "response": {
  26613. // "$ref": "Operation"
  26614. // },
  26615. // "scopes": [
  26616. // "https://www.googleapis.com/auth/cloud-platform",
  26617. // "https://www.googleapis.com/auth/compute"
  26618. // ]
  26619. // }
  26620. }
  26621. // method id "compute.backendServices.update":
  26622. type BackendServicesUpdateCall struct {
  26623. s *Service
  26624. project string
  26625. backendService string
  26626. backendservice *BackendService
  26627. urlParams_ gensupport.URLParams
  26628. ctx_ context.Context
  26629. header_ http.Header
  26630. }
  26631. // Update: Updates the specified BackendService resource with the data
  26632. // included in the request. There are several restrictions and
  26633. // guidelines to keep in mind when updating a backend service. Read
  26634. // Restrictions and Guidelines for more information.
  26635. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  26636. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  26637. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26638. c.project = project
  26639. c.backendService = backendService
  26640. c.backendservice = backendservice
  26641. return c
  26642. }
  26643. // RequestId sets the optional parameter "requestId": An optional
  26644. // request ID to identify requests. Specify a unique request ID so that
  26645. // if you must retry your request, the server will know to ignore the
  26646. // request if it has already been completed.
  26647. //
  26648. // For example, consider a situation where you make an initial request
  26649. // and the request times out. If you make the request again with the
  26650. // same request ID, the server can check if original operation with the
  26651. // same request ID was received, and if so, will ignore the second
  26652. // request. This prevents clients from accidentally creating duplicate
  26653. // commitments.
  26654. //
  26655. // The request ID must be a valid UUID with the exception that zero UUID
  26656. // is not supported (00000000-0000-0000-0000-000000000000).
  26657. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  26658. c.urlParams_.Set("requestId", requestId)
  26659. return c
  26660. }
  26661. // Fields allows partial responses to be retrieved. See
  26662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26663. // for more information.
  26664. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  26665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26666. return c
  26667. }
  26668. // Context sets the context to be used in this call's Do method. Any
  26669. // pending HTTP request will be aborted if the provided context is
  26670. // canceled.
  26671. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  26672. c.ctx_ = ctx
  26673. return c
  26674. }
  26675. // Header returns an http.Header that can be modified by the caller to
  26676. // add HTTP headers to the request.
  26677. func (c *BackendServicesUpdateCall) Header() http.Header {
  26678. if c.header_ == nil {
  26679. c.header_ = make(http.Header)
  26680. }
  26681. return c.header_
  26682. }
  26683. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  26684. reqHeaders := make(http.Header)
  26685. for k, v := range c.header_ {
  26686. reqHeaders[k] = v
  26687. }
  26688. reqHeaders.Set("User-Agent", c.s.userAgent())
  26689. var body io.Reader = nil
  26690. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  26691. if err != nil {
  26692. return nil, err
  26693. }
  26694. reqHeaders.Set("Content-Type", "application/json")
  26695. c.urlParams_.Set("alt", alt)
  26696. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  26697. urls += "?" + c.urlParams_.Encode()
  26698. req, _ := http.NewRequest("PUT", urls, body)
  26699. req.Header = reqHeaders
  26700. googleapi.Expand(req.URL, map[string]string{
  26701. "project": c.project,
  26702. "backendService": c.backendService,
  26703. })
  26704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26705. }
  26706. // Do executes the "compute.backendServices.update" call.
  26707. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  26708. // status code is an error. Response headers are in either
  26709. // *Operation.ServerResponse.Header or (if a response was returned at
  26710. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26711. // to check whether the returned error was because
  26712. // http.StatusNotModified was returned.
  26713. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  26714. gensupport.SetOptions(c.urlParams_, opts...)
  26715. res, err := c.doRequest("json")
  26716. if res != nil && res.StatusCode == http.StatusNotModified {
  26717. if res.Body != nil {
  26718. res.Body.Close()
  26719. }
  26720. return nil, &googleapi.Error{
  26721. Code: res.StatusCode,
  26722. Header: res.Header,
  26723. }
  26724. }
  26725. if err != nil {
  26726. return nil, err
  26727. }
  26728. defer googleapi.CloseBody(res)
  26729. if err := googleapi.CheckResponse(res); err != nil {
  26730. return nil, err
  26731. }
  26732. ret := &Operation{
  26733. ServerResponse: googleapi.ServerResponse{
  26734. Header: res.Header,
  26735. HTTPStatusCode: res.StatusCode,
  26736. },
  26737. }
  26738. target := &ret
  26739. if err := gensupport.DecodeResponse(target, res); err != nil {
  26740. return nil, err
  26741. }
  26742. return ret, nil
  26743. // {
  26744. // "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.",
  26745. // "httpMethod": "PUT",
  26746. // "id": "compute.backendServices.update",
  26747. // "parameterOrder": [
  26748. // "project",
  26749. // "backendService"
  26750. // ],
  26751. // "parameters": {
  26752. // "backendService": {
  26753. // "description": "Name of the BackendService resource to update.",
  26754. // "location": "path",
  26755. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26756. // "required": true,
  26757. // "type": "string"
  26758. // },
  26759. // "project": {
  26760. // "description": "Project ID for this request.",
  26761. // "location": "path",
  26762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26763. // "required": true,
  26764. // "type": "string"
  26765. // },
  26766. // "requestId": {
  26767. // "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).",
  26768. // "location": "query",
  26769. // "type": "string"
  26770. // }
  26771. // },
  26772. // "path": "{project}/global/backendServices/{backendService}",
  26773. // "request": {
  26774. // "$ref": "BackendService"
  26775. // },
  26776. // "response": {
  26777. // "$ref": "Operation"
  26778. // },
  26779. // "scopes": [
  26780. // "https://www.googleapis.com/auth/cloud-platform",
  26781. // "https://www.googleapis.com/auth/compute"
  26782. // ]
  26783. // }
  26784. }
  26785. // method id "compute.diskTypes.aggregatedList":
  26786. type DiskTypesAggregatedListCall struct {
  26787. s *Service
  26788. project string
  26789. urlParams_ gensupport.URLParams
  26790. ifNoneMatch_ string
  26791. ctx_ context.Context
  26792. header_ http.Header
  26793. }
  26794. // AggregatedList: Retrieves an aggregated list of disk types.
  26795. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  26796. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  26797. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26798. c.project = project
  26799. return c
  26800. }
  26801. // Filter sets the optional parameter "filter": A filter expression that
  26802. // filters resources listed in the response. The expression must specify
  26803. // the field name, a comparison operator, and the value that you want to
  26804. // use for filtering. The value must be a string, a number, or a
  26805. // boolean. The comparison operator must be either =, !=, >, or <.
  26806. //
  26807. // For example, if you are filtering Compute Engine instances, you can
  26808. // exclude instances named example-instance by specifying name !=
  26809. // example-instance.
  26810. //
  26811. // You can also filter nested fields. For example, you could specify
  26812. // scheduling.automaticRestart = false to include instances only if they
  26813. // are not scheduled for automatic restarts. You can use filtering on
  26814. // nested fields to filter based on resource labels.
  26815. //
  26816. // To filter on multiple expressions, provide each separate expression
  26817. // within parentheses. For example, (scheduling.automaticRestart = true)
  26818. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26819. // AND expression. However, you can include AND and OR expressions
  26820. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26821. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26822. // true).
  26823. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  26824. c.urlParams_.Set("filter", filter)
  26825. return c
  26826. }
  26827. // MaxResults sets the optional parameter "maxResults": The maximum
  26828. // number of results per page that should be returned. If the number of
  26829. // available results is larger than maxResults, Compute Engine returns a
  26830. // nextPageToken that can be used to get the next page of results in
  26831. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26832. // (Default: 500)
  26833. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  26834. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26835. return c
  26836. }
  26837. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26838. // a certain order. By default, results are returned in alphanumerical
  26839. // order based on the resource name.
  26840. //
  26841. // You can also sort results in descending order based on the creation
  26842. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26843. // based on the creationTimestamp field in reverse chronological order
  26844. // (newest result first). Use this to sort resources like operations so
  26845. // that the newest operation is returned first.
  26846. //
  26847. // Currently, only sorting by name or creationTimestamp desc is
  26848. // supported.
  26849. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  26850. c.urlParams_.Set("orderBy", orderBy)
  26851. return c
  26852. }
  26853. // PageToken sets the optional parameter "pageToken": Specifies a page
  26854. // token to use. Set pageToken to the nextPageToken returned by a
  26855. // previous list request to get the next page of results.
  26856. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  26857. c.urlParams_.Set("pageToken", pageToken)
  26858. return c
  26859. }
  26860. // Fields allows partial responses to be retrieved. See
  26861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26862. // for more information.
  26863. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  26864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26865. return c
  26866. }
  26867. // IfNoneMatch sets the optional parameter which makes the operation
  26868. // fail if the object's ETag matches the given value. This is useful for
  26869. // getting updates only after the object has changed since the last
  26870. // request. Use googleapi.IsNotModified to check whether the response
  26871. // error from Do is the result of In-None-Match.
  26872. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  26873. c.ifNoneMatch_ = entityTag
  26874. return c
  26875. }
  26876. // Context sets the context to be used in this call's Do method. Any
  26877. // pending HTTP request will be aborted if the provided context is
  26878. // canceled.
  26879. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  26880. c.ctx_ = ctx
  26881. return c
  26882. }
  26883. // Header returns an http.Header that can be modified by the caller to
  26884. // add HTTP headers to the request.
  26885. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  26886. if c.header_ == nil {
  26887. c.header_ = make(http.Header)
  26888. }
  26889. return c.header_
  26890. }
  26891. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  26892. reqHeaders := make(http.Header)
  26893. for k, v := range c.header_ {
  26894. reqHeaders[k] = v
  26895. }
  26896. reqHeaders.Set("User-Agent", c.s.userAgent())
  26897. if c.ifNoneMatch_ != "" {
  26898. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26899. }
  26900. var body io.Reader = nil
  26901. c.urlParams_.Set("alt", alt)
  26902. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  26903. urls += "?" + c.urlParams_.Encode()
  26904. req, _ := http.NewRequest("GET", urls, body)
  26905. req.Header = reqHeaders
  26906. googleapi.Expand(req.URL, map[string]string{
  26907. "project": c.project,
  26908. })
  26909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26910. }
  26911. // Do executes the "compute.diskTypes.aggregatedList" call.
  26912. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  26913. // non-2xx status code is an error. Response headers are in either
  26914. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  26915. // returned at all) in error.(*googleapi.Error).Header. Use
  26916. // googleapi.IsNotModified to check whether the returned error was
  26917. // because http.StatusNotModified was returned.
  26918. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  26919. gensupport.SetOptions(c.urlParams_, opts...)
  26920. res, err := c.doRequest("json")
  26921. if res != nil && res.StatusCode == http.StatusNotModified {
  26922. if res.Body != nil {
  26923. res.Body.Close()
  26924. }
  26925. return nil, &googleapi.Error{
  26926. Code: res.StatusCode,
  26927. Header: res.Header,
  26928. }
  26929. }
  26930. if err != nil {
  26931. return nil, err
  26932. }
  26933. defer googleapi.CloseBody(res)
  26934. if err := googleapi.CheckResponse(res); err != nil {
  26935. return nil, err
  26936. }
  26937. ret := &DiskTypeAggregatedList{
  26938. ServerResponse: googleapi.ServerResponse{
  26939. Header: res.Header,
  26940. HTTPStatusCode: res.StatusCode,
  26941. },
  26942. }
  26943. target := &ret
  26944. if err := gensupport.DecodeResponse(target, res); err != nil {
  26945. return nil, err
  26946. }
  26947. return ret, nil
  26948. // {
  26949. // "description": "Retrieves an aggregated list of disk types.",
  26950. // "httpMethod": "GET",
  26951. // "id": "compute.diskTypes.aggregatedList",
  26952. // "parameterOrder": [
  26953. // "project"
  26954. // ],
  26955. // "parameters": {
  26956. // "filter": {
  26957. // "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).",
  26958. // "location": "query",
  26959. // "type": "string"
  26960. // },
  26961. // "maxResults": {
  26962. // "default": "500",
  26963. // "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)",
  26964. // "format": "uint32",
  26965. // "location": "query",
  26966. // "minimum": "0",
  26967. // "type": "integer"
  26968. // },
  26969. // "orderBy": {
  26970. // "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.",
  26971. // "location": "query",
  26972. // "type": "string"
  26973. // },
  26974. // "pageToken": {
  26975. // "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.",
  26976. // "location": "query",
  26977. // "type": "string"
  26978. // },
  26979. // "project": {
  26980. // "description": "Project ID for this request.",
  26981. // "location": "path",
  26982. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26983. // "required": true,
  26984. // "type": "string"
  26985. // }
  26986. // },
  26987. // "path": "{project}/aggregated/diskTypes",
  26988. // "response": {
  26989. // "$ref": "DiskTypeAggregatedList"
  26990. // },
  26991. // "scopes": [
  26992. // "https://www.googleapis.com/auth/cloud-platform",
  26993. // "https://www.googleapis.com/auth/compute",
  26994. // "https://www.googleapis.com/auth/compute.readonly"
  26995. // ]
  26996. // }
  26997. }
  26998. // Pages invokes f for each page of results.
  26999. // A non-nil error returned from f will halt the iteration.
  27000. // The provided context supersedes any context provided to the Context method.
  27001. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  27002. c.ctx_ = ctx
  27003. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27004. for {
  27005. x, err := c.Do()
  27006. if err != nil {
  27007. return err
  27008. }
  27009. if err := f(x); err != nil {
  27010. return err
  27011. }
  27012. if x.NextPageToken == "" {
  27013. return nil
  27014. }
  27015. c.PageToken(x.NextPageToken)
  27016. }
  27017. }
  27018. // method id "compute.diskTypes.get":
  27019. type DiskTypesGetCall struct {
  27020. s *Service
  27021. project string
  27022. zone string
  27023. diskType string
  27024. urlParams_ gensupport.URLParams
  27025. ifNoneMatch_ string
  27026. ctx_ context.Context
  27027. header_ http.Header
  27028. }
  27029. // Get: Returns the specified disk type. Gets a list of available disk
  27030. // types by making a list() request.
  27031. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  27032. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  27033. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27034. c.project = project
  27035. c.zone = zone
  27036. c.diskType = diskType
  27037. return c
  27038. }
  27039. // Fields allows partial responses to be retrieved. See
  27040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27041. // for more information.
  27042. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  27043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27044. return c
  27045. }
  27046. // IfNoneMatch sets the optional parameter which makes the operation
  27047. // fail if the object's ETag matches the given value. This is useful for
  27048. // getting updates only after the object has changed since the last
  27049. // request. Use googleapi.IsNotModified to check whether the response
  27050. // error from Do is the result of In-None-Match.
  27051. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  27052. c.ifNoneMatch_ = entityTag
  27053. return c
  27054. }
  27055. // Context sets the context to be used in this call's Do method. Any
  27056. // pending HTTP request will be aborted if the provided context is
  27057. // canceled.
  27058. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  27059. c.ctx_ = ctx
  27060. return c
  27061. }
  27062. // Header returns an http.Header that can be modified by the caller to
  27063. // add HTTP headers to the request.
  27064. func (c *DiskTypesGetCall) Header() http.Header {
  27065. if c.header_ == nil {
  27066. c.header_ = make(http.Header)
  27067. }
  27068. return c.header_
  27069. }
  27070. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  27071. reqHeaders := make(http.Header)
  27072. for k, v := range c.header_ {
  27073. reqHeaders[k] = v
  27074. }
  27075. reqHeaders.Set("User-Agent", c.s.userAgent())
  27076. if c.ifNoneMatch_ != "" {
  27077. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27078. }
  27079. var body io.Reader = nil
  27080. c.urlParams_.Set("alt", alt)
  27081. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  27082. urls += "?" + c.urlParams_.Encode()
  27083. req, _ := http.NewRequest("GET", urls, body)
  27084. req.Header = reqHeaders
  27085. googleapi.Expand(req.URL, map[string]string{
  27086. "project": c.project,
  27087. "zone": c.zone,
  27088. "diskType": c.diskType,
  27089. })
  27090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27091. }
  27092. // Do executes the "compute.diskTypes.get" call.
  27093. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  27094. // code is an error. Response headers are in either
  27095. // *DiskType.ServerResponse.Header or (if a response was returned at
  27096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27097. // to check whether the returned error was because
  27098. // http.StatusNotModified was returned.
  27099. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  27100. gensupport.SetOptions(c.urlParams_, opts...)
  27101. res, err := c.doRequest("json")
  27102. if res != nil && res.StatusCode == http.StatusNotModified {
  27103. if res.Body != nil {
  27104. res.Body.Close()
  27105. }
  27106. return nil, &googleapi.Error{
  27107. Code: res.StatusCode,
  27108. Header: res.Header,
  27109. }
  27110. }
  27111. if err != nil {
  27112. return nil, err
  27113. }
  27114. defer googleapi.CloseBody(res)
  27115. if err := googleapi.CheckResponse(res); err != nil {
  27116. return nil, err
  27117. }
  27118. ret := &DiskType{
  27119. ServerResponse: googleapi.ServerResponse{
  27120. Header: res.Header,
  27121. HTTPStatusCode: res.StatusCode,
  27122. },
  27123. }
  27124. target := &ret
  27125. if err := gensupport.DecodeResponse(target, res); err != nil {
  27126. return nil, err
  27127. }
  27128. return ret, nil
  27129. // {
  27130. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  27131. // "httpMethod": "GET",
  27132. // "id": "compute.diskTypes.get",
  27133. // "parameterOrder": [
  27134. // "project",
  27135. // "zone",
  27136. // "diskType"
  27137. // ],
  27138. // "parameters": {
  27139. // "diskType": {
  27140. // "description": "Name of the disk type to return.",
  27141. // "location": "path",
  27142. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27143. // "required": true,
  27144. // "type": "string"
  27145. // },
  27146. // "project": {
  27147. // "description": "Project ID for this request.",
  27148. // "location": "path",
  27149. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27150. // "required": true,
  27151. // "type": "string"
  27152. // },
  27153. // "zone": {
  27154. // "description": "The name of the zone for this request.",
  27155. // "location": "path",
  27156. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27157. // "required": true,
  27158. // "type": "string"
  27159. // }
  27160. // },
  27161. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  27162. // "response": {
  27163. // "$ref": "DiskType"
  27164. // },
  27165. // "scopes": [
  27166. // "https://www.googleapis.com/auth/cloud-platform",
  27167. // "https://www.googleapis.com/auth/compute",
  27168. // "https://www.googleapis.com/auth/compute.readonly"
  27169. // ]
  27170. // }
  27171. }
  27172. // method id "compute.diskTypes.list":
  27173. type DiskTypesListCall struct {
  27174. s *Service
  27175. project string
  27176. zone string
  27177. urlParams_ gensupport.URLParams
  27178. ifNoneMatch_ string
  27179. ctx_ context.Context
  27180. header_ http.Header
  27181. }
  27182. // List: Retrieves a list of disk types available to the specified
  27183. // project.
  27184. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  27185. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  27186. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27187. c.project = project
  27188. c.zone = zone
  27189. return c
  27190. }
  27191. // Filter sets the optional parameter "filter": A filter expression that
  27192. // filters resources listed in the response. The expression must specify
  27193. // the field name, a comparison operator, and the value that you want to
  27194. // use for filtering. The value must be a string, a number, or a
  27195. // boolean. The comparison operator must be either =, !=, >, or <.
  27196. //
  27197. // For example, if you are filtering Compute Engine instances, you can
  27198. // exclude instances named example-instance by specifying name !=
  27199. // example-instance.
  27200. //
  27201. // You can also filter nested fields. For example, you could specify
  27202. // scheduling.automaticRestart = false to include instances only if they
  27203. // are not scheduled for automatic restarts. You can use filtering on
  27204. // nested fields to filter based on resource labels.
  27205. //
  27206. // To filter on multiple expressions, provide each separate expression
  27207. // within parentheses. For example, (scheduling.automaticRestart = true)
  27208. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27209. // AND expression. However, you can include AND and OR expressions
  27210. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27211. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27212. // true).
  27213. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  27214. c.urlParams_.Set("filter", filter)
  27215. return c
  27216. }
  27217. // MaxResults sets the optional parameter "maxResults": The maximum
  27218. // number of results per page that should be returned. If the number of
  27219. // available results is larger than maxResults, Compute Engine returns a
  27220. // nextPageToken that can be used to get the next page of results in
  27221. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27222. // (Default: 500)
  27223. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  27224. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27225. return c
  27226. }
  27227. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27228. // a certain order. By default, results are returned in alphanumerical
  27229. // order based on the resource name.
  27230. //
  27231. // You can also sort results in descending order based on the creation
  27232. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27233. // based on the creationTimestamp field in reverse chronological order
  27234. // (newest result first). Use this to sort resources like operations so
  27235. // that the newest operation is returned first.
  27236. //
  27237. // Currently, only sorting by name or creationTimestamp desc is
  27238. // supported.
  27239. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  27240. c.urlParams_.Set("orderBy", orderBy)
  27241. return c
  27242. }
  27243. // PageToken sets the optional parameter "pageToken": Specifies a page
  27244. // token to use. Set pageToken to the nextPageToken returned by a
  27245. // previous list request to get the next page of results.
  27246. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  27247. c.urlParams_.Set("pageToken", pageToken)
  27248. return c
  27249. }
  27250. // Fields allows partial responses to be retrieved. See
  27251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27252. // for more information.
  27253. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  27254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27255. return c
  27256. }
  27257. // IfNoneMatch sets the optional parameter which makes the operation
  27258. // fail if the object's ETag matches the given value. This is useful for
  27259. // getting updates only after the object has changed since the last
  27260. // request. Use googleapi.IsNotModified to check whether the response
  27261. // error from Do is the result of In-None-Match.
  27262. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  27263. c.ifNoneMatch_ = entityTag
  27264. return c
  27265. }
  27266. // Context sets the context to be used in this call's Do method. Any
  27267. // pending HTTP request will be aborted if the provided context is
  27268. // canceled.
  27269. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  27270. c.ctx_ = ctx
  27271. return c
  27272. }
  27273. // Header returns an http.Header that can be modified by the caller to
  27274. // add HTTP headers to the request.
  27275. func (c *DiskTypesListCall) Header() http.Header {
  27276. if c.header_ == nil {
  27277. c.header_ = make(http.Header)
  27278. }
  27279. return c.header_
  27280. }
  27281. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  27282. reqHeaders := make(http.Header)
  27283. for k, v := range c.header_ {
  27284. reqHeaders[k] = v
  27285. }
  27286. reqHeaders.Set("User-Agent", c.s.userAgent())
  27287. if c.ifNoneMatch_ != "" {
  27288. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27289. }
  27290. var body io.Reader = nil
  27291. c.urlParams_.Set("alt", alt)
  27292. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  27293. urls += "?" + c.urlParams_.Encode()
  27294. req, _ := http.NewRequest("GET", urls, body)
  27295. req.Header = reqHeaders
  27296. googleapi.Expand(req.URL, map[string]string{
  27297. "project": c.project,
  27298. "zone": c.zone,
  27299. })
  27300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27301. }
  27302. // Do executes the "compute.diskTypes.list" call.
  27303. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  27304. // status code is an error. Response headers are in either
  27305. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  27306. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27307. // to check whether the returned error was because
  27308. // http.StatusNotModified was returned.
  27309. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  27310. gensupport.SetOptions(c.urlParams_, opts...)
  27311. res, err := c.doRequest("json")
  27312. if res != nil && res.StatusCode == http.StatusNotModified {
  27313. if res.Body != nil {
  27314. res.Body.Close()
  27315. }
  27316. return nil, &googleapi.Error{
  27317. Code: res.StatusCode,
  27318. Header: res.Header,
  27319. }
  27320. }
  27321. if err != nil {
  27322. return nil, err
  27323. }
  27324. defer googleapi.CloseBody(res)
  27325. if err := googleapi.CheckResponse(res); err != nil {
  27326. return nil, err
  27327. }
  27328. ret := &DiskTypeList{
  27329. ServerResponse: googleapi.ServerResponse{
  27330. Header: res.Header,
  27331. HTTPStatusCode: res.StatusCode,
  27332. },
  27333. }
  27334. target := &ret
  27335. if err := gensupport.DecodeResponse(target, res); err != nil {
  27336. return nil, err
  27337. }
  27338. return ret, nil
  27339. // {
  27340. // "description": "Retrieves a list of disk types available to the specified project.",
  27341. // "httpMethod": "GET",
  27342. // "id": "compute.diskTypes.list",
  27343. // "parameterOrder": [
  27344. // "project",
  27345. // "zone"
  27346. // ],
  27347. // "parameters": {
  27348. // "filter": {
  27349. // "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).",
  27350. // "location": "query",
  27351. // "type": "string"
  27352. // },
  27353. // "maxResults": {
  27354. // "default": "500",
  27355. // "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)",
  27356. // "format": "uint32",
  27357. // "location": "query",
  27358. // "minimum": "0",
  27359. // "type": "integer"
  27360. // },
  27361. // "orderBy": {
  27362. // "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.",
  27363. // "location": "query",
  27364. // "type": "string"
  27365. // },
  27366. // "pageToken": {
  27367. // "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.",
  27368. // "location": "query",
  27369. // "type": "string"
  27370. // },
  27371. // "project": {
  27372. // "description": "Project ID for this request.",
  27373. // "location": "path",
  27374. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27375. // "required": true,
  27376. // "type": "string"
  27377. // },
  27378. // "zone": {
  27379. // "description": "The name of the zone for this request.",
  27380. // "location": "path",
  27381. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27382. // "required": true,
  27383. // "type": "string"
  27384. // }
  27385. // },
  27386. // "path": "{project}/zones/{zone}/diskTypes",
  27387. // "response": {
  27388. // "$ref": "DiskTypeList"
  27389. // },
  27390. // "scopes": [
  27391. // "https://www.googleapis.com/auth/cloud-platform",
  27392. // "https://www.googleapis.com/auth/compute",
  27393. // "https://www.googleapis.com/auth/compute.readonly"
  27394. // ]
  27395. // }
  27396. }
  27397. // Pages invokes f for each page of results.
  27398. // A non-nil error returned from f will halt the iteration.
  27399. // The provided context supersedes any context provided to the Context method.
  27400. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  27401. c.ctx_ = ctx
  27402. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27403. for {
  27404. x, err := c.Do()
  27405. if err != nil {
  27406. return err
  27407. }
  27408. if err := f(x); err != nil {
  27409. return err
  27410. }
  27411. if x.NextPageToken == "" {
  27412. return nil
  27413. }
  27414. c.PageToken(x.NextPageToken)
  27415. }
  27416. }
  27417. // method id "compute.disks.aggregatedList":
  27418. type DisksAggregatedListCall struct {
  27419. s *Service
  27420. project string
  27421. urlParams_ gensupport.URLParams
  27422. ifNoneMatch_ string
  27423. ctx_ context.Context
  27424. header_ http.Header
  27425. }
  27426. // AggregatedList: Retrieves an aggregated list of persistent disks.
  27427. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  27428. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  27429. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27430. c.project = project
  27431. return c
  27432. }
  27433. // Filter sets the optional parameter "filter": A filter expression that
  27434. // filters resources listed in the response. The expression must specify
  27435. // the field name, a comparison operator, and the value that you want to
  27436. // use for filtering. The value must be a string, a number, or a
  27437. // boolean. The comparison operator must be either =, !=, >, or <.
  27438. //
  27439. // For example, if you are filtering Compute Engine instances, you can
  27440. // exclude instances named example-instance by specifying name !=
  27441. // example-instance.
  27442. //
  27443. // You can also filter nested fields. For example, you could specify
  27444. // scheduling.automaticRestart = false to include instances only if they
  27445. // are not scheduled for automatic restarts. You can use filtering on
  27446. // nested fields to filter based on resource labels.
  27447. //
  27448. // To filter on multiple expressions, provide each separate expression
  27449. // within parentheses. For example, (scheduling.automaticRestart = true)
  27450. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27451. // AND expression. However, you can include AND and OR expressions
  27452. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27453. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27454. // true).
  27455. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  27456. c.urlParams_.Set("filter", filter)
  27457. return c
  27458. }
  27459. // MaxResults sets the optional parameter "maxResults": The maximum
  27460. // number of results per page that should be returned. If the number of
  27461. // available results is larger than maxResults, Compute Engine returns a
  27462. // nextPageToken that can be used to get the next page of results in
  27463. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27464. // (Default: 500)
  27465. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  27466. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27467. return c
  27468. }
  27469. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27470. // a certain order. By default, results are returned in alphanumerical
  27471. // order based on the resource name.
  27472. //
  27473. // You can also sort results in descending order based on the creation
  27474. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27475. // based on the creationTimestamp field in reverse chronological order
  27476. // (newest result first). Use this to sort resources like operations so
  27477. // that the newest operation is returned first.
  27478. //
  27479. // Currently, only sorting by name or creationTimestamp desc is
  27480. // supported.
  27481. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  27482. c.urlParams_.Set("orderBy", orderBy)
  27483. return c
  27484. }
  27485. // PageToken sets the optional parameter "pageToken": Specifies a page
  27486. // token to use. Set pageToken to the nextPageToken returned by a
  27487. // previous list request to get the next page of results.
  27488. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  27489. c.urlParams_.Set("pageToken", pageToken)
  27490. return c
  27491. }
  27492. // Fields allows partial responses to be retrieved. See
  27493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27494. // for more information.
  27495. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  27496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27497. return c
  27498. }
  27499. // IfNoneMatch sets the optional parameter which makes the operation
  27500. // fail if the object's ETag matches the given value. This is useful for
  27501. // getting updates only after the object has changed since the last
  27502. // request. Use googleapi.IsNotModified to check whether the response
  27503. // error from Do is the result of In-None-Match.
  27504. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  27505. c.ifNoneMatch_ = entityTag
  27506. return c
  27507. }
  27508. // Context sets the context to be used in this call's Do method. Any
  27509. // pending HTTP request will be aborted if the provided context is
  27510. // canceled.
  27511. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  27512. c.ctx_ = ctx
  27513. return c
  27514. }
  27515. // Header returns an http.Header that can be modified by the caller to
  27516. // add HTTP headers to the request.
  27517. func (c *DisksAggregatedListCall) Header() http.Header {
  27518. if c.header_ == nil {
  27519. c.header_ = make(http.Header)
  27520. }
  27521. return c.header_
  27522. }
  27523. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  27524. reqHeaders := make(http.Header)
  27525. for k, v := range c.header_ {
  27526. reqHeaders[k] = v
  27527. }
  27528. reqHeaders.Set("User-Agent", c.s.userAgent())
  27529. if c.ifNoneMatch_ != "" {
  27530. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27531. }
  27532. var body io.Reader = nil
  27533. c.urlParams_.Set("alt", alt)
  27534. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  27535. urls += "?" + c.urlParams_.Encode()
  27536. req, _ := http.NewRequest("GET", urls, body)
  27537. req.Header = reqHeaders
  27538. googleapi.Expand(req.URL, map[string]string{
  27539. "project": c.project,
  27540. })
  27541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27542. }
  27543. // Do executes the "compute.disks.aggregatedList" call.
  27544. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  27545. // non-2xx status code is an error. Response headers are in either
  27546. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  27547. // returned at all) in error.(*googleapi.Error).Header. Use
  27548. // googleapi.IsNotModified to check whether the returned error was
  27549. // because http.StatusNotModified was returned.
  27550. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  27551. gensupport.SetOptions(c.urlParams_, opts...)
  27552. res, err := c.doRequest("json")
  27553. if res != nil && res.StatusCode == http.StatusNotModified {
  27554. if res.Body != nil {
  27555. res.Body.Close()
  27556. }
  27557. return nil, &googleapi.Error{
  27558. Code: res.StatusCode,
  27559. Header: res.Header,
  27560. }
  27561. }
  27562. if err != nil {
  27563. return nil, err
  27564. }
  27565. defer googleapi.CloseBody(res)
  27566. if err := googleapi.CheckResponse(res); err != nil {
  27567. return nil, err
  27568. }
  27569. ret := &DiskAggregatedList{
  27570. ServerResponse: googleapi.ServerResponse{
  27571. Header: res.Header,
  27572. HTTPStatusCode: res.StatusCode,
  27573. },
  27574. }
  27575. target := &ret
  27576. if err := gensupport.DecodeResponse(target, res); err != nil {
  27577. return nil, err
  27578. }
  27579. return ret, nil
  27580. // {
  27581. // "description": "Retrieves an aggregated list of persistent disks.",
  27582. // "httpMethod": "GET",
  27583. // "id": "compute.disks.aggregatedList",
  27584. // "parameterOrder": [
  27585. // "project"
  27586. // ],
  27587. // "parameters": {
  27588. // "filter": {
  27589. // "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).",
  27590. // "location": "query",
  27591. // "type": "string"
  27592. // },
  27593. // "maxResults": {
  27594. // "default": "500",
  27595. // "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)",
  27596. // "format": "uint32",
  27597. // "location": "query",
  27598. // "minimum": "0",
  27599. // "type": "integer"
  27600. // },
  27601. // "orderBy": {
  27602. // "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.",
  27603. // "location": "query",
  27604. // "type": "string"
  27605. // },
  27606. // "pageToken": {
  27607. // "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.",
  27608. // "location": "query",
  27609. // "type": "string"
  27610. // },
  27611. // "project": {
  27612. // "description": "Project ID for this request.",
  27613. // "location": "path",
  27614. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27615. // "required": true,
  27616. // "type": "string"
  27617. // }
  27618. // },
  27619. // "path": "{project}/aggregated/disks",
  27620. // "response": {
  27621. // "$ref": "DiskAggregatedList"
  27622. // },
  27623. // "scopes": [
  27624. // "https://www.googleapis.com/auth/cloud-platform",
  27625. // "https://www.googleapis.com/auth/compute",
  27626. // "https://www.googleapis.com/auth/compute.readonly"
  27627. // ]
  27628. // }
  27629. }
  27630. // Pages invokes f for each page of results.
  27631. // A non-nil error returned from f will halt the iteration.
  27632. // The provided context supersedes any context provided to the Context method.
  27633. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  27634. c.ctx_ = ctx
  27635. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27636. for {
  27637. x, err := c.Do()
  27638. if err != nil {
  27639. return err
  27640. }
  27641. if err := f(x); err != nil {
  27642. return err
  27643. }
  27644. if x.NextPageToken == "" {
  27645. return nil
  27646. }
  27647. c.PageToken(x.NextPageToken)
  27648. }
  27649. }
  27650. // method id "compute.disks.createSnapshot":
  27651. type DisksCreateSnapshotCall struct {
  27652. s *Service
  27653. project string
  27654. zone string
  27655. disk string
  27656. snapshot *Snapshot
  27657. urlParams_ gensupport.URLParams
  27658. ctx_ context.Context
  27659. header_ http.Header
  27660. }
  27661. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  27662. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  27663. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  27664. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27665. c.project = project
  27666. c.zone = zone
  27667. c.disk = disk
  27668. c.snapshot = snapshot
  27669. return c
  27670. }
  27671. // GuestFlush sets the optional parameter "guestFlush":
  27672. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  27673. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  27674. return c
  27675. }
  27676. // RequestId sets the optional parameter "requestId": An optional
  27677. // request ID to identify requests. Specify a unique request ID so that
  27678. // if you must retry your request, the server will know to ignore the
  27679. // request if it has already been completed.
  27680. //
  27681. // For example, consider a situation where you make an initial request
  27682. // and the request times out. If you make the request again with the
  27683. // same request ID, the server can check if original operation with the
  27684. // same request ID was received, and if so, will ignore the second
  27685. // request. This prevents clients from accidentally creating duplicate
  27686. // commitments.
  27687. //
  27688. // The request ID must be a valid UUID with the exception that zero UUID
  27689. // is not supported (00000000-0000-0000-0000-000000000000).
  27690. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  27691. c.urlParams_.Set("requestId", requestId)
  27692. return c
  27693. }
  27694. // Fields allows partial responses to be retrieved. See
  27695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27696. // for more information.
  27697. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  27698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27699. return c
  27700. }
  27701. // Context sets the context to be used in this call's Do method. Any
  27702. // pending HTTP request will be aborted if the provided context is
  27703. // canceled.
  27704. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  27705. c.ctx_ = ctx
  27706. return c
  27707. }
  27708. // Header returns an http.Header that can be modified by the caller to
  27709. // add HTTP headers to the request.
  27710. func (c *DisksCreateSnapshotCall) Header() http.Header {
  27711. if c.header_ == nil {
  27712. c.header_ = make(http.Header)
  27713. }
  27714. return c.header_
  27715. }
  27716. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  27717. reqHeaders := make(http.Header)
  27718. for k, v := range c.header_ {
  27719. reqHeaders[k] = v
  27720. }
  27721. reqHeaders.Set("User-Agent", c.s.userAgent())
  27722. var body io.Reader = nil
  27723. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  27724. if err != nil {
  27725. return nil, err
  27726. }
  27727. reqHeaders.Set("Content-Type", "application/json")
  27728. c.urlParams_.Set("alt", alt)
  27729. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  27730. urls += "?" + c.urlParams_.Encode()
  27731. req, _ := http.NewRequest("POST", urls, body)
  27732. req.Header = reqHeaders
  27733. googleapi.Expand(req.URL, map[string]string{
  27734. "project": c.project,
  27735. "zone": c.zone,
  27736. "disk": c.disk,
  27737. })
  27738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27739. }
  27740. // Do executes the "compute.disks.createSnapshot" call.
  27741. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27742. // status code is an error. Response headers are in either
  27743. // *Operation.ServerResponse.Header or (if a response was returned at
  27744. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27745. // to check whether the returned error was because
  27746. // http.StatusNotModified was returned.
  27747. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27748. gensupport.SetOptions(c.urlParams_, opts...)
  27749. res, err := c.doRequest("json")
  27750. if res != nil && res.StatusCode == http.StatusNotModified {
  27751. if res.Body != nil {
  27752. res.Body.Close()
  27753. }
  27754. return nil, &googleapi.Error{
  27755. Code: res.StatusCode,
  27756. Header: res.Header,
  27757. }
  27758. }
  27759. if err != nil {
  27760. return nil, err
  27761. }
  27762. defer googleapi.CloseBody(res)
  27763. if err := googleapi.CheckResponse(res); err != nil {
  27764. return nil, err
  27765. }
  27766. ret := &Operation{
  27767. ServerResponse: googleapi.ServerResponse{
  27768. Header: res.Header,
  27769. HTTPStatusCode: res.StatusCode,
  27770. },
  27771. }
  27772. target := &ret
  27773. if err := gensupport.DecodeResponse(target, res); err != nil {
  27774. return nil, err
  27775. }
  27776. return ret, nil
  27777. // {
  27778. // "description": "Creates a snapshot of a specified persistent disk.",
  27779. // "httpMethod": "POST",
  27780. // "id": "compute.disks.createSnapshot",
  27781. // "parameterOrder": [
  27782. // "project",
  27783. // "zone",
  27784. // "disk"
  27785. // ],
  27786. // "parameters": {
  27787. // "disk": {
  27788. // "description": "Name of the persistent disk to snapshot.",
  27789. // "location": "path",
  27790. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27791. // "required": true,
  27792. // "type": "string"
  27793. // },
  27794. // "guestFlush": {
  27795. // "location": "query",
  27796. // "type": "boolean"
  27797. // },
  27798. // "project": {
  27799. // "description": "Project ID for this request.",
  27800. // "location": "path",
  27801. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27802. // "required": true,
  27803. // "type": "string"
  27804. // },
  27805. // "requestId": {
  27806. // "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).",
  27807. // "location": "query",
  27808. // "type": "string"
  27809. // },
  27810. // "zone": {
  27811. // "description": "The name of the zone for this request.",
  27812. // "location": "path",
  27813. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27814. // "required": true,
  27815. // "type": "string"
  27816. // }
  27817. // },
  27818. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  27819. // "request": {
  27820. // "$ref": "Snapshot"
  27821. // },
  27822. // "response": {
  27823. // "$ref": "Operation"
  27824. // },
  27825. // "scopes": [
  27826. // "https://www.googleapis.com/auth/cloud-platform",
  27827. // "https://www.googleapis.com/auth/compute"
  27828. // ]
  27829. // }
  27830. }
  27831. // method id "compute.disks.delete":
  27832. type DisksDeleteCall struct {
  27833. s *Service
  27834. project string
  27835. zone string
  27836. disk string
  27837. urlParams_ gensupport.URLParams
  27838. ctx_ context.Context
  27839. header_ http.Header
  27840. }
  27841. // Delete: Deletes the specified persistent disk. Deleting a disk
  27842. // removes its data permanently and is irreversible. However, deleting a
  27843. // disk does not delete any snapshots previously made from the disk. You
  27844. // must separately delete snapshots.
  27845. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  27846. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  27847. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27848. c.project = project
  27849. c.zone = zone
  27850. c.disk = disk
  27851. return c
  27852. }
  27853. // RequestId sets the optional parameter "requestId": An optional
  27854. // request ID to identify requests. Specify a unique request ID so that
  27855. // if you must retry your request, the server will know to ignore the
  27856. // request if it has already been completed.
  27857. //
  27858. // For example, consider a situation where you make an initial request
  27859. // and the request times out. If you make the request again with the
  27860. // same request ID, the server can check if original operation with the
  27861. // same request ID was received, and if so, will ignore the second
  27862. // request. This prevents clients from accidentally creating duplicate
  27863. // commitments.
  27864. //
  27865. // The request ID must be a valid UUID with the exception that zero UUID
  27866. // is not supported (00000000-0000-0000-0000-000000000000).
  27867. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  27868. c.urlParams_.Set("requestId", requestId)
  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 *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  27875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27876. return c
  27877. }
  27878. // Context sets the context to be used in this call's Do method. Any
  27879. // pending HTTP request will be aborted if the provided context is
  27880. // canceled.
  27881. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  27882. c.ctx_ = ctx
  27883. return c
  27884. }
  27885. // Header returns an http.Header that can be modified by the caller to
  27886. // add HTTP headers to the request.
  27887. func (c *DisksDeleteCall) Header() http.Header {
  27888. if c.header_ == nil {
  27889. c.header_ = make(http.Header)
  27890. }
  27891. return c.header_
  27892. }
  27893. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  27894. reqHeaders := make(http.Header)
  27895. for k, v := range c.header_ {
  27896. reqHeaders[k] = v
  27897. }
  27898. reqHeaders.Set("User-Agent", c.s.userAgent())
  27899. var body io.Reader = nil
  27900. c.urlParams_.Set("alt", alt)
  27901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  27902. urls += "?" + c.urlParams_.Encode()
  27903. req, _ := http.NewRequest("DELETE", urls, body)
  27904. req.Header = reqHeaders
  27905. googleapi.Expand(req.URL, map[string]string{
  27906. "project": c.project,
  27907. "zone": c.zone,
  27908. "disk": c.disk,
  27909. })
  27910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27911. }
  27912. // Do executes the "compute.disks.delete" call.
  27913. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27914. // status code is an error. Response headers are in either
  27915. // *Operation.ServerResponse.Header or (if a response was returned at
  27916. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27917. // to check whether the returned error was because
  27918. // http.StatusNotModified was returned.
  27919. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27920. gensupport.SetOptions(c.urlParams_, opts...)
  27921. res, err := c.doRequest("json")
  27922. if res != nil && res.StatusCode == http.StatusNotModified {
  27923. if res.Body != nil {
  27924. res.Body.Close()
  27925. }
  27926. return nil, &googleapi.Error{
  27927. Code: res.StatusCode,
  27928. Header: res.Header,
  27929. }
  27930. }
  27931. if err != nil {
  27932. return nil, err
  27933. }
  27934. defer googleapi.CloseBody(res)
  27935. if err := googleapi.CheckResponse(res); err != nil {
  27936. return nil, err
  27937. }
  27938. ret := &Operation{
  27939. ServerResponse: googleapi.ServerResponse{
  27940. Header: res.Header,
  27941. HTTPStatusCode: res.StatusCode,
  27942. },
  27943. }
  27944. target := &ret
  27945. if err := gensupport.DecodeResponse(target, res); err != nil {
  27946. return nil, err
  27947. }
  27948. return ret, nil
  27949. // {
  27950. // "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.",
  27951. // "httpMethod": "DELETE",
  27952. // "id": "compute.disks.delete",
  27953. // "parameterOrder": [
  27954. // "project",
  27955. // "zone",
  27956. // "disk"
  27957. // ],
  27958. // "parameters": {
  27959. // "disk": {
  27960. // "description": "Name of the persistent disk to delete.",
  27961. // "location": "path",
  27962. // "required": true,
  27963. // "type": "string"
  27964. // },
  27965. // "project": {
  27966. // "description": "Project ID for this request.",
  27967. // "location": "path",
  27968. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27969. // "required": true,
  27970. // "type": "string"
  27971. // },
  27972. // "requestId": {
  27973. // "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).",
  27974. // "location": "query",
  27975. // "type": "string"
  27976. // },
  27977. // "zone": {
  27978. // "description": "The name of the zone for this request.",
  27979. // "location": "path",
  27980. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27981. // "required": true,
  27982. // "type": "string"
  27983. // }
  27984. // },
  27985. // "path": "{project}/zones/{zone}/disks/{disk}",
  27986. // "response": {
  27987. // "$ref": "Operation"
  27988. // },
  27989. // "scopes": [
  27990. // "https://www.googleapis.com/auth/cloud-platform",
  27991. // "https://www.googleapis.com/auth/compute"
  27992. // ]
  27993. // }
  27994. }
  27995. // method id "compute.disks.get":
  27996. type DisksGetCall struct {
  27997. s *Service
  27998. project string
  27999. zone string
  28000. disk string
  28001. urlParams_ gensupport.URLParams
  28002. ifNoneMatch_ string
  28003. ctx_ context.Context
  28004. header_ http.Header
  28005. }
  28006. // Get: Returns a specified persistent disk. Gets a list of available
  28007. // persistent disks by making a list() request.
  28008. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  28009. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  28010. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28011. c.project = project
  28012. c.zone = zone
  28013. c.disk = disk
  28014. return c
  28015. }
  28016. // Fields allows partial responses to be retrieved. See
  28017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28018. // for more information.
  28019. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  28020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28021. return c
  28022. }
  28023. // IfNoneMatch sets the optional parameter which makes the operation
  28024. // fail if the object's ETag matches the given value. This is useful for
  28025. // getting updates only after the object has changed since the last
  28026. // request. Use googleapi.IsNotModified to check whether the response
  28027. // error from Do is the result of In-None-Match.
  28028. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  28029. c.ifNoneMatch_ = entityTag
  28030. return c
  28031. }
  28032. // Context sets the context to be used in this call's Do method. Any
  28033. // pending HTTP request will be aborted if the provided context is
  28034. // canceled.
  28035. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  28036. c.ctx_ = ctx
  28037. return c
  28038. }
  28039. // Header returns an http.Header that can be modified by the caller to
  28040. // add HTTP headers to the request.
  28041. func (c *DisksGetCall) Header() http.Header {
  28042. if c.header_ == nil {
  28043. c.header_ = make(http.Header)
  28044. }
  28045. return c.header_
  28046. }
  28047. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  28048. reqHeaders := make(http.Header)
  28049. for k, v := range c.header_ {
  28050. reqHeaders[k] = v
  28051. }
  28052. reqHeaders.Set("User-Agent", c.s.userAgent())
  28053. if c.ifNoneMatch_ != "" {
  28054. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28055. }
  28056. var body io.Reader = nil
  28057. c.urlParams_.Set("alt", alt)
  28058. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  28059. urls += "?" + c.urlParams_.Encode()
  28060. req, _ := http.NewRequest("GET", urls, body)
  28061. req.Header = reqHeaders
  28062. googleapi.Expand(req.URL, map[string]string{
  28063. "project": c.project,
  28064. "zone": c.zone,
  28065. "disk": c.disk,
  28066. })
  28067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28068. }
  28069. // Do executes the "compute.disks.get" call.
  28070. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  28071. // code is an error. Response headers are in either
  28072. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  28073. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  28074. // whether the returned error was because http.StatusNotModified was
  28075. // returned.
  28076. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  28077. gensupport.SetOptions(c.urlParams_, opts...)
  28078. res, err := c.doRequest("json")
  28079. if res != nil && res.StatusCode == http.StatusNotModified {
  28080. if res.Body != nil {
  28081. res.Body.Close()
  28082. }
  28083. return nil, &googleapi.Error{
  28084. Code: res.StatusCode,
  28085. Header: res.Header,
  28086. }
  28087. }
  28088. if err != nil {
  28089. return nil, err
  28090. }
  28091. defer googleapi.CloseBody(res)
  28092. if err := googleapi.CheckResponse(res); err != nil {
  28093. return nil, err
  28094. }
  28095. ret := &Disk{
  28096. ServerResponse: googleapi.ServerResponse{
  28097. Header: res.Header,
  28098. HTTPStatusCode: res.StatusCode,
  28099. },
  28100. }
  28101. target := &ret
  28102. if err := gensupport.DecodeResponse(target, res); err != nil {
  28103. return nil, err
  28104. }
  28105. return ret, nil
  28106. // {
  28107. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  28108. // "httpMethod": "GET",
  28109. // "id": "compute.disks.get",
  28110. // "parameterOrder": [
  28111. // "project",
  28112. // "zone",
  28113. // "disk"
  28114. // ],
  28115. // "parameters": {
  28116. // "disk": {
  28117. // "description": "Name of the persistent disk to return.",
  28118. // "location": "path",
  28119. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28120. // "required": true,
  28121. // "type": "string"
  28122. // },
  28123. // "project": {
  28124. // "description": "Project ID for this request.",
  28125. // "location": "path",
  28126. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28127. // "required": true,
  28128. // "type": "string"
  28129. // },
  28130. // "zone": {
  28131. // "description": "The name of the zone for this request.",
  28132. // "location": "path",
  28133. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28134. // "required": true,
  28135. // "type": "string"
  28136. // }
  28137. // },
  28138. // "path": "{project}/zones/{zone}/disks/{disk}",
  28139. // "response": {
  28140. // "$ref": "Disk"
  28141. // },
  28142. // "scopes": [
  28143. // "https://www.googleapis.com/auth/cloud-platform",
  28144. // "https://www.googleapis.com/auth/compute",
  28145. // "https://www.googleapis.com/auth/compute.readonly"
  28146. // ]
  28147. // }
  28148. }
  28149. // method id "compute.disks.insert":
  28150. type DisksInsertCall struct {
  28151. s *Service
  28152. project string
  28153. zone string
  28154. disk *Disk
  28155. urlParams_ gensupport.URLParams
  28156. ctx_ context.Context
  28157. header_ http.Header
  28158. }
  28159. // Insert: Creates a persistent disk in the specified project using the
  28160. // data in the request. You can create a disk with a sourceImage, a
  28161. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  28162. // properties. You can also create a disk that is larger than the
  28163. // default size by specifying the sizeGb property.
  28164. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  28165. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  28166. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28167. c.project = project
  28168. c.zone = zone
  28169. c.disk = disk
  28170. return c
  28171. }
  28172. // RequestId sets the optional parameter "requestId": An optional
  28173. // request ID to identify requests. Specify a unique request ID so that
  28174. // if you must retry your request, the server will know to ignore the
  28175. // request if it has already been completed.
  28176. //
  28177. // For example, consider a situation where you make an initial request
  28178. // and the request times out. If you make the request again with the
  28179. // same request ID, the server can check if original operation with the
  28180. // same request ID was received, and if so, will ignore the second
  28181. // request. This prevents clients from accidentally creating duplicate
  28182. // commitments.
  28183. //
  28184. // The request ID must be a valid UUID with the exception that zero UUID
  28185. // is not supported (00000000-0000-0000-0000-000000000000).
  28186. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  28187. c.urlParams_.Set("requestId", requestId)
  28188. return c
  28189. }
  28190. // SourceImage sets the optional parameter "sourceImage": Source image
  28191. // to restore onto a disk.
  28192. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  28193. c.urlParams_.Set("sourceImage", sourceImage)
  28194. return c
  28195. }
  28196. // Fields allows partial responses to be retrieved. See
  28197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28198. // for more information.
  28199. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  28200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28201. return c
  28202. }
  28203. // Context sets the context to be used in this call's Do method. Any
  28204. // pending HTTP request will be aborted if the provided context is
  28205. // canceled.
  28206. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  28207. c.ctx_ = ctx
  28208. return c
  28209. }
  28210. // Header returns an http.Header that can be modified by the caller to
  28211. // add HTTP headers to the request.
  28212. func (c *DisksInsertCall) Header() http.Header {
  28213. if c.header_ == nil {
  28214. c.header_ = make(http.Header)
  28215. }
  28216. return c.header_
  28217. }
  28218. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  28219. reqHeaders := make(http.Header)
  28220. for k, v := range c.header_ {
  28221. reqHeaders[k] = v
  28222. }
  28223. reqHeaders.Set("User-Agent", c.s.userAgent())
  28224. var body io.Reader = nil
  28225. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  28226. if err != nil {
  28227. return nil, err
  28228. }
  28229. reqHeaders.Set("Content-Type", "application/json")
  28230. c.urlParams_.Set("alt", alt)
  28231. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  28232. urls += "?" + c.urlParams_.Encode()
  28233. req, _ := http.NewRequest("POST", urls, body)
  28234. req.Header = reqHeaders
  28235. googleapi.Expand(req.URL, map[string]string{
  28236. "project": c.project,
  28237. "zone": c.zone,
  28238. })
  28239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28240. }
  28241. // Do executes the "compute.disks.insert" call.
  28242. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28243. // status code is an error. Response headers are in either
  28244. // *Operation.ServerResponse.Header or (if a response was returned at
  28245. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28246. // to check whether the returned error was because
  28247. // http.StatusNotModified was returned.
  28248. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28249. gensupport.SetOptions(c.urlParams_, opts...)
  28250. res, err := c.doRequest("json")
  28251. if res != nil && res.StatusCode == http.StatusNotModified {
  28252. if res.Body != nil {
  28253. res.Body.Close()
  28254. }
  28255. return nil, &googleapi.Error{
  28256. Code: res.StatusCode,
  28257. Header: res.Header,
  28258. }
  28259. }
  28260. if err != nil {
  28261. return nil, err
  28262. }
  28263. defer googleapi.CloseBody(res)
  28264. if err := googleapi.CheckResponse(res); err != nil {
  28265. return nil, err
  28266. }
  28267. ret := &Operation{
  28268. ServerResponse: googleapi.ServerResponse{
  28269. Header: res.Header,
  28270. HTTPStatusCode: res.StatusCode,
  28271. },
  28272. }
  28273. target := &ret
  28274. if err := gensupport.DecodeResponse(target, res); err != nil {
  28275. return nil, err
  28276. }
  28277. return ret, nil
  28278. // {
  28279. // "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.",
  28280. // "httpMethod": "POST",
  28281. // "id": "compute.disks.insert",
  28282. // "parameterOrder": [
  28283. // "project",
  28284. // "zone"
  28285. // ],
  28286. // "parameters": {
  28287. // "project": {
  28288. // "description": "Project ID for this request.",
  28289. // "location": "path",
  28290. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28291. // "required": true,
  28292. // "type": "string"
  28293. // },
  28294. // "requestId": {
  28295. // "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).",
  28296. // "location": "query",
  28297. // "type": "string"
  28298. // },
  28299. // "sourceImage": {
  28300. // "description": "Optional. Source image to restore onto a disk.",
  28301. // "location": "query",
  28302. // "type": "string"
  28303. // },
  28304. // "zone": {
  28305. // "description": "The name of the zone for this request.",
  28306. // "location": "path",
  28307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28308. // "required": true,
  28309. // "type": "string"
  28310. // }
  28311. // },
  28312. // "path": "{project}/zones/{zone}/disks",
  28313. // "request": {
  28314. // "$ref": "Disk"
  28315. // },
  28316. // "response": {
  28317. // "$ref": "Operation"
  28318. // },
  28319. // "scopes": [
  28320. // "https://www.googleapis.com/auth/cloud-platform",
  28321. // "https://www.googleapis.com/auth/compute"
  28322. // ]
  28323. // }
  28324. }
  28325. // method id "compute.disks.list":
  28326. type DisksListCall struct {
  28327. s *Service
  28328. project string
  28329. zone string
  28330. urlParams_ gensupport.URLParams
  28331. ifNoneMatch_ string
  28332. ctx_ context.Context
  28333. header_ http.Header
  28334. }
  28335. // List: Retrieves a list of persistent disks contained within the
  28336. // specified zone.
  28337. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  28338. func (r *DisksService) List(project string, zone string) *DisksListCall {
  28339. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28340. c.project = project
  28341. c.zone = zone
  28342. return c
  28343. }
  28344. // Filter sets the optional parameter "filter": A filter expression that
  28345. // filters resources listed in the response. The expression must specify
  28346. // the field name, a comparison operator, and the value that you want to
  28347. // use for filtering. The value must be a string, a number, or a
  28348. // boolean. The comparison operator must be either =, !=, >, or <.
  28349. //
  28350. // For example, if you are filtering Compute Engine instances, you can
  28351. // exclude instances named example-instance by specifying name !=
  28352. // example-instance.
  28353. //
  28354. // You can also filter nested fields. For example, you could specify
  28355. // scheduling.automaticRestart = false to include instances only if they
  28356. // are not scheduled for automatic restarts. You can use filtering on
  28357. // nested fields to filter based on resource labels.
  28358. //
  28359. // To filter on multiple expressions, provide each separate expression
  28360. // within parentheses. For example, (scheduling.automaticRestart = true)
  28361. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  28362. // AND expression. However, you can include AND and OR expressions
  28363. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  28364. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  28365. // true).
  28366. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  28367. c.urlParams_.Set("filter", filter)
  28368. return c
  28369. }
  28370. // MaxResults sets the optional parameter "maxResults": The maximum
  28371. // number of results per page that should be returned. If the number of
  28372. // available results is larger than maxResults, Compute Engine returns a
  28373. // nextPageToken that can be used to get the next page of results in
  28374. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  28375. // (Default: 500)
  28376. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  28377. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28378. return c
  28379. }
  28380. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28381. // a certain order. By default, results are returned in alphanumerical
  28382. // order based on the resource name.
  28383. //
  28384. // You can also sort results in descending order based on the creation
  28385. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28386. // based on the creationTimestamp field in reverse chronological order
  28387. // (newest result first). Use this to sort resources like operations so
  28388. // that the newest operation is returned first.
  28389. //
  28390. // Currently, only sorting by name or creationTimestamp desc is
  28391. // supported.
  28392. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  28393. c.urlParams_.Set("orderBy", orderBy)
  28394. return c
  28395. }
  28396. // PageToken sets the optional parameter "pageToken": Specifies a page
  28397. // token to use. Set pageToken to the nextPageToken returned by a
  28398. // previous list request to get the next page of results.
  28399. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  28400. c.urlParams_.Set("pageToken", pageToken)
  28401. return c
  28402. }
  28403. // Fields allows partial responses to be retrieved. See
  28404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28405. // for more information.
  28406. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  28407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28408. return c
  28409. }
  28410. // IfNoneMatch sets the optional parameter which makes the operation
  28411. // fail if the object's ETag matches the given value. This is useful for
  28412. // getting updates only after the object has changed since the last
  28413. // request. Use googleapi.IsNotModified to check whether the response
  28414. // error from Do is the result of In-None-Match.
  28415. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  28416. c.ifNoneMatch_ = entityTag
  28417. return c
  28418. }
  28419. // Context sets the context to be used in this call's Do method. Any
  28420. // pending HTTP request will be aborted if the provided context is
  28421. // canceled.
  28422. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  28423. c.ctx_ = ctx
  28424. return c
  28425. }
  28426. // Header returns an http.Header that can be modified by the caller to
  28427. // add HTTP headers to the request.
  28428. func (c *DisksListCall) Header() http.Header {
  28429. if c.header_ == nil {
  28430. c.header_ = make(http.Header)
  28431. }
  28432. return c.header_
  28433. }
  28434. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  28435. reqHeaders := make(http.Header)
  28436. for k, v := range c.header_ {
  28437. reqHeaders[k] = v
  28438. }
  28439. reqHeaders.Set("User-Agent", c.s.userAgent())
  28440. if c.ifNoneMatch_ != "" {
  28441. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28442. }
  28443. var body io.Reader = nil
  28444. c.urlParams_.Set("alt", alt)
  28445. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  28446. urls += "?" + c.urlParams_.Encode()
  28447. req, _ := http.NewRequest("GET", urls, body)
  28448. req.Header = reqHeaders
  28449. googleapi.Expand(req.URL, map[string]string{
  28450. "project": c.project,
  28451. "zone": c.zone,
  28452. })
  28453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28454. }
  28455. // Do executes the "compute.disks.list" call.
  28456. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  28457. // code is an error. Response headers are in either
  28458. // *DiskList.ServerResponse.Header or (if a response was returned at
  28459. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28460. // to check whether the returned error was because
  28461. // http.StatusNotModified was returned.
  28462. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  28463. gensupport.SetOptions(c.urlParams_, opts...)
  28464. res, err := c.doRequest("json")
  28465. if res != nil && res.StatusCode == http.StatusNotModified {
  28466. if res.Body != nil {
  28467. res.Body.Close()
  28468. }
  28469. return nil, &googleapi.Error{
  28470. Code: res.StatusCode,
  28471. Header: res.Header,
  28472. }
  28473. }
  28474. if err != nil {
  28475. return nil, err
  28476. }
  28477. defer googleapi.CloseBody(res)
  28478. if err := googleapi.CheckResponse(res); err != nil {
  28479. return nil, err
  28480. }
  28481. ret := &DiskList{
  28482. ServerResponse: googleapi.ServerResponse{
  28483. Header: res.Header,
  28484. HTTPStatusCode: res.StatusCode,
  28485. },
  28486. }
  28487. target := &ret
  28488. if err := gensupport.DecodeResponse(target, res); err != nil {
  28489. return nil, err
  28490. }
  28491. return ret, nil
  28492. // {
  28493. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  28494. // "httpMethod": "GET",
  28495. // "id": "compute.disks.list",
  28496. // "parameterOrder": [
  28497. // "project",
  28498. // "zone"
  28499. // ],
  28500. // "parameters": {
  28501. // "filter": {
  28502. // "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).",
  28503. // "location": "query",
  28504. // "type": "string"
  28505. // },
  28506. // "maxResults": {
  28507. // "default": "500",
  28508. // "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)",
  28509. // "format": "uint32",
  28510. // "location": "query",
  28511. // "minimum": "0",
  28512. // "type": "integer"
  28513. // },
  28514. // "orderBy": {
  28515. // "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.",
  28516. // "location": "query",
  28517. // "type": "string"
  28518. // },
  28519. // "pageToken": {
  28520. // "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.",
  28521. // "location": "query",
  28522. // "type": "string"
  28523. // },
  28524. // "project": {
  28525. // "description": "Project ID for this request.",
  28526. // "location": "path",
  28527. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28528. // "required": true,
  28529. // "type": "string"
  28530. // },
  28531. // "zone": {
  28532. // "description": "The name of the zone for this request.",
  28533. // "location": "path",
  28534. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28535. // "required": true,
  28536. // "type": "string"
  28537. // }
  28538. // },
  28539. // "path": "{project}/zones/{zone}/disks",
  28540. // "response": {
  28541. // "$ref": "DiskList"
  28542. // },
  28543. // "scopes": [
  28544. // "https://www.googleapis.com/auth/cloud-platform",
  28545. // "https://www.googleapis.com/auth/compute",
  28546. // "https://www.googleapis.com/auth/compute.readonly"
  28547. // ]
  28548. // }
  28549. }
  28550. // Pages invokes f for each page of results.
  28551. // A non-nil error returned from f will halt the iteration.
  28552. // The provided context supersedes any context provided to the Context method.
  28553. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  28554. c.ctx_ = ctx
  28555. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28556. for {
  28557. x, err := c.Do()
  28558. if err != nil {
  28559. return err
  28560. }
  28561. if err := f(x); err != nil {
  28562. return err
  28563. }
  28564. if x.NextPageToken == "" {
  28565. return nil
  28566. }
  28567. c.PageToken(x.NextPageToken)
  28568. }
  28569. }
  28570. // method id "compute.disks.resize":
  28571. type DisksResizeCall struct {
  28572. s *Service
  28573. project string
  28574. zone string
  28575. disk string
  28576. disksresizerequest *DisksResizeRequest
  28577. urlParams_ gensupport.URLParams
  28578. ctx_ context.Context
  28579. header_ http.Header
  28580. }
  28581. // Resize: Resizes the specified persistent disk. You can only increase
  28582. // the size of the disk.
  28583. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  28584. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28585. c.project = project
  28586. c.zone = zone
  28587. c.disk = disk
  28588. c.disksresizerequest = disksresizerequest
  28589. return c
  28590. }
  28591. // RequestId sets the optional parameter "requestId": An optional
  28592. // request ID to identify requests. Specify a unique request ID so that
  28593. // if you must retry your request, the server will know to ignore the
  28594. // request if it has already been completed.
  28595. //
  28596. // For example, consider a situation where you make an initial request
  28597. // and the request times out. If you make the request again with the
  28598. // same request ID, the server can check if original operation with the
  28599. // same request ID was received, and if so, will ignore the second
  28600. // request. This prevents clients from accidentally creating duplicate
  28601. // commitments.
  28602. //
  28603. // The request ID must be a valid UUID with the exception that zero UUID
  28604. // is not supported (00000000-0000-0000-0000-000000000000).
  28605. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  28606. c.urlParams_.Set("requestId", requestId)
  28607. return c
  28608. }
  28609. // Fields allows partial responses to be retrieved. See
  28610. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28611. // for more information.
  28612. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  28613. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28614. return c
  28615. }
  28616. // Context sets the context to be used in this call's Do method. Any
  28617. // pending HTTP request will be aborted if the provided context is
  28618. // canceled.
  28619. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  28620. c.ctx_ = ctx
  28621. return c
  28622. }
  28623. // Header returns an http.Header that can be modified by the caller to
  28624. // add HTTP headers to the request.
  28625. func (c *DisksResizeCall) Header() http.Header {
  28626. if c.header_ == nil {
  28627. c.header_ = make(http.Header)
  28628. }
  28629. return c.header_
  28630. }
  28631. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  28632. reqHeaders := make(http.Header)
  28633. for k, v := range c.header_ {
  28634. reqHeaders[k] = v
  28635. }
  28636. reqHeaders.Set("User-Agent", c.s.userAgent())
  28637. var body io.Reader = nil
  28638. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  28639. if err != nil {
  28640. return nil, err
  28641. }
  28642. reqHeaders.Set("Content-Type", "application/json")
  28643. c.urlParams_.Set("alt", alt)
  28644. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  28645. urls += "?" + c.urlParams_.Encode()
  28646. req, _ := http.NewRequest("POST", urls, body)
  28647. req.Header = reqHeaders
  28648. googleapi.Expand(req.URL, map[string]string{
  28649. "project": c.project,
  28650. "zone": c.zone,
  28651. "disk": c.disk,
  28652. })
  28653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28654. }
  28655. // Do executes the "compute.disks.resize" call.
  28656. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28657. // status code is an error. Response headers are in either
  28658. // *Operation.ServerResponse.Header or (if a response was returned at
  28659. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28660. // to check whether the returned error was because
  28661. // http.StatusNotModified was returned.
  28662. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28663. gensupport.SetOptions(c.urlParams_, opts...)
  28664. res, err := c.doRequest("json")
  28665. if res != nil && res.StatusCode == http.StatusNotModified {
  28666. if res.Body != nil {
  28667. res.Body.Close()
  28668. }
  28669. return nil, &googleapi.Error{
  28670. Code: res.StatusCode,
  28671. Header: res.Header,
  28672. }
  28673. }
  28674. if err != nil {
  28675. return nil, err
  28676. }
  28677. defer googleapi.CloseBody(res)
  28678. if err := googleapi.CheckResponse(res); err != nil {
  28679. return nil, err
  28680. }
  28681. ret := &Operation{
  28682. ServerResponse: googleapi.ServerResponse{
  28683. Header: res.Header,
  28684. HTTPStatusCode: res.StatusCode,
  28685. },
  28686. }
  28687. target := &ret
  28688. if err := gensupport.DecodeResponse(target, res); err != nil {
  28689. return nil, err
  28690. }
  28691. return ret, nil
  28692. // {
  28693. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  28694. // "httpMethod": "POST",
  28695. // "id": "compute.disks.resize",
  28696. // "parameterOrder": [
  28697. // "project",
  28698. // "zone",
  28699. // "disk"
  28700. // ],
  28701. // "parameters": {
  28702. // "disk": {
  28703. // "description": "The name of the persistent disk.",
  28704. // "location": "path",
  28705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28706. // "required": true,
  28707. // "type": "string"
  28708. // },
  28709. // "project": {
  28710. // "description": "Project ID for this request.",
  28711. // "location": "path",
  28712. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28713. // "required": true,
  28714. // "type": "string"
  28715. // },
  28716. // "requestId": {
  28717. // "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).",
  28718. // "location": "query",
  28719. // "type": "string"
  28720. // },
  28721. // "zone": {
  28722. // "description": "The name of the zone for this request.",
  28723. // "location": "path",
  28724. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28725. // "required": true,
  28726. // "type": "string"
  28727. // }
  28728. // },
  28729. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  28730. // "request": {
  28731. // "$ref": "DisksResizeRequest"
  28732. // },
  28733. // "response": {
  28734. // "$ref": "Operation"
  28735. // },
  28736. // "scopes": [
  28737. // "https://www.googleapis.com/auth/cloud-platform",
  28738. // "https://www.googleapis.com/auth/compute"
  28739. // ]
  28740. // }
  28741. }
  28742. // method id "compute.disks.setLabels":
  28743. type DisksSetLabelsCall struct {
  28744. s *Service
  28745. project string
  28746. zone string
  28747. resource string
  28748. zonesetlabelsrequest *ZoneSetLabelsRequest
  28749. urlParams_ gensupport.URLParams
  28750. ctx_ context.Context
  28751. header_ http.Header
  28752. }
  28753. // SetLabels: Sets the labels on a disk. To learn more about labels,
  28754. // read the Labeling Resources documentation.
  28755. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  28756. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28757. c.project = project
  28758. c.zone = zone
  28759. c.resource = resource
  28760. c.zonesetlabelsrequest = zonesetlabelsrequest
  28761. return c
  28762. }
  28763. // RequestId sets the optional parameter "requestId": An optional
  28764. // request ID to identify requests. Specify a unique request ID so that
  28765. // if you must retry your request, the server will know to ignore the
  28766. // request if it has already been completed.
  28767. //
  28768. // For example, consider a situation where you make an initial request
  28769. // and the request times out. If you make the request again with the
  28770. // same request ID, the server can check if original operation with the
  28771. // same request ID was received, and if so, will ignore the second
  28772. // request. This prevents clients from accidentally creating duplicate
  28773. // commitments.
  28774. //
  28775. // The request ID must be a valid UUID with the exception that zero UUID
  28776. // is not supported (00000000-0000-0000-0000-000000000000).
  28777. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  28778. c.urlParams_.Set("requestId", requestId)
  28779. return c
  28780. }
  28781. // Fields allows partial responses to be retrieved. See
  28782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28783. // for more information.
  28784. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  28785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28786. return c
  28787. }
  28788. // Context sets the context to be used in this call's Do method. Any
  28789. // pending HTTP request will be aborted if the provided context is
  28790. // canceled.
  28791. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  28792. c.ctx_ = ctx
  28793. return c
  28794. }
  28795. // Header returns an http.Header that can be modified by the caller to
  28796. // add HTTP headers to the request.
  28797. func (c *DisksSetLabelsCall) Header() http.Header {
  28798. if c.header_ == nil {
  28799. c.header_ = make(http.Header)
  28800. }
  28801. return c.header_
  28802. }
  28803. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  28804. reqHeaders := make(http.Header)
  28805. for k, v := range c.header_ {
  28806. reqHeaders[k] = v
  28807. }
  28808. reqHeaders.Set("User-Agent", c.s.userAgent())
  28809. var body io.Reader = nil
  28810. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  28811. if err != nil {
  28812. return nil, err
  28813. }
  28814. reqHeaders.Set("Content-Type", "application/json")
  28815. c.urlParams_.Set("alt", alt)
  28816. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  28817. urls += "?" + c.urlParams_.Encode()
  28818. req, _ := http.NewRequest("POST", urls, body)
  28819. req.Header = reqHeaders
  28820. googleapi.Expand(req.URL, map[string]string{
  28821. "project": c.project,
  28822. "zone": c.zone,
  28823. "resource": c.resource,
  28824. })
  28825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28826. }
  28827. // Do executes the "compute.disks.setLabels" call.
  28828. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28829. // status code is an error. Response headers are in either
  28830. // *Operation.ServerResponse.Header or (if a response was returned at
  28831. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28832. // to check whether the returned error was because
  28833. // http.StatusNotModified was returned.
  28834. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28835. gensupport.SetOptions(c.urlParams_, opts...)
  28836. res, err := c.doRequest("json")
  28837. if res != nil && res.StatusCode == http.StatusNotModified {
  28838. if res.Body != nil {
  28839. res.Body.Close()
  28840. }
  28841. return nil, &googleapi.Error{
  28842. Code: res.StatusCode,
  28843. Header: res.Header,
  28844. }
  28845. }
  28846. if err != nil {
  28847. return nil, err
  28848. }
  28849. defer googleapi.CloseBody(res)
  28850. if err := googleapi.CheckResponse(res); err != nil {
  28851. return nil, err
  28852. }
  28853. ret := &Operation{
  28854. ServerResponse: googleapi.ServerResponse{
  28855. Header: res.Header,
  28856. HTTPStatusCode: res.StatusCode,
  28857. },
  28858. }
  28859. target := &ret
  28860. if err := gensupport.DecodeResponse(target, res); err != nil {
  28861. return nil, err
  28862. }
  28863. return ret, nil
  28864. // {
  28865. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  28866. // "httpMethod": "POST",
  28867. // "id": "compute.disks.setLabels",
  28868. // "parameterOrder": [
  28869. // "project",
  28870. // "zone",
  28871. // "resource"
  28872. // ],
  28873. // "parameters": {
  28874. // "project": {
  28875. // "description": "Project ID for this request.",
  28876. // "location": "path",
  28877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28878. // "required": true,
  28879. // "type": "string"
  28880. // },
  28881. // "requestId": {
  28882. // "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).",
  28883. // "location": "query",
  28884. // "type": "string"
  28885. // },
  28886. // "resource": {
  28887. // "description": "Name of the resource for this request.",
  28888. // "location": "path",
  28889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28890. // "required": true,
  28891. // "type": "string"
  28892. // },
  28893. // "zone": {
  28894. // "description": "The name of the zone for this request.",
  28895. // "location": "path",
  28896. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28897. // "required": true,
  28898. // "type": "string"
  28899. // }
  28900. // },
  28901. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  28902. // "request": {
  28903. // "$ref": "ZoneSetLabelsRequest"
  28904. // },
  28905. // "response": {
  28906. // "$ref": "Operation"
  28907. // },
  28908. // "scopes": [
  28909. // "https://www.googleapis.com/auth/cloud-platform",
  28910. // "https://www.googleapis.com/auth/compute"
  28911. // ]
  28912. // }
  28913. }
  28914. // method id "compute.firewalls.delete":
  28915. type FirewallsDeleteCall struct {
  28916. s *Service
  28917. project string
  28918. firewall string
  28919. urlParams_ gensupport.URLParams
  28920. ctx_ context.Context
  28921. header_ http.Header
  28922. }
  28923. // Delete: Deletes the specified firewall.
  28924. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  28925. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  28926. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28927. c.project = project
  28928. c.firewall = firewall
  28929. return c
  28930. }
  28931. // RequestId sets the optional parameter "requestId": An optional
  28932. // request ID to identify requests. Specify a unique request ID so that
  28933. // if you must retry your request, the server will know to ignore the
  28934. // request if it has already been completed.
  28935. //
  28936. // For example, consider a situation where you make an initial request
  28937. // and the request times out. If you make the request again with the
  28938. // same request ID, the server can check if original operation with the
  28939. // same request ID was received, and if so, will ignore the second
  28940. // request. This prevents clients from accidentally creating duplicate
  28941. // commitments.
  28942. //
  28943. // The request ID must be a valid UUID with the exception that zero UUID
  28944. // is not supported (00000000-0000-0000-0000-000000000000).
  28945. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  28946. c.urlParams_.Set("requestId", requestId)
  28947. return c
  28948. }
  28949. // Fields allows partial responses to be retrieved. See
  28950. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28951. // for more information.
  28952. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  28953. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28954. return c
  28955. }
  28956. // Context sets the context to be used in this call's Do method. Any
  28957. // pending HTTP request will be aborted if the provided context is
  28958. // canceled.
  28959. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  28960. c.ctx_ = ctx
  28961. return c
  28962. }
  28963. // Header returns an http.Header that can be modified by the caller to
  28964. // add HTTP headers to the request.
  28965. func (c *FirewallsDeleteCall) Header() http.Header {
  28966. if c.header_ == nil {
  28967. c.header_ = make(http.Header)
  28968. }
  28969. return c.header_
  28970. }
  28971. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  28972. reqHeaders := make(http.Header)
  28973. for k, v := range c.header_ {
  28974. reqHeaders[k] = v
  28975. }
  28976. reqHeaders.Set("User-Agent", c.s.userAgent())
  28977. var body io.Reader = nil
  28978. c.urlParams_.Set("alt", alt)
  28979. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  28980. urls += "?" + c.urlParams_.Encode()
  28981. req, _ := http.NewRequest("DELETE", urls, body)
  28982. req.Header = reqHeaders
  28983. googleapi.Expand(req.URL, map[string]string{
  28984. "project": c.project,
  28985. "firewall": c.firewall,
  28986. })
  28987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28988. }
  28989. // Do executes the "compute.firewalls.delete" call.
  28990. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28991. // status code is an error. Response headers are in either
  28992. // *Operation.ServerResponse.Header or (if a response was returned at
  28993. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28994. // to check whether the returned error was because
  28995. // http.StatusNotModified was returned.
  28996. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28997. gensupport.SetOptions(c.urlParams_, opts...)
  28998. res, err := c.doRequest("json")
  28999. if res != nil && res.StatusCode == http.StatusNotModified {
  29000. if res.Body != nil {
  29001. res.Body.Close()
  29002. }
  29003. return nil, &googleapi.Error{
  29004. Code: res.StatusCode,
  29005. Header: res.Header,
  29006. }
  29007. }
  29008. if err != nil {
  29009. return nil, err
  29010. }
  29011. defer googleapi.CloseBody(res)
  29012. if err := googleapi.CheckResponse(res); err != nil {
  29013. return nil, err
  29014. }
  29015. ret := &Operation{
  29016. ServerResponse: googleapi.ServerResponse{
  29017. Header: res.Header,
  29018. HTTPStatusCode: res.StatusCode,
  29019. },
  29020. }
  29021. target := &ret
  29022. if err := gensupport.DecodeResponse(target, res); err != nil {
  29023. return nil, err
  29024. }
  29025. return ret, nil
  29026. // {
  29027. // "description": "Deletes the specified firewall.",
  29028. // "httpMethod": "DELETE",
  29029. // "id": "compute.firewalls.delete",
  29030. // "parameterOrder": [
  29031. // "project",
  29032. // "firewall"
  29033. // ],
  29034. // "parameters": {
  29035. // "firewall": {
  29036. // "description": "Name of the firewall rule to delete.",
  29037. // "location": "path",
  29038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29039. // "required": true,
  29040. // "type": "string"
  29041. // },
  29042. // "project": {
  29043. // "description": "Project ID for this request.",
  29044. // "location": "path",
  29045. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29046. // "required": true,
  29047. // "type": "string"
  29048. // },
  29049. // "requestId": {
  29050. // "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).",
  29051. // "location": "query",
  29052. // "type": "string"
  29053. // }
  29054. // },
  29055. // "path": "{project}/global/firewalls/{firewall}",
  29056. // "response": {
  29057. // "$ref": "Operation"
  29058. // },
  29059. // "scopes": [
  29060. // "https://www.googleapis.com/auth/cloud-platform",
  29061. // "https://www.googleapis.com/auth/compute"
  29062. // ]
  29063. // }
  29064. }
  29065. // method id "compute.firewalls.get":
  29066. type FirewallsGetCall struct {
  29067. s *Service
  29068. project string
  29069. firewall string
  29070. urlParams_ gensupport.URLParams
  29071. ifNoneMatch_ string
  29072. ctx_ context.Context
  29073. header_ http.Header
  29074. }
  29075. // Get: Returns the specified firewall.
  29076. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  29077. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  29078. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29079. c.project = project
  29080. c.firewall = firewall
  29081. return c
  29082. }
  29083. // Fields allows partial responses to be retrieved. See
  29084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29085. // for more information.
  29086. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  29087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29088. return c
  29089. }
  29090. // IfNoneMatch sets the optional parameter which makes the operation
  29091. // fail if the object's ETag matches the given value. This is useful for
  29092. // getting updates only after the object has changed since the last
  29093. // request. Use googleapi.IsNotModified to check whether the response
  29094. // error from Do is the result of In-None-Match.
  29095. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  29096. c.ifNoneMatch_ = entityTag
  29097. return c
  29098. }
  29099. // Context sets the context to be used in this call's Do method. Any
  29100. // pending HTTP request will be aborted if the provided context is
  29101. // canceled.
  29102. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  29103. c.ctx_ = ctx
  29104. return c
  29105. }
  29106. // Header returns an http.Header that can be modified by the caller to
  29107. // add HTTP headers to the request.
  29108. func (c *FirewallsGetCall) Header() http.Header {
  29109. if c.header_ == nil {
  29110. c.header_ = make(http.Header)
  29111. }
  29112. return c.header_
  29113. }
  29114. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  29115. reqHeaders := make(http.Header)
  29116. for k, v := range c.header_ {
  29117. reqHeaders[k] = v
  29118. }
  29119. reqHeaders.Set("User-Agent", c.s.userAgent())
  29120. if c.ifNoneMatch_ != "" {
  29121. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29122. }
  29123. var body io.Reader = nil
  29124. c.urlParams_.Set("alt", alt)
  29125. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  29126. urls += "?" + c.urlParams_.Encode()
  29127. req, _ := http.NewRequest("GET", urls, body)
  29128. req.Header = reqHeaders
  29129. googleapi.Expand(req.URL, map[string]string{
  29130. "project": c.project,
  29131. "firewall": c.firewall,
  29132. })
  29133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29134. }
  29135. // Do executes the "compute.firewalls.get" call.
  29136. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  29137. // code is an error. Response headers are in either
  29138. // *Firewall.ServerResponse.Header or (if a response was returned at
  29139. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29140. // to check whether the returned error was because
  29141. // http.StatusNotModified was returned.
  29142. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  29143. gensupport.SetOptions(c.urlParams_, opts...)
  29144. res, err := c.doRequest("json")
  29145. if res != nil && res.StatusCode == http.StatusNotModified {
  29146. if res.Body != nil {
  29147. res.Body.Close()
  29148. }
  29149. return nil, &googleapi.Error{
  29150. Code: res.StatusCode,
  29151. Header: res.Header,
  29152. }
  29153. }
  29154. if err != nil {
  29155. return nil, err
  29156. }
  29157. defer googleapi.CloseBody(res)
  29158. if err := googleapi.CheckResponse(res); err != nil {
  29159. return nil, err
  29160. }
  29161. ret := &Firewall{
  29162. ServerResponse: googleapi.ServerResponse{
  29163. Header: res.Header,
  29164. HTTPStatusCode: res.StatusCode,
  29165. },
  29166. }
  29167. target := &ret
  29168. if err := gensupport.DecodeResponse(target, res); err != nil {
  29169. return nil, err
  29170. }
  29171. return ret, nil
  29172. // {
  29173. // "description": "Returns the specified firewall.",
  29174. // "httpMethod": "GET",
  29175. // "id": "compute.firewalls.get",
  29176. // "parameterOrder": [
  29177. // "project",
  29178. // "firewall"
  29179. // ],
  29180. // "parameters": {
  29181. // "firewall": {
  29182. // "description": "Name of the firewall rule to return.",
  29183. // "location": "path",
  29184. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29185. // "required": true,
  29186. // "type": "string"
  29187. // },
  29188. // "project": {
  29189. // "description": "Project ID for this request.",
  29190. // "location": "path",
  29191. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29192. // "required": true,
  29193. // "type": "string"
  29194. // }
  29195. // },
  29196. // "path": "{project}/global/firewalls/{firewall}",
  29197. // "response": {
  29198. // "$ref": "Firewall"
  29199. // },
  29200. // "scopes": [
  29201. // "https://www.googleapis.com/auth/cloud-platform",
  29202. // "https://www.googleapis.com/auth/compute",
  29203. // "https://www.googleapis.com/auth/compute.readonly"
  29204. // ]
  29205. // }
  29206. }
  29207. // method id "compute.firewalls.insert":
  29208. type FirewallsInsertCall struct {
  29209. s *Service
  29210. project string
  29211. firewall *Firewall
  29212. urlParams_ gensupport.URLParams
  29213. ctx_ context.Context
  29214. header_ http.Header
  29215. }
  29216. // Insert: Creates a firewall rule in the specified project using the
  29217. // data included in the request.
  29218. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  29219. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  29220. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29221. c.project = project
  29222. c.firewall = firewall
  29223. return c
  29224. }
  29225. // RequestId sets the optional parameter "requestId": An optional
  29226. // request ID to identify requests. Specify a unique request ID so that
  29227. // if you must retry your request, the server will know to ignore the
  29228. // request if it has already been completed.
  29229. //
  29230. // For example, consider a situation where you make an initial request
  29231. // and the request times out. If you make the request again with the
  29232. // same request ID, the server can check if original operation with the
  29233. // same request ID was received, and if so, will ignore the second
  29234. // request. This prevents clients from accidentally creating duplicate
  29235. // commitments.
  29236. //
  29237. // The request ID must be a valid UUID with the exception that zero UUID
  29238. // is not supported (00000000-0000-0000-0000-000000000000).
  29239. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  29240. c.urlParams_.Set("requestId", requestId)
  29241. return c
  29242. }
  29243. // Fields allows partial responses to be retrieved. See
  29244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29245. // for more information.
  29246. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  29247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29248. return c
  29249. }
  29250. // Context sets the context to be used in this call's Do method. Any
  29251. // pending HTTP request will be aborted if the provided context is
  29252. // canceled.
  29253. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  29254. c.ctx_ = ctx
  29255. return c
  29256. }
  29257. // Header returns an http.Header that can be modified by the caller to
  29258. // add HTTP headers to the request.
  29259. func (c *FirewallsInsertCall) Header() http.Header {
  29260. if c.header_ == nil {
  29261. c.header_ = make(http.Header)
  29262. }
  29263. return c.header_
  29264. }
  29265. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  29266. reqHeaders := make(http.Header)
  29267. for k, v := range c.header_ {
  29268. reqHeaders[k] = v
  29269. }
  29270. reqHeaders.Set("User-Agent", c.s.userAgent())
  29271. var body io.Reader = nil
  29272. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  29273. if err != nil {
  29274. return nil, err
  29275. }
  29276. reqHeaders.Set("Content-Type", "application/json")
  29277. c.urlParams_.Set("alt", alt)
  29278. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  29279. urls += "?" + c.urlParams_.Encode()
  29280. req, _ := http.NewRequest("POST", urls, body)
  29281. req.Header = reqHeaders
  29282. googleapi.Expand(req.URL, map[string]string{
  29283. "project": c.project,
  29284. })
  29285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29286. }
  29287. // Do executes the "compute.firewalls.insert" call.
  29288. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29289. // status code is an error. Response headers are in either
  29290. // *Operation.ServerResponse.Header or (if a response was returned at
  29291. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29292. // to check whether the returned error was because
  29293. // http.StatusNotModified was returned.
  29294. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29295. gensupport.SetOptions(c.urlParams_, opts...)
  29296. res, err := c.doRequest("json")
  29297. if res != nil && res.StatusCode == http.StatusNotModified {
  29298. if res.Body != nil {
  29299. res.Body.Close()
  29300. }
  29301. return nil, &googleapi.Error{
  29302. Code: res.StatusCode,
  29303. Header: res.Header,
  29304. }
  29305. }
  29306. if err != nil {
  29307. return nil, err
  29308. }
  29309. defer googleapi.CloseBody(res)
  29310. if err := googleapi.CheckResponse(res); err != nil {
  29311. return nil, err
  29312. }
  29313. ret := &Operation{
  29314. ServerResponse: googleapi.ServerResponse{
  29315. Header: res.Header,
  29316. HTTPStatusCode: res.StatusCode,
  29317. },
  29318. }
  29319. target := &ret
  29320. if err := gensupport.DecodeResponse(target, res); err != nil {
  29321. return nil, err
  29322. }
  29323. return ret, nil
  29324. // {
  29325. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  29326. // "httpMethod": "POST",
  29327. // "id": "compute.firewalls.insert",
  29328. // "parameterOrder": [
  29329. // "project"
  29330. // ],
  29331. // "parameters": {
  29332. // "project": {
  29333. // "description": "Project ID for this request.",
  29334. // "location": "path",
  29335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29336. // "required": true,
  29337. // "type": "string"
  29338. // },
  29339. // "requestId": {
  29340. // "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).",
  29341. // "location": "query",
  29342. // "type": "string"
  29343. // }
  29344. // },
  29345. // "path": "{project}/global/firewalls",
  29346. // "request": {
  29347. // "$ref": "Firewall"
  29348. // },
  29349. // "response": {
  29350. // "$ref": "Operation"
  29351. // },
  29352. // "scopes": [
  29353. // "https://www.googleapis.com/auth/cloud-platform",
  29354. // "https://www.googleapis.com/auth/compute"
  29355. // ]
  29356. // }
  29357. }
  29358. // method id "compute.firewalls.list":
  29359. type FirewallsListCall struct {
  29360. s *Service
  29361. project string
  29362. urlParams_ gensupport.URLParams
  29363. ifNoneMatch_ string
  29364. ctx_ context.Context
  29365. header_ http.Header
  29366. }
  29367. // List: Retrieves the list of firewall rules available to the specified
  29368. // project.
  29369. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  29370. func (r *FirewallsService) List(project string) *FirewallsListCall {
  29371. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29372. c.project = project
  29373. return c
  29374. }
  29375. // Filter sets the optional parameter "filter": A filter expression that
  29376. // filters resources listed in the response. The expression must specify
  29377. // the field name, a comparison operator, and the value that you want to
  29378. // use for filtering. The value must be a string, a number, or a
  29379. // boolean. The comparison operator must be either =, !=, >, or <.
  29380. //
  29381. // For example, if you are filtering Compute Engine instances, you can
  29382. // exclude instances named example-instance by specifying name !=
  29383. // example-instance.
  29384. //
  29385. // You can also filter nested fields. For example, you could specify
  29386. // scheduling.automaticRestart = false to include instances only if they
  29387. // are not scheduled for automatic restarts. You can use filtering on
  29388. // nested fields to filter based on resource labels.
  29389. //
  29390. // To filter on multiple expressions, provide each separate expression
  29391. // within parentheses. For example, (scheduling.automaticRestart = true)
  29392. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29393. // AND expression. However, you can include AND and OR expressions
  29394. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29395. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29396. // true).
  29397. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  29398. c.urlParams_.Set("filter", filter)
  29399. return c
  29400. }
  29401. // MaxResults sets the optional parameter "maxResults": The maximum
  29402. // number of results per page that should be returned. If the number of
  29403. // available results is larger than maxResults, Compute Engine returns a
  29404. // nextPageToken that can be used to get the next page of results in
  29405. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29406. // (Default: 500)
  29407. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  29408. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29409. return c
  29410. }
  29411. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29412. // a certain order. By default, results are returned in alphanumerical
  29413. // order based on the resource name.
  29414. //
  29415. // You can also sort results in descending order based on the creation
  29416. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29417. // based on the creationTimestamp field in reverse chronological order
  29418. // (newest result first). Use this to sort resources like operations so
  29419. // that the newest operation is returned first.
  29420. //
  29421. // Currently, only sorting by name or creationTimestamp desc is
  29422. // supported.
  29423. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  29424. c.urlParams_.Set("orderBy", orderBy)
  29425. return c
  29426. }
  29427. // PageToken sets the optional parameter "pageToken": Specifies a page
  29428. // token to use. Set pageToken to the nextPageToken returned by a
  29429. // previous list request to get the next page of results.
  29430. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  29431. c.urlParams_.Set("pageToken", pageToken)
  29432. return c
  29433. }
  29434. // Fields allows partial responses to be retrieved. See
  29435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29436. // for more information.
  29437. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  29438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29439. return c
  29440. }
  29441. // IfNoneMatch sets the optional parameter which makes the operation
  29442. // fail if the object's ETag matches the given value. This is useful for
  29443. // getting updates only after the object has changed since the last
  29444. // request. Use googleapi.IsNotModified to check whether the response
  29445. // error from Do is the result of In-None-Match.
  29446. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  29447. c.ifNoneMatch_ = entityTag
  29448. return c
  29449. }
  29450. // Context sets the context to be used in this call's Do method. Any
  29451. // pending HTTP request will be aborted if the provided context is
  29452. // canceled.
  29453. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  29454. c.ctx_ = ctx
  29455. return c
  29456. }
  29457. // Header returns an http.Header that can be modified by the caller to
  29458. // add HTTP headers to the request.
  29459. func (c *FirewallsListCall) Header() http.Header {
  29460. if c.header_ == nil {
  29461. c.header_ = make(http.Header)
  29462. }
  29463. return c.header_
  29464. }
  29465. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  29466. reqHeaders := make(http.Header)
  29467. for k, v := range c.header_ {
  29468. reqHeaders[k] = v
  29469. }
  29470. reqHeaders.Set("User-Agent", c.s.userAgent())
  29471. if c.ifNoneMatch_ != "" {
  29472. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29473. }
  29474. var body io.Reader = nil
  29475. c.urlParams_.Set("alt", alt)
  29476. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  29477. urls += "?" + c.urlParams_.Encode()
  29478. req, _ := http.NewRequest("GET", urls, body)
  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.firewalls.list" call.
  29486. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  29487. // status code is an error. Response headers are in either
  29488. // *FirewallList.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 *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, 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 := &FirewallList{
  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": "Retrieves the list of firewall rules available to the specified project.",
  29524. // "httpMethod": "GET",
  29525. // "id": "compute.firewalls.list",
  29526. // "parameterOrder": [
  29527. // "project"
  29528. // ],
  29529. // "parameters": {
  29530. // "filter": {
  29531. // "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).",
  29532. // "location": "query",
  29533. // "type": "string"
  29534. // },
  29535. // "maxResults": {
  29536. // "default": "500",
  29537. // "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)",
  29538. // "format": "uint32",
  29539. // "location": "query",
  29540. // "minimum": "0",
  29541. // "type": "integer"
  29542. // },
  29543. // "orderBy": {
  29544. // "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.",
  29545. // "location": "query",
  29546. // "type": "string"
  29547. // },
  29548. // "pageToken": {
  29549. // "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.",
  29550. // "location": "query",
  29551. // "type": "string"
  29552. // },
  29553. // "project": {
  29554. // "description": "Project ID for this request.",
  29555. // "location": "path",
  29556. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29557. // "required": true,
  29558. // "type": "string"
  29559. // }
  29560. // },
  29561. // "path": "{project}/global/firewalls",
  29562. // "response": {
  29563. // "$ref": "FirewallList"
  29564. // },
  29565. // "scopes": [
  29566. // "https://www.googleapis.com/auth/cloud-platform",
  29567. // "https://www.googleapis.com/auth/compute",
  29568. // "https://www.googleapis.com/auth/compute.readonly"
  29569. // ]
  29570. // }
  29571. }
  29572. // Pages invokes f for each page of results.
  29573. // A non-nil error returned from f will halt the iteration.
  29574. // The provided context supersedes any context provided to the Context method.
  29575. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  29576. c.ctx_ = ctx
  29577. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29578. for {
  29579. x, err := c.Do()
  29580. if err != nil {
  29581. return err
  29582. }
  29583. if err := f(x); err != nil {
  29584. return err
  29585. }
  29586. if x.NextPageToken == "" {
  29587. return nil
  29588. }
  29589. c.PageToken(x.NextPageToken)
  29590. }
  29591. }
  29592. // method id "compute.firewalls.patch":
  29593. type FirewallsPatchCall struct {
  29594. s *Service
  29595. project string
  29596. firewall string
  29597. firewall2 *Firewall
  29598. urlParams_ gensupport.URLParams
  29599. ctx_ context.Context
  29600. header_ http.Header
  29601. }
  29602. // Patch: Updates the specified firewall rule with the data included in
  29603. // the request. This method supports PATCH semantics and uses the JSON
  29604. // merge patch format and processing rules.
  29605. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  29606. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  29607. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29608. c.project = project
  29609. c.firewall = firewall
  29610. c.firewall2 = firewall2
  29611. return c
  29612. }
  29613. // RequestId sets the optional parameter "requestId": An optional
  29614. // request ID to identify requests. Specify a unique request ID so that
  29615. // if you must retry your request, the server will know to ignore the
  29616. // request if it has already been completed.
  29617. //
  29618. // For example, consider a situation where you make an initial request
  29619. // and the request times out. If you make the request again with the
  29620. // same request ID, the server can check if original operation with the
  29621. // same request ID was received, and if so, will ignore the second
  29622. // request. This prevents clients from accidentally creating duplicate
  29623. // commitments.
  29624. //
  29625. // The request ID must be a valid UUID with the exception that zero UUID
  29626. // is not supported (00000000-0000-0000-0000-000000000000).
  29627. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  29628. c.urlParams_.Set("requestId", requestId)
  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 *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  29635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29636. return c
  29637. }
  29638. // Context sets the context to be used in this call's Do method. Any
  29639. // pending HTTP request will be aborted if the provided context is
  29640. // canceled.
  29641. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  29642. c.ctx_ = ctx
  29643. return c
  29644. }
  29645. // Header returns an http.Header that can be modified by the caller to
  29646. // add HTTP headers to the request.
  29647. func (c *FirewallsPatchCall) Header() http.Header {
  29648. if c.header_ == nil {
  29649. c.header_ = make(http.Header)
  29650. }
  29651. return c.header_
  29652. }
  29653. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  29654. reqHeaders := make(http.Header)
  29655. for k, v := range c.header_ {
  29656. reqHeaders[k] = v
  29657. }
  29658. reqHeaders.Set("User-Agent", c.s.userAgent())
  29659. var body io.Reader = nil
  29660. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  29661. if err != nil {
  29662. return nil, err
  29663. }
  29664. reqHeaders.Set("Content-Type", "application/json")
  29665. c.urlParams_.Set("alt", alt)
  29666. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  29667. urls += "?" + c.urlParams_.Encode()
  29668. req, _ := http.NewRequest("PATCH", urls, body)
  29669. req.Header = reqHeaders
  29670. googleapi.Expand(req.URL, map[string]string{
  29671. "project": c.project,
  29672. "firewall": c.firewall,
  29673. })
  29674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29675. }
  29676. // Do executes the "compute.firewalls.patch" call.
  29677. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29678. // status code is an error. Response headers are in either
  29679. // *Operation.ServerResponse.Header or (if a response was returned at
  29680. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29681. // to check whether the returned error was because
  29682. // http.StatusNotModified was returned.
  29683. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29684. gensupport.SetOptions(c.urlParams_, opts...)
  29685. res, err := c.doRequest("json")
  29686. if res != nil && res.StatusCode == http.StatusNotModified {
  29687. if res.Body != nil {
  29688. res.Body.Close()
  29689. }
  29690. return nil, &googleapi.Error{
  29691. Code: res.StatusCode,
  29692. Header: res.Header,
  29693. }
  29694. }
  29695. if err != nil {
  29696. return nil, err
  29697. }
  29698. defer googleapi.CloseBody(res)
  29699. if err := googleapi.CheckResponse(res); err != nil {
  29700. return nil, err
  29701. }
  29702. ret := &Operation{
  29703. ServerResponse: googleapi.ServerResponse{
  29704. Header: res.Header,
  29705. HTTPStatusCode: res.StatusCode,
  29706. },
  29707. }
  29708. target := &ret
  29709. if err := gensupport.DecodeResponse(target, res); err != nil {
  29710. return nil, err
  29711. }
  29712. return ret, nil
  29713. // {
  29714. // "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.",
  29715. // "httpMethod": "PATCH",
  29716. // "id": "compute.firewalls.patch",
  29717. // "parameterOrder": [
  29718. // "project",
  29719. // "firewall"
  29720. // ],
  29721. // "parameters": {
  29722. // "firewall": {
  29723. // "description": "Name of the firewall rule to patch.",
  29724. // "location": "path",
  29725. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29726. // "required": true,
  29727. // "type": "string"
  29728. // },
  29729. // "project": {
  29730. // "description": "Project ID for this request.",
  29731. // "location": "path",
  29732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29733. // "required": true,
  29734. // "type": "string"
  29735. // },
  29736. // "requestId": {
  29737. // "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).",
  29738. // "location": "query",
  29739. // "type": "string"
  29740. // }
  29741. // },
  29742. // "path": "{project}/global/firewalls/{firewall}",
  29743. // "request": {
  29744. // "$ref": "Firewall"
  29745. // },
  29746. // "response": {
  29747. // "$ref": "Operation"
  29748. // },
  29749. // "scopes": [
  29750. // "https://www.googleapis.com/auth/cloud-platform",
  29751. // "https://www.googleapis.com/auth/compute"
  29752. // ]
  29753. // }
  29754. }
  29755. // method id "compute.firewalls.update":
  29756. type FirewallsUpdateCall struct {
  29757. s *Service
  29758. project string
  29759. firewall string
  29760. firewall2 *Firewall
  29761. urlParams_ gensupport.URLParams
  29762. ctx_ context.Context
  29763. header_ http.Header
  29764. }
  29765. // Update: Updates the specified firewall rule with the data included in
  29766. // the request. The PUT method can only update the following fields of
  29767. // firewall rule: allowed, description, sourceRanges, sourceTags,
  29768. // targetTags.
  29769. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  29770. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  29771. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29772. c.project = project
  29773. c.firewall = firewall
  29774. c.firewall2 = firewall2
  29775. return c
  29776. }
  29777. // RequestId sets the optional parameter "requestId": An optional
  29778. // request ID to identify requests. Specify a unique request ID so that
  29779. // if you must retry your request, the server will know to ignore the
  29780. // request if it has already been completed.
  29781. //
  29782. // For example, consider a situation where you make an initial request
  29783. // and the request times out. If you make the request again with the
  29784. // same request ID, the server can check if original operation with the
  29785. // same request ID was received, and if so, will ignore the second
  29786. // request. This prevents clients from accidentally creating duplicate
  29787. // commitments.
  29788. //
  29789. // The request ID must be a valid UUID with the exception that zero UUID
  29790. // is not supported (00000000-0000-0000-0000-000000000000).
  29791. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  29792. c.urlParams_.Set("requestId", requestId)
  29793. return c
  29794. }
  29795. // Fields allows partial responses to be retrieved. See
  29796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29797. // for more information.
  29798. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  29799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29800. return c
  29801. }
  29802. // Context sets the context to be used in this call's Do method. Any
  29803. // pending HTTP request will be aborted if the provided context is
  29804. // canceled.
  29805. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  29806. c.ctx_ = ctx
  29807. return c
  29808. }
  29809. // Header returns an http.Header that can be modified by the caller to
  29810. // add HTTP headers to the request.
  29811. func (c *FirewallsUpdateCall) Header() http.Header {
  29812. if c.header_ == nil {
  29813. c.header_ = make(http.Header)
  29814. }
  29815. return c.header_
  29816. }
  29817. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  29818. reqHeaders := make(http.Header)
  29819. for k, v := range c.header_ {
  29820. reqHeaders[k] = v
  29821. }
  29822. reqHeaders.Set("User-Agent", c.s.userAgent())
  29823. var body io.Reader = nil
  29824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  29825. if err != nil {
  29826. return nil, err
  29827. }
  29828. reqHeaders.Set("Content-Type", "application/json")
  29829. c.urlParams_.Set("alt", alt)
  29830. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  29831. urls += "?" + c.urlParams_.Encode()
  29832. req, _ := http.NewRequest("PUT", urls, body)
  29833. req.Header = reqHeaders
  29834. googleapi.Expand(req.URL, map[string]string{
  29835. "project": c.project,
  29836. "firewall": c.firewall,
  29837. })
  29838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29839. }
  29840. // Do executes the "compute.firewalls.update" call.
  29841. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29842. // status code is an error. Response headers are in either
  29843. // *Operation.ServerResponse.Header or (if a response was returned at
  29844. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29845. // to check whether the returned error was because
  29846. // http.StatusNotModified was returned.
  29847. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29848. gensupport.SetOptions(c.urlParams_, opts...)
  29849. res, err := c.doRequest("json")
  29850. if res != nil && res.StatusCode == http.StatusNotModified {
  29851. if res.Body != nil {
  29852. res.Body.Close()
  29853. }
  29854. return nil, &googleapi.Error{
  29855. Code: res.StatusCode,
  29856. Header: res.Header,
  29857. }
  29858. }
  29859. if err != nil {
  29860. return nil, err
  29861. }
  29862. defer googleapi.CloseBody(res)
  29863. if err := googleapi.CheckResponse(res); err != nil {
  29864. return nil, err
  29865. }
  29866. ret := &Operation{
  29867. ServerResponse: googleapi.ServerResponse{
  29868. Header: res.Header,
  29869. HTTPStatusCode: res.StatusCode,
  29870. },
  29871. }
  29872. target := &ret
  29873. if err := gensupport.DecodeResponse(target, res); err != nil {
  29874. return nil, err
  29875. }
  29876. return ret, nil
  29877. // {
  29878. // "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.",
  29879. // "httpMethod": "PUT",
  29880. // "id": "compute.firewalls.update",
  29881. // "parameterOrder": [
  29882. // "project",
  29883. // "firewall"
  29884. // ],
  29885. // "parameters": {
  29886. // "firewall": {
  29887. // "description": "Name of the firewall rule to update.",
  29888. // "location": "path",
  29889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29890. // "required": true,
  29891. // "type": "string"
  29892. // },
  29893. // "project": {
  29894. // "description": "Project ID for this request.",
  29895. // "location": "path",
  29896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29897. // "required": true,
  29898. // "type": "string"
  29899. // },
  29900. // "requestId": {
  29901. // "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).",
  29902. // "location": "query",
  29903. // "type": "string"
  29904. // }
  29905. // },
  29906. // "path": "{project}/global/firewalls/{firewall}",
  29907. // "request": {
  29908. // "$ref": "Firewall"
  29909. // },
  29910. // "response": {
  29911. // "$ref": "Operation"
  29912. // },
  29913. // "scopes": [
  29914. // "https://www.googleapis.com/auth/cloud-platform",
  29915. // "https://www.googleapis.com/auth/compute"
  29916. // ]
  29917. // }
  29918. }
  29919. // method id "compute.forwardingRules.aggregatedList":
  29920. type ForwardingRulesAggregatedListCall struct {
  29921. s *Service
  29922. project string
  29923. urlParams_ gensupport.URLParams
  29924. ifNoneMatch_ string
  29925. ctx_ context.Context
  29926. header_ http.Header
  29927. }
  29928. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  29929. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  29930. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  29931. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29932. c.project = project
  29933. return c
  29934. }
  29935. // Filter sets the optional parameter "filter": A filter expression that
  29936. // filters resources listed in the response. The expression must specify
  29937. // the field name, a comparison operator, and the value that you want to
  29938. // use for filtering. The value must be a string, a number, or a
  29939. // boolean. The comparison operator must be either =, !=, >, or <.
  29940. //
  29941. // For example, if you are filtering Compute Engine instances, you can
  29942. // exclude instances named example-instance by specifying name !=
  29943. // example-instance.
  29944. //
  29945. // You can also filter nested fields. For example, you could specify
  29946. // scheduling.automaticRestart = false to include instances only if they
  29947. // are not scheduled for automatic restarts. You can use filtering on
  29948. // nested fields to filter based on resource labels.
  29949. //
  29950. // To filter on multiple expressions, provide each separate expression
  29951. // within parentheses. For example, (scheduling.automaticRestart = true)
  29952. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29953. // AND expression. However, you can include AND and OR expressions
  29954. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29955. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29956. // true).
  29957. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  29958. c.urlParams_.Set("filter", filter)
  29959. return c
  29960. }
  29961. // MaxResults sets the optional parameter "maxResults": The maximum
  29962. // number of results per page that should be returned. If the number of
  29963. // available results is larger than maxResults, Compute Engine returns a
  29964. // nextPageToken that can be used to get the next page of results in
  29965. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29966. // (Default: 500)
  29967. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  29968. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29969. return c
  29970. }
  29971. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29972. // a certain order. By default, results are returned in alphanumerical
  29973. // order based on the resource name.
  29974. //
  29975. // You can also sort results in descending order based on the creation
  29976. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29977. // based on the creationTimestamp field in reverse chronological order
  29978. // (newest result first). Use this to sort resources like operations so
  29979. // that the newest operation is returned first.
  29980. //
  29981. // Currently, only sorting by name or creationTimestamp desc is
  29982. // supported.
  29983. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  29984. c.urlParams_.Set("orderBy", orderBy)
  29985. return c
  29986. }
  29987. // PageToken sets the optional parameter "pageToken": Specifies a page
  29988. // token to use. Set pageToken to the nextPageToken returned by a
  29989. // previous list request to get the next page of results.
  29990. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  29991. c.urlParams_.Set("pageToken", pageToken)
  29992. return c
  29993. }
  29994. // Fields allows partial responses to be retrieved. See
  29995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29996. // for more information.
  29997. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  29998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29999. return c
  30000. }
  30001. // IfNoneMatch sets the optional parameter which makes the operation
  30002. // fail if the object's ETag matches the given value. This is useful for
  30003. // getting updates only after the object has changed since the last
  30004. // request. Use googleapi.IsNotModified to check whether the response
  30005. // error from Do is the result of In-None-Match.
  30006. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  30007. c.ifNoneMatch_ = entityTag
  30008. return c
  30009. }
  30010. // Context sets the context to be used in this call's Do method. Any
  30011. // pending HTTP request will be aborted if the provided context is
  30012. // canceled.
  30013. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  30014. c.ctx_ = ctx
  30015. return c
  30016. }
  30017. // Header returns an http.Header that can be modified by the caller to
  30018. // add HTTP headers to the request.
  30019. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  30020. if c.header_ == nil {
  30021. c.header_ = make(http.Header)
  30022. }
  30023. return c.header_
  30024. }
  30025. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  30026. reqHeaders := make(http.Header)
  30027. for k, v := range c.header_ {
  30028. reqHeaders[k] = v
  30029. }
  30030. reqHeaders.Set("User-Agent", c.s.userAgent())
  30031. if c.ifNoneMatch_ != "" {
  30032. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30033. }
  30034. var body io.Reader = nil
  30035. c.urlParams_.Set("alt", alt)
  30036. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  30037. urls += "?" + c.urlParams_.Encode()
  30038. req, _ := http.NewRequest("GET", urls, body)
  30039. req.Header = reqHeaders
  30040. googleapi.Expand(req.URL, map[string]string{
  30041. "project": c.project,
  30042. })
  30043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30044. }
  30045. // Do executes the "compute.forwardingRules.aggregatedList" call.
  30046. // Exactly one of *ForwardingRuleAggregatedList or error will be
  30047. // non-nil. Any non-2xx status code is an error. Response headers are in
  30048. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  30049. // response was returned at all) in error.(*googleapi.Error).Header. Use
  30050. // googleapi.IsNotModified to check whether the returned error was
  30051. // because http.StatusNotModified was returned.
  30052. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, 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 := &ForwardingRuleAggregatedList{
  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": "Retrieves an aggregated list of forwarding rules.",
  30084. // "httpMethod": "GET",
  30085. // "id": "compute.forwardingRules.aggregatedList",
  30086. // "parameterOrder": [
  30087. // "project"
  30088. // ],
  30089. // "parameters": {
  30090. // "filter": {
  30091. // "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).",
  30092. // "location": "query",
  30093. // "type": "string"
  30094. // },
  30095. // "maxResults": {
  30096. // "default": "500",
  30097. // "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)",
  30098. // "format": "uint32",
  30099. // "location": "query",
  30100. // "minimum": "0",
  30101. // "type": "integer"
  30102. // },
  30103. // "orderBy": {
  30104. // "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.",
  30105. // "location": "query",
  30106. // "type": "string"
  30107. // },
  30108. // "pageToken": {
  30109. // "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.",
  30110. // "location": "query",
  30111. // "type": "string"
  30112. // },
  30113. // "project": {
  30114. // "description": "Project ID for this request.",
  30115. // "location": "path",
  30116. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30117. // "required": true,
  30118. // "type": "string"
  30119. // }
  30120. // },
  30121. // "path": "{project}/aggregated/forwardingRules",
  30122. // "response": {
  30123. // "$ref": "ForwardingRuleAggregatedList"
  30124. // },
  30125. // "scopes": [
  30126. // "https://www.googleapis.com/auth/cloud-platform",
  30127. // "https://www.googleapis.com/auth/compute",
  30128. // "https://www.googleapis.com/auth/compute.readonly"
  30129. // ]
  30130. // }
  30131. }
  30132. // Pages invokes f for each page of results.
  30133. // A non-nil error returned from f will halt the iteration.
  30134. // The provided context supersedes any context provided to the Context method.
  30135. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  30136. c.ctx_ = ctx
  30137. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30138. for {
  30139. x, err := c.Do()
  30140. if err != nil {
  30141. return err
  30142. }
  30143. if err := f(x); err != nil {
  30144. return err
  30145. }
  30146. if x.NextPageToken == "" {
  30147. return nil
  30148. }
  30149. c.PageToken(x.NextPageToken)
  30150. }
  30151. }
  30152. // method id "compute.forwardingRules.delete":
  30153. type ForwardingRulesDeleteCall struct {
  30154. s *Service
  30155. project string
  30156. region string
  30157. forwardingRule string
  30158. urlParams_ gensupport.URLParams
  30159. ctx_ context.Context
  30160. header_ http.Header
  30161. }
  30162. // Delete: Deletes the specified ForwardingRule resource.
  30163. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  30164. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  30165. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30166. c.project = project
  30167. c.region = region
  30168. c.forwardingRule = forwardingRule
  30169. return c
  30170. }
  30171. // RequestId sets the optional parameter "requestId": An optional
  30172. // request ID to identify requests. Specify a unique request ID so that
  30173. // if you must retry your request, the server will know to ignore the
  30174. // request if it has already been completed.
  30175. //
  30176. // For example, consider a situation where you make an initial request
  30177. // and the request times out. If you make the request again with the
  30178. // same request ID, the server can check if original operation with the
  30179. // same request ID was received, and if so, will ignore the second
  30180. // request. This prevents clients from accidentally creating duplicate
  30181. // commitments.
  30182. //
  30183. // The request ID must be a valid UUID with the exception that zero UUID
  30184. // is not supported (00000000-0000-0000-0000-000000000000).
  30185. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  30186. c.urlParams_.Set("requestId", requestId)
  30187. return c
  30188. }
  30189. // Fields allows partial responses to be retrieved. See
  30190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30191. // for more information.
  30192. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  30193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30194. return c
  30195. }
  30196. // Context sets the context to be used in this call's Do method. Any
  30197. // pending HTTP request will be aborted if the provided context is
  30198. // canceled.
  30199. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  30200. c.ctx_ = ctx
  30201. return c
  30202. }
  30203. // Header returns an http.Header that can be modified by the caller to
  30204. // add HTTP headers to the request.
  30205. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  30206. if c.header_ == nil {
  30207. c.header_ = make(http.Header)
  30208. }
  30209. return c.header_
  30210. }
  30211. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  30212. reqHeaders := make(http.Header)
  30213. for k, v := range c.header_ {
  30214. reqHeaders[k] = v
  30215. }
  30216. reqHeaders.Set("User-Agent", c.s.userAgent())
  30217. var body io.Reader = nil
  30218. c.urlParams_.Set("alt", alt)
  30219. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  30220. urls += "?" + c.urlParams_.Encode()
  30221. req, _ := http.NewRequest("DELETE", urls, body)
  30222. req.Header = reqHeaders
  30223. googleapi.Expand(req.URL, map[string]string{
  30224. "project": c.project,
  30225. "region": c.region,
  30226. "forwardingRule": c.forwardingRule,
  30227. })
  30228. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30229. }
  30230. // Do executes the "compute.forwardingRules.delete" call.
  30231. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30232. // status code is an error. Response headers are in either
  30233. // *Operation.ServerResponse.Header or (if a response was returned at
  30234. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30235. // to check whether the returned error was because
  30236. // http.StatusNotModified was returned.
  30237. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30238. gensupport.SetOptions(c.urlParams_, opts...)
  30239. res, err := c.doRequest("json")
  30240. if res != nil && res.StatusCode == http.StatusNotModified {
  30241. if res.Body != nil {
  30242. res.Body.Close()
  30243. }
  30244. return nil, &googleapi.Error{
  30245. Code: res.StatusCode,
  30246. Header: res.Header,
  30247. }
  30248. }
  30249. if err != nil {
  30250. return nil, err
  30251. }
  30252. defer googleapi.CloseBody(res)
  30253. if err := googleapi.CheckResponse(res); err != nil {
  30254. return nil, err
  30255. }
  30256. ret := &Operation{
  30257. ServerResponse: googleapi.ServerResponse{
  30258. Header: res.Header,
  30259. HTTPStatusCode: res.StatusCode,
  30260. },
  30261. }
  30262. target := &ret
  30263. if err := gensupport.DecodeResponse(target, res); err != nil {
  30264. return nil, err
  30265. }
  30266. return ret, nil
  30267. // {
  30268. // "description": "Deletes the specified ForwardingRule resource.",
  30269. // "httpMethod": "DELETE",
  30270. // "id": "compute.forwardingRules.delete",
  30271. // "parameterOrder": [
  30272. // "project",
  30273. // "region",
  30274. // "forwardingRule"
  30275. // ],
  30276. // "parameters": {
  30277. // "forwardingRule": {
  30278. // "description": "Name of the ForwardingRule resource to delete.",
  30279. // "location": "path",
  30280. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30281. // "required": true,
  30282. // "type": "string"
  30283. // },
  30284. // "project": {
  30285. // "description": "Project ID for this request.",
  30286. // "location": "path",
  30287. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30288. // "required": true,
  30289. // "type": "string"
  30290. // },
  30291. // "region": {
  30292. // "description": "Name of the region scoping this request.",
  30293. // "location": "path",
  30294. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30295. // "required": true,
  30296. // "type": "string"
  30297. // },
  30298. // "requestId": {
  30299. // "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).",
  30300. // "location": "query",
  30301. // "type": "string"
  30302. // }
  30303. // },
  30304. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  30305. // "response": {
  30306. // "$ref": "Operation"
  30307. // },
  30308. // "scopes": [
  30309. // "https://www.googleapis.com/auth/cloud-platform",
  30310. // "https://www.googleapis.com/auth/compute"
  30311. // ]
  30312. // }
  30313. }
  30314. // method id "compute.forwardingRules.get":
  30315. type ForwardingRulesGetCall struct {
  30316. s *Service
  30317. project string
  30318. region string
  30319. forwardingRule string
  30320. urlParams_ gensupport.URLParams
  30321. ifNoneMatch_ string
  30322. ctx_ context.Context
  30323. header_ http.Header
  30324. }
  30325. // Get: Returns the specified ForwardingRule resource.
  30326. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  30327. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  30328. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30329. c.project = project
  30330. c.region = region
  30331. c.forwardingRule = forwardingRule
  30332. return c
  30333. }
  30334. // Fields allows partial responses to be retrieved. See
  30335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30336. // for more information.
  30337. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  30338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30339. return c
  30340. }
  30341. // IfNoneMatch sets the optional parameter which makes the operation
  30342. // fail if the object's ETag matches the given value. This is useful for
  30343. // getting updates only after the object has changed since the last
  30344. // request. Use googleapi.IsNotModified to check whether the response
  30345. // error from Do is the result of In-None-Match.
  30346. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  30347. c.ifNoneMatch_ = entityTag
  30348. return c
  30349. }
  30350. // Context sets the context to be used in this call's Do method. Any
  30351. // pending HTTP request will be aborted if the provided context is
  30352. // canceled.
  30353. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  30354. c.ctx_ = ctx
  30355. return c
  30356. }
  30357. // Header returns an http.Header that can be modified by the caller to
  30358. // add HTTP headers to the request.
  30359. func (c *ForwardingRulesGetCall) Header() http.Header {
  30360. if c.header_ == nil {
  30361. c.header_ = make(http.Header)
  30362. }
  30363. return c.header_
  30364. }
  30365. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  30366. reqHeaders := make(http.Header)
  30367. for k, v := range c.header_ {
  30368. reqHeaders[k] = v
  30369. }
  30370. reqHeaders.Set("User-Agent", c.s.userAgent())
  30371. if c.ifNoneMatch_ != "" {
  30372. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30373. }
  30374. var body io.Reader = nil
  30375. c.urlParams_.Set("alt", alt)
  30376. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  30377. urls += "?" + c.urlParams_.Encode()
  30378. req, _ := http.NewRequest("GET", urls, body)
  30379. req.Header = reqHeaders
  30380. googleapi.Expand(req.URL, map[string]string{
  30381. "project": c.project,
  30382. "region": c.region,
  30383. "forwardingRule": c.forwardingRule,
  30384. })
  30385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30386. }
  30387. // Do executes the "compute.forwardingRules.get" call.
  30388. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  30389. // status code is an error. Response headers are in either
  30390. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  30391. // at all) in error.(*googleapi.Error).Header. Use
  30392. // googleapi.IsNotModified to check whether the returned error was
  30393. // because http.StatusNotModified was returned.
  30394. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  30395. gensupport.SetOptions(c.urlParams_, opts...)
  30396. res, err := c.doRequest("json")
  30397. if res != nil && res.StatusCode == http.StatusNotModified {
  30398. if res.Body != nil {
  30399. res.Body.Close()
  30400. }
  30401. return nil, &googleapi.Error{
  30402. Code: res.StatusCode,
  30403. Header: res.Header,
  30404. }
  30405. }
  30406. if err != nil {
  30407. return nil, err
  30408. }
  30409. defer googleapi.CloseBody(res)
  30410. if err := googleapi.CheckResponse(res); err != nil {
  30411. return nil, err
  30412. }
  30413. ret := &ForwardingRule{
  30414. ServerResponse: googleapi.ServerResponse{
  30415. Header: res.Header,
  30416. HTTPStatusCode: res.StatusCode,
  30417. },
  30418. }
  30419. target := &ret
  30420. if err := gensupport.DecodeResponse(target, res); err != nil {
  30421. return nil, err
  30422. }
  30423. return ret, nil
  30424. // {
  30425. // "description": "Returns the specified ForwardingRule resource.",
  30426. // "httpMethod": "GET",
  30427. // "id": "compute.forwardingRules.get",
  30428. // "parameterOrder": [
  30429. // "project",
  30430. // "region",
  30431. // "forwardingRule"
  30432. // ],
  30433. // "parameters": {
  30434. // "forwardingRule": {
  30435. // "description": "Name of the ForwardingRule resource to return.",
  30436. // "location": "path",
  30437. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30438. // "required": true,
  30439. // "type": "string"
  30440. // },
  30441. // "project": {
  30442. // "description": "Project ID for this request.",
  30443. // "location": "path",
  30444. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30445. // "required": true,
  30446. // "type": "string"
  30447. // },
  30448. // "region": {
  30449. // "description": "Name of the region scoping this request.",
  30450. // "location": "path",
  30451. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30452. // "required": true,
  30453. // "type": "string"
  30454. // }
  30455. // },
  30456. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  30457. // "response": {
  30458. // "$ref": "ForwardingRule"
  30459. // },
  30460. // "scopes": [
  30461. // "https://www.googleapis.com/auth/cloud-platform",
  30462. // "https://www.googleapis.com/auth/compute",
  30463. // "https://www.googleapis.com/auth/compute.readonly"
  30464. // ]
  30465. // }
  30466. }
  30467. // method id "compute.forwardingRules.insert":
  30468. type ForwardingRulesInsertCall struct {
  30469. s *Service
  30470. project string
  30471. region string
  30472. forwardingrule *ForwardingRule
  30473. urlParams_ gensupport.URLParams
  30474. ctx_ context.Context
  30475. header_ http.Header
  30476. }
  30477. // Insert: Creates a ForwardingRule resource in the specified project
  30478. // and region using the data included in the request.
  30479. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  30480. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  30481. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30482. c.project = project
  30483. c.region = region
  30484. c.forwardingrule = forwardingrule
  30485. return c
  30486. }
  30487. // RequestId sets the optional parameter "requestId": An optional
  30488. // request ID to identify requests. Specify a unique request ID so that
  30489. // if you must retry your request, the server will know to ignore the
  30490. // request if it has already been completed.
  30491. //
  30492. // For example, consider a situation where you make an initial request
  30493. // and the request times out. If you make the request again with the
  30494. // same request ID, the server can check if original operation with the
  30495. // same request ID was received, and if so, will ignore the second
  30496. // request. This prevents clients from accidentally creating duplicate
  30497. // commitments.
  30498. //
  30499. // The request ID must be a valid UUID with the exception that zero UUID
  30500. // is not supported (00000000-0000-0000-0000-000000000000).
  30501. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  30502. c.urlParams_.Set("requestId", requestId)
  30503. return c
  30504. }
  30505. // Fields allows partial responses to be retrieved. See
  30506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30507. // for more information.
  30508. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  30509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30510. return c
  30511. }
  30512. // Context sets the context to be used in this call's Do method. Any
  30513. // pending HTTP request will be aborted if the provided context is
  30514. // canceled.
  30515. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  30516. c.ctx_ = ctx
  30517. return c
  30518. }
  30519. // Header returns an http.Header that can be modified by the caller to
  30520. // add HTTP headers to the request.
  30521. func (c *ForwardingRulesInsertCall) Header() http.Header {
  30522. if c.header_ == nil {
  30523. c.header_ = make(http.Header)
  30524. }
  30525. return c.header_
  30526. }
  30527. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  30528. reqHeaders := make(http.Header)
  30529. for k, v := range c.header_ {
  30530. reqHeaders[k] = v
  30531. }
  30532. reqHeaders.Set("User-Agent", c.s.userAgent())
  30533. var body io.Reader = nil
  30534. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  30535. if err != nil {
  30536. return nil, err
  30537. }
  30538. reqHeaders.Set("Content-Type", "application/json")
  30539. c.urlParams_.Set("alt", alt)
  30540. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  30541. urls += "?" + c.urlParams_.Encode()
  30542. req, _ := http.NewRequest("POST", urls, body)
  30543. req.Header = reqHeaders
  30544. googleapi.Expand(req.URL, map[string]string{
  30545. "project": c.project,
  30546. "region": c.region,
  30547. })
  30548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30549. }
  30550. // Do executes the "compute.forwardingRules.insert" call.
  30551. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30552. // status code is an error. Response headers are in either
  30553. // *Operation.ServerResponse.Header or (if a response was returned at
  30554. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30555. // to check whether the returned error was because
  30556. // http.StatusNotModified was returned.
  30557. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30558. gensupport.SetOptions(c.urlParams_, opts...)
  30559. res, err := c.doRequest("json")
  30560. if res != nil && res.StatusCode == http.StatusNotModified {
  30561. if res.Body != nil {
  30562. res.Body.Close()
  30563. }
  30564. return nil, &googleapi.Error{
  30565. Code: res.StatusCode,
  30566. Header: res.Header,
  30567. }
  30568. }
  30569. if err != nil {
  30570. return nil, err
  30571. }
  30572. defer googleapi.CloseBody(res)
  30573. if err := googleapi.CheckResponse(res); err != nil {
  30574. return nil, err
  30575. }
  30576. ret := &Operation{
  30577. ServerResponse: googleapi.ServerResponse{
  30578. Header: res.Header,
  30579. HTTPStatusCode: res.StatusCode,
  30580. },
  30581. }
  30582. target := &ret
  30583. if err := gensupport.DecodeResponse(target, res); err != nil {
  30584. return nil, err
  30585. }
  30586. return ret, nil
  30587. // {
  30588. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  30589. // "httpMethod": "POST",
  30590. // "id": "compute.forwardingRules.insert",
  30591. // "parameterOrder": [
  30592. // "project",
  30593. // "region"
  30594. // ],
  30595. // "parameters": {
  30596. // "project": {
  30597. // "description": "Project ID for this request.",
  30598. // "location": "path",
  30599. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30600. // "required": true,
  30601. // "type": "string"
  30602. // },
  30603. // "region": {
  30604. // "description": "Name of the region scoping this request.",
  30605. // "location": "path",
  30606. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30607. // "required": true,
  30608. // "type": "string"
  30609. // },
  30610. // "requestId": {
  30611. // "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).",
  30612. // "location": "query",
  30613. // "type": "string"
  30614. // }
  30615. // },
  30616. // "path": "{project}/regions/{region}/forwardingRules",
  30617. // "request": {
  30618. // "$ref": "ForwardingRule"
  30619. // },
  30620. // "response": {
  30621. // "$ref": "Operation"
  30622. // },
  30623. // "scopes": [
  30624. // "https://www.googleapis.com/auth/cloud-platform",
  30625. // "https://www.googleapis.com/auth/compute"
  30626. // ]
  30627. // }
  30628. }
  30629. // method id "compute.forwardingRules.list":
  30630. type ForwardingRulesListCall struct {
  30631. s *Service
  30632. project string
  30633. region string
  30634. urlParams_ gensupport.URLParams
  30635. ifNoneMatch_ string
  30636. ctx_ context.Context
  30637. header_ http.Header
  30638. }
  30639. // List: Retrieves a list of ForwardingRule resources available to the
  30640. // specified project and region.
  30641. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  30642. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  30643. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30644. c.project = project
  30645. c.region = region
  30646. return c
  30647. }
  30648. // Filter sets the optional parameter "filter": A filter expression that
  30649. // filters resources listed in the response. The expression must specify
  30650. // the field name, a comparison operator, and the value that you want to
  30651. // use for filtering. The value must be a string, a number, or a
  30652. // boolean. The comparison operator must be either =, !=, >, or <.
  30653. //
  30654. // For example, if you are filtering Compute Engine instances, you can
  30655. // exclude instances named example-instance by specifying name !=
  30656. // example-instance.
  30657. //
  30658. // You can also filter nested fields. For example, you could specify
  30659. // scheduling.automaticRestart = false to include instances only if they
  30660. // are not scheduled for automatic restarts. You can use filtering on
  30661. // nested fields to filter based on resource labels.
  30662. //
  30663. // To filter on multiple expressions, provide each separate expression
  30664. // within parentheses. For example, (scheduling.automaticRestart = true)
  30665. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30666. // AND expression. However, you can include AND and OR expressions
  30667. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  30668. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  30669. // true).
  30670. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  30671. c.urlParams_.Set("filter", filter)
  30672. return c
  30673. }
  30674. // MaxResults sets the optional parameter "maxResults": The maximum
  30675. // number of results per page that should be returned. If the number of
  30676. // available results is larger than maxResults, Compute Engine returns a
  30677. // nextPageToken that can be used to get the next page of results in
  30678. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30679. // (Default: 500)
  30680. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  30681. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30682. return c
  30683. }
  30684. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30685. // a certain order. By default, results are returned in alphanumerical
  30686. // order based on the resource name.
  30687. //
  30688. // You can also sort results in descending order based on the creation
  30689. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30690. // based on the creationTimestamp field in reverse chronological order
  30691. // (newest result first). Use this to sort resources like operations so
  30692. // that the newest operation is returned first.
  30693. //
  30694. // Currently, only sorting by name or creationTimestamp desc is
  30695. // supported.
  30696. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  30697. c.urlParams_.Set("orderBy", orderBy)
  30698. return c
  30699. }
  30700. // PageToken sets the optional parameter "pageToken": Specifies a page
  30701. // token to use. Set pageToken to the nextPageToken returned by a
  30702. // previous list request to get the next page of results.
  30703. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  30704. c.urlParams_.Set("pageToken", pageToken)
  30705. return c
  30706. }
  30707. // Fields allows partial responses to be retrieved. See
  30708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30709. // for more information.
  30710. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  30711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30712. return c
  30713. }
  30714. // IfNoneMatch sets the optional parameter which makes the operation
  30715. // fail if the object's ETag matches the given value. This is useful for
  30716. // getting updates only after the object has changed since the last
  30717. // request. Use googleapi.IsNotModified to check whether the response
  30718. // error from Do is the result of In-None-Match.
  30719. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  30720. c.ifNoneMatch_ = entityTag
  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 *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  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 *ForwardingRulesListCall) Header() http.Header {
  30733. if c.header_ == nil {
  30734. c.header_ = make(http.Header)
  30735. }
  30736. return c.header_
  30737. }
  30738. func (c *ForwardingRulesListCall) 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. if c.ifNoneMatch_ != "" {
  30745. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30746. }
  30747. var body io.Reader = nil
  30748. c.urlParams_.Set("alt", alt)
  30749. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  30750. urls += "?" + c.urlParams_.Encode()
  30751. req, _ := http.NewRequest("GET", urls, body)
  30752. req.Header = reqHeaders
  30753. googleapi.Expand(req.URL, map[string]string{
  30754. "project": c.project,
  30755. "region": c.region,
  30756. })
  30757. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30758. }
  30759. // Do executes the "compute.forwardingRules.list" call.
  30760. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  30761. // non-2xx status code is an error. Response headers are in either
  30762. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  30763. // returned at all) in error.(*googleapi.Error).Header. Use
  30764. // googleapi.IsNotModified to check whether the returned error was
  30765. // because http.StatusNotModified was returned.
  30766. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  30767. gensupport.SetOptions(c.urlParams_, opts...)
  30768. res, err := c.doRequest("json")
  30769. if res != nil && res.StatusCode == http.StatusNotModified {
  30770. if res.Body != nil {
  30771. res.Body.Close()
  30772. }
  30773. return nil, &googleapi.Error{
  30774. Code: res.StatusCode,
  30775. Header: res.Header,
  30776. }
  30777. }
  30778. if err != nil {
  30779. return nil, err
  30780. }
  30781. defer googleapi.CloseBody(res)
  30782. if err := googleapi.CheckResponse(res); err != nil {
  30783. return nil, err
  30784. }
  30785. ret := &ForwardingRuleList{
  30786. ServerResponse: googleapi.ServerResponse{
  30787. Header: res.Header,
  30788. HTTPStatusCode: res.StatusCode,
  30789. },
  30790. }
  30791. target := &ret
  30792. if err := gensupport.DecodeResponse(target, res); err != nil {
  30793. return nil, err
  30794. }
  30795. return ret, nil
  30796. // {
  30797. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  30798. // "httpMethod": "GET",
  30799. // "id": "compute.forwardingRules.list",
  30800. // "parameterOrder": [
  30801. // "project",
  30802. // "region"
  30803. // ],
  30804. // "parameters": {
  30805. // "filter": {
  30806. // "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).",
  30807. // "location": "query",
  30808. // "type": "string"
  30809. // },
  30810. // "maxResults": {
  30811. // "default": "500",
  30812. // "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)",
  30813. // "format": "uint32",
  30814. // "location": "query",
  30815. // "minimum": "0",
  30816. // "type": "integer"
  30817. // },
  30818. // "orderBy": {
  30819. // "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.",
  30820. // "location": "query",
  30821. // "type": "string"
  30822. // },
  30823. // "pageToken": {
  30824. // "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.",
  30825. // "location": "query",
  30826. // "type": "string"
  30827. // },
  30828. // "project": {
  30829. // "description": "Project ID for this request.",
  30830. // "location": "path",
  30831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30832. // "required": true,
  30833. // "type": "string"
  30834. // },
  30835. // "region": {
  30836. // "description": "Name of the region scoping this request.",
  30837. // "location": "path",
  30838. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30839. // "required": true,
  30840. // "type": "string"
  30841. // }
  30842. // },
  30843. // "path": "{project}/regions/{region}/forwardingRules",
  30844. // "response": {
  30845. // "$ref": "ForwardingRuleList"
  30846. // },
  30847. // "scopes": [
  30848. // "https://www.googleapis.com/auth/cloud-platform",
  30849. // "https://www.googleapis.com/auth/compute",
  30850. // "https://www.googleapis.com/auth/compute.readonly"
  30851. // ]
  30852. // }
  30853. }
  30854. // Pages invokes f for each page of results.
  30855. // A non-nil error returned from f will halt the iteration.
  30856. // The provided context supersedes any context provided to the Context method.
  30857. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  30858. c.ctx_ = ctx
  30859. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30860. for {
  30861. x, err := c.Do()
  30862. if err != nil {
  30863. return err
  30864. }
  30865. if err := f(x); err != nil {
  30866. return err
  30867. }
  30868. if x.NextPageToken == "" {
  30869. return nil
  30870. }
  30871. c.PageToken(x.NextPageToken)
  30872. }
  30873. }
  30874. // method id "compute.forwardingRules.setTarget":
  30875. type ForwardingRulesSetTargetCall struct {
  30876. s *Service
  30877. project string
  30878. region string
  30879. forwardingRule string
  30880. targetreference *TargetReference
  30881. urlParams_ gensupport.URLParams
  30882. ctx_ context.Context
  30883. header_ http.Header
  30884. }
  30885. // SetTarget: Changes target URL for forwarding rule. The new target
  30886. // should be of the same type as the old target.
  30887. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  30888. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  30889. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30890. c.project = project
  30891. c.region = region
  30892. c.forwardingRule = forwardingRule
  30893. c.targetreference = targetreference
  30894. return c
  30895. }
  30896. // RequestId sets the optional parameter "requestId": An optional
  30897. // request ID to identify requests. Specify a unique request ID so that
  30898. // if you must retry your request, the server will know to ignore the
  30899. // request if it has already been completed.
  30900. //
  30901. // For example, consider a situation where you make an initial request
  30902. // and the request times out. If you make the request again with the
  30903. // same request ID, the server can check if original operation with the
  30904. // same request ID was received, and if so, will ignore the second
  30905. // request. This prevents clients from accidentally creating duplicate
  30906. // commitments.
  30907. //
  30908. // The request ID must be a valid UUID with the exception that zero UUID
  30909. // is not supported (00000000-0000-0000-0000-000000000000).
  30910. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  30911. c.urlParams_.Set("requestId", requestId)
  30912. return c
  30913. }
  30914. // Fields allows partial responses to be retrieved. See
  30915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30916. // for more information.
  30917. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  30918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30919. return c
  30920. }
  30921. // Context sets the context to be used in this call's Do method. Any
  30922. // pending HTTP request will be aborted if the provided context is
  30923. // canceled.
  30924. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  30925. c.ctx_ = ctx
  30926. return c
  30927. }
  30928. // Header returns an http.Header that can be modified by the caller to
  30929. // add HTTP headers to the request.
  30930. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  30931. if c.header_ == nil {
  30932. c.header_ = make(http.Header)
  30933. }
  30934. return c.header_
  30935. }
  30936. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  30937. reqHeaders := make(http.Header)
  30938. for k, v := range c.header_ {
  30939. reqHeaders[k] = v
  30940. }
  30941. reqHeaders.Set("User-Agent", c.s.userAgent())
  30942. var body io.Reader = nil
  30943. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  30944. if err != nil {
  30945. return nil, err
  30946. }
  30947. reqHeaders.Set("Content-Type", "application/json")
  30948. c.urlParams_.Set("alt", alt)
  30949. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  30950. urls += "?" + c.urlParams_.Encode()
  30951. req, _ := http.NewRequest("POST", urls, body)
  30952. req.Header = reqHeaders
  30953. googleapi.Expand(req.URL, map[string]string{
  30954. "project": c.project,
  30955. "region": c.region,
  30956. "forwardingRule": c.forwardingRule,
  30957. })
  30958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30959. }
  30960. // Do executes the "compute.forwardingRules.setTarget" call.
  30961. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30962. // status code is an error. Response headers are in either
  30963. // *Operation.ServerResponse.Header or (if a response was returned at
  30964. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30965. // to check whether the returned error was because
  30966. // http.StatusNotModified was returned.
  30967. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30968. gensupport.SetOptions(c.urlParams_, opts...)
  30969. res, err := c.doRequest("json")
  30970. if res != nil && res.StatusCode == http.StatusNotModified {
  30971. if res.Body != nil {
  30972. res.Body.Close()
  30973. }
  30974. return nil, &googleapi.Error{
  30975. Code: res.StatusCode,
  30976. Header: res.Header,
  30977. }
  30978. }
  30979. if err != nil {
  30980. return nil, err
  30981. }
  30982. defer googleapi.CloseBody(res)
  30983. if err := googleapi.CheckResponse(res); err != nil {
  30984. return nil, err
  30985. }
  30986. ret := &Operation{
  30987. ServerResponse: googleapi.ServerResponse{
  30988. Header: res.Header,
  30989. HTTPStatusCode: res.StatusCode,
  30990. },
  30991. }
  30992. target := &ret
  30993. if err := gensupport.DecodeResponse(target, res); err != nil {
  30994. return nil, err
  30995. }
  30996. return ret, nil
  30997. // {
  30998. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  30999. // "httpMethod": "POST",
  31000. // "id": "compute.forwardingRules.setTarget",
  31001. // "parameterOrder": [
  31002. // "project",
  31003. // "region",
  31004. // "forwardingRule"
  31005. // ],
  31006. // "parameters": {
  31007. // "forwardingRule": {
  31008. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  31009. // "location": "path",
  31010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31011. // "required": true,
  31012. // "type": "string"
  31013. // },
  31014. // "project": {
  31015. // "description": "Project ID for this request.",
  31016. // "location": "path",
  31017. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31018. // "required": true,
  31019. // "type": "string"
  31020. // },
  31021. // "region": {
  31022. // "description": "Name of the region scoping this request.",
  31023. // "location": "path",
  31024. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31025. // "required": true,
  31026. // "type": "string"
  31027. // },
  31028. // "requestId": {
  31029. // "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).",
  31030. // "location": "query",
  31031. // "type": "string"
  31032. // }
  31033. // },
  31034. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  31035. // "request": {
  31036. // "$ref": "TargetReference"
  31037. // },
  31038. // "response": {
  31039. // "$ref": "Operation"
  31040. // },
  31041. // "scopes": [
  31042. // "https://www.googleapis.com/auth/cloud-platform",
  31043. // "https://www.googleapis.com/auth/compute"
  31044. // ]
  31045. // }
  31046. }
  31047. // method id "compute.globalAddresses.delete":
  31048. type GlobalAddressesDeleteCall struct {
  31049. s *Service
  31050. project string
  31051. address string
  31052. urlParams_ gensupport.URLParams
  31053. ctx_ context.Context
  31054. header_ http.Header
  31055. }
  31056. // Delete: Deletes the specified address resource.
  31057. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  31058. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  31059. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31060. c.project = project
  31061. c.address = address
  31062. return c
  31063. }
  31064. // RequestId sets the optional parameter "requestId": An optional
  31065. // request ID to identify requests. Specify a unique request ID so that
  31066. // if you must retry your request, the server will know to ignore the
  31067. // request if it has already been completed.
  31068. //
  31069. // For example, consider a situation where you make an initial request
  31070. // and the request times out. If you make the request again with the
  31071. // same request ID, the server can check if original operation with the
  31072. // same request ID was received, and if so, will ignore the second
  31073. // request. This prevents clients from accidentally creating duplicate
  31074. // commitments.
  31075. //
  31076. // The request ID must be a valid UUID with the exception that zero UUID
  31077. // is not supported (00000000-0000-0000-0000-000000000000).
  31078. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  31079. c.urlParams_.Set("requestId", requestId)
  31080. return c
  31081. }
  31082. // Fields allows partial responses to be retrieved. See
  31083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31084. // for more information.
  31085. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  31086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31087. return c
  31088. }
  31089. // Context sets the context to be used in this call's Do method. Any
  31090. // pending HTTP request will be aborted if the provided context is
  31091. // canceled.
  31092. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  31093. c.ctx_ = ctx
  31094. return c
  31095. }
  31096. // Header returns an http.Header that can be modified by the caller to
  31097. // add HTTP headers to the request.
  31098. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  31099. if c.header_ == nil {
  31100. c.header_ = make(http.Header)
  31101. }
  31102. return c.header_
  31103. }
  31104. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  31105. reqHeaders := make(http.Header)
  31106. for k, v := range c.header_ {
  31107. reqHeaders[k] = v
  31108. }
  31109. reqHeaders.Set("User-Agent", c.s.userAgent())
  31110. var body io.Reader = nil
  31111. c.urlParams_.Set("alt", alt)
  31112. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  31113. urls += "?" + c.urlParams_.Encode()
  31114. req, _ := http.NewRequest("DELETE", urls, body)
  31115. req.Header = reqHeaders
  31116. googleapi.Expand(req.URL, map[string]string{
  31117. "project": c.project,
  31118. "address": c.address,
  31119. })
  31120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31121. }
  31122. // Do executes the "compute.globalAddresses.delete" call.
  31123. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31124. // status code is an error. Response headers are in either
  31125. // *Operation.ServerResponse.Header or (if a response was returned at
  31126. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31127. // to check whether the returned error was because
  31128. // http.StatusNotModified was returned.
  31129. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31130. gensupport.SetOptions(c.urlParams_, opts...)
  31131. res, err := c.doRequest("json")
  31132. if res != nil && res.StatusCode == http.StatusNotModified {
  31133. if res.Body != nil {
  31134. res.Body.Close()
  31135. }
  31136. return nil, &googleapi.Error{
  31137. Code: res.StatusCode,
  31138. Header: res.Header,
  31139. }
  31140. }
  31141. if err != nil {
  31142. return nil, err
  31143. }
  31144. defer googleapi.CloseBody(res)
  31145. if err := googleapi.CheckResponse(res); err != nil {
  31146. return nil, err
  31147. }
  31148. ret := &Operation{
  31149. ServerResponse: googleapi.ServerResponse{
  31150. Header: res.Header,
  31151. HTTPStatusCode: res.StatusCode,
  31152. },
  31153. }
  31154. target := &ret
  31155. if err := gensupport.DecodeResponse(target, res); err != nil {
  31156. return nil, err
  31157. }
  31158. return ret, nil
  31159. // {
  31160. // "description": "Deletes the specified address resource.",
  31161. // "httpMethod": "DELETE",
  31162. // "id": "compute.globalAddresses.delete",
  31163. // "parameterOrder": [
  31164. // "project",
  31165. // "address"
  31166. // ],
  31167. // "parameters": {
  31168. // "address": {
  31169. // "description": "Name of the address resource to delete.",
  31170. // "location": "path",
  31171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31172. // "required": true,
  31173. // "type": "string"
  31174. // },
  31175. // "project": {
  31176. // "description": "Project ID for this request.",
  31177. // "location": "path",
  31178. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31179. // "required": true,
  31180. // "type": "string"
  31181. // },
  31182. // "requestId": {
  31183. // "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).",
  31184. // "location": "query",
  31185. // "type": "string"
  31186. // }
  31187. // },
  31188. // "path": "{project}/global/addresses/{address}",
  31189. // "response": {
  31190. // "$ref": "Operation"
  31191. // },
  31192. // "scopes": [
  31193. // "https://www.googleapis.com/auth/cloud-platform",
  31194. // "https://www.googleapis.com/auth/compute"
  31195. // ]
  31196. // }
  31197. }
  31198. // method id "compute.globalAddresses.get":
  31199. type GlobalAddressesGetCall struct {
  31200. s *Service
  31201. project string
  31202. address string
  31203. urlParams_ gensupport.URLParams
  31204. ifNoneMatch_ string
  31205. ctx_ context.Context
  31206. header_ http.Header
  31207. }
  31208. // Get: Returns the specified address resource. Gets a list of available
  31209. // addresses by making a list() request.
  31210. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  31211. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  31212. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31213. c.project = project
  31214. c.address = address
  31215. return c
  31216. }
  31217. // Fields allows partial responses to be retrieved. See
  31218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31219. // for more information.
  31220. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  31221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31222. return c
  31223. }
  31224. // IfNoneMatch sets the optional parameter which makes the operation
  31225. // fail if the object's ETag matches the given value. This is useful for
  31226. // getting updates only after the object has changed since the last
  31227. // request. Use googleapi.IsNotModified to check whether the response
  31228. // error from Do is the result of In-None-Match.
  31229. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  31230. c.ifNoneMatch_ = entityTag
  31231. return c
  31232. }
  31233. // Context sets the context to be used in this call's Do method. Any
  31234. // pending HTTP request will be aborted if the provided context is
  31235. // canceled.
  31236. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  31237. c.ctx_ = ctx
  31238. return c
  31239. }
  31240. // Header returns an http.Header that can be modified by the caller to
  31241. // add HTTP headers to the request.
  31242. func (c *GlobalAddressesGetCall) Header() http.Header {
  31243. if c.header_ == nil {
  31244. c.header_ = make(http.Header)
  31245. }
  31246. return c.header_
  31247. }
  31248. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  31249. reqHeaders := make(http.Header)
  31250. for k, v := range c.header_ {
  31251. reqHeaders[k] = v
  31252. }
  31253. reqHeaders.Set("User-Agent", c.s.userAgent())
  31254. if c.ifNoneMatch_ != "" {
  31255. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31256. }
  31257. var body io.Reader = nil
  31258. c.urlParams_.Set("alt", alt)
  31259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  31260. urls += "?" + c.urlParams_.Encode()
  31261. req, _ := http.NewRequest("GET", urls, body)
  31262. req.Header = reqHeaders
  31263. googleapi.Expand(req.URL, map[string]string{
  31264. "project": c.project,
  31265. "address": c.address,
  31266. })
  31267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31268. }
  31269. // Do executes the "compute.globalAddresses.get" call.
  31270. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  31271. // code is an error. Response headers are in either
  31272. // *Address.ServerResponse.Header or (if a response was returned at all)
  31273. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  31274. // check whether the returned error was because http.StatusNotModified
  31275. // was returned.
  31276. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  31277. gensupport.SetOptions(c.urlParams_, opts...)
  31278. res, err := c.doRequest("json")
  31279. if res != nil && res.StatusCode == http.StatusNotModified {
  31280. if res.Body != nil {
  31281. res.Body.Close()
  31282. }
  31283. return nil, &googleapi.Error{
  31284. Code: res.StatusCode,
  31285. Header: res.Header,
  31286. }
  31287. }
  31288. if err != nil {
  31289. return nil, err
  31290. }
  31291. defer googleapi.CloseBody(res)
  31292. if err := googleapi.CheckResponse(res); err != nil {
  31293. return nil, err
  31294. }
  31295. ret := &Address{
  31296. ServerResponse: googleapi.ServerResponse{
  31297. Header: res.Header,
  31298. HTTPStatusCode: res.StatusCode,
  31299. },
  31300. }
  31301. target := &ret
  31302. if err := gensupport.DecodeResponse(target, res); err != nil {
  31303. return nil, err
  31304. }
  31305. return ret, nil
  31306. // {
  31307. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  31308. // "httpMethod": "GET",
  31309. // "id": "compute.globalAddresses.get",
  31310. // "parameterOrder": [
  31311. // "project",
  31312. // "address"
  31313. // ],
  31314. // "parameters": {
  31315. // "address": {
  31316. // "description": "Name of the address resource to return.",
  31317. // "location": "path",
  31318. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31319. // "required": true,
  31320. // "type": "string"
  31321. // },
  31322. // "project": {
  31323. // "description": "Project ID for this request.",
  31324. // "location": "path",
  31325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31326. // "required": true,
  31327. // "type": "string"
  31328. // }
  31329. // },
  31330. // "path": "{project}/global/addresses/{address}",
  31331. // "response": {
  31332. // "$ref": "Address"
  31333. // },
  31334. // "scopes": [
  31335. // "https://www.googleapis.com/auth/cloud-platform",
  31336. // "https://www.googleapis.com/auth/compute",
  31337. // "https://www.googleapis.com/auth/compute.readonly"
  31338. // ]
  31339. // }
  31340. }
  31341. // method id "compute.globalAddresses.insert":
  31342. type GlobalAddressesInsertCall struct {
  31343. s *Service
  31344. project string
  31345. address *Address
  31346. urlParams_ gensupport.URLParams
  31347. ctx_ context.Context
  31348. header_ http.Header
  31349. }
  31350. // Insert: Creates an address resource in the specified project using
  31351. // the data included in the request.
  31352. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  31353. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  31354. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31355. c.project = project
  31356. c.address = address
  31357. return c
  31358. }
  31359. // RequestId sets the optional parameter "requestId": An optional
  31360. // request ID to identify requests. Specify a unique request ID so that
  31361. // if you must retry your request, the server will know to ignore the
  31362. // request if it has already been completed.
  31363. //
  31364. // For example, consider a situation where you make an initial request
  31365. // and the request times out. If you make the request again with the
  31366. // same request ID, the server can check if original operation with the
  31367. // same request ID was received, and if so, will ignore the second
  31368. // request. This prevents clients from accidentally creating duplicate
  31369. // commitments.
  31370. //
  31371. // The request ID must be a valid UUID with the exception that zero UUID
  31372. // is not supported (00000000-0000-0000-0000-000000000000).
  31373. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  31374. c.urlParams_.Set("requestId", requestId)
  31375. return c
  31376. }
  31377. // Fields allows partial responses to be retrieved. See
  31378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31379. // for more information.
  31380. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  31381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31382. return c
  31383. }
  31384. // Context sets the context to be used in this call's Do method. Any
  31385. // pending HTTP request will be aborted if the provided context is
  31386. // canceled.
  31387. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  31388. c.ctx_ = ctx
  31389. return c
  31390. }
  31391. // Header returns an http.Header that can be modified by the caller to
  31392. // add HTTP headers to the request.
  31393. func (c *GlobalAddressesInsertCall) Header() http.Header {
  31394. if c.header_ == nil {
  31395. c.header_ = make(http.Header)
  31396. }
  31397. return c.header_
  31398. }
  31399. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  31400. reqHeaders := make(http.Header)
  31401. for k, v := range c.header_ {
  31402. reqHeaders[k] = v
  31403. }
  31404. reqHeaders.Set("User-Agent", c.s.userAgent())
  31405. var body io.Reader = nil
  31406. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  31407. if err != nil {
  31408. return nil, err
  31409. }
  31410. reqHeaders.Set("Content-Type", "application/json")
  31411. c.urlParams_.Set("alt", alt)
  31412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  31413. urls += "?" + c.urlParams_.Encode()
  31414. req, _ := http.NewRequest("POST", urls, body)
  31415. req.Header = reqHeaders
  31416. googleapi.Expand(req.URL, map[string]string{
  31417. "project": c.project,
  31418. })
  31419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31420. }
  31421. // Do executes the "compute.globalAddresses.insert" call.
  31422. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31423. // status code is an error. Response headers are in either
  31424. // *Operation.ServerResponse.Header or (if a response was returned at
  31425. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31426. // to check whether the returned error was because
  31427. // http.StatusNotModified was returned.
  31428. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31429. gensupport.SetOptions(c.urlParams_, opts...)
  31430. res, err := c.doRequest("json")
  31431. if res != nil && res.StatusCode == http.StatusNotModified {
  31432. if res.Body != nil {
  31433. res.Body.Close()
  31434. }
  31435. return nil, &googleapi.Error{
  31436. Code: res.StatusCode,
  31437. Header: res.Header,
  31438. }
  31439. }
  31440. if err != nil {
  31441. return nil, err
  31442. }
  31443. defer googleapi.CloseBody(res)
  31444. if err := googleapi.CheckResponse(res); err != nil {
  31445. return nil, err
  31446. }
  31447. ret := &Operation{
  31448. ServerResponse: googleapi.ServerResponse{
  31449. Header: res.Header,
  31450. HTTPStatusCode: res.StatusCode,
  31451. },
  31452. }
  31453. target := &ret
  31454. if err := gensupport.DecodeResponse(target, res); err != nil {
  31455. return nil, err
  31456. }
  31457. return ret, nil
  31458. // {
  31459. // "description": "Creates an address resource in the specified project using the data included in the request.",
  31460. // "httpMethod": "POST",
  31461. // "id": "compute.globalAddresses.insert",
  31462. // "parameterOrder": [
  31463. // "project"
  31464. // ],
  31465. // "parameters": {
  31466. // "project": {
  31467. // "description": "Project ID for this request.",
  31468. // "location": "path",
  31469. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31470. // "required": true,
  31471. // "type": "string"
  31472. // },
  31473. // "requestId": {
  31474. // "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).",
  31475. // "location": "query",
  31476. // "type": "string"
  31477. // }
  31478. // },
  31479. // "path": "{project}/global/addresses",
  31480. // "request": {
  31481. // "$ref": "Address"
  31482. // },
  31483. // "response": {
  31484. // "$ref": "Operation"
  31485. // },
  31486. // "scopes": [
  31487. // "https://www.googleapis.com/auth/cloud-platform",
  31488. // "https://www.googleapis.com/auth/compute"
  31489. // ]
  31490. // }
  31491. }
  31492. // method id "compute.globalAddresses.list":
  31493. type GlobalAddressesListCall struct {
  31494. s *Service
  31495. project string
  31496. urlParams_ gensupport.URLParams
  31497. ifNoneMatch_ string
  31498. ctx_ context.Context
  31499. header_ http.Header
  31500. }
  31501. // List: Retrieves a list of global addresses.
  31502. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  31503. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  31504. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31505. c.project = project
  31506. return c
  31507. }
  31508. // Filter sets the optional parameter "filter": A filter expression that
  31509. // filters resources listed in the response. The expression must specify
  31510. // the field name, a comparison operator, and the value that you want to
  31511. // use for filtering. The value must be a string, a number, or a
  31512. // boolean. The comparison operator must be either =, !=, >, or <.
  31513. //
  31514. // For example, if you are filtering Compute Engine instances, you can
  31515. // exclude instances named example-instance by specifying name !=
  31516. // example-instance.
  31517. //
  31518. // You can also filter nested fields. For example, you could specify
  31519. // scheduling.automaticRestart = false to include instances only if they
  31520. // are not scheduled for automatic restarts. You can use filtering on
  31521. // nested fields to filter based on resource labels.
  31522. //
  31523. // To filter on multiple expressions, provide each separate expression
  31524. // within parentheses. For example, (scheduling.automaticRestart = true)
  31525. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31526. // AND expression. However, you can include AND and OR expressions
  31527. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31528. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31529. // true).
  31530. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  31531. c.urlParams_.Set("filter", filter)
  31532. return c
  31533. }
  31534. // MaxResults sets the optional parameter "maxResults": The maximum
  31535. // number of results per page that should be returned. If the number of
  31536. // available results is larger than maxResults, Compute Engine returns a
  31537. // nextPageToken that can be used to get the next page of results in
  31538. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31539. // (Default: 500)
  31540. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  31541. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31542. return c
  31543. }
  31544. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31545. // a certain order. By default, results are returned in alphanumerical
  31546. // order based on the resource name.
  31547. //
  31548. // You can also sort results in descending order based on the creation
  31549. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31550. // based on the creationTimestamp field in reverse chronological order
  31551. // (newest result first). Use this to sort resources like operations so
  31552. // that the newest operation is returned first.
  31553. //
  31554. // Currently, only sorting by name or creationTimestamp desc is
  31555. // supported.
  31556. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  31557. c.urlParams_.Set("orderBy", orderBy)
  31558. return c
  31559. }
  31560. // PageToken sets the optional parameter "pageToken": Specifies a page
  31561. // token to use. Set pageToken to the nextPageToken returned by a
  31562. // previous list request to get the next page of results.
  31563. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  31564. c.urlParams_.Set("pageToken", pageToken)
  31565. return c
  31566. }
  31567. // Fields allows partial responses to be retrieved. See
  31568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31569. // for more information.
  31570. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  31571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31572. return c
  31573. }
  31574. // IfNoneMatch sets the optional parameter which makes the operation
  31575. // fail if the object's ETag matches the given value. This is useful for
  31576. // getting updates only after the object has changed since the last
  31577. // request. Use googleapi.IsNotModified to check whether the response
  31578. // error from Do is the result of In-None-Match.
  31579. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  31580. c.ifNoneMatch_ = entityTag
  31581. return c
  31582. }
  31583. // Context sets the context to be used in this call's Do method. Any
  31584. // pending HTTP request will be aborted if the provided context is
  31585. // canceled.
  31586. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  31587. c.ctx_ = ctx
  31588. return c
  31589. }
  31590. // Header returns an http.Header that can be modified by the caller to
  31591. // add HTTP headers to the request.
  31592. func (c *GlobalAddressesListCall) Header() http.Header {
  31593. if c.header_ == nil {
  31594. c.header_ = make(http.Header)
  31595. }
  31596. return c.header_
  31597. }
  31598. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  31599. reqHeaders := make(http.Header)
  31600. for k, v := range c.header_ {
  31601. reqHeaders[k] = v
  31602. }
  31603. reqHeaders.Set("User-Agent", c.s.userAgent())
  31604. if c.ifNoneMatch_ != "" {
  31605. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31606. }
  31607. var body io.Reader = nil
  31608. c.urlParams_.Set("alt", alt)
  31609. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  31610. urls += "?" + c.urlParams_.Encode()
  31611. req, _ := http.NewRequest("GET", urls, body)
  31612. req.Header = reqHeaders
  31613. googleapi.Expand(req.URL, map[string]string{
  31614. "project": c.project,
  31615. })
  31616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31617. }
  31618. // Do executes the "compute.globalAddresses.list" call.
  31619. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  31620. // status code is an error. Response headers are in either
  31621. // *AddressList.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 *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, 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 := &AddressList{
  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": "Retrieves a list of global addresses.",
  31657. // "httpMethod": "GET",
  31658. // "id": "compute.globalAddresses.list",
  31659. // "parameterOrder": [
  31660. // "project"
  31661. // ],
  31662. // "parameters": {
  31663. // "filter": {
  31664. // "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).",
  31665. // "location": "query",
  31666. // "type": "string"
  31667. // },
  31668. // "maxResults": {
  31669. // "default": "500",
  31670. // "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)",
  31671. // "format": "uint32",
  31672. // "location": "query",
  31673. // "minimum": "0",
  31674. // "type": "integer"
  31675. // },
  31676. // "orderBy": {
  31677. // "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.",
  31678. // "location": "query",
  31679. // "type": "string"
  31680. // },
  31681. // "pageToken": {
  31682. // "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.",
  31683. // "location": "query",
  31684. // "type": "string"
  31685. // },
  31686. // "project": {
  31687. // "description": "Project ID for this request.",
  31688. // "location": "path",
  31689. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31690. // "required": true,
  31691. // "type": "string"
  31692. // }
  31693. // },
  31694. // "path": "{project}/global/addresses",
  31695. // "response": {
  31696. // "$ref": "AddressList"
  31697. // },
  31698. // "scopes": [
  31699. // "https://www.googleapis.com/auth/cloud-platform",
  31700. // "https://www.googleapis.com/auth/compute",
  31701. // "https://www.googleapis.com/auth/compute.readonly"
  31702. // ]
  31703. // }
  31704. }
  31705. // Pages invokes f for each page of results.
  31706. // A non-nil error returned from f will halt the iteration.
  31707. // The provided context supersedes any context provided to the Context method.
  31708. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  31709. c.ctx_ = ctx
  31710. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31711. for {
  31712. x, err := c.Do()
  31713. if err != nil {
  31714. return err
  31715. }
  31716. if err := f(x); err != nil {
  31717. return err
  31718. }
  31719. if x.NextPageToken == "" {
  31720. return nil
  31721. }
  31722. c.PageToken(x.NextPageToken)
  31723. }
  31724. }
  31725. // method id "compute.globalForwardingRules.delete":
  31726. type GlobalForwardingRulesDeleteCall struct {
  31727. s *Service
  31728. project string
  31729. forwardingRule string
  31730. urlParams_ gensupport.URLParams
  31731. ctx_ context.Context
  31732. header_ http.Header
  31733. }
  31734. // Delete: Deletes the specified GlobalForwardingRule resource.
  31735. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  31736. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  31737. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31738. c.project = project
  31739. c.forwardingRule = forwardingRule
  31740. return c
  31741. }
  31742. // RequestId sets the optional parameter "requestId": An optional
  31743. // request ID to identify requests. Specify a unique request ID so that
  31744. // if you must retry your request, the server will know to ignore the
  31745. // request if it has already been completed.
  31746. //
  31747. // For example, consider a situation where you make an initial request
  31748. // and the request times out. If you make the request again with the
  31749. // same request ID, the server can check if original operation with the
  31750. // same request ID was received, and if so, will ignore the second
  31751. // request. This prevents clients from accidentally creating duplicate
  31752. // commitments.
  31753. //
  31754. // The request ID must be a valid UUID with the exception that zero UUID
  31755. // is not supported (00000000-0000-0000-0000-000000000000).
  31756. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  31757. c.urlParams_.Set("requestId", requestId)
  31758. return c
  31759. }
  31760. // Fields allows partial responses to be retrieved. See
  31761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31762. // for more information.
  31763. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  31764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31765. return c
  31766. }
  31767. // Context sets the context to be used in this call's Do method. Any
  31768. // pending HTTP request will be aborted if the provided context is
  31769. // canceled.
  31770. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  31771. c.ctx_ = ctx
  31772. return c
  31773. }
  31774. // Header returns an http.Header that can be modified by the caller to
  31775. // add HTTP headers to the request.
  31776. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  31777. if c.header_ == nil {
  31778. c.header_ = make(http.Header)
  31779. }
  31780. return c.header_
  31781. }
  31782. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  31783. reqHeaders := make(http.Header)
  31784. for k, v := range c.header_ {
  31785. reqHeaders[k] = v
  31786. }
  31787. reqHeaders.Set("User-Agent", c.s.userAgent())
  31788. var body io.Reader = nil
  31789. c.urlParams_.Set("alt", alt)
  31790. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  31791. urls += "?" + c.urlParams_.Encode()
  31792. req, _ := http.NewRequest("DELETE", urls, body)
  31793. req.Header = reqHeaders
  31794. googleapi.Expand(req.URL, map[string]string{
  31795. "project": c.project,
  31796. "forwardingRule": c.forwardingRule,
  31797. })
  31798. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31799. }
  31800. // Do executes the "compute.globalForwardingRules.delete" call.
  31801. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31802. // status code is an error. Response headers are in either
  31803. // *Operation.ServerResponse.Header or (if a response was returned at
  31804. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31805. // to check whether the returned error was because
  31806. // http.StatusNotModified was returned.
  31807. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31808. gensupport.SetOptions(c.urlParams_, opts...)
  31809. res, err := c.doRequest("json")
  31810. if res != nil && res.StatusCode == http.StatusNotModified {
  31811. if res.Body != nil {
  31812. res.Body.Close()
  31813. }
  31814. return nil, &googleapi.Error{
  31815. Code: res.StatusCode,
  31816. Header: res.Header,
  31817. }
  31818. }
  31819. if err != nil {
  31820. return nil, err
  31821. }
  31822. defer googleapi.CloseBody(res)
  31823. if err := googleapi.CheckResponse(res); err != nil {
  31824. return nil, err
  31825. }
  31826. ret := &Operation{
  31827. ServerResponse: googleapi.ServerResponse{
  31828. Header: res.Header,
  31829. HTTPStatusCode: res.StatusCode,
  31830. },
  31831. }
  31832. target := &ret
  31833. if err := gensupport.DecodeResponse(target, res); err != nil {
  31834. return nil, err
  31835. }
  31836. return ret, nil
  31837. // {
  31838. // "description": "Deletes the specified GlobalForwardingRule resource.",
  31839. // "httpMethod": "DELETE",
  31840. // "id": "compute.globalForwardingRules.delete",
  31841. // "parameterOrder": [
  31842. // "project",
  31843. // "forwardingRule"
  31844. // ],
  31845. // "parameters": {
  31846. // "forwardingRule": {
  31847. // "description": "Name of the ForwardingRule resource to delete.",
  31848. // "location": "path",
  31849. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31850. // "required": true,
  31851. // "type": "string"
  31852. // },
  31853. // "project": {
  31854. // "description": "Project ID for this request.",
  31855. // "location": "path",
  31856. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31857. // "required": true,
  31858. // "type": "string"
  31859. // },
  31860. // "requestId": {
  31861. // "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).",
  31862. // "location": "query",
  31863. // "type": "string"
  31864. // }
  31865. // },
  31866. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  31867. // "response": {
  31868. // "$ref": "Operation"
  31869. // },
  31870. // "scopes": [
  31871. // "https://www.googleapis.com/auth/cloud-platform",
  31872. // "https://www.googleapis.com/auth/compute"
  31873. // ]
  31874. // }
  31875. }
  31876. // method id "compute.globalForwardingRules.get":
  31877. type GlobalForwardingRulesGetCall struct {
  31878. s *Service
  31879. project string
  31880. forwardingRule string
  31881. urlParams_ gensupport.URLParams
  31882. ifNoneMatch_ string
  31883. ctx_ context.Context
  31884. header_ http.Header
  31885. }
  31886. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  31887. // of available forwarding rules by making a list() request.
  31888. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  31889. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  31890. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31891. c.project = project
  31892. c.forwardingRule = forwardingRule
  31893. return c
  31894. }
  31895. // Fields allows partial responses to be retrieved. See
  31896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31897. // for more information.
  31898. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  31899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31900. return c
  31901. }
  31902. // IfNoneMatch sets the optional parameter which makes the operation
  31903. // fail if the object's ETag matches the given value. This is useful for
  31904. // getting updates only after the object has changed since the last
  31905. // request. Use googleapi.IsNotModified to check whether the response
  31906. // error from Do is the result of In-None-Match.
  31907. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  31908. c.ifNoneMatch_ = entityTag
  31909. return c
  31910. }
  31911. // Context sets the context to be used in this call's Do method. Any
  31912. // pending HTTP request will be aborted if the provided context is
  31913. // canceled.
  31914. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  31915. c.ctx_ = ctx
  31916. return c
  31917. }
  31918. // Header returns an http.Header that can be modified by the caller to
  31919. // add HTTP headers to the request.
  31920. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  31921. if c.header_ == nil {
  31922. c.header_ = make(http.Header)
  31923. }
  31924. return c.header_
  31925. }
  31926. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  31927. reqHeaders := make(http.Header)
  31928. for k, v := range c.header_ {
  31929. reqHeaders[k] = v
  31930. }
  31931. reqHeaders.Set("User-Agent", c.s.userAgent())
  31932. if c.ifNoneMatch_ != "" {
  31933. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31934. }
  31935. var body io.Reader = nil
  31936. c.urlParams_.Set("alt", alt)
  31937. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  31938. urls += "?" + c.urlParams_.Encode()
  31939. req, _ := http.NewRequest("GET", urls, body)
  31940. req.Header = reqHeaders
  31941. googleapi.Expand(req.URL, map[string]string{
  31942. "project": c.project,
  31943. "forwardingRule": c.forwardingRule,
  31944. })
  31945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31946. }
  31947. // Do executes the "compute.globalForwardingRules.get" call.
  31948. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  31949. // status code is an error. Response headers are in either
  31950. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  31951. // at all) in error.(*googleapi.Error).Header. Use
  31952. // googleapi.IsNotModified to check whether the returned error was
  31953. // because http.StatusNotModified was returned.
  31954. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  31955. gensupport.SetOptions(c.urlParams_, opts...)
  31956. res, err := c.doRequest("json")
  31957. if res != nil && res.StatusCode == http.StatusNotModified {
  31958. if res.Body != nil {
  31959. res.Body.Close()
  31960. }
  31961. return nil, &googleapi.Error{
  31962. Code: res.StatusCode,
  31963. Header: res.Header,
  31964. }
  31965. }
  31966. if err != nil {
  31967. return nil, err
  31968. }
  31969. defer googleapi.CloseBody(res)
  31970. if err := googleapi.CheckResponse(res); err != nil {
  31971. return nil, err
  31972. }
  31973. ret := &ForwardingRule{
  31974. ServerResponse: googleapi.ServerResponse{
  31975. Header: res.Header,
  31976. HTTPStatusCode: res.StatusCode,
  31977. },
  31978. }
  31979. target := &ret
  31980. if err := gensupport.DecodeResponse(target, res); err != nil {
  31981. return nil, err
  31982. }
  31983. return ret, nil
  31984. // {
  31985. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  31986. // "httpMethod": "GET",
  31987. // "id": "compute.globalForwardingRules.get",
  31988. // "parameterOrder": [
  31989. // "project",
  31990. // "forwardingRule"
  31991. // ],
  31992. // "parameters": {
  31993. // "forwardingRule": {
  31994. // "description": "Name of the ForwardingRule resource to return.",
  31995. // "location": "path",
  31996. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31997. // "required": true,
  31998. // "type": "string"
  31999. // },
  32000. // "project": {
  32001. // "description": "Project ID for this request.",
  32002. // "location": "path",
  32003. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32004. // "required": true,
  32005. // "type": "string"
  32006. // }
  32007. // },
  32008. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  32009. // "response": {
  32010. // "$ref": "ForwardingRule"
  32011. // },
  32012. // "scopes": [
  32013. // "https://www.googleapis.com/auth/cloud-platform",
  32014. // "https://www.googleapis.com/auth/compute",
  32015. // "https://www.googleapis.com/auth/compute.readonly"
  32016. // ]
  32017. // }
  32018. }
  32019. // method id "compute.globalForwardingRules.insert":
  32020. type GlobalForwardingRulesInsertCall struct {
  32021. s *Service
  32022. project string
  32023. forwardingrule *ForwardingRule
  32024. urlParams_ gensupport.URLParams
  32025. ctx_ context.Context
  32026. header_ http.Header
  32027. }
  32028. // Insert: Creates a GlobalForwardingRule resource in the specified
  32029. // project using the data included in the request.
  32030. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  32031. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  32032. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32033. c.project = project
  32034. c.forwardingrule = forwardingrule
  32035. return c
  32036. }
  32037. // RequestId sets the optional parameter "requestId": An optional
  32038. // request ID to identify requests. Specify a unique request ID so that
  32039. // if you must retry your request, the server will know to ignore the
  32040. // request if it has already been completed.
  32041. //
  32042. // For example, consider a situation where you make an initial request
  32043. // and the request times out. If you make the request again with the
  32044. // same request ID, the server can check if original operation with the
  32045. // same request ID was received, and if so, will ignore the second
  32046. // request. This prevents clients from accidentally creating duplicate
  32047. // commitments.
  32048. //
  32049. // The request ID must be a valid UUID with the exception that zero UUID
  32050. // is not supported (00000000-0000-0000-0000-000000000000).
  32051. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  32052. c.urlParams_.Set("requestId", requestId)
  32053. return c
  32054. }
  32055. // Fields allows partial responses to be retrieved. See
  32056. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32057. // for more information.
  32058. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  32059. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32060. return c
  32061. }
  32062. // Context sets the context to be used in this call's Do method. Any
  32063. // pending HTTP request will be aborted if the provided context is
  32064. // canceled.
  32065. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  32066. c.ctx_ = ctx
  32067. return c
  32068. }
  32069. // Header returns an http.Header that can be modified by the caller to
  32070. // add HTTP headers to the request.
  32071. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  32072. if c.header_ == nil {
  32073. c.header_ = make(http.Header)
  32074. }
  32075. return c.header_
  32076. }
  32077. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  32078. reqHeaders := make(http.Header)
  32079. for k, v := range c.header_ {
  32080. reqHeaders[k] = v
  32081. }
  32082. reqHeaders.Set("User-Agent", c.s.userAgent())
  32083. var body io.Reader = nil
  32084. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  32085. if err != nil {
  32086. return nil, err
  32087. }
  32088. reqHeaders.Set("Content-Type", "application/json")
  32089. c.urlParams_.Set("alt", alt)
  32090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  32091. urls += "?" + c.urlParams_.Encode()
  32092. req, _ := http.NewRequest("POST", urls, body)
  32093. req.Header = reqHeaders
  32094. googleapi.Expand(req.URL, map[string]string{
  32095. "project": c.project,
  32096. })
  32097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32098. }
  32099. // Do executes the "compute.globalForwardingRules.insert" call.
  32100. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32101. // status code is an error. Response headers are in either
  32102. // *Operation.ServerResponse.Header or (if a response was returned at
  32103. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32104. // to check whether the returned error was because
  32105. // http.StatusNotModified was returned.
  32106. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32107. gensupport.SetOptions(c.urlParams_, opts...)
  32108. res, err := c.doRequest("json")
  32109. if res != nil && res.StatusCode == http.StatusNotModified {
  32110. if res.Body != nil {
  32111. res.Body.Close()
  32112. }
  32113. return nil, &googleapi.Error{
  32114. Code: res.StatusCode,
  32115. Header: res.Header,
  32116. }
  32117. }
  32118. if err != nil {
  32119. return nil, err
  32120. }
  32121. defer googleapi.CloseBody(res)
  32122. if err := googleapi.CheckResponse(res); err != nil {
  32123. return nil, err
  32124. }
  32125. ret := &Operation{
  32126. ServerResponse: googleapi.ServerResponse{
  32127. Header: res.Header,
  32128. HTTPStatusCode: res.StatusCode,
  32129. },
  32130. }
  32131. target := &ret
  32132. if err := gensupport.DecodeResponse(target, res); err != nil {
  32133. return nil, err
  32134. }
  32135. return ret, nil
  32136. // {
  32137. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  32138. // "httpMethod": "POST",
  32139. // "id": "compute.globalForwardingRules.insert",
  32140. // "parameterOrder": [
  32141. // "project"
  32142. // ],
  32143. // "parameters": {
  32144. // "project": {
  32145. // "description": "Project ID for this request.",
  32146. // "location": "path",
  32147. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32148. // "required": true,
  32149. // "type": "string"
  32150. // },
  32151. // "requestId": {
  32152. // "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).",
  32153. // "location": "query",
  32154. // "type": "string"
  32155. // }
  32156. // },
  32157. // "path": "{project}/global/forwardingRules",
  32158. // "request": {
  32159. // "$ref": "ForwardingRule"
  32160. // },
  32161. // "response": {
  32162. // "$ref": "Operation"
  32163. // },
  32164. // "scopes": [
  32165. // "https://www.googleapis.com/auth/cloud-platform",
  32166. // "https://www.googleapis.com/auth/compute"
  32167. // ]
  32168. // }
  32169. }
  32170. // method id "compute.globalForwardingRules.list":
  32171. type GlobalForwardingRulesListCall struct {
  32172. s *Service
  32173. project string
  32174. urlParams_ gensupport.URLParams
  32175. ifNoneMatch_ string
  32176. ctx_ context.Context
  32177. header_ http.Header
  32178. }
  32179. // List: Retrieves a list of GlobalForwardingRule resources available to
  32180. // the specified project.
  32181. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  32182. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  32183. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32184. c.project = project
  32185. return c
  32186. }
  32187. // Filter sets the optional parameter "filter": A filter expression that
  32188. // filters resources listed in the response. The expression must specify
  32189. // the field name, a comparison operator, and the value that you want to
  32190. // use for filtering. The value must be a string, a number, or a
  32191. // boolean. The comparison operator must be either =, !=, >, or <.
  32192. //
  32193. // For example, if you are filtering Compute Engine instances, you can
  32194. // exclude instances named example-instance by specifying name !=
  32195. // example-instance.
  32196. //
  32197. // You can also filter nested fields. For example, you could specify
  32198. // scheduling.automaticRestart = false to include instances only if they
  32199. // are not scheduled for automatic restarts. You can use filtering on
  32200. // nested fields to filter based on resource labels.
  32201. //
  32202. // To filter on multiple expressions, provide each separate expression
  32203. // within parentheses. For example, (scheduling.automaticRestart = true)
  32204. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32205. // AND expression. However, you can include AND and OR expressions
  32206. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32207. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32208. // true).
  32209. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  32210. c.urlParams_.Set("filter", filter)
  32211. return c
  32212. }
  32213. // MaxResults sets the optional parameter "maxResults": The maximum
  32214. // number of results per page that should be returned. If the number of
  32215. // available results is larger than maxResults, Compute Engine returns a
  32216. // nextPageToken that can be used to get the next page of results in
  32217. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32218. // (Default: 500)
  32219. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  32220. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32221. return c
  32222. }
  32223. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32224. // a certain order. By default, results are returned in alphanumerical
  32225. // order based on the resource name.
  32226. //
  32227. // You can also sort results in descending order based on the creation
  32228. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32229. // based on the creationTimestamp field in reverse chronological order
  32230. // (newest result first). Use this to sort resources like operations so
  32231. // that the newest operation is returned first.
  32232. //
  32233. // Currently, only sorting by name or creationTimestamp desc is
  32234. // supported.
  32235. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  32236. c.urlParams_.Set("orderBy", orderBy)
  32237. return c
  32238. }
  32239. // PageToken sets the optional parameter "pageToken": Specifies a page
  32240. // token to use. Set pageToken to the nextPageToken returned by a
  32241. // previous list request to get the next page of results.
  32242. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  32243. c.urlParams_.Set("pageToken", pageToken)
  32244. return c
  32245. }
  32246. // Fields allows partial responses to be retrieved. See
  32247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32248. // for more information.
  32249. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  32250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32251. return c
  32252. }
  32253. // IfNoneMatch sets the optional parameter which makes the operation
  32254. // fail if the object's ETag matches the given value. This is useful for
  32255. // getting updates only after the object has changed since the last
  32256. // request. Use googleapi.IsNotModified to check whether the response
  32257. // error from Do is the result of In-None-Match.
  32258. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  32259. c.ifNoneMatch_ = entityTag
  32260. return c
  32261. }
  32262. // Context sets the context to be used in this call's Do method. Any
  32263. // pending HTTP request will be aborted if the provided context is
  32264. // canceled.
  32265. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  32266. c.ctx_ = ctx
  32267. return c
  32268. }
  32269. // Header returns an http.Header that can be modified by the caller to
  32270. // add HTTP headers to the request.
  32271. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  32272. if c.header_ == nil {
  32273. c.header_ = make(http.Header)
  32274. }
  32275. return c.header_
  32276. }
  32277. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  32278. reqHeaders := make(http.Header)
  32279. for k, v := range c.header_ {
  32280. reqHeaders[k] = v
  32281. }
  32282. reqHeaders.Set("User-Agent", c.s.userAgent())
  32283. if c.ifNoneMatch_ != "" {
  32284. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32285. }
  32286. var body io.Reader = nil
  32287. c.urlParams_.Set("alt", alt)
  32288. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  32289. urls += "?" + c.urlParams_.Encode()
  32290. req, _ := http.NewRequest("GET", urls, body)
  32291. req.Header = reqHeaders
  32292. googleapi.Expand(req.URL, map[string]string{
  32293. "project": c.project,
  32294. })
  32295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32296. }
  32297. // Do executes the "compute.globalForwardingRules.list" call.
  32298. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  32299. // non-2xx status code is an error. Response headers are in either
  32300. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  32301. // returned at all) in error.(*googleapi.Error).Header. Use
  32302. // googleapi.IsNotModified to check whether the returned error was
  32303. // because http.StatusNotModified was returned.
  32304. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  32305. gensupport.SetOptions(c.urlParams_, opts...)
  32306. res, err := c.doRequest("json")
  32307. if res != nil && res.StatusCode == http.StatusNotModified {
  32308. if res.Body != nil {
  32309. res.Body.Close()
  32310. }
  32311. return nil, &googleapi.Error{
  32312. Code: res.StatusCode,
  32313. Header: res.Header,
  32314. }
  32315. }
  32316. if err != nil {
  32317. return nil, err
  32318. }
  32319. defer googleapi.CloseBody(res)
  32320. if err := googleapi.CheckResponse(res); err != nil {
  32321. return nil, err
  32322. }
  32323. ret := &ForwardingRuleList{
  32324. ServerResponse: googleapi.ServerResponse{
  32325. Header: res.Header,
  32326. HTTPStatusCode: res.StatusCode,
  32327. },
  32328. }
  32329. target := &ret
  32330. if err := gensupport.DecodeResponse(target, res); err != nil {
  32331. return nil, err
  32332. }
  32333. return ret, nil
  32334. // {
  32335. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  32336. // "httpMethod": "GET",
  32337. // "id": "compute.globalForwardingRules.list",
  32338. // "parameterOrder": [
  32339. // "project"
  32340. // ],
  32341. // "parameters": {
  32342. // "filter": {
  32343. // "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).",
  32344. // "location": "query",
  32345. // "type": "string"
  32346. // },
  32347. // "maxResults": {
  32348. // "default": "500",
  32349. // "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)",
  32350. // "format": "uint32",
  32351. // "location": "query",
  32352. // "minimum": "0",
  32353. // "type": "integer"
  32354. // },
  32355. // "orderBy": {
  32356. // "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.",
  32357. // "location": "query",
  32358. // "type": "string"
  32359. // },
  32360. // "pageToken": {
  32361. // "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.",
  32362. // "location": "query",
  32363. // "type": "string"
  32364. // },
  32365. // "project": {
  32366. // "description": "Project ID for this request.",
  32367. // "location": "path",
  32368. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32369. // "required": true,
  32370. // "type": "string"
  32371. // }
  32372. // },
  32373. // "path": "{project}/global/forwardingRules",
  32374. // "response": {
  32375. // "$ref": "ForwardingRuleList"
  32376. // },
  32377. // "scopes": [
  32378. // "https://www.googleapis.com/auth/cloud-platform",
  32379. // "https://www.googleapis.com/auth/compute",
  32380. // "https://www.googleapis.com/auth/compute.readonly"
  32381. // ]
  32382. // }
  32383. }
  32384. // Pages invokes f for each page of results.
  32385. // A non-nil error returned from f will halt the iteration.
  32386. // The provided context supersedes any context provided to the Context method.
  32387. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  32388. c.ctx_ = ctx
  32389. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32390. for {
  32391. x, err := c.Do()
  32392. if err != nil {
  32393. return err
  32394. }
  32395. if err := f(x); err != nil {
  32396. return err
  32397. }
  32398. if x.NextPageToken == "" {
  32399. return nil
  32400. }
  32401. c.PageToken(x.NextPageToken)
  32402. }
  32403. }
  32404. // method id "compute.globalForwardingRules.setTarget":
  32405. type GlobalForwardingRulesSetTargetCall struct {
  32406. s *Service
  32407. project string
  32408. forwardingRule string
  32409. targetreference *TargetReference
  32410. urlParams_ gensupport.URLParams
  32411. ctx_ context.Context
  32412. header_ http.Header
  32413. }
  32414. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  32415. // The new target should be of the same type as the old target.
  32416. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  32417. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  32418. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32419. c.project = project
  32420. c.forwardingRule = forwardingRule
  32421. c.targetreference = targetreference
  32422. return c
  32423. }
  32424. // RequestId sets the optional parameter "requestId": An optional
  32425. // request ID to identify requests. Specify a unique request ID so that
  32426. // if you must retry your request, the server will know to ignore the
  32427. // request if it has already been completed.
  32428. //
  32429. // For example, consider a situation where you make an initial request
  32430. // and the request times out. If you make the request again with the
  32431. // same request ID, the server can check if original operation with the
  32432. // same request ID was received, and if so, will ignore the second
  32433. // request. This prevents clients from accidentally creating duplicate
  32434. // commitments.
  32435. //
  32436. // The request ID must be a valid UUID with the exception that zero UUID
  32437. // is not supported (00000000-0000-0000-0000-000000000000).
  32438. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  32439. c.urlParams_.Set("requestId", requestId)
  32440. return c
  32441. }
  32442. // Fields allows partial responses to be retrieved. See
  32443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32444. // for more information.
  32445. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  32446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32447. return c
  32448. }
  32449. // Context sets the context to be used in this call's Do method. Any
  32450. // pending HTTP request will be aborted if the provided context is
  32451. // canceled.
  32452. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  32453. c.ctx_ = ctx
  32454. return c
  32455. }
  32456. // Header returns an http.Header that can be modified by the caller to
  32457. // add HTTP headers to the request.
  32458. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  32459. if c.header_ == nil {
  32460. c.header_ = make(http.Header)
  32461. }
  32462. return c.header_
  32463. }
  32464. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  32465. reqHeaders := make(http.Header)
  32466. for k, v := range c.header_ {
  32467. reqHeaders[k] = v
  32468. }
  32469. reqHeaders.Set("User-Agent", c.s.userAgent())
  32470. var body io.Reader = nil
  32471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  32472. if err != nil {
  32473. return nil, err
  32474. }
  32475. reqHeaders.Set("Content-Type", "application/json")
  32476. c.urlParams_.Set("alt", alt)
  32477. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  32478. urls += "?" + c.urlParams_.Encode()
  32479. req, _ := http.NewRequest("POST", urls, body)
  32480. req.Header = reqHeaders
  32481. googleapi.Expand(req.URL, map[string]string{
  32482. "project": c.project,
  32483. "forwardingRule": c.forwardingRule,
  32484. })
  32485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32486. }
  32487. // Do executes the "compute.globalForwardingRules.setTarget" call.
  32488. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32489. // status code is an error. Response headers are in either
  32490. // *Operation.ServerResponse.Header or (if a response was returned at
  32491. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32492. // to check whether the returned error was because
  32493. // http.StatusNotModified was returned.
  32494. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32495. gensupport.SetOptions(c.urlParams_, opts...)
  32496. res, err := c.doRequest("json")
  32497. if res != nil && res.StatusCode == http.StatusNotModified {
  32498. if res.Body != nil {
  32499. res.Body.Close()
  32500. }
  32501. return nil, &googleapi.Error{
  32502. Code: res.StatusCode,
  32503. Header: res.Header,
  32504. }
  32505. }
  32506. if err != nil {
  32507. return nil, err
  32508. }
  32509. defer googleapi.CloseBody(res)
  32510. if err := googleapi.CheckResponse(res); err != nil {
  32511. return nil, err
  32512. }
  32513. ret := &Operation{
  32514. ServerResponse: googleapi.ServerResponse{
  32515. Header: res.Header,
  32516. HTTPStatusCode: res.StatusCode,
  32517. },
  32518. }
  32519. target := &ret
  32520. if err := gensupport.DecodeResponse(target, res); err != nil {
  32521. return nil, err
  32522. }
  32523. return ret, nil
  32524. // {
  32525. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  32526. // "httpMethod": "POST",
  32527. // "id": "compute.globalForwardingRules.setTarget",
  32528. // "parameterOrder": [
  32529. // "project",
  32530. // "forwardingRule"
  32531. // ],
  32532. // "parameters": {
  32533. // "forwardingRule": {
  32534. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  32535. // "location": "path",
  32536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32537. // "required": true,
  32538. // "type": "string"
  32539. // },
  32540. // "project": {
  32541. // "description": "Project ID for this request.",
  32542. // "location": "path",
  32543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32544. // "required": true,
  32545. // "type": "string"
  32546. // },
  32547. // "requestId": {
  32548. // "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).",
  32549. // "location": "query",
  32550. // "type": "string"
  32551. // }
  32552. // },
  32553. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  32554. // "request": {
  32555. // "$ref": "TargetReference"
  32556. // },
  32557. // "response": {
  32558. // "$ref": "Operation"
  32559. // },
  32560. // "scopes": [
  32561. // "https://www.googleapis.com/auth/cloud-platform",
  32562. // "https://www.googleapis.com/auth/compute"
  32563. // ]
  32564. // }
  32565. }
  32566. // method id "compute.globalOperations.aggregatedList":
  32567. type GlobalOperationsAggregatedListCall struct {
  32568. s *Service
  32569. project string
  32570. urlParams_ gensupport.URLParams
  32571. ifNoneMatch_ string
  32572. ctx_ context.Context
  32573. header_ http.Header
  32574. }
  32575. // AggregatedList: Retrieves an aggregated list of all operations.
  32576. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  32577. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  32578. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32579. c.project = project
  32580. return c
  32581. }
  32582. // Filter sets the optional parameter "filter": A filter expression that
  32583. // filters resources listed in the response. The expression must specify
  32584. // the field name, a comparison operator, and the value that you want to
  32585. // use for filtering. The value must be a string, a number, or a
  32586. // boolean. The comparison operator must be either =, !=, >, or <.
  32587. //
  32588. // For example, if you are filtering Compute Engine instances, you can
  32589. // exclude instances named example-instance by specifying name !=
  32590. // example-instance.
  32591. //
  32592. // You can also filter nested fields. For example, you could specify
  32593. // scheduling.automaticRestart = false to include instances only if they
  32594. // are not scheduled for automatic restarts. You can use filtering on
  32595. // nested fields to filter based on resource labels.
  32596. //
  32597. // To filter on multiple expressions, provide each separate expression
  32598. // within parentheses. For example, (scheduling.automaticRestart = true)
  32599. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32600. // AND expression. However, you can include AND and OR expressions
  32601. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32602. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32603. // true).
  32604. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  32605. c.urlParams_.Set("filter", filter)
  32606. return c
  32607. }
  32608. // MaxResults sets the optional parameter "maxResults": The maximum
  32609. // number of results per page that should be returned. If the number of
  32610. // available results is larger than maxResults, Compute Engine returns a
  32611. // nextPageToken that can be used to get the next page of results in
  32612. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32613. // (Default: 500)
  32614. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  32615. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32616. return c
  32617. }
  32618. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32619. // a certain order. By default, results are returned in alphanumerical
  32620. // order based on the resource name.
  32621. //
  32622. // You can also sort results in descending order based on the creation
  32623. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32624. // based on the creationTimestamp field in reverse chronological order
  32625. // (newest result first). Use this to sort resources like operations so
  32626. // that the newest operation is returned first.
  32627. //
  32628. // Currently, only sorting by name or creationTimestamp desc is
  32629. // supported.
  32630. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  32631. c.urlParams_.Set("orderBy", orderBy)
  32632. return c
  32633. }
  32634. // PageToken sets the optional parameter "pageToken": Specifies a page
  32635. // token to use. Set pageToken to the nextPageToken returned by a
  32636. // previous list request to get the next page of results.
  32637. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  32638. c.urlParams_.Set("pageToken", pageToken)
  32639. return c
  32640. }
  32641. // Fields allows partial responses to be retrieved. See
  32642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32643. // for more information.
  32644. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  32645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32646. return c
  32647. }
  32648. // IfNoneMatch sets the optional parameter which makes the operation
  32649. // fail if the object's ETag matches the given value. This is useful for
  32650. // getting updates only after the object has changed since the last
  32651. // request. Use googleapi.IsNotModified to check whether the response
  32652. // error from Do is the result of In-None-Match.
  32653. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  32654. c.ifNoneMatch_ = entityTag
  32655. return c
  32656. }
  32657. // Context sets the context to be used in this call's Do method. Any
  32658. // pending HTTP request will be aborted if the provided context is
  32659. // canceled.
  32660. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  32661. c.ctx_ = ctx
  32662. return c
  32663. }
  32664. // Header returns an http.Header that can be modified by the caller to
  32665. // add HTTP headers to the request.
  32666. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  32667. if c.header_ == nil {
  32668. c.header_ = make(http.Header)
  32669. }
  32670. return c.header_
  32671. }
  32672. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  32673. reqHeaders := make(http.Header)
  32674. for k, v := range c.header_ {
  32675. reqHeaders[k] = v
  32676. }
  32677. reqHeaders.Set("User-Agent", c.s.userAgent())
  32678. if c.ifNoneMatch_ != "" {
  32679. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32680. }
  32681. var body io.Reader = nil
  32682. c.urlParams_.Set("alt", alt)
  32683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  32684. urls += "?" + c.urlParams_.Encode()
  32685. req, _ := http.NewRequest("GET", urls, body)
  32686. req.Header = reqHeaders
  32687. googleapi.Expand(req.URL, map[string]string{
  32688. "project": c.project,
  32689. })
  32690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32691. }
  32692. // Do executes the "compute.globalOperations.aggregatedList" call.
  32693. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  32694. // non-2xx status code is an error. Response headers are in either
  32695. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  32696. // returned at all) in error.(*googleapi.Error).Header. Use
  32697. // googleapi.IsNotModified to check whether the returned error was
  32698. // because http.StatusNotModified was returned.
  32699. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  32700. gensupport.SetOptions(c.urlParams_, opts...)
  32701. res, err := c.doRequest("json")
  32702. if res != nil && res.StatusCode == http.StatusNotModified {
  32703. if res.Body != nil {
  32704. res.Body.Close()
  32705. }
  32706. return nil, &googleapi.Error{
  32707. Code: res.StatusCode,
  32708. Header: res.Header,
  32709. }
  32710. }
  32711. if err != nil {
  32712. return nil, err
  32713. }
  32714. defer googleapi.CloseBody(res)
  32715. if err := googleapi.CheckResponse(res); err != nil {
  32716. return nil, err
  32717. }
  32718. ret := &OperationAggregatedList{
  32719. ServerResponse: googleapi.ServerResponse{
  32720. Header: res.Header,
  32721. HTTPStatusCode: res.StatusCode,
  32722. },
  32723. }
  32724. target := &ret
  32725. if err := gensupport.DecodeResponse(target, res); err != nil {
  32726. return nil, err
  32727. }
  32728. return ret, nil
  32729. // {
  32730. // "description": "Retrieves an aggregated list of all operations.",
  32731. // "httpMethod": "GET",
  32732. // "id": "compute.globalOperations.aggregatedList",
  32733. // "parameterOrder": [
  32734. // "project"
  32735. // ],
  32736. // "parameters": {
  32737. // "filter": {
  32738. // "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).",
  32739. // "location": "query",
  32740. // "type": "string"
  32741. // },
  32742. // "maxResults": {
  32743. // "default": "500",
  32744. // "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)",
  32745. // "format": "uint32",
  32746. // "location": "query",
  32747. // "minimum": "0",
  32748. // "type": "integer"
  32749. // },
  32750. // "orderBy": {
  32751. // "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.",
  32752. // "location": "query",
  32753. // "type": "string"
  32754. // },
  32755. // "pageToken": {
  32756. // "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.",
  32757. // "location": "query",
  32758. // "type": "string"
  32759. // },
  32760. // "project": {
  32761. // "description": "Project ID for this request.",
  32762. // "location": "path",
  32763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32764. // "required": true,
  32765. // "type": "string"
  32766. // }
  32767. // },
  32768. // "path": "{project}/aggregated/operations",
  32769. // "response": {
  32770. // "$ref": "OperationAggregatedList"
  32771. // },
  32772. // "scopes": [
  32773. // "https://www.googleapis.com/auth/cloud-platform",
  32774. // "https://www.googleapis.com/auth/compute",
  32775. // "https://www.googleapis.com/auth/compute.readonly"
  32776. // ]
  32777. // }
  32778. }
  32779. // Pages invokes f for each page of results.
  32780. // A non-nil error returned from f will halt the iteration.
  32781. // The provided context supersedes any context provided to the Context method.
  32782. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  32783. c.ctx_ = ctx
  32784. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32785. for {
  32786. x, err := c.Do()
  32787. if err != nil {
  32788. return err
  32789. }
  32790. if err := f(x); err != nil {
  32791. return err
  32792. }
  32793. if x.NextPageToken == "" {
  32794. return nil
  32795. }
  32796. c.PageToken(x.NextPageToken)
  32797. }
  32798. }
  32799. // method id "compute.globalOperations.delete":
  32800. type GlobalOperationsDeleteCall struct {
  32801. s *Service
  32802. project string
  32803. operation string
  32804. urlParams_ gensupport.URLParams
  32805. ctx_ context.Context
  32806. header_ http.Header
  32807. }
  32808. // Delete: Deletes the specified Operations resource.
  32809. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  32810. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  32811. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32812. c.project = project
  32813. c.operation = operation
  32814. return c
  32815. }
  32816. // Fields allows partial responses to be retrieved. See
  32817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32818. // for more information.
  32819. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  32820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32821. return c
  32822. }
  32823. // Context sets the context to be used in this call's Do method. Any
  32824. // pending HTTP request will be aborted if the provided context is
  32825. // canceled.
  32826. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  32827. c.ctx_ = ctx
  32828. return c
  32829. }
  32830. // Header returns an http.Header that can be modified by the caller to
  32831. // add HTTP headers to the request.
  32832. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  32833. if c.header_ == nil {
  32834. c.header_ = make(http.Header)
  32835. }
  32836. return c.header_
  32837. }
  32838. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  32839. reqHeaders := make(http.Header)
  32840. for k, v := range c.header_ {
  32841. reqHeaders[k] = v
  32842. }
  32843. reqHeaders.Set("User-Agent", c.s.userAgent())
  32844. var body io.Reader = nil
  32845. c.urlParams_.Set("alt", alt)
  32846. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  32847. urls += "?" + c.urlParams_.Encode()
  32848. req, _ := http.NewRequest("DELETE", urls, body)
  32849. req.Header = reqHeaders
  32850. googleapi.Expand(req.URL, map[string]string{
  32851. "project": c.project,
  32852. "operation": c.operation,
  32853. })
  32854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32855. }
  32856. // Do executes the "compute.globalOperations.delete" call.
  32857. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  32858. gensupport.SetOptions(c.urlParams_, opts...)
  32859. res, err := c.doRequest("json")
  32860. if err != nil {
  32861. return err
  32862. }
  32863. defer googleapi.CloseBody(res)
  32864. if err := googleapi.CheckResponse(res); err != nil {
  32865. return err
  32866. }
  32867. return nil
  32868. // {
  32869. // "description": "Deletes the specified Operations resource.",
  32870. // "httpMethod": "DELETE",
  32871. // "id": "compute.globalOperations.delete",
  32872. // "parameterOrder": [
  32873. // "project",
  32874. // "operation"
  32875. // ],
  32876. // "parameters": {
  32877. // "operation": {
  32878. // "description": "Name of the Operations resource to delete.",
  32879. // "location": "path",
  32880. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32881. // "required": true,
  32882. // "type": "string"
  32883. // },
  32884. // "project": {
  32885. // "description": "Project ID for this request.",
  32886. // "location": "path",
  32887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32888. // "required": true,
  32889. // "type": "string"
  32890. // }
  32891. // },
  32892. // "path": "{project}/global/operations/{operation}",
  32893. // "scopes": [
  32894. // "https://www.googleapis.com/auth/cloud-platform",
  32895. // "https://www.googleapis.com/auth/compute"
  32896. // ]
  32897. // }
  32898. }
  32899. // method id "compute.globalOperations.get":
  32900. type GlobalOperationsGetCall struct {
  32901. s *Service
  32902. project string
  32903. operation string
  32904. urlParams_ gensupport.URLParams
  32905. ifNoneMatch_ string
  32906. ctx_ context.Context
  32907. header_ http.Header
  32908. }
  32909. // Get: Retrieves the specified Operations resource. Gets a list of
  32910. // operations by making a list() request.
  32911. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  32912. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  32913. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32914. c.project = project
  32915. c.operation = operation
  32916. return c
  32917. }
  32918. // Fields allows partial responses to be retrieved. See
  32919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32920. // for more information.
  32921. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  32922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32923. return c
  32924. }
  32925. // IfNoneMatch sets the optional parameter which makes the operation
  32926. // fail if the object's ETag matches the given value. This is useful for
  32927. // getting updates only after the object has changed since the last
  32928. // request. Use googleapi.IsNotModified to check whether the response
  32929. // error from Do is the result of In-None-Match.
  32930. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  32931. c.ifNoneMatch_ = entityTag
  32932. return c
  32933. }
  32934. // Context sets the context to be used in this call's Do method. Any
  32935. // pending HTTP request will be aborted if the provided context is
  32936. // canceled.
  32937. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  32938. c.ctx_ = ctx
  32939. return c
  32940. }
  32941. // Header returns an http.Header that can be modified by the caller to
  32942. // add HTTP headers to the request.
  32943. func (c *GlobalOperationsGetCall) Header() http.Header {
  32944. if c.header_ == nil {
  32945. c.header_ = make(http.Header)
  32946. }
  32947. return c.header_
  32948. }
  32949. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  32950. reqHeaders := make(http.Header)
  32951. for k, v := range c.header_ {
  32952. reqHeaders[k] = v
  32953. }
  32954. reqHeaders.Set("User-Agent", c.s.userAgent())
  32955. if c.ifNoneMatch_ != "" {
  32956. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32957. }
  32958. var body io.Reader = nil
  32959. c.urlParams_.Set("alt", alt)
  32960. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  32961. urls += "?" + c.urlParams_.Encode()
  32962. req, _ := http.NewRequest("GET", urls, body)
  32963. req.Header = reqHeaders
  32964. googleapi.Expand(req.URL, map[string]string{
  32965. "project": c.project,
  32966. "operation": c.operation,
  32967. })
  32968. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32969. }
  32970. // Do executes the "compute.globalOperations.get" call.
  32971. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32972. // status code is an error. Response headers are in either
  32973. // *Operation.ServerResponse.Header or (if a response was returned at
  32974. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32975. // to check whether the returned error was because
  32976. // http.StatusNotModified was returned.
  32977. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32978. gensupport.SetOptions(c.urlParams_, opts...)
  32979. res, err := c.doRequest("json")
  32980. if res != nil && res.StatusCode == http.StatusNotModified {
  32981. if res.Body != nil {
  32982. res.Body.Close()
  32983. }
  32984. return nil, &googleapi.Error{
  32985. Code: res.StatusCode,
  32986. Header: res.Header,
  32987. }
  32988. }
  32989. if err != nil {
  32990. return nil, err
  32991. }
  32992. defer googleapi.CloseBody(res)
  32993. if err := googleapi.CheckResponse(res); err != nil {
  32994. return nil, err
  32995. }
  32996. ret := &Operation{
  32997. ServerResponse: googleapi.ServerResponse{
  32998. Header: res.Header,
  32999. HTTPStatusCode: res.StatusCode,
  33000. },
  33001. }
  33002. target := &ret
  33003. if err := gensupport.DecodeResponse(target, res); err != nil {
  33004. return nil, err
  33005. }
  33006. return ret, nil
  33007. // {
  33008. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  33009. // "httpMethod": "GET",
  33010. // "id": "compute.globalOperations.get",
  33011. // "parameterOrder": [
  33012. // "project",
  33013. // "operation"
  33014. // ],
  33015. // "parameters": {
  33016. // "operation": {
  33017. // "description": "Name of the Operations resource to return.",
  33018. // "location": "path",
  33019. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33020. // "required": true,
  33021. // "type": "string"
  33022. // },
  33023. // "project": {
  33024. // "description": "Project ID for this request.",
  33025. // "location": "path",
  33026. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33027. // "required": true,
  33028. // "type": "string"
  33029. // }
  33030. // },
  33031. // "path": "{project}/global/operations/{operation}",
  33032. // "response": {
  33033. // "$ref": "Operation"
  33034. // },
  33035. // "scopes": [
  33036. // "https://www.googleapis.com/auth/cloud-platform",
  33037. // "https://www.googleapis.com/auth/compute",
  33038. // "https://www.googleapis.com/auth/compute.readonly"
  33039. // ]
  33040. // }
  33041. }
  33042. // method id "compute.globalOperations.list":
  33043. type GlobalOperationsListCall struct {
  33044. s *Service
  33045. project string
  33046. urlParams_ gensupport.URLParams
  33047. ifNoneMatch_ string
  33048. ctx_ context.Context
  33049. header_ http.Header
  33050. }
  33051. // List: Retrieves a list of Operation resources contained within the
  33052. // specified project.
  33053. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  33054. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  33055. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33056. c.project = project
  33057. return c
  33058. }
  33059. // Filter sets the optional parameter "filter": A filter expression that
  33060. // filters resources listed in the response. The expression must specify
  33061. // the field name, a comparison operator, and the value that you want to
  33062. // use for filtering. The value must be a string, a number, or a
  33063. // boolean. The comparison operator must be either =, !=, >, or <.
  33064. //
  33065. // For example, if you are filtering Compute Engine instances, you can
  33066. // exclude instances named example-instance by specifying name !=
  33067. // example-instance.
  33068. //
  33069. // You can also filter nested fields. For example, you could specify
  33070. // scheduling.automaticRestart = false to include instances only if they
  33071. // are not scheduled for automatic restarts. You can use filtering on
  33072. // nested fields to filter based on resource labels.
  33073. //
  33074. // To filter on multiple expressions, provide each separate expression
  33075. // within parentheses. For example, (scheduling.automaticRestart = true)
  33076. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33077. // AND expression. However, you can include AND and OR expressions
  33078. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33079. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33080. // true).
  33081. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  33082. c.urlParams_.Set("filter", filter)
  33083. return c
  33084. }
  33085. // MaxResults sets the optional parameter "maxResults": The maximum
  33086. // number of results per page that should be returned. If the number of
  33087. // available results is larger than maxResults, Compute Engine returns a
  33088. // nextPageToken that can be used to get the next page of results in
  33089. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33090. // (Default: 500)
  33091. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  33092. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33093. return c
  33094. }
  33095. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33096. // a certain order. By default, results are returned in alphanumerical
  33097. // order based on the resource name.
  33098. //
  33099. // You can also sort results in descending order based on the creation
  33100. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33101. // based on the creationTimestamp field in reverse chronological order
  33102. // (newest result first). Use this to sort resources like operations so
  33103. // that the newest operation is returned first.
  33104. //
  33105. // Currently, only sorting by name or creationTimestamp desc is
  33106. // supported.
  33107. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  33108. c.urlParams_.Set("orderBy", orderBy)
  33109. return c
  33110. }
  33111. // PageToken sets the optional parameter "pageToken": Specifies a page
  33112. // token to use. Set pageToken to the nextPageToken returned by a
  33113. // previous list request to get the next page of results.
  33114. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  33115. c.urlParams_.Set("pageToken", pageToken)
  33116. return c
  33117. }
  33118. // Fields allows partial responses to be retrieved. See
  33119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33120. // for more information.
  33121. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  33122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33123. return c
  33124. }
  33125. // IfNoneMatch sets the optional parameter which makes the operation
  33126. // fail if the object's ETag matches the given value. This is useful for
  33127. // getting updates only after the object has changed since the last
  33128. // request. Use googleapi.IsNotModified to check whether the response
  33129. // error from Do is the result of In-None-Match.
  33130. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  33131. c.ifNoneMatch_ = entityTag
  33132. return c
  33133. }
  33134. // Context sets the context to be used in this call's Do method. Any
  33135. // pending HTTP request will be aborted if the provided context is
  33136. // canceled.
  33137. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  33138. c.ctx_ = ctx
  33139. return c
  33140. }
  33141. // Header returns an http.Header that can be modified by the caller to
  33142. // add HTTP headers to the request.
  33143. func (c *GlobalOperationsListCall) Header() http.Header {
  33144. if c.header_ == nil {
  33145. c.header_ = make(http.Header)
  33146. }
  33147. return c.header_
  33148. }
  33149. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  33150. reqHeaders := make(http.Header)
  33151. for k, v := range c.header_ {
  33152. reqHeaders[k] = v
  33153. }
  33154. reqHeaders.Set("User-Agent", c.s.userAgent())
  33155. if c.ifNoneMatch_ != "" {
  33156. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33157. }
  33158. var body io.Reader = nil
  33159. c.urlParams_.Set("alt", alt)
  33160. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  33161. urls += "?" + c.urlParams_.Encode()
  33162. req, _ := http.NewRequest("GET", urls, body)
  33163. req.Header = reqHeaders
  33164. googleapi.Expand(req.URL, map[string]string{
  33165. "project": c.project,
  33166. })
  33167. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33168. }
  33169. // Do executes the "compute.globalOperations.list" call.
  33170. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  33171. // status code is an error. Response headers are in either
  33172. // *OperationList.ServerResponse.Header or (if a response was returned
  33173. // at all) in error.(*googleapi.Error).Header. Use
  33174. // googleapi.IsNotModified to check whether the returned error was
  33175. // because http.StatusNotModified was returned.
  33176. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  33177. gensupport.SetOptions(c.urlParams_, opts...)
  33178. res, err := c.doRequest("json")
  33179. if res != nil && res.StatusCode == http.StatusNotModified {
  33180. if res.Body != nil {
  33181. res.Body.Close()
  33182. }
  33183. return nil, &googleapi.Error{
  33184. Code: res.StatusCode,
  33185. Header: res.Header,
  33186. }
  33187. }
  33188. if err != nil {
  33189. return nil, err
  33190. }
  33191. defer googleapi.CloseBody(res)
  33192. if err := googleapi.CheckResponse(res); err != nil {
  33193. return nil, err
  33194. }
  33195. ret := &OperationList{
  33196. ServerResponse: googleapi.ServerResponse{
  33197. Header: res.Header,
  33198. HTTPStatusCode: res.StatusCode,
  33199. },
  33200. }
  33201. target := &ret
  33202. if err := gensupport.DecodeResponse(target, res); err != nil {
  33203. return nil, err
  33204. }
  33205. return ret, nil
  33206. // {
  33207. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  33208. // "httpMethod": "GET",
  33209. // "id": "compute.globalOperations.list",
  33210. // "parameterOrder": [
  33211. // "project"
  33212. // ],
  33213. // "parameters": {
  33214. // "filter": {
  33215. // "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).",
  33216. // "location": "query",
  33217. // "type": "string"
  33218. // },
  33219. // "maxResults": {
  33220. // "default": "500",
  33221. // "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)",
  33222. // "format": "uint32",
  33223. // "location": "query",
  33224. // "minimum": "0",
  33225. // "type": "integer"
  33226. // },
  33227. // "orderBy": {
  33228. // "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.",
  33229. // "location": "query",
  33230. // "type": "string"
  33231. // },
  33232. // "pageToken": {
  33233. // "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.",
  33234. // "location": "query",
  33235. // "type": "string"
  33236. // },
  33237. // "project": {
  33238. // "description": "Project ID for this request.",
  33239. // "location": "path",
  33240. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33241. // "required": true,
  33242. // "type": "string"
  33243. // }
  33244. // },
  33245. // "path": "{project}/global/operations",
  33246. // "response": {
  33247. // "$ref": "OperationList"
  33248. // },
  33249. // "scopes": [
  33250. // "https://www.googleapis.com/auth/cloud-platform",
  33251. // "https://www.googleapis.com/auth/compute",
  33252. // "https://www.googleapis.com/auth/compute.readonly"
  33253. // ]
  33254. // }
  33255. }
  33256. // Pages invokes f for each page of results.
  33257. // A non-nil error returned from f will halt the iteration.
  33258. // The provided context supersedes any context provided to the Context method.
  33259. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  33260. c.ctx_ = ctx
  33261. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33262. for {
  33263. x, err := c.Do()
  33264. if err != nil {
  33265. return err
  33266. }
  33267. if err := f(x); err != nil {
  33268. return err
  33269. }
  33270. if x.NextPageToken == "" {
  33271. return nil
  33272. }
  33273. c.PageToken(x.NextPageToken)
  33274. }
  33275. }
  33276. // method id "compute.healthChecks.delete":
  33277. type HealthChecksDeleteCall struct {
  33278. s *Service
  33279. project string
  33280. healthCheck string
  33281. urlParams_ gensupport.URLParams
  33282. ctx_ context.Context
  33283. header_ http.Header
  33284. }
  33285. // Delete: Deletes the specified HealthCheck resource.
  33286. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  33287. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33288. c.project = project
  33289. c.healthCheck = healthCheck
  33290. return c
  33291. }
  33292. // RequestId sets the optional parameter "requestId": An optional
  33293. // request ID to identify requests. Specify a unique request ID so that
  33294. // if you must retry your request, the server will know to ignore the
  33295. // request if it has already been completed.
  33296. //
  33297. // For example, consider a situation where you make an initial request
  33298. // and the request times out. If you make the request again with the
  33299. // same request ID, the server can check if original operation with the
  33300. // same request ID was received, and if so, will ignore the second
  33301. // request. This prevents clients from accidentally creating duplicate
  33302. // commitments.
  33303. //
  33304. // The request ID must be a valid UUID with the exception that zero UUID
  33305. // is not supported (00000000-0000-0000-0000-000000000000).
  33306. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  33307. c.urlParams_.Set("requestId", requestId)
  33308. return c
  33309. }
  33310. // Fields allows partial responses to be retrieved. See
  33311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33312. // for more information.
  33313. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  33314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33315. return c
  33316. }
  33317. // Context sets the context to be used in this call's Do method. Any
  33318. // pending HTTP request will be aborted if the provided context is
  33319. // canceled.
  33320. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  33321. c.ctx_ = ctx
  33322. return c
  33323. }
  33324. // Header returns an http.Header that can be modified by the caller to
  33325. // add HTTP headers to the request.
  33326. func (c *HealthChecksDeleteCall) Header() http.Header {
  33327. if c.header_ == nil {
  33328. c.header_ = make(http.Header)
  33329. }
  33330. return c.header_
  33331. }
  33332. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  33333. reqHeaders := make(http.Header)
  33334. for k, v := range c.header_ {
  33335. reqHeaders[k] = v
  33336. }
  33337. reqHeaders.Set("User-Agent", c.s.userAgent())
  33338. var body io.Reader = nil
  33339. c.urlParams_.Set("alt", alt)
  33340. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  33341. urls += "?" + c.urlParams_.Encode()
  33342. req, _ := http.NewRequest("DELETE", urls, body)
  33343. req.Header = reqHeaders
  33344. googleapi.Expand(req.URL, map[string]string{
  33345. "project": c.project,
  33346. "healthCheck": c.healthCheck,
  33347. })
  33348. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33349. }
  33350. // Do executes the "compute.healthChecks.delete" call.
  33351. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33352. // status code is an error. Response headers are in either
  33353. // *Operation.ServerResponse.Header or (if a response was returned at
  33354. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33355. // to check whether the returned error was because
  33356. // http.StatusNotModified was returned.
  33357. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33358. gensupport.SetOptions(c.urlParams_, opts...)
  33359. res, err := c.doRequest("json")
  33360. if res != nil && res.StatusCode == http.StatusNotModified {
  33361. if res.Body != nil {
  33362. res.Body.Close()
  33363. }
  33364. return nil, &googleapi.Error{
  33365. Code: res.StatusCode,
  33366. Header: res.Header,
  33367. }
  33368. }
  33369. if err != nil {
  33370. return nil, err
  33371. }
  33372. defer googleapi.CloseBody(res)
  33373. if err := googleapi.CheckResponse(res); err != nil {
  33374. return nil, err
  33375. }
  33376. ret := &Operation{
  33377. ServerResponse: googleapi.ServerResponse{
  33378. Header: res.Header,
  33379. HTTPStatusCode: res.StatusCode,
  33380. },
  33381. }
  33382. target := &ret
  33383. if err := gensupport.DecodeResponse(target, res); err != nil {
  33384. return nil, err
  33385. }
  33386. return ret, nil
  33387. // {
  33388. // "description": "Deletes the specified HealthCheck resource.",
  33389. // "httpMethod": "DELETE",
  33390. // "id": "compute.healthChecks.delete",
  33391. // "parameterOrder": [
  33392. // "project",
  33393. // "healthCheck"
  33394. // ],
  33395. // "parameters": {
  33396. // "healthCheck": {
  33397. // "description": "Name of the HealthCheck resource to delete.",
  33398. // "location": "path",
  33399. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33400. // "required": true,
  33401. // "type": "string"
  33402. // },
  33403. // "project": {
  33404. // "description": "Project ID for this request.",
  33405. // "location": "path",
  33406. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33407. // "required": true,
  33408. // "type": "string"
  33409. // },
  33410. // "requestId": {
  33411. // "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).",
  33412. // "location": "query",
  33413. // "type": "string"
  33414. // }
  33415. // },
  33416. // "path": "{project}/global/healthChecks/{healthCheck}",
  33417. // "response": {
  33418. // "$ref": "Operation"
  33419. // },
  33420. // "scopes": [
  33421. // "https://www.googleapis.com/auth/cloud-platform",
  33422. // "https://www.googleapis.com/auth/compute"
  33423. // ]
  33424. // }
  33425. }
  33426. // method id "compute.healthChecks.get":
  33427. type HealthChecksGetCall struct {
  33428. s *Service
  33429. project string
  33430. healthCheck string
  33431. urlParams_ gensupport.URLParams
  33432. ifNoneMatch_ string
  33433. ctx_ context.Context
  33434. header_ http.Header
  33435. }
  33436. // Get: Returns the specified HealthCheck resource. Gets a list of
  33437. // available health checks by making a list() request.
  33438. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  33439. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33440. c.project = project
  33441. c.healthCheck = healthCheck
  33442. return c
  33443. }
  33444. // Fields allows partial responses to be retrieved. See
  33445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33446. // for more information.
  33447. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  33448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33449. return c
  33450. }
  33451. // IfNoneMatch sets the optional parameter which makes the operation
  33452. // fail if the object's ETag matches the given value. This is useful for
  33453. // getting updates only after the object has changed since the last
  33454. // request. Use googleapi.IsNotModified to check whether the response
  33455. // error from Do is the result of In-None-Match.
  33456. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  33457. c.ifNoneMatch_ = entityTag
  33458. return c
  33459. }
  33460. // Context sets the context to be used in this call's Do method. Any
  33461. // pending HTTP request will be aborted if the provided context is
  33462. // canceled.
  33463. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  33464. c.ctx_ = ctx
  33465. return c
  33466. }
  33467. // Header returns an http.Header that can be modified by the caller to
  33468. // add HTTP headers to the request.
  33469. func (c *HealthChecksGetCall) Header() http.Header {
  33470. if c.header_ == nil {
  33471. c.header_ = make(http.Header)
  33472. }
  33473. return c.header_
  33474. }
  33475. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  33476. reqHeaders := make(http.Header)
  33477. for k, v := range c.header_ {
  33478. reqHeaders[k] = v
  33479. }
  33480. reqHeaders.Set("User-Agent", c.s.userAgent())
  33481. if c.ifNoneMatch_ != "" {
  33482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33483. }
  33484. var body io.Reader = nil
  33485. c.urlParams_.Set("alt", alt)
  33486. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  33487. urls += "?" + c.urlParams_.Encode()
  33488. req, _ := http.NewRequest("GET", urls, body)
  33489. req.Header = reqHeaders
  33490. googleapi.Expand(req.URL, map[string]string{
  33491. "project": c.project,
  33492. "healthCheck": c.healthCheck,
  33493. })
  33494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33495. }
  33496. // Do executes the "compute.healthChecks.get" call.
  33497. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  33498. // status code is an error. Response headers are in either
  33499. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  33500. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33501. // to check whether the returned error was because
  33502. // http.StatusNotModified was returned.
  33503. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  33504. gensupport.SetOptions(c.urlParams_, opts...)
  33505. res, err := c.doRequest("json")
  33506. if res != nil && res.StatusCode == http.StatusNotModified {
  33507. if res.Body != nil {
  33508. res.Body.Close()
  33509. }
  33510. return nil, &googleapi.Error{
  33511. Code: res.StatusCode,
  33512. Header: res.Header,
  33513. }
  33514. }
  33515. if err != nil {
  33516. return nil, err
  33517. }
  33518. defer googleapi.CloseBody(res)
  33519. if err := googleapi.CheckResponse(res); err != nil {
  33520. return nil, err
  33521. }
  33522. ret := &HealthCheck{
  33523. ServerResponse: googleapi.ServerResponse{
  33524. Header: res.Header,
  33525. HTTPStatusCode: res.StatusCode,
  33526. },
  33527. }
  33528. target := &ret
  33529. if err := gensupport.DecodeResponse(target, res); err != nil {
  33530. return nil, err
  33531. }
  33532. return ret, nil
  33533. // {
  33534. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  33535. // "httpMethod": "GET",
  33536. // "id": "compute.healthChecks.get",
  33537. // "parameterOrder": [
  33538. // "project",
  33539. // "healthCheck"
  33540. // ],
  33541. // "parameters": {
  33542. // "healthCheck": {
  33543. // "description": "Name of the HealthCheck resource to return.",
  33544. // "location": "path",
  33545. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33546. // "required": true,
  33547. // "type": "string"
  33548. // },
  33549. // "project": {
  33550. // "description": "Project ID for this request.",
  33551. // "location": "path",
  33552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33553. // "required": true,
  33554. // "type": "string"
  33555. // }
  33556. // },
  33557. // "path": "{project}/global/healthChecks/{healthCheck}",
  33558. // "response": {
  33559. // "$ref": "HealthCheck"
  33560. // },
  33561. // "scopes": [
  33562. // "https://www.googleapis.com/auth/cloud-platform",
  33563. // "https://www.googleapis.com/auth/compute",
  33564. // "https://www.googleapis.com/auth/compute.readonly"
  33565. // ]
  33566. // }
  33567. }
  33568. // method id "compute.healthChecks.insert":
  33569. type HealthChecksInsertCall struct {
  33570. s *Service
  33571. project string
  33572. healthcheck *HealthCheck
  33573. urlParams_ gensupport.URLParams
  33574. ctx_ context.Context
  33575. header_ http.Header
  33576. }
  33577. // Insert: Creates a HealthCheck resource in the specified project using
  33578. // the data included in the request.
  33579. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  33580. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33581. c.project = project
  33582. c.healthcheck = healthcheck
  33583. return c
  33584. }
  33585. // RequestId sets the optional parameter "requestId": An optional
  33586. // request ID to identify requests. Specify a unique request ID so that
  33587. // if you must retry your request, the server will know to ignore the
  33588. // request if it has already been completed.
  33589. //
  33590. // For example, consider a situation where you make an initial request
  33591. // and the request times out. If you make the request again with the
  33592. // same request ID, the server can check if original operation with the
  33593. // same request ID was received, and if so, will ignore the second
  33594. // request. This prevents clients from accidentally creating duplicate
  33595. // commitments.
  33596. //
  33597. // The request ID must be a valid UUID with the exception that zero UUID
  33598. // is not supported (00000000-0000-0000-0000-000000000000).
  33599. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  33600. c.urlParams_.Set("requestId", requestId)
  33601. return c
  33602. }
  33603. // Fields allows partial responses to be retrieved. See
  33604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33605. // for more information.
  33606. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  33607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33608. return c
  33609. }
  33610. // Context sets the context to be used in this call's Do method. Any
  33611. // pending HTTP request will be aborted if the provided context is
  33612. // canceled.
  33613. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  33614. c.ctx_ = ctx
  33615. return c
  33616. }
  33617. // Header returns an http.Header that can be modified by the caller to
  33618. // add HTTP headers to the request.
  33619. func (c *HealthChecksInsertCall) Header() http.Header {
  33620. if c.header_ == nil {
  33621. c.header_ = make(http.Header)
  33622. }
  33623. return c.header_
  33624. }
  33625. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  33626. reqHeaders := make(http.Header)
  33627. for k, v := range c.header_ {
  33628. reqHeaders[k] = v
  33629. }
  33630. reqHeaders.Set("User-Agent", c.s.userAgent())
  33631. var body io.Reader = nil
  33632. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  33633. if err != nil {
  33634. return nil, err
  33635. }
  33636. reqHeaders.Set("Content-Type", "application/json")
  33637. c.urlParams_.Set("alt", alt)
  33638. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  33639. urls += "?" + c.urlParams_.Encode()
  33640. req, _ := http.NewRequest("POST", urls, body)
  33641. req.Header = reqHeaders
  33642. googleapi.Expand(req.URL, map[string]string{
  33643. "project": c.project,
  33644. })
  33645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33646. }
  33647. // Do executes the "compute.healthChecks.insert" call.
  33648. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33649. // status code is an error. Response headers are in either
  33650. // *Operation.ServerResponse.Header or (if a response was returned at
  33651. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33652. // to check whether the returned error was because
  33653. // http.StatusNotModified was returned.
  33654. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33655. gensupport.SetOptions(c.urlParams_, opts...)
  33656. res, err := c.doRequest("json")
  33657. if res != nil && res.StatusCode == http.StatusNotModified {
  33658. if res.Body != nil {
  33659. res.Body.Close()
  33660. }
  33661. return nil, &googleapi.Error{
  33662. Code: res.StatusCode,
  33663. Header: res.Header,
  33664. }
  33665. }
  33666. if err != nil {
  33667. return nil, err
  33668. }
  33669. defer googleapi.CloseBody(res)
  33670. if err := googleapi.CheckResponse(res); err != nil {
  33671. return nil, err
  33672. }
  33673. ret := &Operation{
  33674. ServerResponse: googleapi.ServerResponse{
  33675. Header: res.Header,
  33676. HTTPStatusCode: res.StatusCode,
  33677. },
  33678. }
  33679. target := &ret
  33680. if err := gensupport.DecodeResponse(target, res); err != nil {
  33681. return nil, err
  33682. }
  33683. return ret, nil
  33684. // {
  33685. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  33686. // "httpMethod": "POST",
  33687. // "id": "compute.healthChecks.insert",
  33688. // "parameterOrder": [
  33689. // "project"
  33690. // ],
  33691. // "parameters": {
  33692. // "project": {
  33693. // "description": "Project ID for this request.",
  33694. // "location": "path",
  33695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33696. // "required": true,
  33697. // "type": "string"
  33698. // },
  33699. // "requestId": {
  33700. // "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).",
  33701. // "location": "query",
  33702. // "type": "string"
  33703. // }
  33704. // },
  33705. // "path": "{project}/global/healthChecks",
  33706. // "request": {
  33707. // "$ref": "HealthCheck"
  33708. // },
  33709. // "response": {
  33710. // "$ref": "Operation"
  33711. // },
  33712. // "scopes": [
  33713. // "https://www.googleapis.com/auth/cloud-platform",
  33714. // "https://www.googleapis.com/auth/compute"
  33715. // ]
  33716. // }
  33717. }
  33718. // method id "compute.healthChecks.list":
  33719. type HealthChecksListCall struct {
  33720. s *Service
  33721. project string
  33722. urlParams_ gensupport.URLParams
  33723. ifNoneMatch_ string
  33724. ctx_ context.Context
  33725. header_ http.Header
  33726. }
  33727. // List: Retrieves the list of HealthCheck resources available to the
  33728. // specified project.
  33729. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  33730. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33731. c.project = project
  33732. return c
  33733. }
  33734. // Filter sets the optional parameter "filter": A filter expression that
  33735. // filters resources listed in the response. The expression must specify
  33736. // the field name, a comparison operator, and the value that you want to
  33737. // use for filtering. The value must be a string, a number, or a
  33738. // boolean. The comparison operator must be either =, !=, >, or <.
  33739. //
  33740. // For example, if you are filtering Compute Engine instances, you can
  33741. // exclude instances named example-instance by specifying name !=
  33742. // example-instance.
  33743. //
  33744. // You can also filter nested fields. For example, you could specify
  33745. // scheduling.automaticRestart = false to include instances only if they
  33746. // are not scheduled for automatic restarts. You can use filtering on
  33747. // nested fields to filter based on resource labels.
  33748. //
  33749. // To filter on multiple expressions, provide each separate expression
  33750. // within parentheses. For example, (scheduling.automaticRestart = true)
  33751. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33752. // AND expression. However, you can include AND and OR expressions
  33753. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33754. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33755. // true).
  33756. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  33757. c.urlParams_.Set("filter", filter)
  33758. return c
  33759. }
  33760. // MaxResults sets the optional parameter "maxResults": The maximum
  33761. // number of results per page that should be returned. If the number of
  33762. // available results is larger than maxResults, Compute Engine returns a
  33763. // nextPageToken that can be used to get the next page of results in
  33764. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33765. // (Default: 500)
  33766. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  33767. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33768. return c
  33769. }
  33770. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33771. // a certain order. By default, results are returned in alphanumerical
  33772. // order based on the resource name.
  33773. //
  33774. // You can also sort results in descending order based on the creation
  33775. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33776. // based on the creationTimestamp field in reverse chronological order
  33777. // (newest result first). Use this to sort resources like operations so
  33778. // that the newest operation is returned first.
  33779. //
  33780. // Currently, only sorting by name or creationTimestamp desc is
  33781. // supported.
  33782. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  33783. c.urlParams_.Set("orderBy", orderBy)
  33784. return c
  33785. }
  33786. // PageToken sets the optional parameter "pageToken": Specifies a page
  33787. // token to use. Set pageToken to the nextPageToken returned by a
  33788. // previous list request to get the next page of results.
  33789. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  33790. c.urlParams_.Set("pageToken", pageToken)
  33791. return c
  33792. }
  33793. // Fields allows partial responses to be retrieved. See
  33794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33795. // for more information.
  33796. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  33797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33798. return c
  33799. }
  33800. // IfNoneMatch sets the optional parameter which makes the operation
  33801. // fail if the object's ETag matches the given value. This is useful for
  33802. // getting updates only after the object has changed since the last
  33803. // request. Use googleapi.IsNotModified to check whether the response
  33804. // error from Do is the result of In-None-Match.
  33805. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  33806. c.ifNoneMatch_ = entityTag
  33807. return c
  33808. }
  33809. // Context sets the context to be used in this call's Do method. Any
  33810. // pending HTTP request will be aborted if the provided context is
  33811. // canceled.
  33812. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  33813. c.ctx_ = ctx
  33814. return c
  33815. }
  33816. // Header returns an http.Header that can be modified by the caller to
  33817. // add HTTP headers to the request.
  33818. func (c *HealthChecksListCall) Header() http.Header {
  33819. if c.header_ == nil {
  33820. c.header_ = make(http.Header)
  33821. }
  33822. return c.header_
  33823. }
  33824. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  33825. reqHeaders := make(http.Header)
  33826. for k, v := range c.header_ {
  33827. reqHeaders[k] = v
  33828. }
  33829. reqHeaders.Set("User-Agent", c.s.userAgent())
  33830. if c.ifNoneMatch_ != "" {
  33831. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33832. }
  33833. var body io.Reader = nil
  33834. c.urlParams_.Set("alt", alt)
  33835. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  33836. urls += "?" + c.urlParams_.Encode()
  33837. req, _ := http.NewRequest("GET", urls, body)
  33838. req.Header = reqHeaders
  33839. googleapi.Expand(req.URL, map[string]string{
  33840. "project": c.project,
  33841. })
  33842. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33843. }
  33844. // Do executes the "compute.healthChecks.list" call.
  33845. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  33846. // status code is an error. Response headers are in either
  33847. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  33848. // at all) in error.(*googleapi.Error).Header. Use
  33849. // googleapi.IsNotModified to check whether the returned error was
  33850. // because http.StatusNotModified was returned.
  33851. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  33852. gensupport.SetOptions(c.urlParams_, opts...)
  33853. res, err := c.doRequest("json")
  33854. if res != nil && res.StatusCode == http.StatusNotModified {
  33855. if res.Body != nil {
  33856. res.Body.Close()
  33857. }
  33858. return nil, &googleapi.Error{
  33859. Code: res.StatusCode,
  33860. Header: res.Header,
  33861. }
  33862. }
  33863. if err != nil {
  33864. return nil, err
  33865. }
  33866. defer googleapi.CloseBody(res)
  33867. if err := googleapi.CheckResponse(res); err != nil {
  33868. return nil, err
  33869. }
  33870. ret := &HealthCheckList{
  33871. ServerResponse: googleapi.ServerResponse{
  33872. Header: res.Header,
  33873. HTTPStatusCode: res.StatusCode,
  33874. },
  33875. }
  33876. target := &ret
  33877. if err := gensupport.DecodeResponse(target, res); err != nil {
  33878. return nil, err
  33879. }
  33880. return ret, nil
  33881. // {
  33882. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  33883. // "httpMethod": "GET",
  33884. // "id": "compute.healthChecks.list",
  33885. // "parameterOrder": [
  33886. // "project"
  33887. // ],
  33888. // "parameters": {
  33889. // "filter": {
  33890. // "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).",
  33891. // "location": "query",
  33892. // "type": "string"
  33893. // },
  33894. // "maxResults": {
  33895. // "default": "500",
  33896. // "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)",
  33897. // "format": "uint32",
  33898. // "location": "query",
  33899. // "minimum": "0",
  33900. // "type": "integer"
  33901. // },
  33902. // "orderBy": {
  33903. // "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.",
  33904. // "location": "query",
  33905. // "type": "string"
  33906. // },
  33907. // "pageToken": {
  33908. // "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.",
  33909. // "location": "query",
  33910. // "type": "string"
  33911. // },
  33912. // "project": {
  33913. // "description": "Project ID for this request.",
  33914. // "location": "path",
  33915. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33916. // "required": true,
  33917. // "type": "string"
  33918. // }
  33919. // },
  33920. // "path": "{project}/global/healthChecks",
  33921. // "response": {
  33922. // "$ref": "HealthCheckList"
  33923. // },
  33924. // "scopes": [
  33925. // "https://www.googleapis.com/auth/cloud-platform",
  33926. // "https://www.googleapis.com/auth/compute",
  33927. // "https://www.googleapis.com/auth/compute.readonly"
  33928. // ]
  33929. // }
  33930. }
  33931. // Pages invokes f for each page of results.
  33932. // A non-nil error returned from f will halt the iteration.
  33933. // The provided context supersedes any context provided to the Context method.
  33934. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  33935. c.ctx_ = ctx
  33936. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33937. for {
  33938. x, err := c.Do()
  33939. if err != nil {
  33940. return err
  33941. }
  33942. if err := f(x); err != nil {
  33943. return err
  33944. }
  33945. if x.NextPageToken == "" {
  33946. return nil
  33947. }
  33948. c.PageToken(x.NextPageToken)
  33949. }
  33950. }
  33951. // method id "compute.healthChecks.patch":
  33952. type HealthChecksPatchCall struct {
  33953. s *Service
  33954. project string
  33955. healthCheck string
  33956. healthcheck *HealthCheck
  33957. urlParams_ gensupport.URLParams
  33958. ctx_ context.Context
  33959. header_ http.Header
  33960. }
  33961. // Patch: Updates a HealthCheck resource in the specified project using
  33962. // the data included in the request. This method supports PATCH
  33963. // semantics and uses the JSON merge patch format and processing rules.
  33964. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  33965. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33966. c.project = project
  33967. c.healthCheck = healthCheck
  33968. c.healthcheck = healthcheck
  33969. return c
  33970. }
  33971. // RequestId sets the optional parameter "requestId": An optional
  33972. // request ID to identify requests. Specify a unique request ID so that
  33973. // if you must retry your request, the server will know to ignore the
  33974. // request if it has already been completed.
  33975. //
  33976. // For example, consider a situation where you make an initial request
  33977. // and the request times out. If you make the request again with the
  33978. // same request ID, the server can check if original operation with the
  33979. // same request ID was received, and if so, will ignore the second
  33980. // request. This prevents clients from accidentally creating duplicate
  33981. // commitments.
  33982. //
  33983. // The request ID must be a valid UUID with the exception that zero UUID
  33984. // is not supported (00000000-0000-0000-0000-000000000000).
  33985. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  33986. c.urlParams_.Set("requestId", requestId)
  33987. return c
  33988. }
  33989. // Fields allows partial responses to be retrieved. See
  33990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33991. // for more information.
  33992. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  33993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33994. return c
  33995. }
  33996. // Context sets the context to be used in this call's Do method. Any
  33997. // pending HTTP request will be aborted if the provided context is
  33998. // canceled.
  33999. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  34000. c.ctx_ = ctx
  34001. return c
  34002. }
  34003. // Header returns an http.Header that can be modified by the caller to
  34004. // add HTTP headers to the request.
  34005. func (c *HealthChecksPatchCall) Header() http.Header {
  34006. if c.header_ == nil {
  34007. c.header_ = make(http.Header)
  34008. }
  34009. return c.header_
  34010. }
  34011. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  34012. reqHeaders := make(http.Header)
  34013. for k, v := range c.header_ {
  34014. reqHeaders[k] = v
  34015. }
  34016. reqHeaders.Set("User-Agent", c.s.userAgent())
  34017. var body io.Reader = nil
  34018. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  34019. if err != nil {
  34020. return nil, err
  34021. }
  34022. reqHeaders.Set("Content-Type", "application/json")
  34023. c.urlParams_.Set("alt", alt)
  34024. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  34025. urls += "?" + c.urlParams_.Encode()
  34026. req, _ := http.NewRequest("PATCH", urls, body)
  34027. req.Header = reqHeaders
  34028. googleapi.Expand(req.URL, map[string]string{
  34029. "project": c.project,
  34030. "healthCheck": c.healthCheck,
  34031. })
  34032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34033. }
  34034. // Do executes the "compute.healthChecks.patch" call.
  34035. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34036. // status code is an error. Response headers are in either
  34037. // *Operation.ServerResponse.Header or (if a response was returned at
  34038. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34039. // to check whether the returned error was because
  34040. // http.StatusNotModified was returned.
  34041. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34042. gensupport.SetOptions(c.urlParams_, opts...)
  34043. res, err := c.doRequest("json")
  34044. if res != nil && res.StatusCode == http.StatusNotModified {
  34045. if res.Body != nil {
  34046. res.Body.Close()
  34047. }
  34048. return nil, &googleapi.Error{
  34049. Code: res.StatusCode,
  34050. Header: res.Header,
  34051. }
  34052. }
  34053. if err != nil {
  34054. return nil, err
  34055. }
  34056. defer googleapi.CloseBody(res)
  34057. if err := googleapi.CheckResponse(res); err != nil {
  34058. return nil, err
  34059. }
  34060. ret := &Operation{
  34061. ServerResponse: googleapi.ServerResponse{
  34062. Header: res.Header,
  34063. HTTPStatusCode: res.StatusCode,
  34064. },
  34065. }
  34066. target := &ret
  34067. if err := gensupport.DecodeResponse(target, res); err != nil {
  34068. return nil, err
  34069. }
  34070. return ret, nil
  34071. // {
  34072. // "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.",
  34073. // "httpMethod": "PATCH",
  34074. // "id": "compute.healthChecks.patch",
  34075. // "parameterOrder": [
  34076. // "project",
  34077. // "healthCheck"
  34078. // ],
  34079. // "parameters": {
  34080. // "healthCheck": {
  34081. // "description": "Name of the HealthCheck resource to patch.",
  34082. // "location": "path",
  34083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34084. // "required": true,
  34085. // "type": "string"
  34086. // },
  34087. // "project": {
  34088. // "description": "Project ID for this request.",
  34089. // "location": "path",
  34090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34091. // "required": true,
  34092. // "type": "string"
  34093. // },
  34094. // "requestId": {
  34095. // "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).",
  34096. // "location": "query",
  34097. // "type": "string"
  34098. // }
  34099. // },
  34100. // "path": "{project}/global/healthChecks/{healthCheck}",
  34101. // "request": {
  34102. // "$ref": "HealthCheck"
  34103. // },
  34104. // "response": {
  34105. // "$ref": "Operation"
  34106. // },
  34107. // "scopes": [
  34108. // "https://www.googleapis.com/auth/cloud-platform",
  34109. // "https://www.googleapis.com/auth/compute"
  34110. // ]
  34111. // }
  34112. }
  34113. // method id "compute.healthChecks.update":
  34114. type HealthChecksUpdateCall struct {
  34115. s *Service
  34116. project string
  34117. healthCheck string
  34118. healthcheck *HealthCheck
  34119. urlParams_ gensupport.URLParams
  34120. ctx_ context.Context
  34121. header_ http.Header
  34122. }
  34123. // Update: Updates a HealthCheck resource in the specified project using
  34124. // the data included in the request.
  34125. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  34126. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34127. c.project = project
  34128. c.healthCheck = healthCheck
  34129. c.healthcheck = healthcheck
  34130. return c
  34131. }
  34132. // RequestId sets the optional parameter "requestId": An optional
  34133. // request ID to identify requests. Specify a unique request ID so that
  34134. // if you must retry your request, the server will know to ignore the
  34135. // request if it has already been completed.
  34136. //
  34137. // For example, consider a situation where you make an initial request
  34138. // and the request times out. If you make the request again with the
  34139. // same request ID, the server can check if original operation with the
  34140. // same request ID was received, and if so, will ignore the second
  34141. // request. This prevents clients from accidentally creating duplicate
  34142. // commitments.
  34143. //
  34144. // The request ID must be a valid UUID with the exception that zero UUID
  34145. // is not supported (00000000-0000-0000-0000-000000000000).
  34146. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  34147. c.urlParams_.Set("requestId", requestId)
  34148. return c
  34149. }
  34150. // Fields allows partial responses to be retrieved. See
  34151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34152. // for more information.
  34153. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  34154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34155. return c
  34156. }
  34157. // Context sets the context to be used in this call's Do method. Any
  34158. // pending HTTP request will be aborted if the provided context is
  34159. // canceled.
  34160. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  34161. c.ctx_ = ctx
  34162. return c
  34163. }
  34164. // Header returns an http.Header that can be modified by the caller to
  34165. // add HTTP headers to the request.
  34166. func (c *HealthChecksUpdateCall) Header() http.Header {
  34167. if c.header_ == nil {
  34168. c.header_ = make(http.Header)
  34169. }
  34170. return c.header_
  34171. }
  34172. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  34173. reqHeaders := make(http.Header)
  34174. for k, v := range c.header_ {
  34175. reqHeaders[k] = v
  34176. }
  34177. reqHeaders.Set("User-Agent", c.s.userAgent())
  34178. var body io.Reader = nil
  34179. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  34180. if err != nil {
  34181. return nil, err
  34182. }
  34183. reqHeaders.Set("Content-Type", "application/json")
  34184. c.urlParams_.Set("alt", alt)
  34185. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  34186. urls += "?" + c.urlParams_.Encode()
  34187. req, _ := http.NewRequest("PUT", urls, body)
  34188. req.Header = reqHeaders
  34189. googleapi.Expand(req.URL, map[string]string{
  34190. "project": c.project,
  34191. "healthCheck": c.healthCheck,
  34192. })
  34193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34194. }
  34195. // Do executes the "compute.healthChecks.update" call.
  34196. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34197. // status code is an error. Response headers are in either
  34198. // *Operation.ServerResponse.Header or (if a response was returned at
  34199. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34200. // to check whether the returned error was because
  34201. // http.StatusNotModified was returned.
  34202. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34203. gensupport.SetOptions(c.urlParams_, opts...)
  34204. res, err := c.doRequest("json")
  34205. if res != nil && res.StatusCode == http.StatusNotModified {
  34206. if res.Body != nil {
  34207. res.Body.Close()
  34208. }
  34209. return nil, &googleapi.Error{
  34210. Code: res.StatusCode,
  34211. Header: res.Header,
  34212. }
  34213. }
  34214. if err != nil {
  34215. return nil, err
  34216. }
  34217. defer googleapi.CloseBody(res)
  34218. if err := googleapi.CheckResponse(res); err != nil {
  34219. return nil, err
  34220. }
  34221. ret := &Operation{
  34222. ServerResponse: googleapi.ServerResponse{
  34223. Header: res.Header,
  34224. HTTPStatusCode: res.StatusCode,
  34225. },
  34226. }
  34227. target := &ret
  34228. if err := gensupport.DecodeResponse(target, res); err != nil {
  34229. return nil, err
  34230. }
  34231. return ret, nil
  34232. // {
  34233. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  34234. // "httpMethod": "PUT",
  34235. // "id": "compute.healthChecks.update",
  34236. // "parameterOrder": [
  34237. // "project",
  34238. // "healthCheck"
  34239. // ],
  34240. // "parameters": {
  34241. // "healthCheck": {
  34242. // "description": "Name of the HealthCheck resource to update.",
  34243. // "location": "path",
  34244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34245. // "required": true,
  34246. // "type": "string"
  34247. // },
  34248. // "project": {
  34249. // "description": "Project ID for this request.",
  34250. // "location": "path",
  34251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34252. // "required": true,
  34253. // "type": "string"
  34254. // },
  34255. // "requestId": {
  34256. // "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).",
  34257. // "location": "query",
  34258. // "type": "string"
  34259. // }
  34260. // },
  34261. // "path": "{project}/global/healthChecks/{healthCheck}",
  34262. // "request": {
  34263. // "$ref": "HealthCheck"
  34264. // },
  34265. // "response": {
  34266. // "$ref": "Operation"
  34267. // },
  34268. // "scopes": [
  34269. // "https://www.googleapis.com/auth/cloud-platform",
  34270. // "https://www.googleapis.com/auth/compute"
  34271. // ]
  34272. // }
  34273. }
  34274. // method id "compute.httpHealthChecks.delete":
  34275. type HttpHealthChecksDeleteCall struct {
  34276. s *Service
  34277. project string
  34278. httpHealthCheck string
  34279. urlParams_ gensupport.URLParams
  34280. ctx_ context.Context
  34281. header_ http.Header
  34282. }
  34283. // Delete: Deletes the specified HttpHealthCheck resource.
  34284. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  34285. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  34286. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34287. c.project = project
  34288. c.httpHealthCheck = httpHealthCheck
  34289. return c
  34290. }
  34291. // RequestId sets the optional parameter "requestId": An optional
  34292. // request ID to identify requests. Specify a unique request ID so that
  34293. // if you must retry your request, the server will know to ignore the
  34294. // request if it has already been completed.
  34295. //
  34296. // For example, consider a situation where you make an initial request
  34297. // and the request times out. If you make the request again with the
  34298. // same request ID, the server can check if original operation with the
  34299. // same request ID was received, and if so, will ignore the second
  34300. // request. This prevents clients from accidentally creating duplicate
  34301. // commitments.
  34302. //
  34303. // The request ID must be a valid UUID with the exception that zero UUID
  34304. // is not supported (00000000-0000-0000-0000-000000000000).
  34305. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  34306. c.urlParams_.Set("requestId", requestId)
  34307. return c
  34308. }
  34309. // Fields allows partial responses to be retrieved. See
  34310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34311. // for more information.
  34312. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  34313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34314. return c
  34315. }
  34316. // Context sets the context to be used in this call's Do method. Any
  34317. // pending HTTP request will be aborted if the provided context is
  34318. // canceled.
  34319. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  34320. c.ctx_ = ctx
  34321. return c
  34322. }
  34323. // Header returns an http.Header that can be modified by the caller to
  34324. // add HTTP headers to the request.
  34325. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  34326. if c.header_ == nil {
  34327. c.header_ = make(http.Header)
  34328. }
  34329. return c.header_
  34330. }
  34331. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  34332. reqHeaders := make(http.Header)
  34333. for k, v := range c.header_ {
  34334. reqHeaders[k] = v
  34335. }
  34336. reqHeaders.Set("User-Agent", c.s.userAgent())
  34337. var body io.Reader = nil
  34338. c.urlParams_.Set("alt", alt)
  34339. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  34340. urls += "?" + c.urlParams_.Encode()
  34341. req, _ := http.NewRequest("DELETE", urls, body)
  34342. req.Header = reqHeaders
  34343. googleapi.Expand(req.URL, map[string]string{
  34344. "project": c.project,
  34345. "httpHealthCheck": c.httpHealthCheck,
  34346. })
  34347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34348. }
  34349. // Do executes the "compute.httpHealthChecks.delete" call.
  34350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34351. // status code is an error. Response headers are in either
  34352. // *Operation.ServerResponse.Header or (if a response was returned at
  34353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34354. // to check whether the returned error was because
  34355. // http.StatusNotModified was returned.
  34356. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34357. gensupport.SetOptions(c.urlParams_, opts...)
  34358. res, err := c.doRequest("json")
  34359. if res != nil && res.StatusCode == http.StatusNotModified {
  34360. if res.Body != nil {
  34361. res.Body.Close()
  34362. }
  34363. return nil, &googleapi.Error{
  34364. Code: res.StatusCode,
  34365. Header: res.Header,
  34366. }
  34367. }
  34368. if err != nil {
  34369. return nil, err
  34370. }
  34371. defer googleapi.CloseBody(res)
  34372. if err := googleapi.CheckResponse(res); err != nil {
  34373. return nil, err
  34374. }
  34375. ret := &Operation{
  34376. ServerResponse: googleapi.ServerResponse{
  34377. Header: res.Header,
  34378. HTTPStatusCode: res.StatusCode,
  34379. },
  34380. }
  34381. target := &ret
  34382. if err := gensupport.DecodeResponse(target, res); err != nil {
  34383. return nil, err
  34384. }
  34385. return ret, nil
  34386. // {
  34387. // "description": "Deletes the specified HttpHealthCheck resource.",
  34388. // "httpMethod": "DELETE",
  34389. // "id": "compute.httpHealthChecks.delete",
  34390. // "parameterOrder": [
  34391. // "project",
  34392. // "httpHealthCheck"
  34393. // ],
  34394. // "parameters": {
  34395. // "httpHealthCheck": {
  34396. // "description": "Name of the HttpHealthCheck resource to delete.",
  34397. // "location": "path",
  34398. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34399. // "required": true,
  34400. // "type": "string"
  34401. // },
  34402. // "project": {
  34403. // "description": "Project ID for this request.",
  34404. // "location": "path",
  34405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34406. // "required": true,
  34407. // "type": "string"
  34408. // },
  34409. // "requestId": {
  34410. // "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).",
  34411. // "location": "query",
  34412. // "type": "string"
  34413. // }
  34414. // },
  34415. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  34416. // "response": {
  34417. // "$ref": "Operation"
  34418. // },
  34419. // "scopes": [
  34420. // "https://www.googleapis.com/auth/cloud-platform",
  34421. // "https://www.googleapis.com/auth/compute"
  34422. // ]
  34423. // }
  34424. }
  34425. // method id "compute.httpHealthChecks.get":
  34426. type HttpHealthChecksGetCall struct {
  34427. s *Service
  34428. project string
  34429. httpHealthCheck string
  34430. urlParams_ gensupport.URLParams
  34431. ifNoneMatch_ string
  34432. ctx_ context.Context
  34433. header_ http.Header
  34434. }
  34435. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  34436. // available HTTP health checks by making a list() request.
  34437. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  34438. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  34439. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34440. c.project = project
  34441. c.httpHealthCheck = httpHealthCheck
  34442. return c
  34443. }
  34444. // Fields allows partial responses to be retrieved. See
  34445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34446. // for more information.
  34447. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  34448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34449. return c
  34450. }
  34451. // IfNoneMatch sets the optional parameter which makes the operation
  34452. // fail if the object's ETag matches the given value. This is useful for
  34453. // getting updates only after the object has changed since the last
  34454. // request. Use googleapi.IsNotModified to check whether the response
  34455. // error from Do is the result of In-None-Match.
  34456. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  34457. c.ifNoneMatch_ = entityTag
  34458. return c
  34459. }
  34460. // Context sets the context to be used in this call's Do method. Any
  34461. // pending HTTP request will be aborted if the provided context is
  34462. // canceled.
  34463. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  34464. c.ctx_ = ctx
  34465. return c
  34466. }
  34467. // Header returns an http.Header that can be modified by the caller to
  34468. // add HTTP headers to the request.
  34469. func (c *HttpHealthChecksGetCall) Header() http.Header {
  34470. if c.header_ == nil {
  34471. c.header_ = make(http.Header)
  34472. }
  34473. return c.header_
  34474. }
  34475. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  34476. reqHeaders := make(http.Header)
  34477. for k, v := range c.header_ {
  34478. reqHeaders[k] = v
  34479. }
  34480. reqHeaders.Set("User-Agent", c.s.userAgent())
  34481. if c.ifNoneMatch_ != "" {
  34482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34483. }
  34484. var body io.Reader = nil
  34485. c.urlParams_.Set("alt", alt)
  34486. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  34487. urls += "?" + c.urlParams_.Encode()
  34488. req, _ := http.NewRequest("GET", urls, body)
  34489. req.Header = reqHeaders
  34490. googleapi.Expand(req.URL, map[string]string{
  34491. "project": c.project,
  34492. "httpHealthCheck": c.httpHealthCheck,
  34493. })
  34494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34495. }
  34496. // Do executes the "compute.httpHealthChecks.get" call.
  34497. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  34498. // status code is an error. Response headers are in either
  34499. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  34500. // at all) in error.(*googleapi.Error).Header. Use
  34501. // googleapi.IsNotModified to check whether the returned error was
  34502. // because http.StatusNotModified was returned.
  34503. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  34504. gensupport.SetOptions(c.urlParams_, opts...)
  34505. res, err := c.doRequest("json")
  34506. if res != nil && res.StatusCode == http.StatusNotModified {
  34507. if res.Body != nil {
  34508. res.Body.Close()
  34509. }
  34510. return nil, &googleapi.Error{
  34511. Code: res.StatusCode,
  34512. Header: res.Header,
  34513. }
  34514. }
  34515. if err != nil {
  34516. return nil, err
  34517. }
  34518. defer googleapi.CloseBody(res)
  34519. if err := googleapi.CheckResponse(res); err != nil {
  34520. return nil, err
  34521. }
  34522. ret := &HttpHealthCheck{
  34523. ServerResponse: googleapi.ServerResponse{
  34524. Header: res.Header,
  34525. HTTPStatusCode: res.StatusCode,
  34526. },
  34527. }
  34528. target := &ret
  34529. if err := gensupport.DecodeResponse(target, res); err != nil {
  34530. return nil, err
  34531. }
  34532. return ret, nil
  34533. // {
  34534. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  34535. // "httpMethod": "GET",
  34536. // "id": "compute.httpHealthChecks.get",
  34537. // "parameterOrder": [
  34538. // "project",
  34539. // "httpHealthCheck"
  34540. // ],
  34541. // "parameters": {
  34542. // "httpHealthCheck": {
  34543. // "description": "Name of the HttpHealthCheck resource to return.",
  34544. // "location": "path",
  34545. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34546. // "required": true,
  34547. // "type": "string"
  34548. // },
  34549. // "project": {
  34550. // "description": "Project ID for this request.",
  34551. // "location": "path",
  34552. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34553. // "required": true,
  34554. // "type": "string"
  34555. // }
  34556. // },
  34557. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  34558. // "response": {
  34559. // "$ref": "HttpHealthCheck"
  34560. // },
  34561. // "scopes": [
  34562. // "https://www.googleapis.com/auth/cloud-platform",
  34563. // "https://www.googleapis.com/auth/compute",
  34564. // "https://www.googleapis.com/auth/compute.readonly"
  34565. // ]
  34566. // }
  34567. }
  34568. // method id "compute.httpHealthChecks.insert":
  34569. type HttpHealthChecksInsertCall struct {
  34570. s *Service
  34571. project string
  34572. httphealthcheck *HttpHealthCheck
  34573. urlParams_ gensupport.URLParams
  34574. ctx_ context.Context
  34575. header_ http.Header
  34576. }
  34577. // Insert: Creates a HttpHealthCheck resource in the specified project
  34578. // using the data included in the request.
  34579. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  34580. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  34581. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34582. c.project = project
  34583. c.httphealthcheck = httphealthcheck
  34584. return c
  34585. }
  34586. // RequestId sets the optional parameter "requestId": An optional
  34587. // request ID to identify requests. Specify a unique request ID so that
  34588. // if you must retry your request, the server will know to ignore the
  34589. // request if it has already been completed.
  34590. //
  34591. // For example, consider a situation where you make an initial request
  34592. // and the request times out. If you make the request again with the
  34593. // same request ID, the server can check if original operation with the
  34594. // same request ID was received, and if so, will ignore the second
  34595. // request. This prevents clients from accidentally creating duplicate
  34596. // commitments.
  34597. //
  34598. // The request ID must be a valid UUID with the exception that zero UUID
  34599. // is not supported (00000000-0000-0000-0000-000000000000).
  34600. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  34601. c.urlParams_.Set("requestId", requestId)
  34602. return c
  34603. }
  34604. // Fields allows partial responses to be retrieved. See
  34605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34606. // for more information.
  34607. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  34608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34609. return c
  34610. }
  34611. // Context sets the context to be used in this call's Do method. Any
  34612. // pending HTTP request will be aborted if the provided context is
  34613. // canceled.
  34614. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  34615. c.ctx_ = ctx
  34616. return c
  34617. }
  34618. // Header returns an http.Header that can be modified by the caller to
  34619. // add HTTP headers to the request.
  34620. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  34621. if c.header_ == nil {
  34622. c.header_ = make(http.Header)
  34623. }
  34624. return c.header_
  34625. }
  34626. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  34627. reqHeaders := make(http.Header)
  34628. for k, v := range c.header_ {
  34629. reqHeaders[k] = v
  34630. }
  34631. reqHeaders.Set("User-Agent", c.s.userAgent())
  34632. var body io.Reader = nil
  34633. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  34634. if err != nil {
  34635. return nil, err
  34636. }
  34637. reqHeaders.Set("Content-Type", "application/json")
  34638. c.urlParams_.Set("alt", alt)
  34639. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  34640. urls += "?" + c.urlParams_.Encode()
  34641. req, _ := http.NewRequest("POST", urls, body)
  34642. req.Header = reqHeaders
  34643. googleapi.Expand(req.URL, map[string]string{
  34644. "project": c.project,
  34645. })
  34646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34647. }
  34648. // Do executes the "compute.httpHealthChecks.insert" call.
  34649. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34650. // status code is an error. Response headers are in either
  34651. // *Operation.ServerResponse.Header or (if a response was returned at
  34652. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34653. // to check whether the returned error was because
  34654. // http.StatusNotModified was returned.
  34655. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34656. gensupport.SetOptions(c.urlParams_, opts...)
  34657. res, err := c.doRequest("json")
  34658. if res != nil && res.StatusCode == http.StatusNotModified {
  34659. if res.Body != nil {
  34660. res.Body.Close()
  34661. }
  34662. return nil, &googleapi.Error{
  34663. Code: res.StatusCode,
  34664. Header: res.Header,
  34665. }
  34666. }
  34667. if err != nil {
  34668. return nil, err
  34669. }
  34670. defer googleapi.CloseBody(res)
  34671. if err := googleapi.CheckResponse(res); err != nil {
  34672. return nil, err
  34673. }
  34674. ret := &Operation{
  34675. ServerResponse: googleapi.ServerResponse{
  34676. Header: res.Header,
  34677. HTTPStatusCode: res.StatusCode,
  34678. },
  34679. }
  34680. target := &ret
  34681. if err := gensupport.DecodeResponse(target, res); err != nil {
  34682. return nil, err
  34683. }
  34684. return ret, nil
  34685. // {
  34686. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  34687. // "httpMethod": "POST",
  34688. // "id": "compute.httpHealthChecks.insert",
  34689. // "parameterOrder": [
  34690. // "project"
  34691. // ],
  34692. // "parameters": {
  34693. // "project": {
  34694. // "description": "Project ID for this request.",
  34695. // "location": "path",
  34696. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34697. // "required": true,
  34698. // "type": "string"
  34699. // },
  34700. // "requestId": {
  34701. // "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).",
  34702. // "location": "query",
  34703. // "type": "string"
  34704. // }
  34705. // },
  34706. // "path": "{project}/global/httpHealthChecks",
  34707. // "request": {
  34708. // "$ref": "HttpHealthCheck"
  34709. // },
  34710. // "response": {
  34711. // "$ref": "Operation"
  34712. // },
  34713. // "scopes": [
  34714. // "https://www.googleapis.com/auth/cloud-platform",
  34715. // "https://www.googleapis.com/auth/compute"
  34716. // ]
  34717. // }
  34718. }
  34719. // method id "compute.httpHealthChecks.list":
  34720. type HttpHealthChecksListCall struct {
  34721. s *Service
  34722. project string
  34723. urlParams_ gensupport.URLParams
  34724. ifNoneMatch_ string
  34725. ctx_ context.Context
  34726. header_ http.Header
  34727. }
  34728. // List: Retrieves the list of HttpHealthCheck resources available to
  34729. // the specified project.
  34730. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  34731. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  34732. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34733. c.project = project
  34734. return c
  34735. }
  34736. // Filter sets the optional parameter "filter": A filter expression that
  34737. // filters resources listed in the response. The expression must specify
  34738. // the field name, a comparison operator, and the value that you want to
  34739. // use for filtering. The value must be a string, a number, or a
  34740. // boolean. The comparison operator must be either =, !=, >, or <.
  34741. //
  34742. // For example, if you are filtering Compute Engine instances, you can
  34743. // exclude instances named example-instance by specifying name !=
  34744. // example-instance.
  34745. //
  34746. // You can also filter nested fields. For example, you could specify
  34747. // scheduling.automaticRestart = false to include instances only if they
  34748. // are not scheduled for automatic restarts. You can use filtering on
  34749. // nested fields to filter based on resource labels.
  34750. //
  34751. // To filter on multiple expressions, provide each separate expression
  34752. // within parentheses. For example, (scheduling.automaticRestart = true)
  34753. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  34754. // AND expression. However, you can include AND and OR expressions
  34755. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  34756. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  34757. // true).
  34758. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  34759. c.urlParams_.Set("filter", filter)
  34760. return c
  34761. }
  34762. // MaxResults sets the optional parameter "maxResults": The maximum
  34763. // number of results per page that should be returned. If the number of
  34764. // available results is larger than maxResults, Compute Engine returns a
  34765. // nextPageToken that can be used to get the next page of results in
  34766. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34767. // (Default: 500)
  34768. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  34769. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34770. return c
  34771. }
  34772. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34773. // a certain order. By default, results are returned in alphanumerical
  34774. // order based on the resource name.
  34775. //
  34776. // You can also sort results in descending order based on the creation
  34777. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34778. // based on the creationTimestamp field in reverse chronological order
  34779. // (newest result first). Use this to sort resources like operations so
  34780. // that the newest operation is returned first.
  34781. //
  34782. // Currently, only sorting by name or creationTimestamp desc is
  34783. // supported.
  34784. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  34785. c.urlParams_.Set("orderBy", orderBy)
  34786. return c
  34787. }
  34788. // PageToken sets the optional parameter "pageToken": Specifies a page
  34789. // token to use. Set pageToken to the nextPageToken returned by a
  34790. // previous list request to get the next page of results.
  34791. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  34792. c.urlParams_.Set("pageToken", pageToken)
  34793. return c
  34794. }
  34795. // Fields allows partial responses to be retrieved. See
  34796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34797. // for more information.
  34798. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  34799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34800. return c
  34801. }
  34802. // IfNoneMatch sets the optional parameter which makes the operation
  34803. // fail if the object's ETag matches the given value. This is useful for
  34804. // getting updates only after the object has changed since the last
  34805. // request. Use googleapi.IsNotModified to check whether the response
  34806. // error from Do is the result of In-None-Match.
  34807. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  34808. c.ifNoneMatch_ = entityTag
  34809. return c
  34810. }
  34811. // Context sets the context to be used in this call's Do method. Any
  34812. // pending HTTP request will be aborted if the provided context is
  34813. // canceled.
  34814. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  34815. c.ctx_ = ctx
  34816. return c
  34817. }
  34818. // Header returns an http.Header that can be modified by the caller to
  34819. // add HTTP headers to the request.
  34820. func (c *HttpHealthChecksListCall) Header() http.Header {
  34821. if c.header_ == nil {
  34822. c.header_ = make(http.Header)
  34823. }
  34824. return c.header_
  34825. }
  34826. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  34827. reqHeaders := make(http.Header)
  34828. for k, v := range c.header_ {
  34829. reqHeaders[k] = v
  34830. }
  34831. reqHeaders.Set("User-Agent", c.s.userAgent())
  34832. if c.ifNoneMatch_ != "" {
  34833. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34834. }
  34835. var body io.Reader = nil
  34836. c.urlParams_.Set("alt", alt)
  34837. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  34838. urls += "?" + c.urlParams_.Encode()
  34839. req, _ := http.NewRequest("GET", urls, body)
  34840. req.Header = reqHeaders
  34841. googleapi.Expand(req.URL, map[string]string{
  34842. "project": c.project,
  34843. })
  34844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34845. }
  34846. // Do executes the "compute.httpHealthChecks.list" call.
  34847. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  34848. // non-2xx status code is an error. Response headers are in either
  34849. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  34850. // returned at all) in error.(*googleapi.Error).Header. Use
  34851. // googleapi.IsNotModified to check whether the returned error was
  34852. // because http.StatusNotModified was returned.
  34853. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  34854. gensupport.SetOptions(c.urlParams_, opts...)
  34855. res, err := c.doRequest("json")
  34856. if res != nil && res.StatusCode == http.StatusNotModified {
  34857. if res.Body != nil {
  34858. res.Body.Close()
  34859. }
  34860. return nil, &googleapi.Error{
  34861. Code: res.StatusCode,
  34862. Header: res.Header,
  34863. }
  34864. }
  34865. if err != nil {
  34866. return nil, err
  34867. }
  34868. defer googleapi.CloseBody(res)
  34869. if err := googleapi.CheckResponse(res); err != nil {
  34870. return nil, err
  34871. }
  34872. ret := &HttpHealthCheckList{
  34873. ServerResponse: googleapi.ServerResponse{
  34874. Header: res.Header,
  34875. HTTPStatusCode: res.StatusCode,
  34876. },
  34877. }
  34878. target := &ret
  34879. if err := gensupport.DecodeResponse(target, res); err != nil {
  34880. return nil, err
  34881. }
  34882. return ret, nil
  34883. // {
  34884. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  34885. // "httpMethod": "GET",
  34886. // "id": "compute.httpHealthChecks.list",
  34887. // "parameterOrder": [
  34888. // "project"
  34889. // ],
  34890. // "parameters": {
  34891. // "filter": {
  34892. // "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).",
  34893. // "location": "query",
  34894. // "type": "string"
  34895. // },
  34896. // "maxResults": {
  34897. // "default": "500",
  34898. // "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)",
  34899. // "format": "uint32",
  34900. // "location": "query",
  34901. // "minimum": "0",
  34902. // "type": "integer"
  34903. // },
  34904. // "orderBy": {
  34905. // "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.",
  34906. // "location": "query",
  34907. // "type": "string"
  34908. // },
  34909. // "pageToken": {
  34910. // "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.",
  34911. // "location": "query",
  34912. // "type": "string"
  34913. // },
  34914. // "project": {
  34915. // "description": "Project ID for this request.",
  34916. // "location": "path",
  34917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34918. // "required": true,
  34919. // "type": "string"
  34920. // }
  34921. // },
  34922. // "path": "{project}/global/httpHealthChecks",
  34923. // "response": {
  34924. // "$ref": "HttpHealthCheckList"
  34925. // },
  34926. // "scopes": [
  34927. // "https://www.googleapis.com/auth/cloud-platform",
  34928. // "https://www.googleapis.com/auth/compute",
  34929. // "https://www.googleapis.com/auth/compute.readonly"
  34930. // ]
  34931. // }
  34932. }
  34933. // Pages invokes f for each page of results.
  34934. // A non-nil error returned from f will halt the iteration.
  34935. // The provided context supersedes any context provided to the Context method.
  34936. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  34937. c.ctx_ = ctx
  34938. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34939. for {
  34940. x, err := c.Do()
  34941. if err != nil {
  34942. return err
  34943. }
  34944. if err := f(x); err != nil {
  34945. return err
  34946. }
  34947. if x.NextPageToken == "" {
  34948. return nil
  34949. }
  34950. c.PageToken(x.NextPageToken)
  34951. }
  34952. }
  34953. // method id "compute.httpHealthChecks.patch":
  34954. type HttpHealthChecksPatchCall struct {
  34955. s *Service
  34956. project string
  34957. httpHealthCheck string
  34958. httphealthcheck *HttpHealthCheck
  34959. urlParams_ gensupport.URLParams
  34960. ctx_ context.Context
  34961. header_ http.Header
  34962. }
  34963. // Patch: Updates a HttpHealthCheck resource in the specified project
  34964. // using the data included in the request. This method supports PATCH
  34965. // semantics and uses the JSON merge patch format and processing rules.
  34966. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  34967. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  34968. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34969. c.project = project
  34970. c.httpHealthCheck = httpHealthCheck
  34971. c.httphealthcheck = httphealthcheck
  34972. return c
  34973. }
  34974. // RequestId sets the optional parameter "requestId": An optional
  34975. // request ID to identify requests. Specify a unique request ID so that
  34976. // if you must retry your request, the server will know to ignore the
  34977. // request if it has already been completed.
  34978. //
  34979. // For example, consider a situation where you make an initial request
  34980. // and the request times out. If you make the request again with the
  34981. // same request ID, the server can check if original operation with the
  34982. // same request ID was received, and if so, will ignore the second
  34983. // request. This prevents clients from accidentally creating duplicate
  34984. // commitments.
  34985. //
  34986. // The request ID must be a valid UUID with the exception that zero UUID
  34987. // is not supported (00000000-0000-0000-0000-000000000000).
  34988. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  34989. c.urlParams_.Set("requestId", requestId)
  34990. return c
  34991. }
  34992. // Fields allows partial responses to be retrieved. See
  34993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34994. // for more information.
  34995. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  34996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34997. return c
  34998. }
  34999. // Context sets the context to be used in this call's Do method. Any
  35000. // pending HTTP request will be aborted if the provided context is
  35001. // canceled.
  35002. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  35003. c.ctx_ = ctx
  35004. return c
  35005. }
  35006. // Header returns an http.Header that can be modified by the caller to
  35007. // add HTTP headers to the request.
  35008. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  35009. if c.header_ == nil {
  35010. c.header_ = make(http.Header)
  35011. }
  35012. return c.header_
  35013. }
  35014. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  35015. reqHeaders := make(http.Header)
  35016. for k, v := range c.header_ {
  35017. reqHeaders[k] = v
  35018. }
  35019. reqHeaders.Set("User-Agent", c.s.userAgent())
  35020. var body io.Reader = nil
  35021. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  35022. if err != nil {
  35023. return nil, err
  35024. }
  35025. reqHeaders.Set("Content-Type", "application/json")
  35026. c.urlParams_.Set("alt", alt)
  35027. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  35028. urls += "?" + c.urlParams_.Encode()
  35029. req, _ := http.NewRequest("PATCH", urls, body)
  35030. req.Header = reqHeaders
  35031. googleapi.Expand(req.URL, map[string]string{
  35032. "project": c.project,
  35033. "httpHealthCheck": c.httpHealthCheck,
  35034. })
  35035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35036. }
  35037. // Do executes the "compute.httpHealthChecks.patch" call.
  35038. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35039. // status code is an error. Response headers are in either
  35040. // *Operation.ServerResponse.Header or (if a response was returned at
  35041. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35042. // to check whether the returned error was because
  35043. // http.StatusNotModified was returned.
  35044. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35045. gensupport.SetOptions(c.urlParams_, opts...)
  35046. res, err := c.doRequest("json")
  35047. if res != nil && res.StatusCode == http.StatusNotModified {
  35048. if res.Body != nil {
  35049. res.Body.Close()
  35050. }
  35051. return nil, &googleapi.Error{
  35052. Code: res.StatusCode,
  35053. Header: res.Header,
  35054. }
  35055. }
  35056. if err != nil {
  35057. return nil, err
  35058. }
  35059. defer googleapi.CloseBody(res)
  35060. if err := googleapi.CheckResponse(res); err != nil {
  35061. return nil, err
  35062. }
  35063. ret := &Operation{
  35064. ServerResponse: googleapi.ServerResponse{
  35065. Header: res.Header,
  35066. HTTPStatusCode: res.StatusCode,
  35067. },
  35068. }
  35069. target := &ret
  35070. if err := gensupport.DecodeResponse(target, res); err != nil {
  35071. return nil, err
  35072. }
  35073. return ret, nil
  35074. // {
  35075. // "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.",
  35076. // "httpMethod": "PATCH",
  35077. // "id": "compute.httpHealthChecks.patch",
  35078. // "parameterOrder": [
  35079. // "project",
  35080. // "httpHealthCheck"
  35081. // ],
  35082. // "parameters": {
  35083. // "httpHealthCheck": {
  35084. // "description": "Name of the HttpHealthCheck resource to patch.",
  35085. // "location": "path",
  35086. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35087. // "required": true,
  35088. // "type": "string"
  35089. // },
  35090. // "project": {
  35091. // "description": "Project ID for this request.",
  35092. // "location": "path",
  35093. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35094. // "required": true,
  35095. // "type": "string"
  35096. // },
  35097. // "requestId": {
  35098. // "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).",
  35099. // "location": "query",
  35100. // "type": "string"
  35101. // }
  35102. // },
  35103. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  35104. // "request": {
  35105. // "$ref": "HttpHealthCheck"
  35106. // },
  35107. // "response": {
  35108. // "$ref": "Operation"
  35109. // },
  35110. // "scopes": [
  35111. // "https://www.googleapis.com/auth/cloud-platform",
  35112. // "https://www.googleapis.com/auth/compute"
  35113. // ]
  35114. // }
  35115. }
  35116. // method id "compute.httpHealthChecks.update":
  35117. type HttpHealthChecksUpdateCall struct {
  35118. s *Service
  35119. project string
  35120. httpHealthCheck string
  35121. httphealthcheck *HttpHealthCheck
  35122. urlParams_ gensupport.URLParams
  35123. ctx_ context.Context
  35124. header_ http.Header
  35125. }
  35126. // Update: Updates a HttpHealthCheck resource in the specified project
  35127. // using the data included in the request.
  35128. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  35129. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  35130. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35131. c.project = project
  35132. c.httpHealthCheck = httpHealthCheck
  35133. c.httphealthcheck = httphealthcheck
  35134. return c
  35135. }
  35136. // RequestId sets the optional parameter "requestId": An optional
  35137. // request ID to identify requests. Specify a unique request ID so that
  35138. // if you must retry your request, the server will know to ignore the
  35139. // request if it has already been completed.
  35140. //
  35141. // For example, consider a situation where you make an initial request
  35142. // and the request times out. If you make the request again with the
  35143. // same request ID, the server can check if original operation with the
  35144. // same request ID was received, and if so, will ignore the second
  35145. // request. This prevents clients from accidentally creating duplicate
  35146. // commitments.
  35147. //
  35148. // The request ID must be a valid UUID with the exception that zero UUID
  35149. // is not supported (00000000-0000-0000-0000-000000000000).
  35150. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  35151. c.urlParams_.Set("requestId", requestId)
  35152. return c
  35153. }
  35154. // Fields allows partial responses to be retrieved. See
  35155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35156. // for more information.
  35157. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  35158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35159. return c
  35160. }
  35161. // Context sets the context to be used in this call's Do method. Any
  35162. // pending HTTP request will be aborted if the provided context is
  35163. // canceled.
  35164. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  35165. c.ctx_ = ctx
  35166. return c
  35167. }
  35168. // Header returns an http.Header that can be modified by the caller to
  35169. // add HTTP headers to the request.
  35170. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  35171. if c.header_ == nil {
  35172. c.header_ = make(http.Header)
  35173. }
  35174. return c.header_
  35175. }
  35176. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  35177. reqHeaders := make(http.Header)
  35178. for k, v := range c.header_ {
  35179. reqHeaders[k] = v
  35180. }
  35181. reqHeaders.Set("User-Agent", c.s.userAgent())
  35182. var body io.Reader = nil
  35183. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  35184. if err != nil {
  35185. return nil, err
  35186. }
  35187. reqHeaders.Set("Content-Type", "application/json")
  35188. c.urlParams_.Set("alt", alt)
  35189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  35190. urls += "?" + c.urlParams_.Encode()
  35191. req, _ := http.NewRequest("PUT", urls, body)
  35192. req.Header = reqHeaders
  35193. googleapi.Expand(req.URL, map[string]string{
  35194. "project": c.project,
  35195. "httpHealthCheck": c.httpHealthCheck,
  35196. })
  35197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35198. }
  35199. // Do executes the "compute.httpHealthChecks.update" call.
  35200. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35201. // status code is an error. Response headers are in either
  35202. // *Operation.ServerResponse.Header or (if a response was returned at
  35203. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35204. // to check whether the returned error was because
  35205. // http.StatusNotModified was returned.
  35206. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35207. gensupport.SetOptions(c.urlParams_, opts...)
  35208. res, err := c.doRequest("json")
  35209. if res != nil && res.StatusCode == http.StatusNotModified {
  35210. if res.Body != nil {
  35211. res.Body.Close()
  35212. }
  35213. return nil, &googleapi.Error{
  35214. Code: res.StatusCode,
  35215. Header: res.Header,
  35216. }
  35217. }
  35218. if err != nil {
  35219. return nil, err
  35220. }
  35221. defer googleapi.CloseBody(res)
  35222. if err := googleapi.CheckResponse(res); err != nil {
  35223. return nil, err
  35224. }
  35225. ret := &Operation{
  35226. ServerResponse: googleapi.ServerResponse{
  35227. Header: res.Header,
  35228. HTTPStatusCode: res.StatusCode,
  35229. },
  35230. }
  35231. target := &ret
  35232. if err := gensupport.DecodeResponse(target, res); err != nil {
  35233. return nil, err
  35234. }
  35235. return ret, nil
  35236. // {
  35237. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  35238. // "httpMethod": "PUT",
  35239. // "id": "compute.httpHealthChecks.update",
  35240. // "parameterOrder": [
  35241. // "project",
  35242. // "httpHealthCheck"
  35243. // ],
  35244. // "parameters": {
  35245. // "httpHealthCheck": {
  35246. // "description": "Name of the HttpHealthCheck resource to update.",
  35247. // "location": "path",
  35248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35249. // "required": true,
  35250. // "type": "string"
  35251. // },
  35252. // "project": {
  35253. // "description": "Project ID for this request.",
  35254. // "location": "path",
  35255. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35256. // "required": true,
  35257. // "type": "string"
  35258. // },
  35259. // "requestId": {
  35260. // "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).",
  35261. // "location": "query",
  35262. // "type": "string"
  35263. // }
  35264. // },
  35265. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  35266. // "request": {
  35267. // "$ref": "HttpHealthCheck"
  35268. // },
  35269. // "response": {
  35270. // "$ref": "Operation"
  35271. // },
  35272. // "scopes": [
  35273. // "https://www.googleapis.com/auth/cloud-platform",
  35274. // "https://www.googleapis.com/auth/compute"
  35275. // ]
  35276. // }
  35277. }
  35278. // method id "compute.httpsHealthChecks.delete":
  35279. type HttpsHealthChecksDeleteCall struct {
  35280. s *Service
  35281. project string
  35282. httpsHealthCheck string
  35283. urlParams_ gensupport.URLParams
  35284. ctx_ context.Context
  35285. header_ http.Header
  35286. }
  35287. // Delete: Deletes the specified HttpsHealthCheck resource.
  35288. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  35289. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35290. c.project = project
  35291. c.httpsHealthCheck = httpsHealthCheck
  35292. return c
  35293. }
  35294. // RequestId sets the optional parameter "requestId": An optional
  35295. // request ID to identify requests. Specify a unique request ID so that
  35296. // if you must retry your request, the server will know to ignore the
  35297. // request if it has already been completed.
  35298. //
  35299. // For example, consider a situation where you make an initial request
  35300. // and the request times out. If you make the request again with the
  35301. // same request ID, the server can check if original operation with the
  35302. // same request ID was received, and if so, will ignore the second
  35303. // request. This prevents clients from accidentally creating duplicate
  35304. // commitments.
  35305. //
  35306. // The request ID must be a valid UUID with the exception that zero UUID
  35307. // is not supported (00000000-0000-0000-0000-000000000000).
  35308. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  35309. c.urlParams_.Set("requestId", requestId)
  35310. return c
  35311. }
  35312. // Fields allows partial responses to be retrieved. See
  35313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35314. // for more information.
  35315. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  35316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35317. return c
  35318. }
  35319. // Context sets the context to be used in this call's Do method. Any
  35320. // pending HTTP request will be aborted if the provided context is
  35321. // canceled.
  35322. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  35323. c.ctx_ = ctx
  35324. return c
  35325. }
  35326. // Header returns an http.Header that can be modified by the caller to
  35327. // add HTTP headers to the request.
  35328. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  35329. if c.header_ == nil {
  35330. c.header_ = make(http.Header)
  35331. }
  35332. return c.header_
  35333. }
  35334. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  35335. reqHeaders := make(http.Header)
  35336. for k, v := range c.header_ {
  35337. reqHeaders[k] = v
  35338. }
  35339. reqHeaders.Set("User-Agent", c.s.userAgent())
  35340. var body io.Reader = nil
  35341. c.urlParams_.Set("alt", alt)
  35342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  35343. urls += "?" + c.urlParams_.Encode()
  35344. req, _ := http.NewRequest("DELETE", urls, body)
  35345. req.Header = reqHeaders
  35346. googleapi.Expand(req.URL, map[string]string{
  35347. "project": c.project,
  35348. "httpsHealthCheck": c.httpsHealthCheck,
  35349. })
  35350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35351. }
  35352. // Do executes the "compute.httpsHealthChecks.delete" call.
  35353. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35354. // status code is an error. Response headers are in either
  35355. // *Operation.ServerResponse.Header or (if a response was returned at
  35356. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35357. // to check whether the returned error was because
  35358. // http.StatusNotModified was returned.
  35359. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35360. gensupport.SetOptions(c.urlParams_, opts...)
  35361. res, err := c.doRequest("json")
  35362. if res != nil && res.StatusCode == http.StatusNotModified {
  35363. if res.Body != nil {
  35364. res.Body.Close()
  35365. }
  35366. return nil, &googleapi.Error{
  35367. Code: res.StatusCode,
  35368. Header: res.Header,
  35369. }
  35370. }
  35371. if err != nil {
  35372. return nil, err
  35373. }
  35374. defer googleapi.CloseBody(res)
  35375. if err := googleapi.CheckResponse(res); err != nil {
  35376. return nil, err
  35377. }
  35378. ret := &Operation{
  35379. ServerResponse: googleapi.ServerResponse{
  35380. Header: res.Header,
  35381. HTTPStatusCode: res.StatusCode,
  35382. },
  35383. }
  35384. target := &ret
  35385. if err := gensupport.DecodeResponse(target, res); err != nil {
  35386. return nil, err
  35387. }
  35388. return ret, nil
  35389. // {
  35390. // "description": "Deletes the specified HttpsHealthCheck resource.",
  35391. // "httpMethod": "DELETE",
  35392. // "id": "compute.httpsHealthChecks.delete",
  35393. // "parameterOrder": [
  35394. // "project",
  35395. // "httpsHealthCheck"
  35396. // ],
  35397. // "parameters": {
  35398. // "httpsHealthCheck": {
  35399. // "description": "Name of the HttpsHealthCheck resource to delete.",
  35400. // "location": "path",
  35401. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35402. // "required": true,
  35403. // "type": "string"
  35404. // },
  35405. // "project": {
  35406. // "description": "Project ID for this request.",
  35407. // "location": "path",
  35408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35409. // "required": true,
  35410. // "type": "string"
  35411. // },
  35412. // "requestId": {
  35413. // "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).",
  35414. // "location": "query",
  35415. // "type": "string"
  35416. // }
  35417. // },
  35418. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  35419. // "response": {
  35420. // "$ref": "Operation"
  35421. // },
  35422. // "scopes": [
  35423. // "https://www.googleapis.com/auth/cloud-platform",
  35424. // "https://www.googleapis.com/auth/compute"
  35425. // ]
  35426. // }
  35427. }
  35428. // method id "compute.httpsHealthChecks.get":
  35429. type HttpsHealthChecksGetCall struct {
  35430. s *Service
  35431. project string
  35432. httpsHealthCheck string
  35433. urlParams_ gensupport.URLParams
  35434. ifNoneMatch_ string
  35435. ctx_ context.Context
  35436. header_ http.Header
  35437. }
  35438. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  35439. // available HTTPS health checks by making a list() request.
  35440. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  35441. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35442. c.project = project
  35443. c.httpsHealthCheck = httpsHealthCheck
  35444. return c
  35445. }
  35446. // Fields allows partial responses to be retrieved. See
  35447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35448. // for more information.
  35449. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  35450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35451. return c
  35452. }
  35453. // IfNoneMatch sets the optional parameter which makes the operation
  35454. // fail if the object's ETag matches the given value. This is useful for
  35455. // getting updates only after the object has changed since the last
  35456. // request. Use googleapi.IsNotModified to check whether the response
  35457. // error from Do is the result of In-None-Match.
  35458. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  35459. c.ifNoneMatch_ = entityTag
  35460. return c
  35461. }
  35462. // Context sets the context to be used in this call's Do method. Any
  35463. // pending HTTP request will be aborted if the provided context is
  35464. // canceled.
  35465. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  35466. c.ctx_ = ctx
  35467. return c
  35468. }
  35469. // Header returns an http.Header that can be modified by the caller to
  35470. // add HTTP headers to the request.
  35471. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  35472. if c.header_ == nil {
  35473. c.header_ = make(http.Header)
  35474. }
  35475. return c.header_
  35476. }
  35477. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  35478. reqHeaders := make(http.Header)
  35479. for k, v := range c.header_ {
  35480. reqHeaders[k] = v
  35481. }
  35482. reqHeaders.Set("User-Agent", c.s.userAgent())
  35483. if c.ifNoneMatch_ != "" {
  35484. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35485. }
  35486. var body io.Reader = nil
  35487. c.urlParams_.Set("alt", alt)
  35488. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  35489. urls += "?" + c.urlParams_.Encode()
  35490. req, _ := http.NewRequest("GET", urls, body)
  35491. req.Header = reqHeaders
  35492. googleapi.Expand(req.URL, map[string]string{
  35493. "project": c.project,
  35494. "httpsHealthCheck": c.httpsHealthCheck,
  35495. })
  35496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35497. }
  35498. // Do executes the "compute.httpsHealthChecks.get" call.
  35499. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  35500. // non-2xx status code is an error. Response headers are in either
  35501. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  35502. // returned at all) in error.(*googleapi.Error).Header. Use
  35503. // googleapi.IsNotModified to check whether the returned error was
  35504. // because http.StatusNotModified was returned.
  35505. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  35506. gensupport.SetOptions(c.urlParams_, opts...)
  35507. res, err := c.doRequest("json")
  35508. if res != nil && res.StatusCode == http.StatusNotModified {
  35509. if res.Body != nil {
  35510. res.Body.Close()
  35511. }
  35512. return nil, &googleapi.Error{
  35513. Code: res.StatusCode,
  35514. Header: res.Header,
  35515. }
  35516. }
  35517. if err != nil {
  35518. return nil, err
  35519. }
  35520. defer googleapi.CloseBody(res)
  35521. if err := googleapi.CheckResponse(res); err != nil {
  35522. return nil, err
  35523. }
  35524. ret := &HttpsHealthCheck{
  35525. ServerResponse: googleapi.ServerResponse{
  35526. Header: res.Header,
  35527. HTTPStatusCode: res.StatusCode,
  35528. },
  35529. }
  35530. target := &ret
  35531. if err := gensupport.DecodeResponse(target, res); err != nil {
  35532. return nil, err
  35533. }
  35534. return ret, nil
  35535. // {
  35536. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  35537. // "httpMethod": "GET",
  35538. // "id": "compute.httpsHealthChecks.get",
  35539. // "parameterOrder": [
  35540. // "project",
  35541. // "httpsHealthCheck"
  35542. // ],
  35543. // "parameters": {
  35544. // "httpsHealthCheck": {
  35545. // "description": "Name of the HttpsHealthCheck resource to return.",
  35546. // "location": "path",
  35547. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35548. // "required": true,
  35549. // "type": "string"
  35550. // },
  35551. // "project": {
  35552. // "description": "Project ID for this request.",
  35553. // "location": "path",
  35554. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35555. // "required": true,
  35556. // "type": "string"
  35557. // }
  35558. // },
  35559. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  35560. // "response": {
  35561. // "$ref": "HttpsHealthCheck"
  35562. // },
  35563. // "scopes": [
  35564. // "https://www.googleapis.com/auth/cloud-platform",
  35565. // "https://www.googleapis.com/auth/compute",
  35566. // "https://www.googleapis.com/auth/compute.readonly"
  35567. // ]
  35568. // }
  35569. }
  35570. // method id "compute.httpsHealthChecks.insert":
  35571. type HttpsHealthChecksInsertCall struct {
  35572. s *Service
  35573. project string
  35574. httpshealthcheck *HttpsHealthCheck
  35575. urlParams_ gensupport.URLParams
  35576. ctx_ context.Context
  35577. header_ http.Header
  35578. }
  35579. // Insert: Creates a HttpsHealthCheck resource in the specified project
  35580. // using the data included in the request.
  35581. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  35582. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35583. c.project = project
  35584. c.httpshealthcheck = httpshealthcheck
  35585. return c
  35586. }
  35587. // RequestId sets the optional parameter "requestId": An optional
  35588. // request ID to identify requests. Specify a unique request ID so that
  35589. // if you must retry your request, the server will know to ignore the
  35590. // request if it has already been completed.
  35591. //
  35592. // For example, consider a situation where you make an initial request
  35593. // and the request times out. If you make the request again with the
  35594. // same request ID, the server can check if original operation with the
  35595. // same request ID was received, and if so, will ignore the second
  35596. // request. This prevents clients from accidentally creating duplicate
  35597. // commitments.
  35598. //
  35599. // The request ID must be a valid UUID with the exception that zero UUID
  35600. // is not supported (00000000-0000-0000-0000-000000000000).
  35601. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  35602. c.urlParams_.Set("requestId", requestId)
  35603. return c
  35604. }
  35605. // Fields allows partial responses to be retrieved. See
  35606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35607. // for more information.
  35608. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  35609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35610. return c
  35611. }
  35612. // Context sets the context to be used in this call's Do method. Any
  35613. // pending HTTP request will be aborted if the provided context is
  35614. // canceled.
  35615. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  35616. c.ctx_ = ctx
  35617. return c
  35618. }
  35619. // Header returns an http.Header that can be modified by the caller to
  35620. // add HTTP headers to the request.
  35621. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  35622. if c.header_ == nil {
  35623. c.header_ = make(http.Header)
  35624. }
  35625. return c.header_
  35626. }
  35627. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  35628. reqHeaders := make(http.Header)
  35629. for k, v := range c.header_ {
  35630. reqHeaders[k] = v
  35631. }
  35632. reqHeaders.Set("User-Agent", c.s.userAgent())
  35633. var body io.Reader = nil
  35634. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  35635. if err != nil {
  35636. return nil, err
  35637. }
  35638. reqHeaders.Set("Content-Type", "application/json")
  35639. c.urlParams_.Set("alt", alt)
  35640. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  35641. urls += "?" + c.urlParams_.Encode()
  35642. req, _ := http.NewRequest("POST", urls, body)
  35643. req.Header = reqHeaders
  35644. googleapi.Expand(req.URL, map[string]string{
  35645. "project": c.project,
  35646. })
  35647. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35648. }
  35649. // Do executes the "compute.httpsHealthChecks.insert" call.
  35650. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35651. // status code is an error. Response headers are in either
  35652. // *Operation.ServerResponse.Header or (if a response was returned at
  35653. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35654. // to check whether the returned error was because
  35655. // http.StatusNotModified was returned.
  35656. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35657. gensupport.SetOptions(c.urlParams_, opts...)
  35658. res, err := c.doRequest("json")
  35659. if res != nil && res.StatusCode == http.StatusNotModified {
  35660. if res.Body != nil {
  35661. res.Body.Close()
  35662. }
  35663. return nil, &googleapi.Error{
  35664. Code: res.StatusCode,
  35665. Header: res.Header,
  35666. }
  35667. }
  35668. if err != nil {
  35669. return nil, err
  35670. }
  35671. defer googleapi.CloseBody(res)
  35672. if err := googleapi.CheckResponse(res); err != nil {
  35673. return nil, err
  35674. }
  35675. ret := &Operation{
  35676. ServerResponse: googleapi.ServerResponse{
  35677. Header: res.Header,
  35678. HTTPStatusCode: res.StatusCode,
  35679. },
  35680. }
  35681. target := &ret
  35682. if err := gensupport.DecodeResponse(target, res); err != nil {
  35683. return nil, err
  35684. }
  35685. return ret, nil
  35686. // {
  35687. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  35688. // "httpMethod": "POST",
  35689. // "id": "compute.httpsHealthChecks.insert",
  35690. // "parameterOrder": [
  35691. // "project"
  35692. // ],
  35693. // "parameters": {
  35694. // "project": {
  35695. // "description": "Project ID for this request.",
  35696. // "location": "path",
  35697. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35698. // "required": true,
  35699. // "type": "string"
  35700. // },
  35701. // "requestId": {
  35702. // "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).",
  35703. // "location": "query",
  35704. // "type": "string"
  35705. // }
  35706. // },
  35707. // "path": "{project}/global/httpsHealthChecks",
  35708. // "request": {
  35709. // "$ref": "HttpsHealthCheck"
  35710. // },
  35711. // "response": {
  35712. // "$ref": "Operation"
  35713. // },
  35714. // "scopes": [
  35715. // "https://www.googleapis.com/auth/cloud-platform",
  35716. // "https://www.googleapis.com/auth/compute"
  35717. // ]
  35718. // }
  35719. }
  35720. // method id "compute.httpsHealthChecks.list":
  35721. type HttpsHealthChecksListCall struct {
  35722. s *Service
  35723. project string
  35724. urlParams_ gensupport.URLParams
  35725. ifNoneMatch_ string
  35726. ctx_ context.Context
  35727. header_ http.Header
  35728. }
  35729. // List: Retrieves the list of HttpsHealthCheck resources available to
  35730. // the specified project.
  35731. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  35732. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35733. c.project = project
  35734. return c
  35735. }
  35736. // Filter sets the optional parameter "filter": A filter expression that
  35737. // filters resources listed in the response. The expression must specify
  35738. // the field name, a comparison operator, and the value that you want to
  35739. // use for filtering. The value must be a string, a number, or a
  35740. // boolean. The comparison operator must be either =, !=, >, or <.
  35741. //
  35742. // For example, if you are filtering Compute Engine instances, you can
  35743. // exclude instances named example-instance by specifying name !=
  35744. // example-instance.
  35745. //
  35746. // You can also filter nested fields. For example, you could specify
  35747. // scheduling.automaticRestart = false to include instances only if they
  35748. // are not scheduled for automatic restarts. You can use filtering on
  35749. // nested fields to filter based on resource labels.
  35750. //
  35751. // To filter on multiple expressions, provide each separate expression
  35752. // within parentheses. For example, (scheduling.automaticRestart = true)
  35753. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35754. // AND expression. However, you can include AND and OR expressions
  35755. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35756. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35757. // true).
  35758. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  35759. c.urlParams_.Set("filter", filter)
  35760. return c
  35761. }
  35762. // MaxResults sets the optional parameter "maxResults": The maximum
  35763. // number of results per page that should be returned. If the number of
  35764. // available results is larger than maxResults, Compute Engine returns a
  35765. // nextPageToken that can be used to get the next page of results in
  35766. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35767. // (Default: 500)
  35768. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  35769. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35770. return c
  35771. }
  35772. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35773. // a certain order. By default, results are returned in alphanumerical
  35774. // order based on the resource name.
  35775. //
  35776. // You can also sort results in descending order based on the creation
  35777. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35778. // based on the creationTimestamp field in reverse chronological order
  35779. // (newest result first). Use this to sort resources like operations so
  35780. // that the newest operation is returned first.
  35781. //
  35782. // Currently, only sorting by name or creationTimestamp desc is
  35783. // supported.
  35784. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  35785. c.urlParams_.Set("orderBy", orderBy)
  35786. return c
  35787. }
  35788. // PageToken sets the optional parameter "pageToken": Specifies a page
  35789. // token to use. Set pageToken to the nextPageToken returned by a
  35790. // previous list request to get the next page of results.
  35791. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  35792. c.urlParams_.Set("pageToken", pageToken)
  35793. return c
  35794. }
  35795. // Fields allows partial responses to be retrieved. See
  35796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35797. // for more information.
  35798. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  35799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35800. return c
  35801. }
  35802. // IfNoneMatch sets the optional parameter which makes the operation
  35803. // fail if the object's ETag matches the given value. This is useful for
  35804. // getting updates only after the object has changed since the last
  35805. // request. Use googleapi.IsNotModified to check whether the response
  35806. // error from Do is the result of In-None-Match.
  35807. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  35808. c.ifNoneMatch_ = entityTag
  35809. return c
  35810. }
  35811. // Context sets the context to be used in this call's Do method. Any
  35812. // pending HTTP request will be aborted if the provided context is
  35813. // canceled.
  35814. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  35815. c.ctx_ = ctx
  35816. return c
  35817. }
  35818. // Header returns an http.Header that can be modified by the caller to
  35819. // add HTTP headers to the request.
  35820. func (c *HttpsHealthChecksListCall) Header() http.Header {
  35821. if c.header_ == nil {
  35822. c.header_ = make(http.Header)
  35823. }
  35824. return c.header_
  35825. }
  35826. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  35827. reqHeaders := make(http.Header)
  35828. for k, v := range c.header_ {
  35829. reqHeaders[k] = v
  35830. }
  35831. reqHeaders.Set("User-Agent", c.s.userAgent())
  35832. if c.ifNoneMatch_ != "" {
  35833. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35834. }
  35835. var body io.Reader = nil
  35836. c.urlParams_.Set("alt", alt)
  35837. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  35838. urls += "?" + c.urlParams_.Encode()
  35839. req, _ := http.NewRequest("GET", urls, body)
  35840. req.Header = reqHeaders
  35841. googleapi.Expand(req.URL, map[string]string{
  35842. "project": c.project,
  35843. })
  35844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35845. }
  35846. // Do executes the "compute.httpsHealthChecks.list" call.
  35847. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  35848. // non-2xx status code is an error. Response headers are in either
  35849. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  35850. // returned at all) in error.(*googleapi.Error).Header. Use
  35851. // googleapi.IsNotModified to check whether the returned error was
  35852. // because http.StatusNotModified was returned.
  35853. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  35854. gensupport.SetOptions(c.urlParams_, opts...)
  35855. res, err := c.doRequest("json")
  35856. if res != nil && res.StatusCode == http.StatusNotModified {
  35857. if res.Body != nil {
  35858. res.Body.Close()
  35859. }
  35860. return nil, &googleapi.Error{
  35861. Code: res.StatusCode,
  35862. Header: res.Header,
  35863. }
  35864. }
  35865. if err != nil {
  35866. return nil, err
  35867. }
  35868. defer googleapi.CloseBody(res)
  35869. if err := googleapi.CheckResponse(res); err != nil {
  35870. return nil, err
  35871. }
  35872. ret := &HttpsHealthCheckList{
  35873. ServerResponse: googleapi.ServerResponse{
  35874. Header: res.Header,
  35875. HTTPStatusCode: res.StatusCode,
  35876. },
  35877. }
  35878. target := &ret
  35879. if err := gensupport.DecodeResponse(target, res); err != nil {
  35880. return nil, err
  35881. }
  35882. return ret, nil
  35883. // {
  35884. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  35885. // "httpMethod": "GET",
  35886. // "id": "compute.httpsHealthChecks.list",
  35887. // "parameterOrder": [
  35888. // "project"
  35889. // ],
  35890. // "parameters": {
  35891. // "filter": {
  35892. // "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).",
  35893. // "location": "query",
  35894. // "type": "string"
  35895. // },
  35896. // "maxResults": {
  35897. // "default": "500",
  35898. // "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)",
  35899. // "format": "uint32",
  35900. // "location": "query",
  35901. // "minimum": "0",
  35902. // "type": "integer"
  35903. // },
  35904. // "orderBy": {
  35905. // "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.",
  35906. // "location": "query",
  35907. // "type": "string"
  35908. // },
  35909. // "pageToken": {
  35910. // "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.",
  35911. // "location": "query",
  35912. // "type": "string"
  35913. // },
  35914. // "project": {
  35915. // "description": "Project ID for this request.",
  35916. // "location": "path",
  35917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35918. // "required": true,
  35919. // "type": "string"
  35920. // }
  35921. // },
  35922. // "path": "{project}/global/httpsHealthChecks",
  35923. // "response": {
  35924. // "$ref": "HttpsHealthCheckList"
  35925. // },
  35926. // "scopes": [
  35927. // "https://www.googleapis.com/auth/cloud-platform",
  35928. // "https://www.googleapis.com/auth/compute",
  35929. // "https://www.googleapis.com/auth/compute.readonly"
  35930. // ]
  35931. // }
  35932. }
  35933. // Pages invokes f for each page of results.
  35934. // A non-nil error returned from f will halt the iteration.
  35935. // The provided context supersedes any context provided to the Context method.
  35936. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  35937. c.ctx_ = ctx
  35938. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35939. for {
  35940. x, err := c.Do()
  35941. if err != nil {
  35942. return err
  35943. }
  35944. if err := f(x); err != nil {
  35945. return err
  35946. }
  35947. if x.NextPageToken == "" {
  35948. return nil
  35949. }
  35950. c.PageToken(x.NextPageToken)
  35951. }
  35952. }
  35953. // method id "compute.httpsHealthChecks.patch":
  35954. type HttpsHealthChecksPatchCall struct {
  35955. s *Service
  35956. project string
  35957. httpsHealthCheck string
  35958. httpshealthcheck *HttpsHealthCheck
  35959. urlParams_ gensupport.URLParams
  35960. ctx_ context.Context
  35961. header_ http.Header
  35962. }
  35963. // Patch: Updates a HttpsHealthCheck resource in the specified project
  35964. // using the data included in the request. This method supports PATCH
  35965. // semantics and uses the JSON merge patch format and processing rules.
  35966. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  35967. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35968. c.project = project
  35969. c.httpsHealthCheck = httpsHealthCheck
  35970. c.httpshealthcheck = httpshealthcheck
  35971. return c
  35972. }
  35973. // RequestId sets the optional parameter "requestId": An optional
  35974. // request ID to identify requests. Specify a unique request ID so that
  35975. // if you must retry your request, the server will know to ignore the
  35976. // request if it has already been completed.
  35977. //
  35978. // For example, consider a situation where you make an initial request
  35979. // and the request times out. If you make the request again with the
  35980. // same request ID, the server can check if original operation with the
  35981. // same request ID was received, and if so, will ignore the second
  35982. // request. This prevents clients from accidentally creating duplicate
  35983. // commitments.
  35984. //
  35985. // The request ID must be a valid UUID with the exception that zero UUID
  35986. // is not supported (00000000-0000-0000-0000-000000000000).
  35987. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  35988. c.urlParams_.Set("requestId", requestId)
  35989. return c
  35990. }
  35991. // Fields allows partial responses to be retrieved. See
  35992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35993. // for more information.
  35994. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  35995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35996. return c
  35997. }
  35998. // Context sets the context to be used in this call's Do method. Any
  35999. // pending HTTP request will be aborted if the provided context is
  36000. // canceled.
  36001. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  36002. c.ctx_ = ctx
  36003. return c
  36004. }
  36005. // Header returns an http.Header that can be modified by the caller to
  36006. // add HTTP headers to the request.
  36007. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  36008. if c.header_ == nil {
  36009. c.header_ = make(http.Header)
  36010. }
  36011. return c.header_
  36012. }
  36013. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  36014. reqHeaders := make(http.Header)
  36015. for k, v := range c.header_ {
  36016. reqHeaders[k] = v
  36017. }
  36018. reqHeaders.Set("User-Agent", c.s.userAgent())
  36019. var body io.Reader = nil
  36020. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  36021. if err != nil {
  36022. return nil, err
  36023. }
  36024. reqHeaders.Set("Content-Type", "application/json")
  36025. c.urlParams_.Set("alt", alt)
  36026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  36027. urls += "?" + c.urlParams_.Encode()
  36028. req, _ := http.NewRequest("PATCH", urls, body)
  36029. req.Header = reqHeaders
  36030. googleapi.Expand(req.URL, map[string]string{
  36031. "project": c.project,
  36032. "httpsHealthCheck": c.httpsHealthCheck,
  36033. })
  36034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36035. }
  36036. // Do executes the "compute.httpsHealthChecks.patch" call.
  36037. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36038. // status code is an error. Response headers are in either
  36039. // *Operation.ServerResponse.Header or (if a response was returned at
  36040. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36041. // to check whether the returned error was because
  36042. // http.StatusNotModified was returned.
  36043. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36044. gensupport.SetOptions(c.urlParams_, opts...)
  36045. res, err := c.doRequest("json")
  36046. if res != nil && res.StatusCode == http.StatusNotModified {
  36047. if res.Body != nil {
  36048. res.Body.Close()
  36049. }
  36050. return nil, &googleapi.Error{
  36051. Code: res.StatusCode,
  36052. Header: res.Header,
  36053. }
  36054. }
  36055. if err != nil {
  36056. return nil, err
  36057. }
  36058. defer googleapi.CloseBody(res)
  36059. if err := googleapi.CheckResponse(res); err != nil {
  36060. return nil, err
  36061. }
  36062. ret := &Operation{
  36063. ServerResponse: googleapi.ServerResponse{
  36064. Header: res.Header,
  36065. HTTPStatusCode: res.StatusCode,
  36066. },
  36067. }
  36068. target := &ret
  36069. if err := gensupport.DecodeResponse(target, res); err != nil {
  36070. return nil, err
  36071. }
  36072. return ret, nil
  36073. // {
  36074. // "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.",
  36075. // "httpMethod": "PATCH",
  36076. // "id": "compute.httpsHealthChecks.patch",
  36077. // "parameterOrder": [
  36078. // "project",
  36079. // "httpsHealthCheck"
  36080. // ],
  36081. // "parameters": {
  36082. // "httpsHealthCheck": {
  36083. // "description": "Name of the HttpsHealthCheck resource to patch.",
  36084. // "location": "path",
  36085. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36086. // "required": true,
  36087. // "type": "string"
  36088. // },
  36089. // "project": {
  36090. // "description": "Project ID for this request.",
  36091. // "location": "path",
  36092. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36093. // "required": true,
  36094. // "type": "string"
  36095. // },
  36096. // "requestId": {
  36097. // "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).",
  36098. // "location": "query",
  36099. // "type": "string"
  36100. // }
  36101. // },
  36102. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  36103. // "request": {
  36104. // "$ref": "HttpsHealthCheck"
  36105. // },
  36106. // "response": {
  36107. // "$ref": "Operation"
  36108. // },
  36109. // "scopes": [
  36110. // "https://www.googleapis.com/auth/cloud-platform",
  36111. // "https://www.googleapis.com/auth/compute"
  36112. // ]
  36113. // }
  36114. }
  36115. // method id "compute.httpsHealthChecks.update":
  36116. type HttpsHealthChecksUpdateCall struct {
  36117. s *Service
  36118. project string
  36119. httpsHealthCheck string
  36120. httpshealthcheck *HttpsHealthCheck
  36121. urlParams_ gensupport.URLParams
  36122. ctx_ context.Context
  36123. header_ http.Header
  36124. }
  36125. // Update: Updates a HttpsHealthCheck resource in the specified project
  36126. // using the data included in the request.
  36127. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  36128. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36129. c.project = project
  36130. c.httpsHealthCheck = httpsHealthCheck
  36131. c.httpshealthcheck = httpshealthcheck
  36132. return c
  36133. }
  36134. // RequestId sets the optional parameter "requestId": An optional
  36135. // request ID to identify requests. Specify a unique request ID so that
  36136. // if you must retry your request, the server will know to ignore the
  36137. // request if it has already been completed.
  36138. //
  36139. // For example, consider a situation where you make an initial request
  36140. // and the request times out. If you make the request again with the
  36141. // same request ID, the server can check if original operation with the
  36142. // same request ID was received, and if so, will ignore the second
  36143. // request. This prevents clients from accidentally creating duplicate
  36144. // commitments.
  36145. //
  36146. // The request ID must be a valid UUID with the exception that zero UUID
  36147. // is not supported (00000000-0000-0000-0000-000000000000).
  36148. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  36149. c.urlParams_.Set("requestId", requestId)
  36150. return c
  36151. }
  36152. // Fields allows partial responses to be retrieved. See
  36153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36154. // for more information.
  36155. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  36156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36157. return c
  36158. }
  36159. // Context sets the context to be used in this call's Do method. Any
  36160. // pending HTTP request will be aborted if the provided context is
  36161. // canceled.
  36162. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  36163. c.ctx_ = ctx
  36164. return c
  36165. }
  36166. // Header returns an http.Header that can be modified by the caller to
  36167. // add HTTP headers to the request.
  36168. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  36169. if c.header_ == nil {
  36170. c.header_ = make(http.Header)
  36171. }
  36172. return c.header_
  36173. }
  36174. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  36175. reqHeaders := make(http.Header)
  36176. for k, v := range c.header_ {
  36177. reqHeaders[k] = v
  36178. }
  36179. reqHeaders.Set("User-Agent", c.s.userAgent())
  36180. var body io.Reader = nil
  36181. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  36182. if err != nil {
  36183. return nil, err
  36184. }
  36185. reqHeaders.Set("Content-Type", "application/json")
  36186. c.urlParams_.Set("alt", alt)
  36187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  36188. urls += "?" + c.urlParams_.Encode()
  36189. req, _ := http.NewRequest("PUT", urls, body)
  36190. req.Header = reqHeaders
  36191. googleapi.Expand(req.URL, map[string]string{
  36192. "project": c.project,
  36193. "httpsHealthCheck": c.httpsHealthCheck,
  36194. })
  36195. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36196. }
  36197. // Do executes the "compute.httpsHealthChecks.update" call.
  36198. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36199. // status code is an error. Response headers are in either
  36200. // *Operation.ServerResponse.Header or (if a response was returned at
  36201. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36202. // to check whether the returned error was because
  36203. // http.StatusNotModified was returned.
  36204. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36205. gensupport.SetOptions(c.urlParams_, opts...)
  36206. res, err := c.doRequest("json")
  36207. if res != nil && res.StatusCode == http.StatusNotModified {
  36208. if res.Body != nil {
  36209. res.Body.Close()
  36210. }
  36211. return nil, &googleapi.Error{
  36212. Code: res.StatusCode,
  36213. Header: res.Header,
  36214. }
  36215. }
  36216. if err != nil {
  36217. return nil, err
  36218. }
  36219. defer googleapi.CloseBody(res)
  36220. if err := googleapi.CheckResponse(res); err != nil {
  36221. return nil, err
  36222. }
  36223. ret := &Operation{
  36224. ServerResponse: googleapi.ServerResponse{
  36225. Header: res.Header,
  36226. HTTPStatusCode: res.StatusCode,
  36227. },
  36228. }
  36229. target := &ret
  36230. if err := gensupport.DecodeResponse(target, res); err != nil {
  36231. return nil, err
  36232. }
  36233. return ret, nil
  36234. // {
  36235. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  36236. // "httpMethod": "PUT",
  36237. // "id": "compute.httpsHealthChecks.update",
  36238. // "parameterOrder": [
  36239. // "project",
  36240. // "httpsHealthCheck"
  36241. // ],
  36242. // "parameters": {
  36243. // "httpsHealthCheck": {
  36244. // "description": "Name of the HttpsHealthCheck resource to update.",
  36245. // "location": "path",
  36246. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36247. // "required": true,
  36248. // "type": "string"
  36249. // },
  36250. // "project": {
  36251. // "description": "Project ID for this request.",
  36252. // "location": "path",
  36253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36254. // "required": true,
  36255. // "type": "string"
  36256. // },
  36257. // "requestId": {
  36258. // "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).",
  36259. // "location": "query",
  36260. // "type": "string"
  36261. // }
  36262. // },
  36263. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  36264. // "request": {
  36265. // "$ref": "HttpsHealthCheck"
  36266. // },
  36267. // "response": {
  36268. // "$ref": "Operation"
  36269. // },
  36270. // "scopes": [
  36271. // "https://www.googleapis.com/auth/cloud-platform",
  36272. // "https://www.googleapis.com/auth/compute"
  36273. // ]
  36274. // }
  36275. }
  36276. // method id "compute.images.delete":
  36277. type ImagesDeleteCall struct {
  36278. s *Service
  36279. project string
  36280. image string
  36281. urlParams_ gensupport.URLParams
  36282. ctx_ context.Context
  36283. header_ http.Header
  36284. }
  36285. // Delete: Deletes the specified image.
  36286. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  36287. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  36288. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36289. c.project = project
  36290. c.image = image
  36291. return c
  36292. }
  36293. // RequestId sets the optional parameter "requestId": An optional
  36294. // request ID to identify requests. Specify a unique request ID so that
  36295. // if you must retry your request, the server will know to ignore the
  36296. // request if it has already been completed.
  36297. //
  36298. // For example, consider a situation where you make an initial request
  36299. // and the request times out. If you make the request again with the
  36300. // same request ID, the server can check if original operation with the
  36301. // same request ID was received, and if so, will ignore the second
  36302. // request. This prevents clients from accidentally creating duplicate
  36303. // commitments.
  36304. //
  36305. // The request ID must be a valid UUID with the exception that zero UUID
  36306. // is not supported (00000000-0000-0000-0000-000000000000).
  36307. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  36308. c.urlParams_.Set("requestId", requestId)
  36309. return c
  36310. }
  36311. // Fields allows partial responses to be retrieved. See
  36312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36313. // for more information.
  36314. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  36315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36316. return c
  36317. }
  36318. // Context sets the context to be used in this call's Do method. Any
  36319. // pending HTTP request will be aborted if the provided context is
  36320. // canceled.
  36321. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  36322. c.ctx_ = ctx
  36323. return c
  36324. }
  36325. // Header returns an http.Header that can be modified by the caller to
  36326. // add HTTP headers to the request.
  36327. func (c *ImagesDeleteCall) Header() http.Header {
  36328. if c.header_ == nil {
  36329. c.header_ = make(http.Header)
  36330. }
  36331. return c.header_
  36332. }
  36333. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  36334. reqHeaders := make(http.Header)
  36335. for k, v := range c.header_ {
  36336. reqHeaders[k] = v
  36337. }
  36338. reqHeaders.Set("User-Agent", c.s.userAgent())
  36339. var body io.Reader = nil
  36340. c.urlParams_.Set("alt", alt)
  36341. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  36342. urls += "?" + c.urlParams_.Encode()
  36343. req, _ := http.NewRequest("DELETE", urls, body)
  36344. req.Header = reqHeaders
  36345. googleapi.Expand(req.URL, map[string]string{
  36346. "project": c.project,
  36347. "image": c.image,
  36348. })
  36349. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36350. }
  36351. // Do executes the "compute.images.delete" call.
  36352. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36353. // status code is an error. Response headers are in either
  36354. // *Operation.ServerResponse.Header or (if a response was returned at
  36355. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36356. // to check whether the returned error was because
  36357. // http.StatusNotModified was returned.
  36358. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36359. gensupport.SetOptions(c.urlParams_, opts...)
  36360. res, err := c.doRequest("json")
  36361. if res != nil && res.StatusCode == http.StatusNotModified {
  36362. if res.Body != nil {
  36363. res.Body.Close()
  36364. }
  36365. return nil, &googleapi.Error{
  36366. Code: res.StatusCode,
  36367. Header: res.Header,
  36368. }
  36369. }
  36370. if err != nil {
  36371. return nil, err
  36372. }
  36373. defer googleapi.CloseBody(res)
  36374. if err := googleapi.CheckResponse(res); err != nil {
  36375. return nil, err
  36376. }
  36377. ret := &Operation{
  36378. ServerResponse: googleapi.ServerResponse{
  36379. Header: res.Header,
  36380. HTTPStatusCode: res.StatusCode,
  36381. },
  36382. }
  36383. target := &ret
  36384. if err := gensupport.DecodeResponse(target, res); err != nil {
  36385. return nil, err
  36386. }
  36387. return ret, nil
  36388. // {
  36389. // "description": "Deletes the specified image.",
  36390. // "httpMethod": "DELETE",
  36391. // "id": "compute.images.delete",
  36392. // "parameterOrder": [
  36393. // "project",
  36394. // "image"
  36395. // ],
  36396. // "parameters": {
  36397. // "image": {
  36398. // "description": "Name of the image resource to delete.",
  36399. // "location": "path",
  36400. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36401. // "required": true,
  36402. // "type": "string"
  36403. // },
  36404. // "project": {
  36405. // "description": "Project ID for this request.",
  36406. // "location": "path",
  36407. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36408. // "required": true,
  36409. // "type": "string"
  36410. // },
  36411. // "requestId": {
  36412. // "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).",
  36413. // "location": "query",
  36414. // "type": "string"
  36415. // }
  36416. // },
  36417. // "path": "{project}/global/images/{image}",
  36418. // "response": {
  36419. // "$ref": "Operation"
  36420. // },
  36421. // "scopes": [
  36422. // "https://www.googleapis.com/auth/cloud-platform",
  36423. // "https://www.googleapis.com/auth/compute"
  36424. // ]
  36425. // }
  36426. }
  36427. // method id "compute.images.deprecate":
  36428. type ImagesDeprecateCall struct {
  36429. s *Service
  36430. project string
  36431. image string
  36432. deprecationstatus *DeprecationStatus
  36433. urlParams_ gensupport.URLParams
  36434. ctx_ context.Context
  36435. header_ http.Header
  36436. }
  36437. // Deprecate: Sets the deprecation status of an image.
  36438. //
  36439. // If an empty request body is given, clears the deprecation status
  36440. // instead.
  36441. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  36442. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  36443. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36444. c.project = project
  36445. c.image = image
  36446. c.deprecationstatus = deprecationstatus
  36447. return c
  36448. }
  36449. // RequestId sets the optional parameter "requestId": An optional
  36450. // request ID to identify requests. Specify a unique request ID so that
  36451. // if you must retry your request, the server will know to ignore the
  36452. // request if it has already been completed.
  36453. //
  36454. // For example, consider a situation where you make an initial request
  36455. // and the request times out. If you make the request again with the
  36456. // same request ID, the server can check if original operation with the
  36457. // same request ID was received, and if so, will ignore the second
  36458. // request. This prevents clients from accidentally creating duplicate
  36459. // commitments.
  36460. //
  36461. // The request ID must be a valid UUID with the exception that zero UUID
  36462. // is not supported (00000000-0000-0000-0000-000000000000).
  36463. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  36464. c.urlParams_.Set("requestId", requestId)
  36465. return c
  36466. }
  36467. // Fields allows partial responses to be retrieved. See
  36468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36469. // for more information.
  36470. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  36471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36472. return c
  36473. }
  36474. // Context sets the context to be used in this call's Do method. Any
  36475. // pending HTTP request will be aborted if the provided context is
  36476. // canceled.
  36477. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  36478. c.ctx_ = ctx
  36479. return c
  36480. }
  36481. // Header returns an http.Header that can be modified by the caller to
  36482. // add HTTP headers to the request.
  36483. func (c *ImagesDeprecateCall) Header() http.Header {
  36484. if c.header_ == nil {
  36485. c.header_ = make(http.Header)
  36486. }
  36487. return c.header_
  36488. }
  36489. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  36490. reqHeaders := make(http.Header)
  36491. for k, v := range c.header_ {
  36492. reqHeaders[k] = v
  36493. }
  36494. reqHeaders.Set("User-Agent", c.s.userAgent())
  36495. var body io.Reader = nil
  36496. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  36497. if err != nil {
  36498. return nil, err
  36499. }
  36500. reqHeaders.Set("Content-Type", "application/json")
  36501. c.urlParams_.Set("alt", alt)
  36502. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  36503. urls += "?" + c.urlParams_.Encode()
  36504. req, _ := http.NewRequest("POST", urls, body)
  36505. req.Header = reqHeaders
  36506. googleapi.Expand(req.URL, map[string]string{
  36507. "project": c.project,
  36508. "image": c.image,
  36509. })
  36510. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36511. }
  36512. // Do executes the "compute.images.deprecate" call.
  36513. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36514. // status code is an error. Response headers are in either
  36515. // *Operation.ServerResponse.Header or (if a response was returned at
  36516. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36517. // to check whether the returned error was because
  36518. // http.StatusNotModified was returned.
  36519. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36520. gensupport.SetOptions(c.urlParams_, opts...)
  36521. res, err := c.doRequest("json")
  36522. if res != nil && res.StatusCode == http.StatusNotModified {
  36523. if res.Body != nil {
  36524. res.Body.Close()
  36525. }
  36526. return nil, &googleapi.Error{
  36527. Code: res.StatusCode,
  36528. Header: res.Header,
  36529. }
  36530. }
  36531. if err != nil {
  36532. return nil, err
  36533. }
  36534. defer googleapi.CloseBody(res)
  36535. if err := googleapi.CheckResponse(res); err != nil {
  36536. return nil, err
  36537. }
  36538. ret := &Operation{
  36539. ServerResponse: googleapi.ServerResponse{
  36540. Header: res.Header,
  36541. HTTPStatusCode: res.StatusCode,
  36542. },
  36543. }
  36544. target := &ret
  36545. if err := gensupport.DecodeResponse(target, res); err != nil {
  36546. return nil, err
  36547. }
  36548. return ret, nil
  36549. // {
  36550. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  36551. // "httpMethod": "POST",
  36552. // "id": "compute.images.deprecate",
  36553. // "parameterOrder": [
  36554. // "project",
  36555. // "image"
  36556. // ],
  36557. // "parameters": {
  36558. // "image": {
  36559. // "description": "Image name.",
  36560. // "location": "path",
  36561. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36562. // "required": true,
  36563. // "type": "string"
  36564. // },
  36565. // "project": {
  36566. // "description": "Project ID for this request.",
  36567. // "location": "path",
  36568. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36569. // "required": true,
  36570. // "type": "string"
  36571. // },
  36572. // "requestId": {
  36573. // "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).",
  36574. // "location": "query",
  36575. // "type": "string"
  36576. // }
  36577. // },
  36578. // "path": "{project}/global/images/{image}/deprecate",
  36579. // "request": {
  36580. // "$ref": "DeprecationStatus"
  36581. // },
  36582. // "response": {
  36583. // "$ref": "Operation"
  36584. // },
  36585. // "scopes": [
  36586. // "https://www.googleapis.com/auth/cloud-platform",
  36587. // "https://www.googleapis.com/auth/compute"
  36588. // ]
  36589. // }
  36590. }
  36591. // method id "compute.images.get":
  36592. type ImagesGetCall struct {
  36593. s *Service
  36594. project string
  36595. image string
  36596. urlParams_ gensupport.URLParams
  36597. ifNoneMatch_ string
  36598. ctx_ context.Context
  36599. header_ http.Header
  36600. }
  36601. // Get: Returns the specified image. Gets a list of available images by
  36602. // making a list() request.
  36603. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  36604. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  36605. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36606. c.project = project
  36607. c.image = image
  36608. return c
  36609. }
  36610. // Fields allows partial responses to be retrieved. See
  36611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36612. // for more information.
  36613. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  36614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36615. return c
  36616. }
  36617. // IfNoneMatch sets the optional parameter which makes the operation
  36618. // fail if the object's ETag matches the given value. This is useful for
  36619. // getting updates only after the object has changed since the last
  36620. // request. Use googleapi.IsNotModified to check whether the response
  36621. // error from Do is the result of In-None-Match.
  36622. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  36623. c.ifNoneMatch_ = entityTag
  36624. return c
  36625. }
  36626. // Context sets the context to be used in this call's Do method. Any
  36627. // pending HTTP request will be aborted if the provided context is
  36628. // canceled.
  36629. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  36630. c.ctx_ = ctx
  36631. return c
  36632. }
  36633. // Header returns an http.Header that can be modified by the caller to
  36634. // add HTTP headers to the request.
  36635. func (c *ImagesGetCall) Header() http.Header {
  36636. if c.header_ == nil {
  36637. c.header_ = make(http.Header)
  36638. }
  36639. return c.header_
  36640. }
  36641. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  36642. reqHeaders := make(http.Header)
  36643. for k, v := range c.header_ {
  36644. reqHeaders[k] = v
  36645. }
  36646. reqHeaders.Set("User-Agent", c.s.userAgent())
  36647. if c.ifNoneMatch_ != "" {
  36648. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36649. }
  36650. var body io.Reader = nil
  36651. c.urlParams_.Set("alt", alt)
  36652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  36653. urls += "?" + c.urlParams_.Encode()
  36654. req, _ := http.NewRequest("GET", urls, body)
  36655. req.Header = reqHeaders
  36656. googleapi.Expand(req.URL, map[string]string{
  36657. "project": c.project,
  36658. "image": c.image,
  36659. })
  36660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36661. }
  36662. // Do executes the "compute.images.get" call.
  36663. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  36664. // code is an error. Response headers are in either
  36665. // *Image.ServerResponse.Header or (if a response was returned at all)
  36666. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36667. // check whether the returned error was because http.StatusNotModified
  36668. // was returned.
  36669. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  36670. gensupport.SetOptions(c.urlParams_, opts...)
  36671. res, err := c.doRequest("json")
  36672. if res != nil && res.StatusCode == http.StatusNotModified {
  36673. if res.Body != nil {
  36674. res.Body.Close()
  36675. }
  36676. return nil, &googleapi.Error{
  36677. Code: res.StatusCode,
  36678. Header: res.Header,
  36679. }
  36680. }
  36681. if err != nil {
  36682. return nil, err
  36683. }
  36684. defer googleapi.CloseBody(res)
  36685. if err := googleapi.CheckResponse(res); err != nil {
  36686. return nil, err
  36687. }
  36688. ret := &Image{
  36689. ServerResponse: googleapi.ServerResponse{
  36690. Header: res.Header,
  36691. HTTPStatusCode: res.StatusCode,
  36692. },
  36693. }
  36694. target := &ret
  36695. if err := gensupport.DecodeResponse(target, res); err != nil {
  36696. return nil, err
  36697. }
  36698. return ret, nil
  36699. // {
  36700. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  36701. // "httpMethod": "GET",
  36702. // "id": "compute.images.get",
  36703. // "parameterOrder": [
  36704. // "project",
  36705. // "image"
  36706. // ],
  36707. // "parameters": {
  36708. // "image": {
  36709. // "description": "Name of the image resource to return.",
  36710. // "location": "path",
  36711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36712. // "required": true,
  36713. // "type": "string"
  36714. // },
  36715. // "project": {
  36716. // "description": "Project ID for this request.",
  36717. // "location": "path",
  36718. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36719. // "required": true,
  36720. // "type": "string"
  36721. // }
  36722. // },
  36723. // "path": "{project}/global/images/{image}",
  36724. // "response": {
  36725. // "$ref": "Image"
  36726. // },
  36727. // "scopes": [
  36728. // "https://www.googleapis.com/auth/cloud-platform",
  36729. // "https://www.googleapis.com/auth/compute",
  36730. // "https://www.googleapis.com/auth/compute.readonly"
  36731. // ]
  36732. // }
  36733. }
  36734. // method id "compute.images.getFromFamily":
  36735. type ImagesGetFromFamilyCall struct {
  36736. s *Service
  36737. project string
  36738. family string
  36739. urlParams_ gensupport.URLParams
  36740. ifNoneMatch_ string
  36741. ctx_ context.Context
  36742. header_ http.Header
  36743. }
  36744. // GetFromFamily: Returns the latest image that is part of an image
  36745. // family and is not deprecated.
  36746. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  36747. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36748. c.project = project
  36749. c.family = family
  36750. return c
  36751. }
  36752. // Fields allows partial responses to be retrieved. See
  36753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36754. // for more information.
  36755. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  36756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36757. return c
  36758. }
  36759. // IfNoneMatch sets the optional parameter which makes the operation
  36760. // fail if the object's ETag matches the given value. This is useful for
  36761. // getting updates only after the object has changed since the last
  36762. // request. Use googleapi.IsNotModified to check whether the response
  36763. // error from Do is the result of In-None-Match.
  36764. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  36765. c.ifNoneMatch_ = entityTag
  36766. return c
  36767. }
  36768. // Context sets the context to be used in this call's Do method. Any
  36769. // pending HTTP request will be aborted if the provided context is
  36770. // canceled.
  36771. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  36772. c.ctx_ = ctx
  36773. return c
  36774. }
  36775. // Header returns an http.Header that can be modified by the caller to
  36776. // add HTTP headers to the request.
  36777. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  36778. if c.header_ == nil {
  36779. c.header_ = make(http.Header)
  36780. }
  36781. return c.header_
  36782. }
  36783. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  36784. reqHeaders := make(http.Header)
  36785. for k, v := range c.header_ {
  36786. reqHeaders[k] = v
  36787. }
  36788. reqHeaders.Set("User-Agent", c.s.userAgent())
  36789. if c.ifNoneMatch_ != "" {
  36790. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36791. }
  36792. var body io.Reader = nil
  36793. c.urlParams_.Set("alt", alt)
  36794. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  36795. urls += "?" + c.urlParams_.Encode()
  36796. req, _ := http.NewRequest("GET", urls, body)
  36797. req.Header = reqHeaders
  36798. googleapi.Expand(req.URL, map[string]string{
  36799. "project": c.project,
  36800. "family": c.family,
  36801. })
  36802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36803. }
  36804. // Do executes the "compute.images.getFromFamily" call.
  36805. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  36806. // code is an error. Response headers are in either
  36807. // *Image.ServerResponse.Header or (if a response was returned at all)
  36808. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36809. // check whether the returned error was because http.StatusNotModified
  36810. // was returned.
  36811. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  36812. gensupport.SetOptions(c.urlParams_, opts...)
  36813. res, err := c.doRequest("json")
  36814. if res != nil && res.StatusCode == http.StatusNotModified {
  36815. if res.Body != nil {
  36816. res.Body.Close()
  36817. }
  36818. return nil, &googleapi.Error{
  36819. Code: res.StatusCode,
  36820. Header: res.Header,
  36821. }
  36822. }
  36823. if err != nil {
  36824. return nil, err
  36825. }
  36826. defer googleapi.CloseBody(res)
  36827. if err := googleapi.CheckResponse(res); err != nil {
  36828. return nil, err
  36829. }
  36830. ret := &Image{
  36831. ServerResponse: googleapi.ServerResponse{
  36832. Header: res.Header,
  36833. HTTPStatusCode: res.StatusCode,
  36834. },
  36835. }
  36836. target := &ret
  36837. if err := gensupport.DecodeResponse(target, res); err != nil {
  36838. return nil, err
  36839. }
  36840. return ret, nil
  36841. // {
  36842. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  36843. // "httpMethod": "GET",
  36844. // "id": "compute.images.getFromFamily",
  36845. // "parameterOrder": [
  36846. // "project",
  36847. // "family"
  36848. // ],
  36849. // "parameters": {
  36850. // "family": {
  36851. // "description": "Name of the image family to search for.",
  36852. // "location": "path",
  36853. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36854. // "required": true,
  36855. // "type": "string"
  36856. // },
  36857. // "project": {
  36858. // "description": "Project ID for this request.",
  36859. // "location": "path",
  36860. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36861. // "required": true,
  36862. // "type": "string"
  36863. // }
  36864. // },
  36865. // "path": "{project}/global/images/family/{family}",
  36866. // "response": {
  36867. // "$ref": "Image"
  36868. // },
  36869. // "scopes": [
  36870. // "https://www.googleapis.com/auth/cloud-platform",
  36871. // "https://www.googleapis.com/auth/compute",
  36872. // "https://www.googleapis.com/auth/compute.readonly"
  36873. // ]
  36874. // }
  36875. }
  36876. // method id "compute.images.insert":
  36877. type ImagesInsertCall struct {
  36878. s *Service
  36879. project string
  36880. image *Image
  36881. urlParams_ gensupport.URLParams
  36882. ctx_ context.Context
  36883. header_ http.Header
  36884. }
  36885. // Insert: Creates an image in the specified project using the data
  36886. // included in the request.
  36887. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  36888. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  36889. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36890. c.project = project
  36891. c.image = image
  36892. return c
  36893. }
  36894. // ForceCreate sets the optional parameter "forceCreate": Force image
  36895. // creation if true.
  36896. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  36897. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  36898. return c
  36899. }
  36900. // RequestId sets the optional parameter "requestId": An optional
  36901. // request ID to identify requests. Specify a unique request ID so that
  36902. // if you must retry your request, the server will know to ignore the
  36903. // request if it has already been completed.
  36904. //
  36905. // For example, consider a situation where you make an initial request
  36906. // and the request times out. If you make the request again with the
  36907. // same request ID, the server can check if original operation with the
  36908. // same request ID was received, and if so, will ignore the second
  36909. // request. This prevents clients from accidentally creating duplicate
  36910. // commitments.
  36911. //
  36912. // The request ID must be a valid UUID with the exception that zero UUID
  36913. // is not supported (00000000-0000-0000-0000-000000000000).
  36914. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  36915. c.urlParams_.Set("requestId", requestId)
  36916. return c
  36917. }
  36918. // Fields allows partial responses to be retrieved. See
  36919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36920. // for more information.
  36921. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  36922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36923. return c
  36924. }
  36925. // Context sets the context to be used in this call's Do method. Any
  36926. // pending HTTP request will be aborted if the provided context is
  36927. // canceled.
  36928. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  36929. c.ctx_ = ctx
  36930. return c
  36931. }
  36932. // Header returns an http.Header that can be modified by the caller to
  36933. // add HTTP headers to the request.
  36934. func (c *ImagesInsertCall) Header() http.Header {
  36935. if c.header_ == nil {
  36936. c.header_ = make(http.Header)
  36937. }
  36938. return c.header_
  36939. }
  36940. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  36941. reqHeaders := make(http.Header)
  36942. for k, v := range c.header_ {
  36943. reqHeaders[k] = v
  36944. }
  36945. reqHeaders.Set("User-Agent", c.s.userAgent())
  36946. var body io.Reader = nil
  36947. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  36948. if err != nil {
  36949. return nil, err
  36950. }
  36951. reqHeaders.Set("Content-Type", "application/json")
  36952. c.urlParams_.Set("alt", alt)
  36953. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  36954. urls += "?" + c.urlParams_.Encode()
  36955. req, _ := http.NewRequest("POST", urls, body)
  36956. req.Header = reqHeaders
  36957. googleapi.Expand(req.URL, map[string]string{
  36958. "project": c.project,
  36959. })
  36960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36961. }
  36962. // Do executes the "compute.images.insert" call.
  36963. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36964. // status code is an error. Response headers are in either
  36965. // *Operation.ServerResponse.Header or (if a response was returned at
  36966. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36967. // to check whether the returned error was because
  36968. // http.StatusNotModified was returned.
  36969. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36970. gensupport.SetOptions(c.urlParams_, opts...)
  36971. res, err := c.doRequest("json")
  36972. if res != nil && res.StatusCode == http.StatusNotModified {
  36973. if res.Body != nil {
  36974. res.Body.Close()
  36975. }
  36976. return nil, &googleapi.Error{
  36977. Code: res.StatusCode,
  36978. Header: res.Header,
  36979. }
  36980. }
  36981. if err != nil {
  36982. return nil, err
  36983. }
  36984. defer googleapi.CloseBody(res)
  36985. if err := googleapi.CheckResponse(res); err != nil {
  36986. return nil, err
  36987. }
  36988. ret := &Operation{
  36989. ServerResponse: googleapi.ServerResponse{
  36990. Header: res.Header,
  36991. HTTPStatusCode: res.StatusCode,
  36992. },
  36993. }
  36994. target := &ret
  36995. if err := gensupport.DecodeResponse(target, res); err != nil {
  36996. return nil, err
  36997. }
  36998. return ret, nil
  36999. // {
  37000. // "description": "Creates an image in the specified project using the data included in the request.",
  37001. // "httpMethod": "POST",
  37002. // "id": "compute.images.insert",
  37003. // "parameterOrder": [
  37004. // "project"
  37005. // ],
  37006. // "parameters": {
  37007. // "forceCreate": {
  37008. // "description": "Force image creation if true.",
  37009. // "location": "query",
  37010. // "type": "boolean"
  37011. // },
  37012. // "project": {
  37013. // "description": "Project ID for this request.",
  37014. // "location": "path",
  37015. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37016. // "required": true,
  37017. // "type": "string"
  37018. // },
  37019. // "requestId": {
  37020. // "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).",
  37021. // "location": "query",
  37022. // "type": "string"
  37023. // }
  37024. // },
  37025. // "path": "{project}/global/images",
  37026. // "request": {
  37027. // "$ref": "Image"
  37028. // },
  37029. // "response": {
  37030. // "$ref": "Operation"
  37031. // },
  37032. // "scopes": [
  37033. // "https://www.googleapis.com/auth/cloud-platform",
  37034. // "https://www.googleapis.com/auth/compute",
  37035. // "https://www.googleapis.com/auth/devstorage.full_control",
  37036. // "https://www.googleapis.com/auth/devstorage.read_only",
  37037. // "https://www.googleapis.com/auth/devstorage.read_write"
  37038. // ]
  37039. // }
  37040. }
  37041. // method id "compute.images.list":
  37042. type ImagesListCall struct {
  37043. s *Service
  37044. project string
  37045. urlParams_ gensupport.URLParams
  37046. ifNoneMatch_ string
  37047. ctx_ context.Context
  37048. header_ http.Header
  37049. }
  37050. // List: Retrieves the list of custom images available to the specified
  37051. // project. Custom images are images you create that belong to your
  37052. // project. This method does not get any images that belong to other
  37053. // projects, including publicly-available images, like Debian 8. If you
  37054. // want to get a list of publicly-available images, use this method to
  37055. // make a request to the respective image project, such as debian-cloud
  37056. // or windows-cloud.
  37057. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  37058. func (r *ImagesService) List(project string) *ImagesListCall {
  37059. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37060. c.project = project
  37061. return c
  37062. }
  37063. // Filter sets the optional parameter "filter": A filter expression that
  37064. // filters resources listed in the response. The expression must specify
  37065. // the field name, a comparison operator, and the value that you want to
  37066. // use for filtering. The value must be a string, a number, or a
  37067. // boolean. The comparison operator must be either =, !=, >, or <.
  37068. //
  37069. // For example, if you are filtering Compute Engine instances, you can
  37070. // exclude instances named example-instance by specifying name !=
  37071. // example-instance.
  37072. //
  37073. // You can also filter nested fields. For example, you could specify
  37074. // scheduling.automaticRestart = false to include instances only if they
  37075. // are not scheduled for automatic restarts. You can use filtering on
  37076. // nested fields to filter based on resource labels.
  37077. //
  37078. // To filter on multiple expressions, provide each separate expression
  37079. // within parentheses. For example, (scheduling.automaticRestart = true)
  37080. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37081. // AND expression. However, you can include AND and OR expressions
  37082. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37083. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37084. // true).
  37085. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  37086. c.urlParams_.Set("filter", filter)
  37087. return c
  37088. }
  37089. // MaxResults sets the optional parameter "maxResults": The maximum
  37090. // number of results per page that should be returned. If the number of
  37091. // available results is larger than maxResults, Compute Engine returns a
  37092. // nextPageToken that can be used to get the next page of results in
  37093. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37094. // (Default: 500)
  37095. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  37096. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37097. return c
  37098. }
  37099. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37100. // a certain order. By default, results are returned in alphanumerical
  37101. // order based on the resource name.
  37102. //
  37103. // You can also sort results in descending order based on the creation
  37104. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37105. // based on the creationTimestamp field in reverse chronological order
  37106. // (newest result first). Use this to sort resources like operations so
  37107. // that the newest operation is returned first.
  37108. //
  37109. // Currently, only sorting by name or creationTimestamp desc is
  37110. // supported.
  37111. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  37112. c.urlParams_.Set("orderBy", orderBy)
  37113. return c
  37114. }
  37115. // PageToken sets the optional parameter "pageToken": Specifies a page
  37116. // token to use. Set pageToken to the nextPageToken returned by a
  37117. // previous list request to get the next page of results.
  37118. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  37119. c.urlParams_.Set("pageToken", pageToken)
  37120. return c
  37121. }
  37122. // Fields allows partial responses to be retrieved. See
  37123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37124. // for more information.
  37125. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  37126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37127. return c
  37128. }
  37129. // IfNoneMatch sets the optional parameter which makes the operation
  37130. // fail if the object's ETag matches the given value. This is useful for
  37131. // getting updates only after the object has changed since the last
  37132. // request. Use googleapi.IsNotModified to check whether the response
  37133. // error from Do is the result of In-None-Match.
  37134. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  37135. c.ifNoneMatch_ = entityTag
  37136. return c
  37137. }
  37138. // Context sets the context to be used in this call's Do method. Any
  37139. // pending HTTP request will be aborted if the provided context is
  37140. // canceled.
  37141. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  37142. c.ctx_ = ctx
  37143. return c
  37144. }
  37145. // Header returns an http.Header that can be modified by the caller to
  37146. // add HTTP headers to the request.
  37147. func (c *ImagesListCall) Header() http.Header {
  37148. if c.header_ == nil {
  37149. c.header_ = make(http.Header)
  37150. }
  37151. return c.header_
  37152. }
  37153. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  37154. reqHeaders := make(http.Header)
  37155. for k, v := range c.header_ {
  37156. reqHeaders[k] = v
  37157. }
  37158. reqHeaders.Set("User-Agent", c.s.userAgent())
  37159. if c.ifNoneMatch_ != "" {
  37160. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37161. }
  37162. var body io.Reader = nil
  37163. c.urlParams_.Set("alt", alt)
  37164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  37165. urls += "?" + c.urlParams_.Encode()
  37166. req, _ := http.NewRequest("GET", urls, body)
  37167. req.Header = reqHeaders
  37168. googleapi.Expand(req.URL, map[string]string{
  37169. "project": c.project,
  37170. })
  37171. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37172. }
  37173. // Do executes the "compute.images.list" call.
  37174. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  37175. // status code is an error. Response headers are in either
  37176. // *ImageList.ServerResponse.Header or (if a response was returned at
  37177. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37178. // to check whether the returned error was because
  37179. // http.StatusNotModified was returned.
  37180. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  37181. gensupport.SetOptions(c.urlParams_, opts...)
  37182. res, err := c.doRequest("json")
  37183. if res != nil && res.StatusCode == http.StatusNotModified {
  37184. if res.Body != nil {
  37185. res.Body.Close()
  37186. }
  37187. return nil, &googleapi.Error{
  37188. Code: res.StatusCode,
  37189. Header: res.Header,
  37190. }
  37191. }
  37192. if err != nil {
  37193. return nil, err
  37194. }
  37195. defer googleapi.CloseBody(res)
  37196. if err := googleapi.CheckResponse(res); err != nil {
  37197. return nil, err
  37198. }
  37199. ret := &ImageList{
  37200. ServerResponse: googleapi.ServerResponse{
  37201. Header: res.Header,
  37202. HTTPStatusCode: res.StatusCode,
  37203. },
  37204. }
  37205. target := &ret
  37206. if err := gensupport.DecodeResponse(target, res); err != nil {
  37207. return nil, err
  37208. }
  37209. return ret, nil
  37210. // {
  37211. // "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.",
  37212. // "httpMethod": "GET",
  37213. // "id": "compute.images.list",
  37214. // "parameterOrder": [
  37215. // "project"
  37216. // ],
  37217. // "parameters": {
  37218. // "filter": {
  37219. // "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).",
  37220. // "location": "query",
  37221. // "type": "string"
  37222. // },
  37223. // "maxResults": {
  37224. // "default": "500",
  37225. // "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)",
  37226. // "format": "uint32",
  37227. // "location": "query",
  37228. // "minimum": "0",
  37229. // "type": "integer"
  37230. // },
  37231. // "orderBy": {
  37232. // "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.",
  37233. // "location": "query",
  37234. // "type": "string"
  37235. // },
  37236. // "pageToken": {
  37237. // "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.",
  37238. // "location": "query",
  37239. // "type": "string"
  37240. // },
  37241. // "project": {
  37242. // "description": "Project ID for this request.",
  37243. // "location": "path",
  37244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37245. // "required": true,
  37246. // "type": "string"
  37247. // }
  37248. // },
  37249. // "path": "{project}/global/images",
  37250. // "response": {
  37251. // "$ref": "ImageList"
  37252. // },
  37253. // "scopes": [
  37254. // "https://www.googleapis.com/auth/cloud-platform",
  37255. // "https://www.googleapis.com/auth/compute",
  37256. // "https://www.googleapis.com/auth/compute.readonly"
  37257. // ]
  37258. // }
  37259. }
  37260. // Pages invokes f for each page of results.
  37261. // A non-nil error returned from f will halt the iteration.
  37262. // The provided context supersedes any context provided to the Context method.
  37263. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  37264. c.ctx_ = ctx
  37265. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37266. for {
  37267. x, err := c.Do()
  37268. if err != nil {
  37269. return err
  37270. }
  37271. if err := f(x); err != nil {
  37272. return err
  37273. }
  37274. if x.NextPageToken == "" {
  37275. return nil
  37276. }
  37277. c.PageToken(x.NextPageToken)
  37278. }
  37279. }
  37280. // method id "compute.images.setLabels":
  37281. type ImagesSetLabelsCall struct {
  37282. s *Service
  37283. project string
  37284. resource string
  37285. globalsetlabelsrequest *GlobalSetLabelsRequest
  37286. urlParams_ gensupport.URLParams
  37287. ctx_ context.Context
  37288. header_ http.Header
  37289. }
  37290. // SetLabels: Sets the labels on an image. To learn more about labels,
  37291. // read the Labeling Resources documentation.
  37292. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  37293. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37294. c.project = project
  37295. c.resource = resource
  37296. c.globalsetlabelsrequest = globalsetlabelsrequest
  37297. return c
  37298. }
  37299. // Fields allows partial responses to be retrieved. See
  37300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37301. // for more information.
  37302. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  37303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37304. return c
  37305. }
  37306. // Context sets the context to be used in this call's Do method. Any
  37307. // pending HTTP request will be aborted if the provided context is
  37308. // canceled.
  37309. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  37310. c.ctx_ = ctx
  37311. return c
  37312. }
  37313. // Header returns an http.Header that can be modified by the caller to
  37314. // add HTTP headers to the request.
  37315. func (c *ImagesSetLabelsCall) Header() http.Header {
  37316. if c.header_ == nil {
  37317. c.header_ = make(http.Header)
  37318. }
  37319. return c.header_
  37320. }
  37321. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  37322. reqHeaders := make(http.Header)
  37323. for k, v := range c.header_ {
  37324. reqHeaders[k] = v
  37325. }
  37326. reqHeaders.Set("User-Agent", c.s.userAgent())
  37327. var body io.Reader = nil
  37328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  37329. if err != nil {
  37330. return nil, err
  37331. }
  37332. reqHeaders.Set("Content-Type", "application/json")
  37333. c.urlParams_.Set("alt", alt)
  37334. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  37335. urls += "?" + c.urlParams_.Encode()
  37336. req, _ := http.NewRequest("POST", urls, body)
  37337. req.Header = reqHeaders
  37338. googleapi.Expand(req.URL, map[string]string{
  37339. "project": c.project,
  37340. "resource": c.resource,
  37341. })
  37342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37343. }
  37344. // Do executes the "compute.images.setLabels" call.
  37345. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37346. // status code is an error. Response headers are in either
  37347. // *Operation.ServerResponse.Header or (if a response was returned at
  37348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37349. // to check whether the returned error was because
  37350. // http.StatusNotModified was returned.
  37351. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37352. gensupport.SetOptions(c.urlParams_, opts...)
  37353. res, err := c.doRequest("json")
  37354. if res != nil && res.StatusCode == http.StatusNotModified {
  37355. if res.Body != nil {
  37356. res.Body.Close()
  37357. }
  37358. return nil, &googleapi.Error{
  37359. Code: res.StatusCode,
  37360. Header: res.Header,
  37361. }
  37362. }
  37363. if err != nil {
  37364. return nil, err
  37365. }
  37366. defer googleapi.CloseBody(res)
  37367. if err := googleapi.CheckResponse(res); err != nil {
  37368. return nil, err
  37369. }
  37370. ret := &Operation{
  37371. ServerResponse: googleapi.ServerResponse{
  37372. Header: res.Header,
  37373. HTTPStatusCode: res.StatusCode,
  37374. },
  37375. }
  37376. target := &ret
  37377. if err := gensupport.DecodeResponse(target, res); err != nil {
  37378. return nil, err
  37379. }
  37380. return ret, nil
  37381. // {
  37382. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  37383. // "httpMethod": "POST",
  37384. // "id": "compute.images.setLabels",
  37385. // "parameterOrder": [
  37386. // "project",
  37387. // "resource"
  37388. // ],
  37389. // "parameters": {
  37390. // "project": {
  37391. // "description": "Project ID for this request.",
  37392. // "location": "path",
  37393. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37394. // "required": true,
  37395. // "type": "string"
  37396. // },
  37397. // "resource": {
  37398. // "description": "Name of the resource for this request.",
  37399. // "location": "path",
  37400. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  37401. // "required": true,
  37402. // "type": "string"
  37403. // }
  37404. // },
  37405. // "path": "{project}/global/images/{resource}/setLabels",
  37406. // "request": {
  37407. // "$ref": "GlobalSetLabelsRequest"
  37408. // },
  37409. // "response": {
  37410. // "$ref": "Operation"
  37411. // },
  37412. // "scopes": [
  37413. // "https://www.googleapis.com/auth/cloud-platform",
  37414. // "https://www.googleapis.com/auth/compute"
  37415. // ]
  37416. // }
  37417. }
  37418. // method id "compute.instanceGroupManagers.abandonInstances":
  37419. type InstanceGroupManagersAbandonInstancesCall struct {
  37420. s *Service
  37421. project string
  37422. zone string
  37423. instanceGroupManager string
  37424. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  37425. urlParams_ gensupport.URLParams
  37426. ctx_ context.Context
  37427. header_ http.Header
  37428. }
  37429. // AbandonInstances: Schedules a group action to remove the specified
  37430. // instances from the managed instance group. Abandoning an instance
  37431. // does not delete the instance, but it does remove the instance from
  37432. // any target pools that are applied by the managed instance group. This
  37433. // method reduces the targetSize of the managed instance group by the
  37434. // number of instances that you abandon. This operation is marked as
  37435. // DONE when the action is scheduled even if the instances have not yet
  37436. // been removed from the group. You must separately verify the status of
  37437. // the abandoning action with the listmanagedinstances method.
  37438. //
  37439. // If the group is part of a backend service that has enabled connection
  37440. // draining, it can take up to 60 seconds after the connection draining
  37441. // duration has elapsed before the VM instance is removed or
  37442. // deleted.
  37443. //
  37444. // You can specify a maximum of 1000 instances with this method per
  37445. // request.
  37446. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  37447. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37448. c.project = project
  37449. c.zone = zone
  37450. c.instanceGroupManager = instanceGroupManager
  37451. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  37452. return c
  37453. }
  37454. // RequestId sets the optional parameter "requestId": An optional
  37455. // request ID to identify requests. Specify a unique request ID so that
  37456. // if you must retry your request, the server will know to ignore the
  37457. // request if it has already been completed.
  37458. //
  37459. // For example, consider a situation where you make an initial request
  37460. // and the request times out. If you make the request again with the
  37461. // same request ID, the server can check if original operation with the
  37462. // same request ID was received, and if so, will ignore the second
  37463. // request. This prevents clients from accidentally creating duplicate
  37464. // commitments.
  37465. //
  37466. // The request ID must be a valid UUID with the exception that zero UUID
  37467. // is not supported (00000000-0000-0000-0000-000000000000).
  37468. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  37469. c.urlParams_.Set("requestId", requestId)
  37470. return c
  37471. }
  37472. // Fields allows partial responses to be retrieved. See
  37473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37474. // for more information.
  37475. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  37476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37477. return c
  37478. }
  37479. // Context sets the context to be used in this call's Do method. Any
  37480. // pending HTTP request will be aborted if the provided context is
  37481. // canceled.
  37482. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  37483. c.ctx_ = ctx
  37484. return c
  37485. }
  37486. // Header returns an http.Header that can be modified by the caller to
  37487. // add HTTP headers to the request.
  37488. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  37489. if c.header_ == nil {
  37490. c.header_ = make(http.Header)
  37491. }
  37492. return c.header_
  37493. }
  37494. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  37495. reqHeaders := make(http.Header)
  37496. for k, v := range c.header_ {
  37497. reqHeaders[k] = v
  37498. }
  37499. reqHeaders.Set("User-Agent", c.s.userAgent())
  37500. var body io.Reader = nil
  37501. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  37502. if err != nil {
  37503. return nil, err
  37504. }
  37505. reqHeaders.Set("Content-Type", "application/json")
  37506. c.urlParams_.Set("alt", alt)
  37507. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  37508. urls += "?" + c.urlParams_.Encode()
  37509. req, _ := http.NewRequest("POST", urls, body)
  37510. req.Header = reqHeaders
  37511. googleapi.Expand(req.URL, map[string]string{
  37512. "project": c.project,
  37513. "zone": c.zone,
  37514. "instanceGroupManager": c.instanceGroupManager,
  37515. })
  37516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37517. }
  37518. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  37519. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37520. // status code is an error. Response headers are in either
  37521. // *Operation.ServerResponse.Header or (if a response was returned at
  37522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37523. // to check whether the returned error was because
  37524. // http.StatusNotModified was returned.
  37525. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37526. gensupport.SetOptions(c.urlParams_, opts...)
  37527. res, err := c.doRequest("json")
  37528. if res != nil && res.StatusCode == http.StatusNotModified {
  37529. if res.Body != nil {
  37530. res.Body.Close()
  37531. }
  37532. return nil, &googleapi.Error{
  37533. Code: res.StatusCode,
  37534. Header: res.Header,
  37535. }
  37536. }
  37537. if err != nil {
  37538. return nil, err
  37539. }
  37540. defer googleapi.CloseBody(res)
  37541. if err := googleapi.CheckResponse(res); err != nil {
  37542. return nil, err
  37543. }
  37544. ret := &Operation{
  37545. ServerResponse: googleapi.ServerResponse{
  37546. Header: res.Header,
  37547. HTTPStatusCode: res.StatusCode,
  37548. },
  37549. }
  37550. target := &ret
  37551. if err := gensupport.DecodeResponse(target, res); err != nil {
  37552. return nil, err
  37553. }
  37554. return ret, nil
  37555. // {
  37556. // "description": "Schedules a group action to remove the specified instances 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.",
  37557. // "httpMethod": "POST",
  37558. // "id": "compute.instanceGroupManagers.abandonInstances",
  37559. // "parameterOrder": [
  37560. // "project",
  37561. // "zone",
  37562. // "instanceGroupManager"
  37563. // ],
  37564. // "parameters": {
  37565. // "instanceGroupManager": {
  37566. // "description": "The name of the managed instance group.",
  37567. // "location": "path",
  37568. // "required": true,
  37569. // "type": "string"
  37570. // },
  37571. // "project": {
  37572. // "description": "Project ID for this request.",
  37573. // "location": "path",
  37574. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37575. // "required": true,
  37576. // "type": "string"
  37577. // },
  37578. // "requestId": {
  37579. // "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).",
  37580. // "location": "query",
  37581. // "type": "string"
  37582. // },
  37583. // "zone": {
  37584. // "description": "The name of the zone where the managed instance group is located.",
  37585. // "location": "path",
  37586. // "required": true,
  37587. // "type": "string"
  37588. // }
  37589. // },
  37590. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  37591. // "request": {
  37592. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  37593. // },
  37594. // "response": {
  37595. // "$ref": "Operation"
  37596. // },
  37597. // "scopes": [
  37598. // "https://www.googleapis.com/auth/cloud-platform",
  37599. // "https://www.googleapis.com/auth/compute"
  37600. // ]
  37601. // }
  37602. }
  37603. // method id "compute.instanceGroupManagers.aggregatedList":
  37604. type InstanceGroupManagersAggregatedListCall struct {
  37605. s *Service
  37606. project string
  37607. urlParams_ gensupport.URLParams
  37608. ifNoneMatch_ string
  37609. ctx_ context.Context
  37610. header_ http.Header
  37611. }
  37612. // AggregatedList: Retrieves the list of managed instance groups and
  37613. // groups them by zone.
  37614. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  37615. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37616. c.project = project
  37617. return c
  37618. }
  37619. // Filter sets the optional parameter "filter": A filter expression that
  37620. // filters resources listed in the response. The expression must specify
  37621. // the field name, a comparison operator, and the value that you want to
  37622. // use for filtering. The value must be a string, a number, or a
  37623. // boolean. The comparison operator must be either =, !=, >, or <.
  37624. //
  37625. // For example, if you are filtering Compute Engine instances, you can
  37626. // exclude instances named example-instance by specifying name !=
  37627. // example-instance.
  37628. //
  37629. // You can also filter nested fields. For example, you could specify
  37630. // scheduling.automaticRestart = false to include instances only if they
  37631. // are not scheduled for automatic restarts. You can use filtering on
  37632. // nested fields to filter based on resource labels.
  37633. //
  37634. // To filter on multiple expressions, provide each separate expression
  37635. // within parentheses. For example, (scheduling.automaticRestart = true)
  37636. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37637. // AND expression. However, you can include AND and OR expressions
  37638. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37639. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37640. // true).
  37641. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  37642. c.urlParams_.Set("filter", filter)
  37643. return c
  37644. }
  37645. // MaxResults sets the optional parameter "maxResults": The maximum
  37646. // number of results per page that should be returned. If the number of
  37647. // available results is larger than maxResults, Compute Engine returns a
  37648. // nextPageToken that can be used to get the next page of results in
  37649. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37650. // (Default: 500)
  37651. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  37652. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37653. return c
  37654. }
  37655. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37656. // a certain order. By default, results are returned in alphanumerical
  37657. // order based on the resource name.
  37658. //
  37659. // You can also sort results in descending order based on the creation
  37660. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37661. // based on the creationTimestamp field in reverse chronological order
  37662. // (newest result first). Use this to sort resources like operations so
  37663. // that the newest operation is returned first.
  37664. //
  37665. // Currently, only sorting by name or creationTimestamp desc is
  37666. // supported.
  37667. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  37668. c.urlParams_.Set("orderBy", orderBy)
  37669. return c
  37670. }
  37671. // PageToken sets the optional parameter "pageToken": Specifies a page
  37672. // token to use. Set pageToken to the nextPageToken returned by a
  37673. // previous list request to get the next page of results.
  37674. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  37675. c.urlParams_.Set("pageToken", pageToken)
  37676. return c
  37677. }
  37678. // Fields allows partial responses to be retrieved. See
  37679. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37680. // for more information.
  37681. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  37682. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37683. return c
  37684. }
  37685. // IfNoneMatch sets the optional parameter which makes the operation
  37686. // fail if the object's ETag matches the given value. This is useful for
  37687. // getting updates only after the object has changed since the last
  37688. // request. Use googleapi.IsNotModified to check whether the response
  37689. // error from Do is the result of In-None-Match.
  37690. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  37691. c.ifNoneMatch_ = entityTag
  37692. return c
  37693. }
  37694. // Context sets the context to be used in this call's Do method. Any
  37695. // pending HTTP request will be aborted if the provided context is
  37696. // canceled.
  37697. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  37698. c.ctx_ = ctx
  37699. return c
  37700. }
  37701. // Header returns an http.Header that can be modified by the caller to
  37702. // add HTTP headers to the request.
  37703. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  37704. if c.header_ == nil {
  37705. c.header_ = make(http.Header)
  37706. }
  37707. return c.header_
  37708. }
  37709. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  37710. reqHeaders := make(http.Header)
  37711. for k, v := range c.header_ {
  37712. reqHeaders[k] = v
  37713. }
  37714. reqHeaders.Set("User-Agent", c.s.userAgent())
  37715. if c.ifNoneMatch_ != "" {
  37716. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37717. }
  37718. var body io.Reader = nil
  37719. c.urlParams_.Set("alt", alt)
  37720. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  37721. urls += "?" + c.urlParams_.Encode()
  37722. req, _ := http.NewRequest("GET", urls, body)
  37723. req.Header = reqHeaders
  37724. googleapi.Expand(req.URL, map[string]string{
  37725. "project": c.project,
  37726. })
  37727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37728. }
  37729. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  37730. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  37731. // non-nil. Any non-2xx status code is an error. Response headers are in
  37732. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  37733. // (if a response was returned at all) in
  37734. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  37735. // whether the returned error was because http.StatusNotModified was
  37736. // returned.
  37737. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  37738. gensupport.SetOptions(c.urlParams_, opts...)
  37739. res, err := c.doRequest("json")
  37740. if res != nil && res.StatusCode == http.StatusNotModified {
  37741. if res.Body != nil {
  37742. res.Body.Close()
  37743. }
  37744. return nil, &googleapi.Error{
  37745. Code: res.StatusCode,
  37746. Header: res.Header,
  37747. }
  37748. }
  37749. if err != nil {
  37750. return nil, err
  37751. }
  37752. defer googleapi.CloseBody(res)
  37753. if err := googleapi.CheckResponse(res); err != nil {
  37754. return nil, err
  37755. }
  37756. ret := &InstanceGroupManagerAggregatedList{
  37757. ServerResponse: googleapi.ServerResponse{
  37758. Header: res.Header,
  37759. HTTPStatusCode: res.StatusCode,
  37760. },
  37761. }
  37762. target := &ret
  37763. if err := gensupport.DecodeResponse(target, res); err != nil {
  37764. return nil, err
  37765. }
  37766. return ret, nil
  37767. // {
  37768. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  37769. // "httpMethod": "GET",
  37770. // "id": "compute.instanceGroupManagers.aggregatedList",
  37771. // "parameterOrder": [
  37772. // "project"
  37773. // ],
  37774. // "parameters": {
  37775. // "filter": {
  37776. // "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).",
  37777. // "location": "query",
  37778. // "type": "string"
  37779. // },
  37780. // "maxResults": {
  37781. // "default": "500",
  37782. // "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)",
  37783. // "format": "uint32",
  37784. // "location": "query",
  37785. // "minimum": "0",
  37786. // "type": "integer"
  37787. // },
  37788. // "orderBy": {
  37789. // "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.",
  37790. // "location": "query",
  37791. // "type": "string"
  37792. // },
  37793. // "pageToken": {
  37794. // "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.",
  37795. // "location": "query",
  37796. // "type": "string"
  37797. // },
  37798. // "project": {
  37799. // "description": "Project ID for this request.",
  37800. // "location": "path",
  37801. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37802. // "required": true,
  37803. // "type": "string"
  37804. // }
  37805. // },
  37806. // "path": "{project}/aggregated/instanceGroupManagers",
  37807. // "response": {
  37808. // "$ref": "InstanceGroupManagerAggregatedList"
  37809. // },
  37810. // "scopes": [
  37811. // "https://www.googleapis.com/auth/cloud-platform",
  37812. // "https://www.googleapis.com/auth/compute",
  37813. // "https://www.googleapis.com/auth/compute.readonly"
  37814. // ]
  37815. // }
  37816. }
  37817. // Pages invokes f for each page of results.
  37818. // A non-nil error returned from f will halt the iteration.
  37819. // The provided context supersedes any context provided to the Context method.
  37820. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  37821. c.ctx_ = ctx
  37822. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37823. for {
  37824. x, err := c.Do()
  37825. if err != nil {
  37826. return err
  37827. }
  37828. if err := f(x); err != nil {
  37829. return err
  37830. }
  37831. if x.NextPageToken == "" {
  37832. return nil
  37833. }
  37834. c.PageToken(x.NextPageToken)
  37835. }
  37836. }
  37837. // method id "compute.instanceGroupManagers.delete":
  37838. type InstanceGroupManagersDeleteCall struct {
  37839. s *Service
  37840. project string
  37841. zone string
  37842. instanceGroupManager string
  37843. urlParams_ gensupport.URLParams
  37844. ctx_ context.Context
  37845. header_ http.Header
  37846. }
  37847. // Delete: Deletes the specified managed instance group and all of the
  37848. // instances in that group. Note that the instance group must not belong
  37849. // to a backend service. Read Deleting an instance group for more
  37850. // information.
  37851. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  37852. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37853. c.project = project
  37854. c.zone = zone
  37855. c.instanceGroupManager = instanceGroupManager
  37856. return c
  37857. }
  37858. // RequestId sets the optional parameter "requestId": An optional
  37859. // request ID to identify requests. Specify a unique request ID so that
  37860. // if you must retry your request, the server will know to ignore the
  37861. // request if it has already been completed.
  37862. //
  37863. // For example, consider a situation where you make an initial request
  37864. // and the request times out. If you make the request again with the
  37865. // same request ID, the server can check if original operation with the
  37866. // same request ID was received, and if so, will ignore the second
  37867. // request. This prevents clients from accidentally creating duplicate
  37868. // commitments.
  37869. //
  37870. // The request ID must be a valid UUID with the exception that zero UUID
  37871. // is not supported (00000000-0000-0000-0000-000000000000).
  37872. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  37873. c.urlParams_.Set("requestId", requestId)
  37874. return c
  37875. }
  37876. // Fields allows partial responses to be retrieved. See
  37877. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37878. // for more information.
  37879. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  37880. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37881. return c
  37882. }
  37883. // Context sets the context to be used in this call's Do method. Any
  37884. // pending HTTP request will be aborted if the provided context is
  37885. // canceled.
  37886. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  37887. c.ctx_ = ctx
  37888. return c
  37889. }
  37890. // Header returns an http.Header that can be modified by the caller to
  37891. // add HTTP headers to the request.
  37892. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  37893. if c.header_ == nil {
  37894. c.header_ = make(http.Header)
  37895. }
  37896. return c.header_
  37897. }
  37898. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  37899. reqHeaders := make(http.Header)
  37900. for k, v := range c.header_ {
  37901. reqHeaders[k] = v
  37902. }
  37903. reqHeaders.Set("User-Agent", c.s.userAgent())
  37904. var body io.Reader = nil
  37905. c.urlParams_.Set("alt", alt)
  37906. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  37907. urls += "?" + c.urlParams_.Encode()
  37908. req, _ := http.NewRequest("DELETE", urls, body)
  37909. req.Header = reqHeaders
  37910. googleapi.Expand(req.URL, map[string]string{
  37911. "project": c.project,
  37912. "zone": c.zone,
  37913. "instanceGroupManager": c.instanceGroupManager,
  37914. })
  37915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37916. }
  37917. // Do executes the "compute.instanceGroupManagers.delete" call.
  37918. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37919. // status code is an error. Response headers are in either
  37920. // *Operation.ServerResponse.Header or (if a response was returned at
  37921. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37922. // to check whether the returned error was because
  37923. // http.StatusNotModified was returned.
  37924. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37925. gensupport.SetOptions(c.urlParams_, opts...)
  37926. res, err := c.doRequest("json")
  37927. if res != nil && res.StatusCode == http.StatusNotModified {
  37928. if res.Body != nil {
  37929. res.Body.Close()
  37930. }
  37931. return nil, &googleapi.Error{
  37932. Code: res.StatusCode,
  37933. Header: res.Header,
  37934. }
  37935. }
  37936. if err != nil {
  37937. return nil, err
  37938. }
  37939. defer googleapi.CloseBody(res)
  37940. if err := googleapi.CheckResponse(res); err != nil {
  37941. return nil, err
  37942. }
  37943. ret := &Operation{
  37944. ServerResponse: googleapi.ServerResponse{
  37945. Header: res.Header,
  37946. HTTPStatusCode: res.StatusCode,
  37947. },
  37948. }
  37949. target := &ret
  37950. if err := gensupport.DecodeResponse(target, res); err != nil {
  37951. return nil, err
  37952. }
  37953. return ret, nil
  37954. // {
  37955. // "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.",
  37956. // "httpMethod": "DELETE",
  37957. // "id": "compute.instanceGroupManagers.delete",
  37958. // "parameterOrder": [
  37959. // "project",
  37960. // "zone",
  37961. // "instanceGroupManager"
  37962. // ],
  37963. // "parameters": {
  37964. // "instanceGroupManager": {
  37965. // "description": "The name of the managed instance group to delete.",
  37966. // "location": "path",
  37967. // "required": true,
  37968. // "type": "string"
  37969. // },
  37970. // "project": {
  37971. // "description": "Project ID for this request.",
  37972. // "location": "path",
  37973. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37974. // "required": true,
  37975. // "type": "string"
  37976. // },
  37977. // "requestId": {
  37978. // "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).",
  37979. // "location": "query",
  37980. // "type": "string"
  37981. // },
  37982. // "zone": {
  37983. // "description": "The name of the zone where the managed instance group is located.",
  37984. // "location": "path",
  37985. // "required": true,
  37986. // "type": "string"
  37987. // }
  37988. // },
  37989. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  37990. // "response": {
  37991. // "$ref": "Operation"
  37992. // },
  37993. // "scopes": [
  37994. // "https://www.googleapis.com/auth/cloud-platform",
  37995. // "https://www.googleapis.com/auth/compute"
  37996. // ]
  37997. // }
  37998. }
  37999. // method id "compute.instanceGroupManagers.deleteInstances":
  38000. type InstanceGroupManagersDeleteInstancesCall struct {
  38001. s *Service
  38002. project string
  38003. zone string
  38004. instanceGroupManager string
  38005. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  38006. urlParams_ gensupport.URLParams
  38007. ctx_ context.Context
  38008. header_ http.Header
  38009. }
  38010. // DeleteInstances: Schedules a group action to delete the specified
  38011. // instances in the managed instance group. The instances are also
  38012. // removed from any target pools of which they were a member. This
  38013. // method reduces the targetSize of the managed instance group by the
  38014. // number of instances that you delete. This operation is marked as DONE
  38015. // when the action is scheduled even if the instances are still being
  38016. // deleted. You must separately verify the status of the deleting action
  38017. // with the listmanagedinstances method.
  38018. //
  38019. // If the group is part of a backend service that has enabled connection
  38020. // draining, it can take up to 60 seconds after the connection draining
  38021. // duration has elapsed before the VM instance is removed or
  38022. // deleted.
  38023. //
  38024. // You can specify a maximum of 1000 instances with this method per
  38025. // request.
  38026. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  38027. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38028. c.project = project
  38029. c.zone = zone
  38030. c.instanceGroupManager = instanceGroupManager
  38031. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  38032. return c
  38033. }
  38034. // RequestId sets the optional parameter "requestId": An optional
  38035. // request ID to identify requests. Specify a unique request ID so that
  38036. // if you must retry your request, the server will know to ignore the
  38037. // request if it has already been completed.
  38038. //
  38039. // For example, consider a situation where you make an initial request
  38040. // and the request times out. If you make the request again with the
  38041. // same request ID, the server can check if original operation with the
  38042. // same request ID was received, and if so, will ignore the second
  38043. // request. This prevents clients from accidentally creating duplicate
  38044. // commitments.
  38045. //
  38046. // The request ID must be a valid UUID with the exception that zero UUID
  38047. // is not supported (00000000-0000-0000-0000-000000000000).
  38048. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  38049. c.urlParams_.Set("requestId", requestId)
  38050. return c
  38051. }
  38052. // Fields allows partial responses to be retrieved. See
  38053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38054. // for more information.
  38055. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  38056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38057. return c
  38058. }
  38059. // Context sets the context to be used in this call's Do method. Any
  38060. // pending HTTP request will be aborted if the provided context is
  38061. // canceled.
  38062. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  38063. c.ctx_ = ctx
  38064. return c
  38065. }
  38066. // Header returns an http.Header that can be modified by the caller to
  38067. // add HTTP headers to the request.
  38068. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  38069. if c.header_ == nil {
  38070. c.header_ = make(http.Header)
  38071. }
  38072. return c.header_
  38073. }
  38074. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  38075. reqHeaders := make(http.Header)
  38076. for k, v := range c.header_ {
  38077. reqHeaders[k] = v
  38078. }
  38079. reqHeaders.Set("User-Agent", c.s.userAgent())
  38080. var body io.Reader = nil
  38081. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  38082. if err != nil {
  38083. return nil, err
  38084. }
  38085. reqHeaders.Set("Content-Type", "application/json")
  38086. c.urlParams_.Set("alt", alt)
  38087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  38088. urls += "?" + c.urlParams_.Encode()
  38089. req, _ := http.NewRequest("POST", urls, body)
  38090. req.Header = reqHeaders
  38091. googleapi.Expand(req.URL, map[string]string{
  38092. "project": c.project,
  38093. "zone": c.zone,
  38094. "instanceGroupManager": c.instanceGroupManager,
  38095. })
  38096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38097. }
  38098. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  38099. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38100. // status code is an error. Response headers are in either
  38101. // *Operation.ServerResponse.Header or (if a response was returned at
  38102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38103. // to check whether the returned error was because
  38104. // http.StatusNotModified was returned.
  38105. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38106. gensupport.SetOptions(c.urlParams_, opts...)
  38107. res, err := c.doRequest("json")
  38108. if res != nil && res.StatusCode == http.StatusNotModified {
  38109. if res.Body != nil {
  38110. res.Body.Close()
  38111. }
  38112. return nil, &googleapi.Error{
  38113. Code: res.StatusCode,
  38114. Header: res.Header,
  38115. }
  38116. }
  38117. if err != nil {
  38118. return nil, err
  38119. }
  38120. defer googleapi.CloseBody(res)
  38121. if err := googleapi.CheckResponse(res); err != nil {
  38122. return nil, err
  38123. }
  38124. ret := &Operation{
  38125. ServerResponse: googleapi.ServerResponse{
  38126. Header: res.Header,
  38127. HTTPStatusCode: res.StatusCode,
  38128. },
  38129. }
  38130. target := &ret
  38131. if err := gensupport.DecodeResponse(target, res); err != nil {
  38132. return nil, err
  38133. }
  38134. return ret, nil
  38135. // {
  38136. // "description": "Schedules a group action to delete the specified instances in the managed instance group. 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.",
  38137. // "httpMethod": "POST",
  38138. // "id": "compute.instanceGroupManagers.deleteInstances",
  38139. // "parameterOrder": [
  38140. // "project",
  38141. // "zone",
  38142. // "instanceGroupManager"
  38143. // ],
  38144. // "parameters": {
  38145. // "instanceGroupManager": {
  38146. // "description": "The name of the managed instance group.",
  38147. // "location": "path",
  38148. // "required": true,
  38149. // "type": "string"
  38150. // },
  38151. // "project": {
  38152. // "description": "Project ID for this request.",
  38153. // "location": "path",
  38154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38155. // "required": true,
  38156. // "type": "string"
  38157. // },
  38158. // "requestId": {
  38159. // "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).",
  38160. // "location": "query",
  38161. // "type": "string"
  38162. // },
  38163. // "zone": {
  38164. // "description": "The name of the zone where the managed instance group is located.",
  38165. // "location": "path",
  38166. // "required": true,
  38167. // "type": "string"
  38168. // }
  38169. // },
  38170. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  38171. // "request": {
  38172. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  38173. // },
  38174. // "response": {
  38175. // "$ref": "Operation"
  38176. // },
  38177. // "scopes": [
  38178. // "https://www.googleapis.com/auth/cloud-platform",
  38179. // "https://www.googleapis.com/auth/compute"
  38180. // ]
  38181. // }
  38182. }
  38183. // method id "compute.instanceGroupManagers.get":
  38184. type InstanceGroupManagersGetCall struct {
  38185. s *Service
  38186. project string
  38187. zone string
  38188. instanceGroupManager string
  38189. urlParams_ gensupport.URLParams
  38190. ifNoneMatch_ string
  38191. ctx_ context.Context
  38192. header_ http.Header
  38193. }
  38194. // Get: Returns all of the details about the specified managed instance
  38195. // group. Gets a list of available managed instance groups by making a
  38196. // list() request.
  38197. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  38198. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38199. c.project = project
  38200. c.zone = zone
  38201. c.instanceGroupManager = instanceGroupManager
  38202. return c
  38203. }
  38204. // Fields allows partial responses to be retrieved. See
  38205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38206. // for more information.
  38207. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  38208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38209. return c
  38210. }
  38211. // IfNoneMatch sets the optional parameter which makes the operation
  38212. // fail if the object's ETag matches the given value. This is useful for
  38213. // getting updates only after the object has changed since the last
  38214. // request. Use googleapi.IsNotModified to check whether the response
  38215. // error from Do is the result of In-None-Match.
  38216. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  38217. c.ifNoneMatch_ = entityTag
  38218. return c
  38219. }
  38220. // Context sets the context to be used in this call's Do method. Any
  38221. // pending HTTP request will be aborted if the provided context is
  38222. // canceled.
  38223. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  38224. c.ctx_ = ctx
  38225. return c
  38226. }
  38227. // Header returns an http.Header that can be modified by the caller to
  38228. // add HTTP headers to the request.
  38229. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  38230. if c.header_ == nil {
  38231. c.header_ = make(http.Header)
  38232. }
  38233. return c.header_
  38234. }
  38235. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  38236. reqHeaders := make(http.Header)
  38237. for k, v := range c.header_ {
  38238. reqHeaders[k] = v
  38239. }
  38240. reqHeaders.Set("User-Agent", c.s.userAgent())
  38241. if c.ifNoneMatch_ != "" {
  38242. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38243. }
  38244. var body io.Reader = nil
  38245. c.urlParams_.Set("alt", alt)
  38246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  38247. urls += "?" + c.urlParams_.Encode()
  38248. req, _ := http.NewRequest("GET", urls, body)
  38249. req.Header = reqHeaders
  38250. googleapi.Expand(req.URL, map[string]string{
  38251. "project": c.project,
  38252. "zone": c.zone,
  38253. "instanceGroupManager": c.instanceGroupManager,
  38254. })
  38255. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38256. }
  38257. // Do executes the "compute.instanceGroupManagers.get" call.
  38258. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  38259. // non-2xx status code is an error. Response headers are in either
  38260. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  38261. // returned at all) in error.(*googleapi.Error).Header. Use
  38262. // googleapi.IsNotModified to check whether the returned error was
  38263. // because http.StatusNotModified was returned.
  38264. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  38265. gensupport.SetOptions(c.urlParams_, opts...)
  38266. res, err := c.doRequest("json")
  38267. if res != nil && res.StatusCode == http.StatusNotModified {
  38268. if res.Body != nil {
  38269. res.Body.Close()
  38270. }
  38271. return nil, &googleapi.Error{
  38272. Code: res.StatusCode,
  38273. Header: res.Header,
  38274. }
  38275. }
  38276. if err != nil {
  38277. return nil, err
  38278. }
  38279. defer googleapi.CloseBody(res)
  38280. if err := googleapi.CheckResponse(res); err != nil {
  38281. return nil, err
  38282. }
  38283. ret := &InstanceGroupManager{
  38284. ServerResponse: googleapi.ServerResponse{
  38285. Header: res.Header,
  38286. HTTPStatusCode: res.StatusCode,
  38287. },
  38288. }
  38289. target := &ret
  38290. if err := gensupport.DecodeResponse(target, res); err != nil {
  38291. return nil, err
  38292. }
  38293. return ret, nil
  38294. // {
  38295. // "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.",
  38296. // "httpMethod": "GET",
  38297. // "id": "compute.instanceGroupManagers.get",
  38298. // "parameterOrder": [
  38299. // "project",
  38300. // "zone",
  38301. // "instanceGroupManager"
  38302. // ],
  38303. // "parameters": {
  38304. // "instanceGroupManager": {
  38305. // "description": "The name of the managed instance group.",
  38306. // "location": "path",
  38307. // "required": true,
  38308. // "type": "string"
  38309. // },
  38310. // "project": {
  38311. // "description": "Project ID for this request.",
  38312. // "location": "path",
  38313. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38314. // "required": true,
  38315. // "type": "string"
  38316. // },
  38317. // "zone": {
  38318. // "description": "The name of the zone where the managed instance group is located.",
  38319. // "location": "path",
  38320. // "required": true,
  38321. // "type": "string"
  38322. // }
  38323. // },
  38324. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  38325. // "response": {
  38326. // "$ref": "InstanceGroupManager"
  38327. // },
  38328. // "scopes": [
  38329. // "https://www.googleapis.com/auth/cloud-platform",
  38330. // "https://www.googleapis.com/auth/compute",
  38331. // "https://www.googleapis.com/auth/compute.readonly"
  38332. // ]
  38333. // }
  38334. }
  38335. // method id "compute.instanceGroupManagers.insert":
  38336. type InstanceGroupManagersInsertCall struct {
  38337. s *Service
  38338. project string
  38339. zone string
  38340. instancegroupmanager *InstanceGroupManager
  38341. urlParams_ gensupport.URLParams
  38342. ctx_ context.Context
  38343. header_ http.Header
  38344. }
  38345. // Insert: Creates a managed instance group using the information that
  38346. // you specify in the request. After the group is created, it schedules
  38347. // an action to create instances in the group using the specified
  38348. // instance template. This operation is marked as DONE when the group is
  38349. // created even if the instances in the group have not yet been created.
  38350. // You must separately verify the status of the individual instances
  38351. // with the listmanagedinstances method.
  38352. //
  38353. // A managed instance group can have up to 1000 VM instances per group.
  38354. // Please contact Cloud Support if you need an increase in this limit.
  38355. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  38356. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38357. c.project = project
  38358. c.zone = zone
  38359. c.instancegroupmanager = instancegroupmanager
  38360. return c
  38361. }
  38362. // RequestId sets the optional parameter "requestId": An optional
  38363. // request ID to identify requests. Specify a unique request ID so that
  38364. // if you must retry your request, the server will know to ignore the
  38365. // request if it has already been completed.
  38366. //
  38367. // For example, consider a situation where you make an initial request
  38368. // and the request times out. If you make the request again with the
  38369. // same request ID, the server can check if original operation with the
  38370. // same request ID was received, and if so, will ignore the second
  38371. // request. This prevents clients from accidentally creating duplicate
  38372. // commitments.
  38373. //
  38374. // The request ID must be a valid UUID with the exception that zero UUID
  38375. // is not supported (00000000-0000-0000-0000-000000000000).
  38376. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  38377. c.urlParams_.Set("requestId", requestId)
  38378. return c
  38379. }
  38380. // Fields allows partial responses to be retrieved. See
  38381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38382. // for more information.
  38383. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  38384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38385. return c
  38386. }
  38387. // Context sets the context to be used in this call's Do method. Any
  38388. // pending HTTP request will be aborted if the provided context is
  38389. // canceled.
  38390. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  38391. c.ctx_ = ctx
  38392. return c
  38393. }
  38394. // Header returns an http.Header that can be modified by the caller to
  38395. // add HTTP headers to the request.
  38396. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  38397. if c.header_ == nil {
  38398. c.header_ = make(http.Header)
  38399. }
  38400. return c.header_
  38401. }
  38402. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  38403. reqHeaders := make(http.Header)
  38404. for k, v := range c.header_ {
  38405. reqHeaders[k] = v
  38406. }
  38407. reqHeaders.Set("User-Agent", c.s.userAgent())
  38408. var body io.Reader = nil
  38409. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  38410. if err != nil {
  38411. return nil, err
  38412. }
  38413. reqHeaders.Set("Content-Type", "application/json")
  38414. c.urlParams_.Set("alt", alt)
  38415. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  38416. urls += "?" + c.urlParams_.Encode()
  38417. req, _ := http.NewRequest("POST", urls, body)
  38418. req.Header = reqHeaders
  38419. googleapi.Expand(req.URL, map[string]string{
  38420. "project": c.project,
  38421. "zone": c.zone,
  38422. })
  38423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38424. }
  38425. // Do executes the "compute.instanceGroupManagers.insert" call.
  38426. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38427. // status code is an error. Response headers are in either
  38428. // *Operation.ServerResponse.Header or (if a response was returned at
  38429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38430. // to check whether the returned error was because
  38431. // http.StatusNotModified was returned.
  38432. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38433. gensupport.SetOptions(c.urlParams_, opts...)
  38434. res, err := c.doRequest("json")
  38435. if res != nil && res.StatusCode == http.StatusNotModified {
  38436. if res.Body != nil {
  38437. res.Body.Close()
  38438. }
  38439. return nil, &googleapi.Error{
  38440. Code: res.StatusCode,
  38441. Header: res.Header,
  38442. }
  38443. }
  38444. if err != nil {
  38445. return nil, err
  38446. }
  38447. defer googleapi.CloseBody(res)
  38448. if err := googleapi.CheckResponse(res); err != nil {
  38449. return nil, err
  38450. }
  38451. ret := &Operation{
  38452. ServerResponse: googleapi.ServerResponse{
  38453. Header: res.Header,
  38454. HTTPStatusCode: res.StatusCode,
  38455. },
  38456. }
  38457. target := &ret
  38458. if err := gensupport.DecodeResponse(target, res); err != nil {
  38459. return nil, err
  38460. }
  38461. return ret, nil
  38462. // {
  38463. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.",
  38464. // "httpMethod": "POST",
  38465. // "id": "compute.instanceGroupManagers.insert",
  38466. // "parameterOrder": [
  38467. // "project",
  38468. // "zone"
  38469. // ],
  38470. // "parameters": {
  38471. // "project": {
  38472. // "description": "Project ID for this request.",
  38473. // "location": "path",
  38474. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38475. // "required": true,
  38476. // "type": "string"
  38477. // },
  38478. // "requestId": {
  38479. // "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).",
  38480. // "location": "query",
  38481. // "type": "string"
  38482. // },
  38483. // "zone": {
  38484. // "description": "The name of the zone where you want to create the managed instance group.",
  38485. // "location": "path",
  38486. // "required": true,
  38487. // "type": "string"
  38488. // }
  38489. // },
  38490. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  38491. // "request": {
  38492. // "$ref": "InstanceGroupManager"
  38493. // },
  38494. // "response": {
  38495. // "$ref": "Operation"
  38496. // },
  38497. // "scopes": [
  38498. // "https://www.googleapis.com/auth/cloud-platform",
  38499. // "https://www.googleapis.com/auth/compute"
  38500. // ]
  38501. // }
  38502. }
  38503. // method id "compute.instanceGroupManagers.list":
  38504. type InstanceGroupManagersListCall struct {
  38505. s *Service
  38506. project string
  38507. zone string
  38508. urlParams_ gensupport.URLParams
  38509. ifNoneMatch_ string
  38510. ctx_ context.Context
  38511. header_ http.Header
  38512. }
  38513. // List: Retrieves a list of managed instance groups that are contained
  38514. // within the specified project and zone.
  38515. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  38516. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38517. c.project = project
  38518. c.zone = zone
  38519. return c
  38520. }
  38521. // Filter sets the optional parameter "filter": A filter expression that
  38522. // filters resources listed in the response. The expression must specify
  38523. // the field name, a comparison operator, and the value that you want to
  38524. // use for filtering. The value must be a string, a number, or a
  38525. // boolean. The comparison operator must be either =, !=, >, or <.
  38526. //
  38527. // For example, if you are filtering Compute Engine instances, you can
  38528. // exclude instances named example-instance by specifying name !=
  38529. // example-instance.
  38530. //
  38531. // You can also filter nested fields. For example, you could specify
  38532. // scheduling.automaticRestart = false to include instances only if they
  38533. // are not scheduled for automatic restarts. You can use filtering on
  38534. // nested fields to filter based on resource labels.
  38535. //
  38536. // To filter on multiple expressions, provide each separate expression
  38537. // within parentheses. For example, (scheduling.automaticRestart = true)
  38538. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38539. // AND expression. However, you can include AND and OR expressions
  38540. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38541. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38542. // true).
  38543. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  38544. c.urlParams_.Set("filter", filter)
  38545. return c
  38546. }
  38547. // MaxResults sets the optional parameter "maxResults": The maximum
  38548. // number of results per page that should be returned. If the number of
  38549. // available results is larger than maxResults, Compute Engine returns a
  38550. // nextPageToken that can be used to get the next page of results in
  38551. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38552. // (Default: 500)
  38553. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  38554. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38555. return c
  38556. }
  38557. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38558. // a certain order. By default, results are returned in alphanumerical
  38559. // order based on the resource name.
  38560. //
  38561. // You can also sort results in descending order based on the creation
  38562. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38563. // based on the creationTimestamp field in reverse chronological order
  38564. // (newest result first). Use this to sort resources like operations so
  38565. // that the newest operation is returned first.
  38566. //
  38567. // Currently, only sorting by name or creationTimestamp desc is
  38568. // supported.
  38569. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  38570. c.urlParams_.Set("orderBy", orderBy)
  38571. return c
  38572. }
  38573. // PageToken sets the optional parameter "pageToken": Specifies a page
  38574. // token to use. Set pageToken to the nextPageToken returned by a
  38575. // previous list request to get the next page of results.
  38576. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  38577. c.urlParams_.Set("pageToken", pageToken)
  38578. return c
  38579. }
  38580. // Fields allows partial responses to be retrieved. See
  38581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38582. // for more information.
  38583. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  38584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38585. return c
  38586. }
  38587. // IfNoneMatch sets the optional parameter which makes the operation
  38588. // fail if the object's ETag matches the given value. This is useful for
  38589. // getting updates only after the object has changed since the last
  38590. // request. Use googleapi.IsNotModified to check whether the response
  38591. // error from Do is the result of In-None-Match.
  38592. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  38593. c.ifNoneMatch_ = entityTag
  38594. return c
  38595. }
  38596. // Context sets the context to be used in this call's Do method. Any
  38597. // pending HTTP request will be aborted if the provided context is
  38598. // canceled.
  38599. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  38600. c.ctx_ = ctx
  38601. return c
  38602. }
  38603. // Header returns an http.Header that can be modified by the caller to
  38604. // add HTTP headers to the request.
  38605. func (c *InstanceGroupManagersListCall) Header() http.Header {
  38606. if c.header_ == nil {
  38607. c.header_ = make(http.Header)
  38608. }
  38609. return c.header_
  38610. }
  38611. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  38612. reqHeaders := make(http.Header)
  38613. for k, v := range c.header_ {
  38614. reqHeaders[k] = v
  38615. }
  38616. reqHeaders.Set("User-Agent", c.s.userAgent())
  38617. if c.ifNoneMatch_ != "" {
  38618. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38619. }
  38620. var body io.Reader = nil
  38621. c.urlParams_.Set("alt", alt)
  38622. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  38623. urls += "?" + c.urlParams_.Encode()
  38624. req, _ := http.NewRequest("GET", urls, body)
  38625. req.Header = reqHeaders
  38626. googleapi.Expand(req.URL, map[string]string{
  38627. "project": c.project,
  38628. "zone": c.zone,
  38629. })
  38630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38631. }
  38632. // Do executes the "compute.instanceGroupManagers.list" call.
  38633. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  38634. // Any non-2xx status code is an error. Response headers are in either
  38635. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  38636. // returned at all) in error.(*googleapi.Error).Header. Use
  38637. // googleapi.IsNotModified to check whether the returned error was
  38638. // because http.StatusNotModified was returned.
  38639. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  38640. gensupport.SetOptions(c.urlParams_, opts...)
  38641. res, err := c.doRequest("json")
  38642. if res != nil && res.StatusCode == http.StatusNotModified {
  38643. if res.Body != nil {
  38644. res.Body.Close()
  38645. }
  38646. return nil, &googleapi.Error{
  38647. Code: res.StatusCode,
  38648. Header: res.Header,
  38649. }
  38650. }
  38651. if err != nil {
  38652. return nil, err
  38653. }
  38654. defer googleapi.CloseBody(res)
  38655. if err := googleapi.CheckResponse(res); err != nil {
  38656. return nil, err
  38657. }
  38658. ret := &InstanceGroupManagerList{
  38659. ServerResponse: googleapi.ServerResponse{
  38660. Header: res.Header,
  38661. HTTPStatusCode: res.StatusCode,
  38662. },
  38663. }
  38664. target := &ret
  38665. if err := gensupport.DecodeResponse(target, res); err != nil {
  38666. return nil, err
  38667. }
  38668. return ret, nil
  38669. // {
  38670. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  38671. // "httpMethod": "GET",
  38672. // "id": "compute.instanceGroupManagers.list",
  38673. // "parameterOrder": [
  38674. // "project",
  38675. // "zone"
  38676. // ],
  38677. // "parameters": {
  38678. // "filter": {
  38679. // "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).",
  38680. // "location": "query",
  38681. // "type": "string"
  38682. // },
  38683. // "maxResults": {
  38684. // "default": "500",
  38685. // "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)",
  38686. // "format": "uint32",
  38687. // "location": "query",
  38688. // "minimum": "0",
  38689. // "type": "integer"
  38690. // },
  38691. // "orderBy": {
  38692. // "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.",
  38693. // "location": "query",
  38694. // "type": "string"
  38695. // },
  38696. // "pageToken": {
  38697. // "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.",
  38698. // "location": "query",
  38699. // "type": "string"
  38700. // },
  38701. // "project": {
  38702. // "description": "Project ID for this request.",
  38703. // "location": "path",
  38704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38705. // "required": true,
  38706. // "type": "string"
  38707. // },
  38708. // "zone": {
  38709. // "description": "The name of the zone where the managed instance group is located.",
  38710. // "location": "path",
  38711. // "required": true,
  38712. // "type": "string"
  38713. // }
  38714. // },
  38715. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  38716. // "response": {
  38717. // "$ref": "InstanceGroupManagerList"
  38718. // },
  38719. // "scopes": [
  38720. // "https://www.googleapis.com/auth/cloud-platform",
  38721. // "https://www.googleapis.com/auth/compute",
  38722. // "https://www.googleapis.com/auth/compute.readonly"
  38723. // ]
  38724. // }
  38725. }
  38726. // Pages invokes f for each page of results.
  38727. // A non-nil error returned from f will halt the iteration.
  38728. // The provided context supersedes any context provided to the Context method.
  38729. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  38730. c.ctx_ = ctx
  38731. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38732. for {
  38733. x, err := c.Do()
  38734. if err != nil {
  38735. return err
  38736. }
  38737. if err := f(x); err != nil {
  38738. return err
  38739. }
  38740. if x.NextPageToken == "" {
  38741. return nil
  38742. }
  38743. c.PageToken(x.NextPageToken)
  38744. }
  38745. }
  38746. // method id "compute.instanceGroupManagers.listManagedInstances":
  38747. type InstanceGroupManagersListManagedInstancesCall struct {
  38748. s *Service
  38749. project string
  38750. zone string
  38751. instanceGroupManager string
  38752. urlParams_ gensupport.URLParams
  38753. ctx_ context.Context
  38754. header_ http.Header
  38755. }
  38756. // ListManagedInstances: Lists all of the instances in the managed
  38757. // instance group. Each instance in the list has a currentAction, which
  38758. // indicates the action that the managed instance group is performing on
  38759. // the instance. For example, if the group is still creating an
  38760. // instance, the currentAction is CREATING. If a previous action failed,
  38761. // the list displays the errors for that failed action.
  38762. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  38763. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38764. c.project = project
  38765. c.zone = zone
  38766. c.instanceGroupManager = instanceGroupManager
  38767. return c
  38768. }
  38769. // Filter sets the optional parameter "filter":
  38770. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  38771. c.urlParams_.Set("filter", filter)
  38772. return c
  38773. }
  38774. // MaxResults sets the optional parameter "maxResults":
  38775. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  38776. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38777. return c
  38778. }
  38779. // OrderBy sets the optional parameter "order_by":
  38780. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  38781. c.urlParams_.Set("order_by", orderBy)
  38782. return c
  38783. }
  38784. // PageToken sets the optional parameter "pageToken":
  38785. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  38786. c.urlParams_.Set("pageToken", pageToken)
  38787. return c
  38788. }
  38789. // Fields allows partial responses to be retrieved. See
  38790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38791. // for more information.
  38792. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  38793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38794. return c
  38795. }
  38796. // Context sets the context to be used in this call's Do method. Any
  38797. // pending HTTP request will be aborted if the provided context is
  38798. // canceled.
  38799. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  38800. c.ctx_ = ctx
  38801. return c
  38802. }
  38803. // Header returns an http.Header that can be modified by the caller to
  38804. // add HTTP headers to the request.
  38805. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  38806. if c.header_ == nil {
  38807. c.header_ = make(http.Header)
  38808. }
  38809. return c.header_
  38810. }
  38811. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  38812. reqHeaders := make(http.Header)
  38813. for k, v := range c.header_ {
  38814. reqHeaders[k] = v
  38815. }
  38816. reqHeaders.Set("User-Agent", c.s.userAgent())
  38817. var body io.Reader = nil
  38818. c.urlParams_.Set("alt", alt)
  38819. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  38820. urls += "?" + c.urlParams_.Encode()
  38821. req, _ := http.NewRequest("POST", urls, body)
  38822. req.Header = reqHeaders
  38823. googleapi.Expand(req.URL, map[string]string{
  38824. "project": c.project,
  38825. "zone": c.zone,
  38826. "instanceGroupManager": c.instanceGroupManager,
  38827. })
  38828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38829. }
  38830. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  38831. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  38832. // error will be non-nil. Any non-2xx status code is an error. Response
  38833. // headers are in either
  38834. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  38835. // er or (if a response was returned at all) in
  38836. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  38837. // whether the returned error was because http.StatusNotModified was
  38838. // returned.
  38839. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  38840. gensupport.SetOptions(c.urlParams_, opts...)
  38841. res, err := c.doRequest("json")
  38842. if res != nil && res.StatusCode == http.StatusNotModified {
  38843. if res.Body != nil {
  38844. res.Body.Close()
  38845. }
  38846. return nil, &googleapi.Error{
  38847. Code: res.StatusCode,
  38848. Header: res.Header,
  38849. }
  38850. }
  38851. if err != nil {
  38852. return nil, err
  38853. }
  38854. defer googleapi.CloseBody(res)
  38855. if err := googleapi.CheckResponse(res); err != nil {
  38856. return nil, err
  38857. }
  38858. ret := &InstanceGroupManagersListManagedInstancesResponse{
  38859. ServerResponse: googleapi.ServerResponse{
  38860. Header: res.Header,
  38861. HTTPStatusCode: res.StatusCode,
  38862. },
  38863. }
  38864. target := &ret
  38865. if err := gensupport.DecodeResponse(target, res); err != nil {
  38866. return nil, err
  38867. }
  38868. return ret, nil
  38869. // {
  38870. // "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.",
  38871. // "httpMethod": "POST",
  38872. // "id": "compute.instanceGroupManagers.listManagedInstances",
  38873. // "parameterOrder": [
  38874. // "project",
  38875. // "zone",
  38876. // "instanceGroupManager"
  38877. // ],
  38878. // "parameters": {
  38879. // "filter": {
  38880. // "location": "query",
  38881. // "type": "string"
  38882. // },
  38883. // "instanceGroupManager": {
  38884. // "description": "The name of the managed instance group.",
  38885. // "location": "path",
  38886. // "required": true,
  38887. // "type": "string"
  38888. // },
  38889. // "maxResults": {
  38890. // "default": "500",
  38891. // "format": "uint32",
  38892. // "location": "query",
  38893. // "minimum": "0",
  38894. // "type": "integer"
  38895. // },
  38896. // "order_by": {
  38897. // "location": "query",
  38898. // "type": "string"
  38899. // },
  38900. // "pageToken": {
  38901. // "location": "query",
  38902. // "type": "string"
  38903. // },
  38904. // "project": {
  38905. // "description": "Project ID for this request.",
  38906. // "location": "path",
  38907. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38908. // "required": true,
  38909. // "type": "string"
  38910. // },
  38911. // "zone": {
  38912. // "description": "The name of the zone where the managed instance group is located.",
  38913. // "location": "path",
  38914. // "required": true,
  38915. // "type": "string"
  38916. // }
  38917. // },
  38918. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  38919. // "response": {
  38920. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  38921. // },
  38922. // "scopes": [
  38923. // "https://www.googleapis.com/auth/cloud-platform",
  38924. // "https://www.googleapis.com/auth/compute",
  38925. // "https://www.googleapis.com/auth/compute.readonly"
  38926. // ]
  38927. // }
  38928. }
  38929. // method id "compute.instanceGroupManagers.recreateInstances":
  38930. type InstanceGroupManagersRecreateInstancesCall struct {
  38931. s *Service
  38932. project string
  38933. zone string
  38934. instanceGroupManager string
  38935. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  38936. urlParams_ gensupport.URLParams
  38937. ctx_ context.Context
  38938. header_ http.Header
  38939. }
  38940. // RecreateInstances: Schedules a group action to recreate the specified
  38941. // instances in the managed instance group. The instances are deleted
  38942. // and recreated using the current instance template for the managed
  38943. // instance group. This operation is marked as DONE when the action is
  38944. // scheduled even if the instances have not yet been recreated. You must
  38945. // separately verify the status of the recreating action with the
  38946. // listmanagedinstances method.
  38947. //
  38948. // If the group is part of a backend service that has enabled connection
  38949. // draining, it can take up to 60 seconds after the connection draining
  38950. // duration has elapsed before the VM instance is removed or
  38951. // deleted.
  38952. //
  38953. // You can specify a maximum of 1000 instances with this method per
  38954. // request.
  38955. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  38956. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38957. c.project = project
  38958. c.zone = zone
  38959. c.instanceGroupManager = instanceGroupManager
  38960. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  38961. return c
  38962. }
  38963. // RequestId sets the optional parameter "requestId": An optional
  38964. // request ID to identify requests. Specify a unique request ID so that
  38965. // if you must retry your request, the server will know to ignore the
  38966. // request if it has already been completed.
  38967. //
  38968. // For example, consider a situation where you make an initial request
  38969. // and the request times out. If you make the request again with the
  38970. // same request ID, the server can check if original operation with the
  38971. // same request ID was received, and if so, will ignore the second
  38972. // request. This prevents clients from accidentally creating duplicate
  38973. // commitments.
  38974. //
  38975. // The request ID must be a valid UUID with the exception that zero UUID
  38976. // is not supported (00000000-0000-0000-0000-000000000000).
  38977. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  38978. c.urlParams_.Set("requestId", requestId)
  38979. return c
  38980. }
  38981. // Fields allows partial responses to be retrieved. See
  38982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38983. // for more information.
  38984. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  38985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38986. return c
  38987. }
  38988. // Context sets the context to be used in this call's Do method. Any
  38989. // pending HTTP request will be aborted if the provided context is
  38990. // canceled.
  38991. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  38992. c.ctx_ = ctx
  38993. return c
  38994. }
  38995. // Header returns an http.Header that can be modified by the caller to
  38996. // add HTTP headers to the request.
  38997. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  38998. if c.header_ == nil {
  38999. c.header_ = make(http.Header)
  39000. }
  39001. return c.header_
  39002. }
  39003. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  39004. reqHeaders := make(http.Header)
  39005. for k, v := range c.header_ {
  39006. reqHeaders[k] = v
  39007. }
  39008. reqHeaders.Set("User-Agent", c.s.userAgent())
  39009. var body io.Reader = nil
  39010. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  39011. if err != nil {
  39012. return nil, err
  39013. }
  39014. reqHeaders.Set("Content-Type", "application/json")
  39015. c.urlParams_.Set("alt", alt)
  39016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  39017. urls += "?" + c.urlParams_.Encode()
  39018. req, _ := http.NewRequest("POST", urls, body)
  39019. req.Header = reqHeaders
  39020. googleapi.Expand(req.URL, map[string]string{
  39021. "project": c.project,
  39022. "zone": c.zone,
  39023. "instanceGroupManager": c.instanceGroupManager,
  39024. })
  39025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39026. }
  39027. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  39028. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39029. // status code is an error. Response headers are in either
  39030. // *Operation.ServerResponse.Header or (if a response was returned at
  39031. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39032. // to check whether the returned error was because
  39033. // http.StatusNotModified was returned.
  39034. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39035. gensupport.SetOptions(c.urlParams_, opts...)
  39036. res, err := c.doRequest("json")
  39037. if res != nil && res.StatusCode == http.StatusNotModified {
  39038. if res.Body != nil {
  39039. res.Body.Close()
  39040. }
  39041. return nil, &googleapi.Error{
  39042. Code: res.StatusCode,
  39043. Header: res.Header,
  39044. }
  39045. }
  39046. if err != nil {
  39047. return nil, err
  39048. }
  39049. defer googleapi.CloseBody(res)
  39050. if err := googleapi.CheckResponse(res); err != nil {
  39051. return nil, err
  39052. }
  39053. ret := &Operation{
  39054. ServerResponse: googleapi.ServerResponse{
  39055. Header: res.Header,
  39056. HTTPStatusCode: res.StatusCode,
  39057. },
  39058. }
  39059. target := &ret
  39060. if err := gensupport.DecodeResponse(target, res); err != nil {
  39061. return nil, err
  39062. }
  39063. return ret, nil
  39064. // {
  39065. // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled 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.",
  39066. // "httpMethod": "POST",
  39067. // "id": "compute.instanceGroupManagers.recreateInstances",
  39068. // "parameterOrder": [
  39069. // "project",
  39070. // "zone",
  39071. // "instanceGroupManager"
  39072. // ],
  39073. // "parameters": {
  39074. // "instanceGroupManager": {
  39075. // "description": "The name of the managed instance group.",
  39076. // "location": "path",
  39077. // "required": true,
  39078. // "type": "string"
  39079. // },
  39080. // "project": {
  39081. // "description": "Project ID for this request.",
  39082. // "location": "path",
  39083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39084. // "required": true,
  39085. // "type": "string"
  39086. // },
  39087. // "requestId": {
  39088. // "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).",
  39089. // "location": "query",
  39090. // "type": "string"
  39091. // },
  39092. // "zone": {
  39093. // "description": "The name of the zone where the managed instance group is located.",
  39094. // "location": "path",
  39095. // "required": true,
  39096. // "type": "string"
  39097. // }
  39098. // },
  39099. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  39100. // "request": {
  39101. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  39102. // },
  39103. // "response": {
  39104. // "$ref": "Operation"
  39105. // },
  39106. // "scopes": [
  39107. // "https://www.googleapis.com/auth/cloud-platform",
  39108. // "https://www.googleapis.com/auth/compute"
  39109. // ]
  39110. // }
  39111. }
  39112. // method id "compute.instanceGroupManagers.resize":
  39113. type InstanceGroupManagersResizeCall struct {
  39114. s *Service
  39115. project string
  39116. zone string
  39117. instanceGroupManager string
  39118. urlParams_ gensupport.URLParams
  39119. ctx_ context.Context
  39120. header_ http.Header
  39121. }
  39122. // Resize: Resizes the managed instance group. If you increase the size,
  39123. // the group creates new instances using the current instance template.
  39124. // If you decrease the size, the group deletes instances. The resize
  39125. // operation is marked DONE when the resize actions are scheduled even
  39126. // if the group has not yet added or deleted any instances. You must
  39127. // separately verify the status of the creating or deleting actions with
  39128. // the listmanagedinstances method.
  39129. //
  39130. // If the group is part of a backend service that has enabled connection
  39131. // draining, it can take up to 60 seconds after the connection draining
  39132. // duration has elapsed before the VM instance is removed or deleted.
  39133. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  39134. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39135. c.project = project
  39136. c.zone = zone
  39137. c.instanceGroupManager = instanceGroupManager
  39138. c.urlParams_.Set("size", fmt.Sprint(size))
  39139. return c
  39140. }
  39141. // RequestId sets the optional parameter "requestId": An optional
  39142. // request ID to identify requests. Specify a unique request ID so that
  39143. // if you must retry your request, the server will know to ignore the
  39144. // request if it has already been completed.
  39145. //
  39146. // For example, consider a situation where you make an initial request
  39147. // and the request times out. If you make the request again with the
  39148. // same request ID, the server can check if original operation with the
  39149. // same request ID was received, and if so, will ignore the second
  39150. // request. This prevents clients from accidentally creating duplicate
  39151. // commitments.
  39152. //
  39153. // The request ID must be a valid UUID with the exception that zero UUID
  39154. // is not supported (00000000-0000-0000-0000-000000000000).
  39155. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  39156. c.urlParams_.Set("requestId", requestId)
  39157. return c
  39158. }
  39159. // Fields allows partial responses to be retrieved. See
  39160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39161. // for more information.
  39162. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  39163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39164. return c
  39165. }
  39166. // Context sets the context to be used in this call's Do method. Any
  39167. // pending HTTP request will be aborted if the provided context is
  39168. // canceled.
  39169. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  39170. c.ctx_ = ctx
  39171. return c
  39172. }
  39173. // Header returns an http.Header that can be modified by the caller to
  39174. // add HTTP headers to the request.
  39175. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  39176. if c.header_ == nil {
  39177. c.header_ = make(http.Header)
  39178. }
  39179. return c.header_
  39180. }
  39181. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  39182. reqHeaders := make(http.Header)
  39183. for k, v := range c.header_ {
  39184. reqHeaders[k] = v
  39185. }
  39186. reqHeaders.Set("User-Agent", c.s.userAgent())
  39187. var body io.Reader = nil
  39188. c.urlParams_.Set("alt", alt)
  39189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  39190. urls += "?" + c.urlParams_.Encode()
  39191. req, _ := http.NewRequest("POST", urls, body)
  39192. req.Header = reqHeaders
  39193. googleapi.Expand(req.URL, map[string]string{
  39194. "project": c.project,
  39195. "zone": c.zone,
  39196. "instanceGroupManager": c.instanceGroupManager,
  39197. })
  39198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39199. }
  39200. // Do executes the "compute.instanceGroupManagers.resize" call.
  39201. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39202. // status code is an error. Response headers are in either
  39203. // *Operation.ServerResponse.Header or (if a response was returned at
  39204. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39205. // to check whether the returned error was because
  39206. // http.StatusNotModified was returned.
  39207. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39208. gensupport.SetOptions(c.urlParams_, opts...)
  39209. res, err := c.doRequest("json")
  39210. if res != nil && res.StatusCode == http.StatusNotModified {
  39211. if res.Body != nil {
  39212. res.Body.Close()
  39213. }
  39214. return nil, &googleapi.Error{
  39215. Code: res.StatusCode,
  39216. Header: res.Header,
  39217. }
  39218. }
  39219. if err != nil {
  39220. return nil, err
  39221. }
  39222. defer googleapi.CloseBody(res)
  39223. if err := googleapi.CheckResponse(res); err != nil {
  39224. return nil, err
  39225. }
  39226. ret := &Operation{
  39227. ServerResponse: googleapi.ServerResponse{
  39228. Header: res.Header,
  39229. HTTPStatusCode: res.StatusCode,
  39230. },
  39231. }
  39232. target := &ret
  39233. if err := gensupport.DecodeResponse(target, res); err != nil {
  39234. return nil, err
  39235. }
  39236. return ret, nil
  39237. // {
  39238. // "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\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.",
  39239. // "httpMethod": "POST",
  39240. // "id": "compute.instanceGroupManagers.resize",
  39241. // "parameterOrder": [
  39242. // "project",
  39243. // "zone",
  39244. // "instanceGroupManager",
  39245. // "size"
  39246. // ],
  39247. // "parameters": {
  39248. // "instanceGroupManager": {
  39249. // "description": "The name of the managed instance group.",
  39250. // "location": "path",
  39251. // "required": true,
  39252. // "type": "string"
  39253. // },
  39254. // "project": {
  39255. // "description": "Project ID for this request.",
  39256. // "location": "path",
  39257. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39258. // "required": true,
  39259. // "type": "string"
  39260. // },
  39261. // "requestId": {
  39262. // "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).",
  39263. // "location": "query",
  39264. // "type": "string"
  39265. // },
  39266. // "size": {
  39267. // "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.",
  39268. // "format": "int32",
  39269. // "location": "query",
  39270. // "required": true,
  39271. // "type": "integer"
  39272. // },
  39273. // "zone": {
  39274. // "description": "The name of the zone where the managed instance group is located.",
  39275. // "location": "path",
  39276. // "required": true,
  39277. // "type": "string"
  39278. // }
  39279. // },
  39280. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  39281. // "response": {
  39282. // "$ref": "Operation"
  39283. // },
  39284. // "scopes": [
  39285. // "https://www.googleapis.com/auth/cloud-platform",
  39286. // "https://www.googleapis.com/auth/compute"
  39287. // ]
  39288. // }
  39289. }
  39290. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  39291. type InstanceGroupManagersSetInstanceTemplateCall struct {
  39292. s *Service
  39293. project string
  39294. zone string
  39295. instanceGroupManager string
  39296. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  39297. urlParams_ gensupport.URLParams
  39298. ctx_ context.Context
  39299. header_ http.Header
  39300. }
  39301. // SetInstanceTemplate: Specifies the instance template to use when
  39302. // creating new instances in this group. The templates for existing
  39303. // instances in the group do not change unless you recreate them.
  39304. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  39305. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39306. c.project = project
  39307. c.zone = zone
  39308. c.instanceGroupManager = instanceGroupManager
  39309. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  39310. return c
  39311. }
  39312. // RequestId sets the optional parameter "requestId": An optional
  39313. // request ID to identify requests. Specify a unique request ID so that
  39314. // if you must retry your request, the server will know to ignore the
  39315. // request if it has already been completed.
  39316. //
  39317. // For example, consider a situation where you make an initial request
  39318. // and the request times out. If you make the request again with the
  39319. // same request ID, the server can check if original operation with the
  39320. // same request ID was received, and if so, will ignore the second
  39321. // request. This prevents clients from accidentally creating duplicate
  39322. // commitments.
  39323. //
  39324. // The request ID must be a valid UUID with the exception that zero UUID
  39325. // is not supported (00000000-0000-0000-0000-000000000000).
  39326. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  39327. c.urlParams_.Set("requestId", requestId)
  39328. return c
  39329. }
  39330. // Fields allows partial responses to be retrieved. See
  39331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39332. // for more information.
  39333. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  39334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39335. return c
  39336. }
  39337. // Context sets the context to be used in this call's Do method. Any
  39338. // pending HTTP request will be aborted if the provided context is
  39339. // canceled.
  39340. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  39341. c.ctx_ = ctx
  39342. return c
  39343. }
  39344. // Header returns an http.Header that can be modified by the caller to
  39345. // add HTTP headers to the request.
  39346. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  39347. if c.header_ == nil {
  39348. c.header_ = make(http.Header)
  39349. }
  39350. return c.header_
  39351. }
  39352. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  39353. reqHeaders := make(http.Header)
  39354. for k, v := range c.header_ {
  39355. reqHeaders[k] = v
  39356. }
  39357. reqHeaders.Set("User-Agent", c.s.userAgent())
  39358. var body io.Reader = nil
  39359. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  39360. if err != nil {
  39361. return nil, err
  39362. }
  39363. reqHeaders.Set("Content-Type", "application/json")
  39364. c.urlParams_.Set("alt", alt)
  39365. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  39366. urls += "?" + c.urlParams_.Encode()
  39367. req, _ := http.NewRequest("POST", urls, body)
  39368. req.Header = reqHeaders
  39369. googleapi.Expand(req.URL, map[string]string{
  39370. "project": c.project,
  39371. "zone": c.zone,
  39372. "instanceGroupManager": c.instanceGroupManager,
  39373. })
  39374. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39375. }
  39376. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  39377. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39378. // status code is an error. Response headers are in either
  39379. // *Operation.ServerResponse.Header or (if a response was returned at
  39380. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39381. // to check whether the returned error was because
  39382. // http.StatusNotModified was returned.
  39383. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39384. gensupport.SetOptions(c.urlParams_, opts...)
  39385. res, err := c.doRequest("json")
  39386. if res != nil && res.StatusCode == http.StatusNotModified {
  39387. if res.Body != nil {
  39388. res.Body.Close()
  39389. }
  39390. return nil, &googleapi.Error{
  39391. Code: res.StatusCode,
  39392. Header: res.Header,
  39393. }
  39394. }
  39395. if err != nil {
  39396. return nil, err
  39397. }
  39398. defer googleapi.CloseBody(res)
  39399. if err := googleapi.CheckResponse(res); err != nil {
  39400. return nil, err
  39401. }
  39402. ret := &Operation{
  39403. ServerResponse: googleapi.ServerResponse{
  39404. Header: res.Header,
  39405. HTTPStatusCode: res.StatusCode,
  39406. },
  39407. }
  39408. target := &ret
  39409. if err := gensupport.DecodeResponse(target, res); err != nil {
  39410. return nil, err
  39411. }
  39412. return ret, nil
  39413. // {
  39414. // "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.",
  39415. // "httpMethod": "POST",
  39416. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  39417. // "parameterOrder": [
  39418. // "project",
  39419. // "zone",
  39420. // "instanceGroupManager"
  39421. // ],
  39422. // "parameters": {
  39423. // "instanceGroupManager": {
  39424. // "description": "The name of the managed instance group.",
  39425. // "location": "path",
  39426. // "required": true,
  39427. // "type": "string"
  39428. // },
  39429. // "project": {
  39430. // "description": "Project ID for this request.",
  39431. // "location": "path",
  39432. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39433. // "required": true,
  39434. // "type": "string"
  39435. // },
  39436. // "requestId": {
  39437. // "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).",
  39438. // "location": "query",
  39439. // "type": "string"
  39440. // },
  39441. // "zone": {
  39442. // "description": "The name of the zone where the managed instance group is located.",
  39443. // "location": "path",
  39444. // "required": true,
  39445. // "type": "string"
  39446. // }
  39447. // },
  39448. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  39449. // "request": {
  39450. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  39451. // },
  39452. // "response": {
  39453. // "$ref": "Operation"
  39454. // },
  39455. // "scopes": [
  39456. // "https://www.googleapis.com/auth/cloud-platform",
  39457. // "https://www.googleapis.com/auth/compute"
  39458. // ]
  39459. // }
  39460. }
  39461. // method id "compute.instanceGroupManagers.setTargetPools":
  39462. type InstanceGroupManagersSetTargetPoolsCall struct {
  39463. s *Service
  39464. project string
  39465. zone string
  39466. instanceGroupManager string
  39467. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  39468. urlParams_ gensupport.URLParams
  39469. ctx_ context.Context
  39470. header_ http.Header
  39471. }
  39472. // SetTargetPools: Modifies the target pools to which all instances in
  39473. // this managed instance group are assigned. The target pools
  39474. // automatically apply to all of the instances in the managed instance
  39475. // group. This operation is marked DONE when you make the request even
  39476. // if the instances have not yet been added to their target pools. The
  39477. // change might take some time to apply to all of the instances in the
  39478. // group depending on the size of the group.
  39479. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  39480. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39481. c.project = project
  39482. c.zone = zone
  39483. c.instanceGroupManager = instanceGroupManager
  39484. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  39485. return c
  39486. }
  39487. // RequestId sets the optional parameter "requestId": An optional
  39488. // request ID to identify requests. Specify a unique request ID so that
  39489. // if you must retry your request, the server will know to ignore the
  39490. // request if it has already been completed.
  39491. //
  39492. // For example, consider a situation where you make an initial request
  39493. // and the request times out. If you make the request again with the
  39494. // same request ID, the server can check if original operation with the
  39495. // same request ID was received, and if so, will ignore the second
  39496. // request. This prevents clients from accidentally creating duplicate
  39497. // commitments.
  39498. //
  39499. // The request ID must be a valid UUID with the exception that zero UUID
  39500. // is not supported (00000000-0000-0000-0000-000000000000).
  39501. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  39502. c.urlParams_.Set("requestId", requestId)
  39503. return c
  39504. }
  39505. // Fields allows partial responses to be retrieved. See
  39506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39507. // for more information.
  39508. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  39509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39510. return c
  39511. }
  39512. // Context sets the context to be used in this call's Do method. Any
  39513. // pending HTTP request will be aborted if the provided context is
  39514. // canceled.
  39515. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  39516. c.ctx_ = ctx
  39517. return c
  39518. }
  39519. // Header returns an http.Header that can be modified by the caller to
  39520. // add HTTP headers to the request.
  39521. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  39522. if c.header_ == nil {
  39523. c.header_ = make(http.Header)
  39524. }
  39525. return c.header_
  39526. }
  39527. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  39528. reqHeaders := make(http.Header)
  39529. for k, v := range c.header_ {
  39530. reqHeaders[k] = v
  39531. }
  39532. reqHeaders.Set("User-Agent", c.s.userAgent())
  39533. var body io.Reader = nil
  39534. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  39535. if err != nil {
  39536. return nil, err
  39537. }
  39538. reqHeaders.Set("Content-Type", "application/json")
  39539. c.urlParams_.Set("alt", alt)
  39540. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  39541. urls += "?" + c.urlParams_.Encode()
  39542. req, _ := http.NewRequest("POST", urls, body)
  39543. req.Header = reqHeaders
  39544. googleapi.Expand(req.URL, map[string]string{
  39545. "project": c.project,
  39546. "zone": c.zone,
  39547. "instanceGroupManager": c.instanceGroupManager,
  39548. })
  39549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39550. }
  39551. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  39552. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39553. // status code is an error. Response headers are in either
  39554. // *Operation.ServerResponse.Header or (if a response was returned at
  39555. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39556. // to check whether the returned error was because
  39557. // http.StatusNotModified was returned.
  39558. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39559. gensupport.SetOptions(c.urlParams_, opts...)
  39560. res, err := c.doRequest("json")
  39561. if res != nil && res.StatusCode == http.StatusNotModified {
  39562. if res.Body != nil {
  39563. res.Body.Close()
  39564. }
  39565. return nil, &googleapi.Error{
  39566. Code: res.StatusCode,
  39567. Header: res.Header,
  39568. }
  39569. }
  39570. if err != nil {
  39571. return nil, err
  39572. }
  39573. defer googleapi.CloseBody(res)
  39574. if err := googleapi.CheckResponse(res); err != nil {
  39575. return nil, err
  39576. }
  39577. ret := &Operation{
  39578. ServerResponse: googleapi.ServerResponse{
  39579. Header: res.Header,
  39580. HTTPStatusCode: res.StatusCode,
  39581. },
  39582. }
  39583. target := &ret
  39584. if err := gensupport.DecodeResponse(target, res); err != nil {
  39585. return nil, err
  39586. }
  39587. return ret, nil
  39588. // {
  39589. // "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.",
  39590. // "httpMethod": "POST",
  39591. // "id": "compute.instanceGroupManagers.setTargetPools",
  39592. // "parameterOrder": [
  39593. // "project",
  39594. // "zone",
  39595. // "instanceGroupManager"
  39596. // ],
  39597. // "parameters": {
  39598. // "instanceGroupManager": {
  39599. // "description": "The name of the managed instance group.",
  39600. // "location": "path",
  39601. // "required": true,
  39602. // "type": "string"
  39603. // },
  39604. // "project": {
  39605. // "description": "Project ID for this request.",
  39606. // "location": "path",
  39607. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39608. // "required": true,
  39609. // "type": "string"
  39610. // },
  39611. // "requestId": {
  39612. // "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).",
  39613. // "location": "query",
  39614. // "type": "string"
  39615. // },
  39616. // "zone": {
  39617. // "description": "The name of the zone where the managed instance group is located.",
  39618. // "location": "path",
  39619. // "required": true,
  39620. // "type": "string"
  39621. // }
  39622. // },
  39623. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  39624. // "request": {
  39625. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  39626. // },
  39627. // "response": {
  39628. // "$ref": "Operation"
  39629. // },
  39630. // "scopes": [
  39631. // "https://www.googleapis.com/auth/cloud-platform",
  39632. // "https://www.googleapis.com/auth/compute"
  39633. // ]
  39634. // }
  39635. }
  39636. // method id "compute.instanceGroups.addInstances":
  39637. type InstanceGroupsAddInstancesCall struct {
  39638. s *Service
  39639. project string
  39640. zone string
  39641. instanceGroup string
  39642. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  39643. urlParams_ gensupport.URLParams
  39644. ctx_ context.Context
  39645. header_ http.Header
  39646. }
  39647. // AddInstances: Adds a list of instances to the specified instance
  39648. // group. All of the instances in the instance group must be in the same
  39649. // network/subnetwork. Read Adding instances for more information.
  39650. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  39651. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39652. c.project = project
  39653. c.zone = zone
  39654. c.instanceGroup = instanceGroup
  39655. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  39656. return c
  39657. }
  39658. // RequestId sets the optional parameter "requestId": An optional
  39659. // request ID to identify requests. Specify a unique request ID so that
  39660. // if you must retry your request, the server will know to ignore the
  39661. // request if it has already been completed.
  39662. //
  39663. // For example, consider a situation where you make an initial request
  39664. // and the request times out. If you make the request again with the
  39665. // same request ID, the server can check if original operation with the
  39666. // same request ID was received, and if so, will ignore the second
  39667. // request. This prevents clients from accidentally creating duplicate
  39668. // commitments.
  39669. //
  39670. // The request ID must be a valid UUID with the exception that zero UUID
  39671. // is not supported (00000000-0000-0000-0000-000000000000).
  39672. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  39673. c.urlParams_.Set("requestId", requestId)
  39674. return c
  39675. }
  39676. // Fields allows partial responses to be retrieved. See
  39677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39678. // for more information.
  39679. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  39680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39681. return c
  39682. }
  39683. // Context sets the context to be used in this call's Do method. Any
  39684. // pending HTTP request will be aborted if the provided context is
  39685. // canceled.
  39686. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  39687. c.ctx_ = ctx
  39688. return c
  39689. }
  39690. // Header returns an http.Header that can be modified by the caller to
  39691. // add HTTP headers to the request.
  39692. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  39693. if c.header_ == nil {
  39694. c.header_ = make(http.Header)
  39695. }
  39696. return c.header_
  39697. }
  39698. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  39699. reqHeaders := make(http.Header)
  39700. for k, v := range c.header_ {
  39701. reqHeaders[k] = v
  39702. }
  39703. reqHeaders.Set("User-Agent", c.s.userAgent())
  39704. var body io.Reader = nil
  39705. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  39706. if err != nil {
  39707. return nil, err
  39708. }
  39709. reqHeaders.Set("Content-Type", "application/json")
  39710. c.urlParams_.Set("alt", alt)
  39711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  39712. urls += "?" + c.urlParams_.Encode()
  39713. req, _ := http.NewRequest("POST", urls, body)
  39714. req.Header = reqHeaders
  39715. googleapi.Expand(req.URL, map[string]string{
  39716. "project": c.project,
  39717. "zone": c.zone,
  39718. "instanceGroup": c.instanceGroup,
  39719. })
  39720. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39721. }
  39722. // Do executes the "compute.instanceGroups.addInstances" call.
  39723. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39724. // status code is an error. Response headers are in either
  39725. // *Operation.ServerResponse.Header or (if a response was returned at
  39726. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39727. // to check whether the returned error was because
  39728. // http.StatusNotModified was returned.
  39729. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39730. gensupport.SetOptions(c.urlParams_, opts...)
  39731. res, err := c.doRequest("json")
  39732. if res != nil && res.StatusCode == http.StatusNotModified {
  39733. if res.Body != nil {
  39734. res.Body.Close()
  39735. }
  39736. return nil, &googleapi.Error{
  39737. Code: res.StatusCode,
  39738. Header: res.Header,
  39739. }
  39740. }
  39741. if err != nil {
  39742. return nil, err
  39743. }
  39744. defer googleapi.CloseBody(res)
  39745. if err := googleapi.CheckResponse(res); err != nil {
  39746. return nil, err
  39747. }
  39748. ret := &Operation{
  39749. ServerResponse: googleapi.ServerResponse{
  39750. Header: res.Header,
  39751. HTTPStatusCode: res.StatusCode,
  39752. },
  39753. }
  39754. target := &ret
  39755. if err := gensupport.DecodeResponse(target, res); err != nil {
  39756. return nil, err
  39757. }
  39758. return ret, nil
  39759. // {
  39760. // "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.",
  39761. // "httpMethod": "POST",
  39762. // "id": "compute.instanceGroups.addInstances",
  39763. // "parameterOrder": [
  39764. // "project",
  39765. // "zone",
  39766. // "instanceGroup"
  39767. // ],
  39768. // "parameters": {
  39769. // "instanceGroup": {
  39770. // "description": "The name of the instance group where you are adding instances.",
  39771. // "location": "path",
  39772. // "required": true,
  39773. // "type": "string"
  39774. // },
  39775. // "project": {
  39776. // "description": "Project ID for this request.",
  39777. // "location": "path",
  39778. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39779. // "required": true,
  39780. // "type": "string"
  39781. // },
  39782. // "requestId": {
  39783. // "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).",
  39784. // "location": "query",
  39785. // "type": "string"
  39786. // },
  39787. // "zone": {
  39788. // "description": "The name of the zone where the instance group is located.",
  39789. // "location": "path",
  39790. // "required": true,
  39791. // "type": "string"
  39792. // }
  39793. // },
  39794. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  39795. // "request": {
  39796. // "$ref": "InstanceGroupsAddInstancesRequest"
  39797. // },
  39798. // "response": {
  39799. // "$ref": "Operation"
  39800. // },
  39801. // "scopes": [
  39802. // "https://www.googleapis.com/auth/cloud-platform",
  39803. // "https://www.googleapis.com/auth/compute"
  39804. // ]
  39805. // }
  39806. }
  39807. // method id "compute.instanceGroups.aggregatedList":
  39808. type InstanceGroupsAggregatedListCall struct {
  39809. s *Service
  39810. project string
  39811. urlParams_ gensupport.URLParams
  39812. ifNoneMatch_ string
  39813. ctx_ context.Context
  39814. header_ http.Header
  39815. }
  39816. // AggregatedList: Retrieves the list of instance groups and sorts them
  39817. // by zone.
  39818. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  39819. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39820. c.project = project
  39821. return c
  39822. }
  39823. // Filter sets the optional parameter "filter": A filter expression that
  39824. // filters resources listed in the response. The expression must specify
  39825. // the field name, a comparison operator, and the value that you want to
  39826. // use for filtering. The value must be a string, a number, or a
  39827. // boolean. The comparison operator must be either =, !=, >, or <.
  39828. //
  39829. // For example, if you are filtering Compute Engine instances, you can
  39830. // exclude instances named example-instance by specifying name !=
  39831. // example-instance.
  39832. //
  39833. // You can also filter nested fields. For example, you could specify
  39834. // scheduling.automaticRestart = false to include instances only if they
  39835. // are not scheduled for automatic restarts. You can use filtering on
  39836. // nested fields to filter based on resource labels.
  39837. //
  39838. // To filter on multiple expressions, provide each separate expression
  39839. // within parentheses. For example, (scheduling.automaticRestart = true)
  39840. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39841. // AND expression. However, you can include AND and OR expressions
  39842. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39843. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39844. // true).
  39845. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  39846. c.urlParams_.Set("filter", filter)
  39847. return c
  39848. }
  39849. // MaxResults sets the optional parameter "maxResults": The maximum
  39850. // number of results per page that should be returned. If the number of
  39851. // available results is larger than maxResults, Compute Engine returns a
  39852. // nextPageToken that can be used to get the next page of results in
  39853. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39854. // (Default: 500)
  39855. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  39856. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39857. return c
  39858. }
  39859. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39860. // a certain order. By default, results are returned in alphanumerical
  39861. // order based on the resource name.
  39862. //
  39863. // You can also sort results in descending order based on the creation
  39864. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39865. // based on the creationTimestamp field in reverse chronological order
  39866. // (newest result first). Use this to sort resources like operations so
  39867. // that the newest operation is returned first.
  39868. //
  39869. // Currently, only sorting by name or creationTimestamp desc is
  39870. // supported.
  39871. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  39872. c.urlParams_.Set("orderBy", orderBy)
  39873. return c
  39874. }
  39875. // PageToken sets the optional parameter "pageToken": Specifies a page
  39876. // token to use. Set pageToken to the nextPageToken returned by a
  39877. // previous list request to get the next page of results.
  39878. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  39879. c.urlParams_.Set("pageToken", pageToken)
  39880. return c
  39881. }
  39882. // Fields allows partial responses to be retrieved. See
  39883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39884. // for more information.
  39885. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  39886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39887. return c
  39888. }
  39889. // IfNoneMatch sets the optional parameter which makes the operation
  39890. // fail if the object's ETag matches the given value. This is useful for
  39891. // getting updates only after the object has changed since the last
  39892. // request. Use googleapi.IsNotModified to check whether the response
  39893. // error from Do is the result of In-None-Match.
  39894. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  39895. c.ifNoneMatch_ = entityTag
  39896. return c
  39897. }
  39898. // Context sets the context to be used in this call's Do method. Any
  39899. // pending HTTP request will be aborted if the provided context is
  39900. // canceled.
  39901. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  39902. c.ctx_ = ctx
  39903. return c
  39904. }
  39905. // Header returns an http.Header that can be modified by the caller to
  39906. // add HTTP headers to the request.
  39907. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  39908. if c.header_ == nil {
  39909. c.header_ = make(http.Header)
  39910. }
  39911. return c.header_
  39912. }
  39913. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  39914. reqHeaders := make(http.Header)
  39915. for k, v := range c.header_ {
  39916. reqHeaders[k] = v
  39917. }
  39918. reqHeaders.Set("User-Agent", c.s.userAgent())
  39919. if c.ifNoneMatch_ != "" {
  39920. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39921. }
  39922. var body io.Reader = nil
  39923. c.urlParams_.Set("alt", alt)
  39924. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  39925. urls += "?" + c.urlParams_.Encode()
  39926. req, _ := http.NewRequest("GET", urls, body)
  39927. req.Header = reqHeaders
  39928. googleapi.Expand(req.URL, map[string]string{
  39929. "project": c.project,
  39930. })
  39931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39932. }
  39933. // Do executes the "compute.instanceGroups.aggregatedList" call.
  39934. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  39935. // Any non-2xx status code is an error. Response headers are in either
  39936. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  39937. // was returned at all) in error.(*googleapi.Error).Header. Use
  39938. // googleapi.IsNotModified to check whether the returned error was
  39939. // because http.StatusNotModified was returned.
  39940. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  39941. gensupport.SetOptions(c.urlParams_, opts...)
  39942. res, err := c.doRequest("json")
  39943. if res != nil && res.StatusCode == http.StatusNotModified {
  39944. if res.Body != nil {
  39945. res.Body.Close()
  39946. }
  39947. return nil, &googleapi.Error{
  39948. Code: res.StatusCode,
  39949. Header: res.Header,
  39950. }
  39951. }
  39952. if err != nil {
  39953. return nil, err
  39954. }
  39955. defer googleapi.CloseBody(res)
  39956. if err := googleapi.CheckResponse(res); err != nil {
  39957. return nil, err
  39958. }
  39959. ret := &InstanceGroupAggregatedList{
  39960. ServerResponse: googleapi.ServerResponse{
  39961. Header: res.Header,
  39962. HTTPStatusCode: res.StatusCode,
  39963. },
  39964. }
  39965. target := &ret
  39966. if err := gensupport.DecodeResponse(target, res); err != nil {
  39967. return nil, err
  39968. }
  39969. return ret, nil
  39970. // {
  39971. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  39972. // "httpMethod": "GET",
  39973. // "id": "compute.instanceGroups.aggregatedList",
  39974. // "parameterOrder": [
  39975. // "project"
  39976. // ],
  39977. // "parameters": {
  39978. // "filter": {
  39979. // "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).",
  39980. // "location": "query",
  39981. // "type": "string"
  39982. // },
  39983. // "maxResults": {
  39984. // "default": "500",
  39985. // "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)",
  39986. // "format": "uint32",
  39987. // "location": "query",
  39988. // "minimum": "0",
  39989. // "type": "integer"
  39990. // },
  39991. // "orderBy": {
  39992. // "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.",
  39993. // "location": "query",
  39994. // "type": "string"
  39995. // },
  39996. // "pageToken": {
  39997. // "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.",
  39998. // "location": "query",
  39999. // "type": "string"
  40000. // },
  40001. // "project": {
  40002. // "description": "Project ID for this request.",
  40003. // "location": "path",
  40004. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40005. // "required": true,
  40006. // "type": "string"
  40007. // }
  40008. // },
  40009. // "path": "{project}/aggregated/instanceGroups",
  40010. // "response": {
  40011. // "$ref": "InstanceGroupAggregatedList"
  40012. // },
  40013. // "scopes": [
  40014. // "https://www.googleapis.com/auth/cloud-platform",
  40015. // "https://www.googleapis.com/auth/compute",
  40016. // "https://www.googleapis.com/auth/compute.readonly"
  40017. // ]
  40018. // }
  40019. }
  40020. // Pages invokes f for each page of results.
  40021. // A non-nil error returned from f will halt the iteration.
  40022. // The provided context supersedes any context provided to the Context method.
  40023. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  40024. c.ctx_ = ctx
  40025. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40026. for {
  40027. x, err := c.Do()
  40028. if err != nil {
  40029. return err
  40030. }
  40031. if err := f(x); err != nil {
  40032. return err
  40033. }
  40034. if x.NextPageToken == "" {
  40035. return nil
  40036. }
  40037. c.PageToken(x.NextPageToken)
  40038. }
  40039. }
  40040. // method id "compute.instanceGroups.delete":
  40041. type InstanceGroupsDeleteCall struct {
  40042. s *Service
  40043. project string
  40044. zone string
  40045. instanceGroup string
  40046. urlParams_ gensupport.URLParams
  40047. ctx_ context.Context
  40048. header_ http.Header
  40049. }
  40050. // Delete: Deletes the specified instance group. The instances in the
  40051. // group are not deleted. Note that instance group must not belong to a
  40052. // backend service. Read Deleting an instance group for more
  40053. // information.
  40054. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  40055. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40056. c.project = project
  40057. c.zone = zone
  40058. c.instanceGroup = instanceGroup
  40059. return c
  40060. }
  40061. // RequestId sets the optional parameter "requestId": An optional
  40062. // request ID to identify requests. Specify a unique request ID so that
  40063. // if you must retry your request, the server will know to ignore the
  40064. // request if it has already been completed.
  40065. //
  40066. // For example, consider a situation where you make an initial request
  40067. // and the request times out. If you make the request again with the
  40068. // same request ID, the server can check if original operation with the
  40069. // same request ID was received, and if so, will ignore the second
  40070. // request. This prevents clients from accidentally creating duplicate
  40071. // commitments.
  40072. //
  40073. // The request ID must be a valid UUID with the exception that zero UUID
  40074. // is not supported (00000000-0000-0000-0000-000000000000).
  40075. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  40076. c.urlParams_.Set("requestId", requestId)
  40077. return c
  40078. }
  40079. // Fields allows partial responses to be retrieved. See
  40080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40081. // for more information.
  40082. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  40083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40084. return c
  40085. }
  40086. // Context sets the context to be used in this call's Do method. Any
  40087. // pending HTTP request will be aborted if the provided context is
  40088. // canceled.
  40089. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  40090. c.ctx_ = ctx
  40091. return c
  40092. }
  40093. // Header returns an http.Header that can be modified by the caller to
  40094. // add HTTP headers to the request.
  40095. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  40096. if c.header_ == nil {
  40097. c.header_ = make(http.Header)
  40098. }
  40099. return c.header_
  40100. }
  40101. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  40102. reqHeaders := make(http.Header)
  40103. for k, v := range c.header_ {
  40104. reqHeaders[k] = v
  40105. }
  40106. reqHeaders.Set("User-Agent", c.s.userAgent())
  40107. var body io.Reader = nil
  40108. c.urlParams_.Set("alt", alt)
  40109. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  40110. urls += "?" + c.urlParams_.Encode()
  40111. req, _ := http.NewRequest("DELETE", urls, body)
  40112. req.Header = reqHeaders
  40113. googleapi.Expand(req.URL, map[string]string{
  40114. "project": c.project,
  40115. "zone": c.zone,
  40116. "instanceGroup": c.instanceGroup,
  40117. })
  40118. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40119. }
  40120. // Do executes the "compute.instanceGroups.delete" call.
  40121. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40122. // status code is an error. Response headers are in either
  40123. // *Operation.ServerResponse.Header or (if a response was returned at
  40124. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40125. // to check whether the returned error was because
  40126. // http.StatusNotModified was returned.
  40127. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40128. gensupport.SetOptions(c.urlParams_, opts...)
  40129. res, err := c.doRequest("json")
  40130. if res != nil && res.StatusCode == http.StatusNotModified {
  40131. if res.Body != nil {
  40132. res.Body.Close()
  40133. }
  40134. return nil, &googleapi.Error{
  40135. Code: res.StatusCode,
  40136. Header: res.Header,
  40137. }
  40138. }
  40139. if err != nil {
  40140. return nil, err
  40141. }
  40142. defer googleapi.CloseBody(res)
  40143. if err := googleapi.CheckResponse(res); err != nil {
  40144. return nil, err
  40145. }
  40146. ret := &Operation{
  40147. ServerResponse: googleapi.ServerResponse{
  40148. Header: res.Header,
  40149. HTTPStatusCode: res.StatusCode,
  40150. },
  40151. }
  40152. target := &ret
  40153. if err := gensupport.DecodeResponse(target, res); err != nil {
  40154. return nil, err
  40155. }
  40156. return ret, nil
  40157. // {
  40158. // "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.",
  40159. // "httpMethod": "DELETE",
  40160. // "id": "compute.instanceGroups.delete",
  40161. // "parameterOrder": [
  40162. // "project",
  40163. // "zone",
  40164. // "instanceGroup"
  40165. // ],
  40166. // "parameters": {
  40167. // "instanceGroup": {
  40168. // "description": "The name of the instance group to delete.",
  40169. // "location": "path",
  40170. // "required": true,
  40171. // "type": "string"
  40172. // },
  40173. // "project": {
  40174. // "description": "Project ID for this request.",
  40175. // "location": "path",
  40176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40177. // "required": true,
  40178. // "type": "string"
  40179. // },
  40180. // "requestId": {
  40181. // "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).",
  40182. // "location": "query",
  40183. // "type": "string"
  40184. // },
  40185. // "zone": {
  40186. // "description": "The name of the zone where the instance group is located.",
  40187. // "location": "path",
  40188. // "required": true,
  40189. // "type": "string"
  40190. // }
  40191. // },
  40192. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  40193. // "response": {
  40194. // "$ref": "Operation"
  40195. // },
  40196. // "scopes": [
  40197. // "https://www.googleapis.com/auth/cloud-platform",
  40198. // "https://www.googleapis.com/auth/compute"
  40199. // ]
  40200. // }
  40201. }
  40202. // method id "compute.instanceGroups.get":
  40203. type InstanceGroupsGetCall struct {
  40204. s *Service
  40205. project string
  40206. zone string
  40207. instanceGroup string
  40208. urlParams_ gensupport.URLParams
  40209. ifNoneMatch_ string
  40210. ctx_ context.Context
  40211. header_ http.Header
  40212. }
  40213. // Get: Returns the specified instance group. Gets a list of available
  40214. // instance groups by making a list() request.
  40215. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  40216. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40217. c.project = project
  40218. c.zone = zone
  40219. c.instanceGroup = instanceGroup
  40220. return c
  40221. }
  40222. // Fields allows partial responses to be retrieved. See
  40223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40224. // for more information.
  40225. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  40226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40227. return c
  40228. }
  40229. // IfNoneMatch sets the optional parameter which makes the operation
  40230. // fail if the object's ETag matches the given value. This is useful for
  40231. // getting updates only after the object has changed since the last
  40232. // request. Use googleapi.IsNotModified to check whether the response
  40233. // error from Do is the result of In-None-Match.
  40234. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  40235. c.ifNoneMatch_ = entityTag
  40236. return c
  40237. }
  40238. // Context sets the context to be used in this call's Do method. Any
  40239. // pending HTTP request will be aborted if the provided context is
  40240. // canceled.
  40241. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  40242. c.ctx_ = ctx
  40243. return c
  40244. }
  40245. // Header returns an http.Header that can be modified by the caller to
  40246. // add HTTP headers to the request.
  40247. func (c *InstanceGroupsGetCall) Header() http.Header {
  40248. if c.header_ == nil {
  40249. c.header_ = make(http.Header)
  40250. }
  40251. return c.header_
  40252. }
  40253. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  40254. reqHeaders := make(http.Header)
  40255. for k, v := range c.header_ {
  40256. reqHeaders[k] = v
  40257. }
  40258. reqHeaders.Set("User-Agent", c.s.userAgent())
  40259. if c.ifNoneMatch_ != "" {
  40260. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40261. }
  40262. var body io.Reader = nil
  40263. c.urlParams_.Set("alt", alt)
  40264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  40265. urls += "?" + c.urlParams_.Encode()
  40266. req, _ := http.NewRequest("GET", urls, body)
  40267. req.Header = reqHeaders
  40268. googleapi.Expand(req.URL, map[string]string{
  40269. "project": c.project,
  40270. "zone": c.zone,
  40271. "instanceGroup": c.instanceGroup,
  40272. })
  40273. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40274. }
  40275. // Do executes the "compute.instanceGroups.get" call.
  40276. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  40277. // status code is an error. Response headers are in either
  40278. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  40279. // at all) in error.(*googleapi.Error).Header. Use
  40280. // googleapi.IsNotModified to check whether the returned error was
  40281. // because http.StatusNotModified was returned.
  40282. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  40283. gensupport.SetOptions(c.urlParams_, opts...)
  40284. res, err := c.doRequest("json")
  40285. if res != nil && res.StatusCode == http.StatusNotModified {
  40286. if res.Body != nil {
  40287. res.Body.Close()
  40288. }
  40289. return nil, &googleapi.Error{
  40290. Code: res.StatusCode,
  40291. Header: res.Header,
  40292. }
  40293. }
  40294. if err != nil {
  40295. return nil, err
  40296. }
  40297. defer googleapi.CloseBody(res)
  40298. if err := googleapi.CheckResponse(res); err != nil {
  40299. return nil, err
  40300. }
  40301. ret := &InstanceGroup{
  40302. ServerResponse: googleapi.ServerResponse{
  40303. Header: res.Header,
  40304. HTTPStatusCode: res.StatusCode,
  40305. },
  40306. }
  40307. target := &ret
  40308. if err := gensupport.DecodeResponse(target, res); err != nil {
  40309. return nil, err
  40310. }
  40311. return ret, nil
  40312. // {
  40313. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  40314. // "httpMethod": "GET",
  40315. // "id": "compute.instanceGroups.get",
  40316. // "parameterOrder": [
  40317. // "project",
  40318. // "zone",
  40319. // "instanceGroup"
  40320. // ],
  40321. // "parameters": {
  40322. // "instanceGroup": {
  40323. // "description": "The name of the instance group.",
  40324. // "location": "path",
  40325. // "required": true,
  40326. // "type": "string"
  40327. // },
  40328. // "project": {
  40329. // "description": "Project ID for this request.",
  40330. // "location": "path",
  40331. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40332. // "required": true,
  40333. // "type": "string"
  40334. // },
  40335. // "zone": {
  40336. // "description": "The name of the zone where the instance group is located.",
  40337. // "location": "path",
  40338. // "required": true,
  40339. // "type": "string"
  40340. // }
  40341. // },
  40342. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  40343. // "response": {
  40344. // "$ref": "InstanceGroup"
  40345. // },
  40346. // "scopes": [
  40347. // "https://www.googleapis.com/auth/cloud-platform",
  40348. // "https://www.googleapis.com/auth/compute",
  40349. // "https://www.googleapis.com/auth/compute.readonly"
  40350. // ]
  40351. // }
  40352. }
  40353. // method id "compute.instanceGroups.insert":
  40354. type InstanceGroupsInsertCall struct {
  40355. s *Service
  40356. project string
  40357. zone string
  40358. instancegroup *InstanceGroup
  40359. urlParams_ gensupport.URLParams
  40360. ctx_ context.Context
  40361. header_ http.Header
  40362. }
  40363. // Insert: Creates an instance group in the specified project using the
  40364. // parameters that are included in the request.
  40365. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  40366. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40367. c.project = project
  40368. c.zone = zone
  40369. c.instancegroup = instancegroup
  40370. return c
  40371. }
  40372. // RequestId sets the optional parameter "requestId": An optional
  40373. // request ID to identify requests. Specify a unique request ID so that
  40374. // if you must retry your request, the server will know to ignore the
  40375. // request if it has already been completed.
  40376. //
  40377. // For example, consider a situation where you make an initial request
  40378. // and the request times out. If you make the request again with the
  40379. // same request ID, the server can check if original operation with the
  40380. // same request ID was received, and if so, will ignore the second
  40381. // request. This prevents clients from accidentally creating duplicate
  40382. // commitments.
  40383. //
  40384. // The request ID must be a valid UUID with the exception that zero UUID
  40385. // is not supported (00000000-0000-0000-0000-000000000000).
  40386. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  40387. c.urlParams_.Set("requestId", requestId)
  40388. return c
  40389. }
  40390. // Fields allows partial responses to be retrieved. See
  40391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40392. // for more information.
  40393. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  40394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40395. return c
  40396. }
  40397. // Context sets the context to be used in this call's Do method. Any
  40398. // pending HTTP request will be aborted if the provided context is
  40399. // canceled.
  40400. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  40401. c.ctx_ = ctx
  40402. return c
  40403. }
  40404. // Header returns an http.Header that can be modified by the caller to
  40405. // add HTTP headers to the request.
  40406. func (c *InstanceGroupsInsertCall) Header() http.Header {
  40407. if c.header_ == nil {
  40408. c.header_ = make(http.Header)
  40409. }
  40410. return c.header_
  40411. }
  40412. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  40413. reqHeaders := make(http.Header)
  40414. for k, v := range c.header_ {
  40415. reqHeaders[k] = v
  40416. }
  40417. reqHeaders.Set("User-Agent", c.s.userAgent())
  40418. var body io.Reader = nil
  40419. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  40420. if err != nil {
  40421. return nil, err
  40422. }
  40423. reqHeaders.Set("Content-Type", "application/json")
  40424. c.urlParams_.Set("alt", alt)
  40425. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  40426. urls += "?" + c.urlParams_.Encode()
  40427. req, _ := http.NewRequest("POST", urls, body)
  40428. req.Header = reqHeaders
  40429. googleapi.Expand(req.URL, map[string]string{
  40430. "project": c.project,
  40431. "zone": c.zone,
  40432. })
  40433. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40434. }
  40435. // Do executes the "compute.instanceGroups.insert" call.
  40436. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40437. // status code is an error. Response headers are in either
  40438. // *Operation.ServerResponse.Header or (if a response was returned at
  40439. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40440. // to check whether the returned error was because
  40441. // http.StatusNotModified was returned.
  40442. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40443. gensupport.SetOptions(c.urlParams_, opts...)
  40444. res, err := c.doRequest("json")
  40445. if res != nil && res.StatusCode == http.StatusNotModified {
  40446. if res.Body != nil {
  40447. res.Body.Close()
  40448. }
  40449. return nil, &googleapi.Error{
  40450. Code: res.StatusCode,
  40451. Header: res.Header,
  40452. }
  40453. }
  40454. if err != nil {
  40455. return nil, err
  40456. }
  40457. defer googleapi.CloseBody(res)
  40458. if err := googleapi.CheckResponse(res); err != nil {
  40459. return nil, err
  40460. }
  40461. ret := &Operation{
  40462. ServerResponse: googleapi.ServerResponse{
  40463. Header: res.Header,
  40464. HTTPStatusCode: res.StatusCode,
  40465. },
  40466. }
  40467. target := &ret
  40468. if err := gensupport.DecodeResponse(target, res); err != nil {
  40469. return nil, err
  40470. }
  40471. return ret, nil
  40472. // {
  40473. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  40474. // "httpMethod": "POST",
  40475. // "id": "compute.instanceGroups.insert",
  40476. // "parameterOrder": [
  40477. // "project",
  40478. // "zone"
  40479. // ],
  40480. // "parameters": {
  40481. // "project": {
  40482. // "description": "Project ID for this request.",
  40483. // "location": "path",
  40484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40485. // "required": true,
  40486. // "type": "string"
  40487. // },
  40488. // "requestId": {
  40489. // "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).",
  40490. // "location": "query",
  40491. // "type": "string"
  40492. // },
  40493. // "zone": {
  40494. // "description": "The name of the zone where you want to create the instance group.",
  40495. // "location": "path",
  40496. // "required": true,
  40497. // "type": "string"
  40498. // }
  40499. // },
  40500. // "path": "{project}/zones/{zone}/instanceGroups",
  40501. // "request": {
  40502. // "$ref": "InstanceGroup"
  40503. // },
  40504. // "response": {
  40505. // "$ref": "Operation"
  40506. // },
  40507. // "scopes": [
  40508. // "https://www.googleapis.com/auth/cloud-platform",
  40509. // "https://www.googleapis.com/auth/compute"
  40510. // ]
  40511. // }
  40512. }
  40513. // method id "compute.instanceGroups.list":
  40514. type InstanceGroupsListCall struct {
  40515. s *Service
  40516. project string
  40517. zone string
  40518. urlParams_ gensupport.URLParams
  40519. ifNoneMatch_ string
  40520. ctx_ context.Context
  40521. header_ http.Header
  40522. }
  40523. // List: Retrieves the list of instance groups that are located in the
  40524. // specified project and zone.
  40525. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  40526. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40527. c.project = project
  40528. c.zone = zone
  40529. return c
  40530. }
  40531. // Filter sets the optional parameter "filter": A filter expression that
  40532. // filters resources listed in the response. The expression must specify
  40533. // the field name, a comparison operator, and the value that you want to
  40534. // use for filtering. The value must be a string, a number, or a
  40535. // boolean. The comparison operator must be either =, !=, >, or <.
  40536. //
  40537. // For example, if you are filtering Compute Engine instances, you can
  40538. // exclude instances named example-instance by specifying name !=
  40539. // example-instance.
  40540. //
  40541. // You can also filter nested fields. For example, you could specify
  40542. // scheduling.automaticRestart = false to include instances only if they
  40543. // are not scheduled for automatic restarts. You can use filtering on
  40544. // nested fields to filter based on resource labels.
  40545. //
  40546. // To filter on multiple expressions, provide each separate expression
  40547. // within parentheses. For example, (scheduling.automaticRestart = true)
  40548. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40549. // AND expression. However, you can include AND and OR expressions
  40550. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40551. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40552. // true).
  40553. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  40554. c.urlParams_.Set("filter", filter)
  40555. return c
  40556. }
  40557. // MaxResults sets the optional parameter "maxResults": The maximum
  40558. // number of results per page that should be returned. If the number of
  40559. // available results is larger than maxResults, Compute Engine returns a
  40560. // nextPageToken that can be used to get the next page of results in
  40561. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40562. // (Default: 500)
  40563. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  40564. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40565. return c
  40566. }
  40567. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40568. // a certain order. By default, results are returned in alphanumerical
  40569. // order based on the resource name.
  40570. //
  40571. // You can also sort results in descending order based on the creation
  40572. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40573. // based on the creationTimestamp field in reverse chronological order
  40574. // (newest result first). Use this to sort resources like operations so
  40575. // that the newest operation is returned first.
  40576. //
  40577. // Currently, only sorting by name or creationTimestamp desc is
  40578. // supported.
  40579. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  40580. c.urlParams_.Set("orderBy", orderBy)
  40581. return c
  40582. }
  40583. // PageToken sets the optional parameter "pageToken": Specifies a page
  40584. // token to use. Set pageToken to the nextPageToken returned by a
  40585. // previous list request to get the next page of results.
  40586. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  40587. c.urlParams_.Set("pageToken", pageToken)
  40588. return c
  40589. }
  40590. // Fields allows partial responses to be retrieved. See
  40591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40592. // for more information.
  40593. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  40594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40595. return c
  40596. }
  40597. // IfNoneMatch sets the optional parameter which makes the operation
  40598. // fail if the object's ETag matches the given value. This is useful for
  40599. // getting updates only after the object has changed since the last
  40600. // request. Use googleapi.IsNotModified to check whether the response
  40601. // error from Do is the result of In-None-Match.
  40602. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  40603. c.ifNoneMatch_ = entityTag
  40604. return c
  40605. }
  40606. // Context sets the context to be used in this call's Do method. Any
  40607. // pending HTTP request will be aborted if the provided context is
  40608. // canceled.
  40609. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  40610. c.ctx_ = ctx
  40611. return c
  40612. }
  40613. // Header returns an http.Header that can be modified by the caller to
  40614. // add HTTP headers to the request.
  40615. func (c *InstanceGroupsListCall) Header() http.Header {
  40616. if c.header_ == nil {
  40617. c.header_ = make(http.Header)
  40618. }
  40619. return c.header_
  40620. }
  40621. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  40622. reqHeaders := make(http.Header)
  40623. for k, v := range c.header_ {
  40624. reqHeaders[k] = v
  40625. }
  40626. reqHeaders.Set("User-Agent", c.s.userAgent())
  40627. if c.ifNoneMatch_ != "" {
  40628. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40629. }
  40630. var body io.Reader = nil
  40631. c.urlParams_.Set("alt", alt)
  40632. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  40633. urls += "?" + c.urlParams_.Encode()
  40634. req, _ := http.NewRequest("GET", urls, body)
  40635. req.Header = reqHeaders
  40636. googleapi.Expand(req.URL, map[string]string{
  40637. "project": c.project,
  40638. "zone": c.zone,
  40639. })
  40640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40641. }
  40642. // Do executes the "compute.instanceGroups.list" call.
  40643. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  40644. // non-2xx status code is an error. Response headers are in either
  40645. // *InstanceGroupList.ServerResponse.Header or (if a response was
  40646. // returned at all) in error.(*googleapi.Error).Header. Use
  40647. // googleapi.IsNotModified to check whether the returned error was
  40648. // because http.StatusNotModified was returned.
  40649. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  40650. gensupport.SetOptions(c.urlParams_, opts...)
  40651. res, err := c.doRequest("json")
  40652. if res != nil && res.StatusCode == http.StatusNotModified {
  40653. if res.Body != nil {
  40654. res.Body.Close()
  40655. }
  40656. return nil, &googleapi.Error{
  40657. Code: res.StatusCode,
  40658. Header: res.Header,
  40659. }
  40660. }
  40661. if err != nil {
  40662. return nil, err
  40663. }
  40664. defer googleapi.CloseBody(res)
  40665. if err := googleapi.CheckResponse(res); err != nil {
  40666. return nil, err
  40667. }
  40668. ret := &InstanceGroupList{
  40669. ServerResponse: googleapi.ServerResponse{
  40670. Header: res.Header,
  40671. HTTPStatusCode: res.StatusCode,
  40672. },
  40673. }
  40674. target := &ret
  40675. if err := gensupport.DecodeResponse(target, res); err != nil {
  40676. return nil, err
  40677. }
  40678. return ret, nil
  40679. // {
  40680. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  40681. // "httpMethod": "GET",
  40682. // "id": "compute.instanceGroups.list",
  40683. // "parameterOrder": [
  40684. // "project",
  40685. // "zone"
  40686. // ],
  40687. // "parameters": {
  40688. // "filter": {
  40689. // "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).",
  40690. // "location": "query",
  40691. // "type": "string"
  40692. // },
  40693. // "maxResults": {
  40694. // "default": "500",
  40695. // "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)",
  40696. // "format": "uint32",
  40697. // "location": "query",
  40698. // "minimum": "0",
  40699. // "type": "integer"
  40700. // },
  40701. // "orderBy": {
  40702. // "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.",
  40703. // "location": "query",
  40704. // "type": "string"
  40705. // },
  40706. // "pageToken": {
  40707. // "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.",
  40708. // "location": "query",
  40709. // "type": "string"
  40710. // },
  40711. // "project": {
  40712. // "description": "Project ID for this request.",
  40713. // "location": "path",
  40714. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40715. // "required": true,
  40716. // "type": "string"
  40717. // },
  40718. // "zone": {
  40719. // "description": "The name of the zone where the instance group is located.",
  40720. // "location": "path",
  40721. // "required": true,
  40722. // "type": "string"
  40723. // }
  40724. // },
  40725. // "path": "{project}/zones/{zone}/instanceGroups",
  40726. // "response": {
  40727. // "$ref": "InstanceGroupList"
  40728. // },
  40729. // "scopes": [
  40730. // "https://www.googleapis.com/auth/cloud-platform",
  40731. // "https://www.googleapis.com/auth/compute",
  40732. // "https://www.googleapis.com/auth/compute.readonly"
  40733. // ]
  40734. // }
  40735. }
  40736. // Pages invokes f for each page of results.
  40737. // A non-nil error returned from f will halt the iteration.
  40738. // The provided context supersedes any context provided to the Context method.
  40739. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  40740. c.ctx_ = ctx
  40741. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40742. for {
  40743. x, err := c.Do()
  40744. if err != nil {
  40745. return err
  40746. }
  40747. if err := f(x); err != nil {
  40748. return err
  40749. }
  40750. if x.NextPageToken == "" {
  40751. return nil
  40752. }
  40753. c.PageToken(x.NextPageToken)
  40754. }
  40755. }
  40756. // method id "compute.instanceGroups.listInstances":
  40757. type InstanceGroupsListInstancesCall struct {
  40758. s *Service
  40759. project string
  40760. zone string
  40761. instanceGroup string
  40762. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  40763. urlParams_ gensupport.URLParams
  40764. ctx_ context.Context
  40765. header_ http.Header
  40766. }
  40767. // ListInstances: Lists the instances in the specified instance group.
  40768. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  40769. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40770. c.project = project
  40771. c.zone = zone
  40772. c.instanceGroup = instanceGroup
  40773. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  40774. return c
  40775. }
  40776. // Filter sets the optional parameter "filter": A filter expression that
  40777. // filters resources listed in the response. The expression must specify
  40778. // the field name, a comparison operator, and the value that you want to
  40779. // use for filtering. The value must be a string, a number, or a
  40780. // boolean. The comparison operator must be either =, !=, >, or <.
  40781. //
  40782. // For example, if you are filtering Compute Engine instances, you can
  40783. // exclude instances named example-instance by specifying name !=
  40784. // example-instance.
  40785. //
  40786. // You can also filter nested fields. For example, you could specify
  40787. // scheduling.automaticRestart = false to include instances only if they
  40788. // are not scheduled for automatic restarts. You can use filtering on
  40789. // nested fields to filter based on resource labels.
  40790. //
  40791. // To filter on multiple expressions, provide each separate expression
  40792. // within parentheses. For example, (scheduling.automaticRestart = true)
  40793. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40794. // AND expression. However, you can include AND and OR expressions
  40795. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40796. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40797. // true).
  40798. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  40799. c.urlParams_.Set("filter", filter)
  40800. return c
  40801. }
  40802. // MaxResults sets the optional parameter "maxResults": The maximum
  40803. // number of results per page that should be returned. If the number of
  40804. // available results is larger than maxResults, Compute Engine returns a
  40805. // nextPageToken that can be used to get the next page of results in
  40806. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40807. // (Default: 500)
  40808. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  40809. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40810. return c
  40811. }
  40812. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40813. // a certain order. By default, results are returned in alphanumerical
  40814. // order based on the resource name.
  40815. //
  40816. // You can also sort results in descending order based on the creation
  40817. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40818. // based on the creationTimestamp field in reverse chronological order
  40819. // (newest result first). Use this to sort resources like operations so
  40820. // that the newest operation is returned first.
  40821. //
  40822. // Currently, only sorting by name or creationTimestamp desc is
  40823. // supported.
  40824. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  40825. c.urlParams_.Set("orderBy", orderBy)
  40826. return c
  40827. }
  40828. // PageToken sets the optional parameter "pageToken": Specifies a page
  40829. // token to use. Set pageToken to the nextPageToken returned by a
  40830. // previous list request to get the next page of results.
  40831. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  40832. c.urlParams_.Set("pageToken", pageToken)
  40833. return c
  40834. }
  40835. // Fields allows partial responses to be retrieved. See
  40836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40837. // for more information.
  40838. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  40839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40840. return c
  40841. }
  40842. // Context sets the context to be used in this call's Do method. Any
  40843. // pending HTTP request will be aborted if the provided context is
  40844. // canceled.
  40845. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  40846. c.ctx_ = ctx
  40847. return c
  40848. }
  40849. // Header returns an http.Header that can be modified by the caller to
  40850. // add HTTP headers to the request.
  40851. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  40852. if c.header_ == nil {
  40853. c.header_ = make(http.Header)
  40854. }
  40855. return c.header_
  40856. }
  40857. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  40858. reqHeaders := make(http.Header)
  40859. for k, v := range c.header_ {
  40860. reqHeaders[k] = v
  40861. }
  40862. reqHeaders.Set("User-Agent", c.s.userAgent())
  40863. var body io.Reader = nil
  40864. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  40865. if err != nil {
  40866. return nil, err
  40867. }
  40868. reqHeaders.Set("Content-Type", "application/json")
  40869. c.urlParams_.Set("alt", alt)
  40870. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  40871. urls += "?" + c.urlParams_.Encode()
  40872. req, _ := http.NewRequest("POST", urls, body)
  40873. req.Header = reqHeaders
  40874. googleapi.Expand(req.URL, map[string]string{
  40875. "project": c.project,
  40876. "zone": c.zone,
  40877. "instanceGroup": c.instanceGroup,
  40878. })
  40879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40880. }
  40881. // Do executes the "compute.instanceGroups.listInstances" call.
  40882. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  40883. // Any non-2xx status code is an error. Response headers are in either
  40884. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  40885. // was returned at all) in error.(*googleapi.Error).Header. Use
  40886. // googleapi.IsNotModified to check whether the returned error was
  40887. // because http.StatusNotModified was returned.
  40888. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  40889. gensupport.SetOptions(c.urlParams_, opts...)
  40890. res, err := c.doRequest("json")
  40891. if res != nil && res.StatusCode == http.StatusNotModified {
  40892. if res.Body != nil {
  40893. res.Body.Close()
  40894. }
  40895. return nil, &googleapi.Error{
  40896. Code: res.StatusCode,
  40897. Header: res.Header,
  40898. }
  40899. }
  40900. if err != nil {
  40901. return nil, err
  40902. }
  40903. defer googleapi.CloseBody(res)
  40904. if err := googleapi.CheckResponse(res); err != nil {
  40905. return nil, err
  40906. }
  40907. ret := &InstanceGroupsListInstances{
  40908. ServerResponse: googleapi.ServerResponse{
  40909. Header: res.Header,
  40910. HTTPStatusCode: res.StatusCode,
  40911. },
  40912. }
  40913. target := &ret
  40914. if err := gensupport.DecodeResponse(target, res); err != nil {
  40915. return nil, err
  40916. }
  40917. return ret, nil
  40918. // {
  40919. // "description": "Lists the instances in the specified instance group.",
  40920. // "httpMethod": "POST",
  40921. // "id": "compute.instanceGroups.listInstances",
  40922. // "parameterOrder": [
  40923. // "project",
  40924. // "zone",
  40925. // "instanceGroup"
  40926. // ],
  40927. // "parameters": {
  40928. // "filter": {
  40929. // "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).",
  40930. // "location": "query",
  40931. // "type": "string"
  40932. // },
  40933. // "instanceGroup": {
  40934. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  40935. // "location": "path",
  40936. // "required": true,
  40937. // "type": "string"
  40938. // },
  40939. // "maxResults": {
  40940. // "default": "500",
  40941. // "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)",
  40942. // "format": "uint32",
  40943. // "location": "query",
  40944. // "minimum": "0",
  40945. // "type": "integer"
  40946. // },
  40947. // "orderBy": {
  40948. // "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.",
  40949. // "location": "query",
  40950. // "type": "string"
  40951. // },
  40952. // "pageToken": {
  40953. // "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.",
  40954. // "location": "query",
  40955. // "type": "string"
  40956. // },
  40957. // "project": {
  40958. // "description": "Project ID for this request.",
  40959. // "location": "path",
  40960. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40961. // "required": true,
  40962. // "type": "string"
  40963. // },
  40964. // "zone": {
  40965. // "description": "The name of the zone where the instance group is located.",
  40966. // "location": "path",
  40967. // "required": true,
  40968. // "type": "string"
  40969. // }
  40970. // },
  40971. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  40972. // "request": {
  40973. // "$ref": "InstanceGroupsListInstancesRequest"
  40974. // },
  40975. // "response": {
  40976. // "$ref": "InstanceGroupsListInstances"
  40977. // },
  40978. // "scopes": [
  40979. // "https://www.googleapis.com/auth/cloud-platform",
  40980. // "https://www.googleapis.com/auth/compute",
  40981. // "https://www.googleapis.com/auth/compute.readonly"
  40982. // ]
  40983. // }
  40984. }
  40985. // Pages invokes f for each page of results.
  40986. // A non-nil error returned from f will halt the iteration.
  40987. // The provided context supersedes any context provided to the Context method.
  40988. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  40989. c.ctx_ = ctx
  40990. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40991. for {
  40992. x, err := c.Do()
  40993. if err != nil {
  40994. return err
  40995. }
  40996. if err := f(x); err != nil {
  40997. return err
  40998. }
  40999. if x.NextPageToken == "" {
  41000. return nil
  41001. }
  41002. c.PageToken(x.NextPageToken)
  41003. }
  41004. }
  41005. // method id "compute.instanceGroups.removeInstances":
  41006. type InstanceGroupsRemoveInstancesCall struct {
  41007. s *Service
  41008. project string
  41009. zone string
  41010. instanceGroup string
  41011. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  41012. urlParams_ gensupport.URLParams
  41013. ctx_ context.Context
  41014. header_ http.Header
  41015. }
  41016. // RemoveInstances: Removes one or more instances from the specified
  41017. // instance group, but does not delete those instances.
  41018. //
  41019. // If the group is part of a backend service that has enabled connection
  41020. // draining, it can take up to 60 seconds after the connection draining
  41021. // duration before the VM instance is removed or deleted.
  41022. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  41023. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41024. c.project = project
  41025. c.zone = zone
  41026. c.instanceGroup = instanceGroup
  41027. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  41028. return c
  41029. }
  41030. // RequestId sets the optional parameter "requestId": An optional
  41031. // request ID to identify requests. Specify a unique request ID so that
  41032. // if you must retry your request, the server will know to ignore the
  41033. // request if it has already been completed.
  41034. //
  41035. // For example, consider a situation where you make an initial request
  41036. // and the request times out. If you make the request again with the
  41037. // same request ID, the server can check if original operation with the
  41038. // same request ID was received, and if so, will ignore the second
  41039. // request. This prevents clients from accidentally creating duplicate
  41040. // commitments.
  41041. //
  41042. // The request ID must be a valid UUID with the exception that zero UUID
  41043. // is not supported (00000000-0000-0000-0000-000000000000).
  41044. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  41045. c.urlParams_.Set("requestId", requestId)
  41046. return c
  41047. }
  41048. // Fields allows partial responses to be retrieved. See
  41049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41050. // for more information.
  41051. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  41052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41053. return c
  41054. }
  41055. // Context sets the context to be used in this call's Do method. Any
  41056. // pending HTTP request will be aborted if the provided context is
  41057. // canceled.
  41058. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  41059. c.ctx_ = ctx
  41060. return c
  41061. }
  41062. // Header returns an http.Header that can be modified by the caller to
  41063. // add HTTP headers to the request.
  41064. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  41065. if c.header_ == nil {
  41066. c.header_ = make(http.Header)
  41067. }
  41068. return c.header_
  41069. }
  41070. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  41071. reqHeaders := make(http.Header)
  41072. for k, v := range c.header_ {
  41073. reqHeaders[k] = v
  41074. }
  41075. reqHeaders.Set("User-Agent", c.s.userAgent())
  41076. var body io.Reader = nil
  41077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  41078. if err != nil {
  41079. return nil, err
  41080. }
  41081. reqHeaders.Set("Content-Type", "application/json")
  41082. c.urlParams_.Set("alt", alt)
  41083. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  41084. urls += "?" + c.urlParams_.Encode()
  41085. req, _ := http.NewRequest("POST", urls, body)
  41086. req.Header = reqHeaders
  41087. googleapi.Expand(req.URL, map[string]string{
  41088. "project": c.project,
  41089. "zone": c.zone,
  41090. "instanceGroup": c.instanceGroup,
  41091. })
  41092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41093. }
  41094. // Do executes the "compute.instanceGroups.removeInstances" call.
  41095. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41096. // status code is an error. Response headers are in either
  41097. // *Operation.ServerResponse.Header or (if a response was returned at
  41098. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41099. // to check whether the returned error was because
  41100. // http.StatusNotModified was returned.
  41101. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41102. gensupport.SetOptions(c.urlParams_, opts...)
  41103. res, err := c.doRequest("json")
  41104. if res != nil && res.StatusCode == http.StatusNotModified {
  41105. if res.Body != nil {
  41106. res.Body.Close()
  41107. }
  41108. return nil, &googleapi.Error{
  41109. Code: res.StatusCode,
  41110. Header: res.Header,
  41111. }
  41112. }
  41113. if err != nil {
  41114. return nil, err
  41115. }
  41116. defer googleapi.CloseBody(res)
  41117. if err := googleapi.CheckResponse(res); err != nil {
  41118. return nil, err
  41119. }
  41120. ret := &Operation{
  41121. ServerResponse: googleapi.ServerResponse{
  41122. Header: res.Header,
  41123. HTTPStatusCode: res.StatusCode,
  41124. },
  41125. }
  41126. target := &ret
  41127. if err := gensupport.DecodeResponse(target, res); err != nil {
  41128. return nil, err
  41129. }
  41130. return ret, nil
  41131. // {
  41132. // "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.",
  41133. // "httpMethod": "POST",
  41134. // "id": "compute.instanceGroups.removeInstances",
  41135. // "parameterOrder": [
  41136. // "project",
  41137. // "zone",
  41138. // "instanceGroup"
  41139. // ],
  41140. // "parameters": {
  41141. // "instanceGroup": {
  41142. // "description": "The name of the instance group where the specified instances will be removed.",
  41143. // "location": "path",
  41144. // "required": true,
  41145. // "type": "string"
  41146. // },
  41147. // "project": {
  41148. // "description": "Project ID for this request.",
  41149. // "location": "path",
  41150. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41151. // "required": true,
  41152. // "type": "string"
  41153. // },
  41154. // "requestId": {
  41155. // "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).",
  41156. // "location": "query",
  41157. // "type": "string"
  41158. // },
  41159. // "zone": {
  41160. // "description": "The name of the zone where the instance group is located.",
  41161. // "location": "path",
  41162. // "required": true,
  41163. // "type": "string"
  41164. // }
  41165. // },
  41166. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  41167. // "request": {
  41168. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  41169. // },
  41170. // "response": {
  41171. // "$ref": "Operation"
  41172. // },
  41173. // "scopes": [
  41174. // "https://www.googleapis.com/auth/cloud-platform",
  41175. // "https://www.googleapis.com/auth/compute"
  41176. // ]
  41177. // }
  41178. }
  41179. // method id "compute.instanceGroups.setNamedPorts":
  41180. type InstanceGroupsSetNamedPortsCall struct {
  41181. s *Service
  41182. project string
  41183. zone string
  41184. instanceGroup string
  41185. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  41186. urlParams_ gensupport.URLParams
  41187. ctx_ context.Context
  41188. header_ http.Header
  41189. }
  41190. // SetNamedPorts: Sets the named ports for the specified instance group.
  41191. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  41192. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41193. c.project = project
  41194. c.zone = zone
  41195. c.instanceGroup = instanceGroup
  41196. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  41197. return c
  41198. }
  41199. // RequestId sets the optional parameter "requestId": An optional
  41200. // request ID to identify requests. Specify a unique request ID so that
  41201. // if you must retry your request, the server will know to ignore the
  41202. // request if it has already been completed.
  41203. //
  41204. // For example, consider a situation where you make an initial request
  41205. // and the request times out. If you make the request again with the
  41206. // same request ID, the server can check if original operation with the
  41207. // same request ID was received, and if so, will ignore the second
  41208. // request. This prevents clients from accidentally creating duplicate
  41209. // commitments.
  41210. //
  41211. // The request ID must be a valid UUID with the exception that zero UUID
  41212. // is not supported (00000000-0000-0000-0000-000000000000).
  41213. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  41214. c.urlParams_.Set("requestId", requestId)
  41215. return c
  41216. }
  41217. // Fields allows partial responses to be retrieved. See
  41218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41219. // for more information.
  41220. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  41221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41222. return c
  41223. }
  41224. // Context sets the context to be used in this call's Do method. Any
  41225. // pending HTTP request will be aborted if the provided context is
  41226. // canceled.
  41227. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  41228. c.ctx_ = ctx
  41229. return c
  41230. }
  41231. // Header returns an http.Header that can be modified by the caller to
  41232. // add HTTP headers to the request.
  41233. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  41234. if c.header_ == nil {
  41235. c.header_ = make(http.Header)
  41236. }
  41237. return c.header_
  41238. }
  41239. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  41240. reqHeaders := make(http.Header)
  41241. for k, v := range c.header_ {
  41242. reqHeaders[k] = v
  41243. }
  41244. reqHeaders.Set("User-Agent", c.s.userAgent())
  41245. var body io.Reader = nil
  41246. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  41247. if err != nil {
  41248. return nil, err
  41249. }
  41250. reqHeaders.Set("Content-Type", "application/json")
  41251. c.urlParams_.Set("alt", alt)
  41252. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  41253. urls += "?" + c.urlParams_.Encode()
  41254. req, _ := http.NewRequest("POST", urls, body)
  41255. req.Header = reqHeaders
  41256. googleapi.Expand(req.URL, map[string]string{
  41257. "project": c.project,
  41258. "zone": c.zone,
  41259. "instanceGroup": c.instanceGroup,
  41260. })
  41261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41262. }
  41263. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  41264. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41265. // status code is an error. Response headers are in either
  41266. // *Operation.ServerResponse.Header or (if a response was returned at
  41267. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41268. // to check whether the returned error was because
  41269. // http.StatusNotModified was returned.
  41270. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41271. gensupport.SetOptions(c.urlParams_, opts...)
  41272. res, err := c.doRequest("json")
  41273. if res != nil && res.StatusCode == http.StatusNotModified {
  41274. if res.Body != nil {
  41275. res.Body.Close()
  41276. }
  41277. return nil, &googleapi.Error{
  41278. Code: res.StatusCode,
  41279. Header: res.Header,
  41280. }
  41281. }
  41282. if err != nil {
  41283. return nil, err
  41284. }
  41285. defer googleapi.CloseBody(res)
  41286. if err := googleapi.CheckResponse(res); err != nil {
  41287. return nil, err
  41288. }
  41289. ret := &Operation{
  41290. ServerResponse: googleapi.ServerResponse{
  41291. Header: res.Header,
  41292. HTTPStatusCode: res.StatusCode,
  41293. },
  41294. }
  41295. target := &ret
  41296. if err := gensupport.DecodeResponse(target, res); err != nil {
  41297. return nil, err
  41298. }
  41299. return ret, nil
  41300. // {
  41301. // "description": "Sets the named ports for the specified instance group.",
  41302. // "httpMethod": "POST",
  41303. // "id": "compute.instanceGroups.setNamedPorts",
  41304. // "parameterOrder": [
  41305. // "project",
  41306. // "zone",
  41307. // "instanceGroup"
  41308. // ],
  41309. // "parameters": {
  41310. // "instanceGroup": {
  41311. // "description": "The name of the instance group where the named ports are updated.",
  41312. // "location": "path",
  41313. // "required": true,
  41314. // "type": "string"
  41315. // },
  41316. // "project": {
  41317. // "description": "Project ID for this request.",
  41318. // "location": "path",
  41319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41320. // "required": true,
  41321. // "type": "string"
  41322. // },
  41323. // "requestId": {
  41324. // "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).",
  41325. // "location": "query",
  41326. // "type": "string"
  41327. // },
  41328. // "zone": {
  41329. // "description": "The name of the zone where the instance group is located.",
  41330. // "location": "path",
  41331. // "required": true,
  41332. // "type": "string"
  41333. // }
  41334. // },
  41335. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  41336. // "request": {
  41337. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  41338. // },
  41339. // "response": {
  41340. // "$ref": "Operation"
  41341. // },
  41342. // "scopes": [
  41343. // "https://www.googleapis.com/auth/cloud-platform",
  41344. // "https://www.googleapis.com/auth/compute"
  41345. // ]
  41346. // }
  41347. }
  41348. // method id "compute.instanceTemplates.delete":
  41349. type InstanceTemplatesDeleteCall struct {
  41350. s *Service
  41351. project string
  41352. instanceTemplate string
  41353. urlParams_ gensupport.URLParams
  41354. ctx_ context.Context
  41355. header_ http.Header
  41356. }
  41357. // Delete: Deletes the specified instance template. Deleting an instance
  41358. // template is permanent and cannot be undone. It's not possible to
  41359. // delete templates which are in use by an instance group.
  41360. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  41361. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  41362. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41363. c.project = project
  41364. c.instanceTemplate = instanceTemplate
  41365. return c
  41366. }
  41367. // RequestId sets the optional parameter "requestId": An optional
  41368. // request ID to identify requests. Specify a unique request ID so that
  41369. // if you must retry your request, the server will know to ignore the
  41370. // request if it has already been completed.
  41371. //
  41372. // For example, consider a situation where you make an initial request
  41373. // and the request times out. If you make the request again with the
  41374. // same request ID, the server can check if original operation with the
  41375. // same request ID was received, and if so, will ignore the second
  41376. // request. This prevents clients from accidentally creating duplicate
  41377. // commitments.
  41378. //
  41379. // The request ID must be a valid UUID with the exception that zero UUID
  41380. // is not supported (00000000-0000-0000-0000-000000000000).
  41381. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  41382. c.urlParams_.Set("requestId", requestId)
  41383. return c
  41384. }
  41385. // Fields allows partial responses to be retrieved. See
  41386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41387. // for more information.
  41388. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  41389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41390. return c
  41391. }
  41392. // Context sets the context to be used in this call's Do method. Any
  41393. // pending HTTP request will be aborted if the provided context is
  41394. // canceled.
  41395. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  41396. c.ctx_ = ctx
  41397. return c
  41398. }
  41399. // Header returns an http.Header that can be modified by the caller to
  41400. // add HTTP headers to the request.
  41401. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  41402. if c.header_ == nil {
  41403. c.header_ = make(http.Header)
  41404. }
  41405. return c.header_
  41406. }
  41407. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  41408. reqHeaders := make(http.Header)
  41409. for k, v := range c.header_ {
  41410. reqHeaders[k] = v
  41411. }
  41412. reqHeaders.Set("User-Agent", c.s.userAgent())
  41413. var body io.Reader = nil
  41414. c.urlParams_.Set("alt", alt)
  41415. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  41416. urls += "?" + c.urlParams_.Encode()
  41417. req, _ := http.NewRequest("DELETE", urls, body)
  41418. req.Header = reqHeaders
  41419. googleapi.Expand(req.URL, map[string]string{
  41420. "project": c.project,
  41421. "instanceTemplate": c.instanceTemplate,
  41422. })
  41423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41424. }
  41425. // Do executes the "compute.instanceTemplates.delete" call.
  41426. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41427. // status code is an error. Response headers are in either
  41428. // *Operation.ServerResponse.Header or (if a response was returned at
  41429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41430. // to check whether the returned error was because
  41431. // http.StatusNotModified was returned.
  41432. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41433. gensupport.SetOptions(c.urlParams_, opts...)
  41434. res, err := c.doRequest("json")
  41435. if res != nil && res.StatusCode == http.StatusNotModified {
  41436. if res.Body != nil {
  41437. res.Body.Close()
  41438. }
  41439. return nil, &googleapi.Error{
  41440. Code: res.StatusCode,
  41441. Header: res.Header,
  41442. }
  41443. }
  41444. if err != nil {
  41445. return nil, err
  41446. }
  41447. defer googleapi.CloseBody(res)
  41448. if err := googleapi.CheckResponse(res); err != nil {
  41449. return nil, err
  41450. }
  41451. ret := &Operation{
  41452. ServerResponse: googleapi.ServerResponse{
  41453. Header: res.Header,
  41454. HTTPStatusCode: res.StatusCode,
  41455. },
  41456. }
  41457. target := &ret
  41458. if err := gensupport.DecodeResponse(target, res); err != nil {
  41459. return nil, err
  41460. }
  41461. return ret, nil
  41462. // {
  41463. // "description": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group.",
  41464. // "httpMethod": "DELETE",
  41465. // "id": "compute.instanceTemplates.delete",
  41466. // "parameterOrder": [
  41467. // "project",
  41468. // "instanceTemplate"
  41469. // ],
  41470. // "parameters": {
  41471. // "instanceTemplate": {
  41472. // "description": "The name of the instance template to delete.",
  41473. // "location": "path",
  41474. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41475. // "required": true,
  41476. // "type": "string"
  41477. // },
  41478. // "project": {
  41479. // "description": "Project ID for this request.",
  41480. // "location": "path",
  41481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41482. // "required": true,
  41483. // "type": "string"
  41484. // },
  41485. // "requestId": {
  41486. // "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).",
  41487. // "location": "query",
  41488. // "type": "string"
  41489. // }
  41490. // },
  41491. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  41492. // "response": {
  41493. // "$ref": "Operation"
  41494. // },
  41495. // "scopes": [
  41496. // "https://www.googleapis.com/auth/cloud-platform",
  41497. // "https://www.googleapis.com/auth/compute"
  41498. // ]
  41499. // }
  41500. }
  41501. // method id "compute.instanceTemplates.get":
  41502. type InstanceTemplatesGetCall struct {
  41503. s *Service
  41504. project string
  41505. instanceTemplate string
  41506. urlParams_ gensupport.URLParams
  41507. ifNoneMatch_ string
  41508. ctx_ context.Context
  41509. header_ http.Header
  41510. }
  41511. // Get: Returns the specified instance template. Gets a list of
  41512. // available instance templates by making a list() request.
  41513. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  41514. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  41515. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41516. c.project = project
  41517. c.instanceTemplate = instanceTemplate
  41518. return c
  41519. }
  41520. // Fields allows partial responses to be retrieved. See
  41521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41522. // for more information.
  41523. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  41524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41525. return c
  41526. }
  41527. // IfNoneMatch sets the optional parameter which makes the operation
  41528. // fail if the object's ETag matches the given value. This is useful for
  41529. // getting updates only after the object has changed since the last
  41530. // request. Use googleapi.IsNotModified to check whether the response
  41531. // error from Do is the result of In-None-Match.
  41532. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  41533. c.ifNoneMatch_ = entityTag
  41534. return c
  41535. }
  41536. // Context sets the context to be used in this call's Do method. Any
  41537. // pending HTTP request will be aborted if the provided context is
  41538. // canceled.
  41539. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  41540. c.ctx_ = ctx
  41541. return c
  41542. }
  41543. // Header returns an http.Header that can be modified by the caller to
  41544. // add HTTP headers to the request.
  41545. func (c *InstanceTemplatesGetCall) Header() http.Header {
  41546. if c.header_ == nil {
  41547. c.header_ = make(http.Header)
  41548. }
  41549. return c.header_
  41550. }
  41551. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  41552. reqHeaders := make(http.Header)
  41553. for k, v := range c.header_ {
  41554. reqHeaders[k] = v
  41555. }
  41556. reqHeaders.Set("User-Agent", c.s.userAgent())
  41557. if c.ifNoneMatch_ != "" {
  41558. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41559. }
  41560. var body io.Reader = nil
  41561. c.urlParams_.Set("alt", alt)
  41562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  41563. urls += "?" + c.urlParams_.Encode()
  41564. req, _ := http.NewRequest("GET", urls, body)
  41565. req.Header = reqHeaders
  41566. googleapi.Expand(req.URL, map[string]string{
  41567. "project": c.project,
  41568. "instanceTemplate": c.instanceTemplate,
  41569. })
  41570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41571. }
  41572. // Do executes the "compute.instanceTemplates.get" call.
  41573. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  41574. // non-2xx status code is an error. Response headers are in either
  41575. // *InstanceTemplate.ServerResponse.Header or (if a response was
  41576. // returned at all) in error.(*googleapi.Error).Header. Use
  41577. // googleapi.IsNotModified to check whether the returned error was
  41578. // because http.StatusNotModified was returned.
  41579. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  41580. gensupport.SetOptions(c.urlParams_, opts...)
  41581. res, err := c.doRequest("json")
  41582. if res != nil && res.StatusCode == http.StatusNotModified {
  41583. if res.Body != nil {
  41584. res.Body.Close()
  41585. }
  41586. return nil, &googleapi.Error{
  41587. Code: res.StatusCode,
  41588. Header: res.Header,
  41589. }
  41590. }
  41591. if err != nil {
  41592. return nil, err
  41593. }
  41594. defer googleapi.CloseBody(res)
  41595. if err := googleapi.CheckResponse(res); err != nil {
  41596. return nil, err
  41597. }
  41598. ret := &InstanceTemplate{
  41599. ServerResponse: googleapi.ServerResponse{
  41600. Header: res.Header,
  41601. HTTPStatusCode: res.StatusCode,
  41602. },
  41603. }
  41604. target := &ret
  41605. if err := gensupport.DecodeResponse(target, res); err != nil {
  41606. return nil, err
  41607. }
  41608. return ret, nil
  41609. // {
  41610. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  41611. // "httpMethod": "GET",
  41612. // "id": "compute.instanceTemplates.get",
  41613. // "parameterOrder": [
  41614. // "project",
  41615. // "instanceTemplate"
  41616. // ],
  41617. // "parameters": {
  41618. // "instanceTemplate": {
  41619. // "description": "The name of the instance template.",
  41620. // "location": "path",
  41621. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41622. // "required": true,
  41623. // "type": "string"
  41624. // },
  41625. // "project": {
  41626. // "description": "Project ID for this request.",
  41627. // "location": "path",
  41628. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41629. // "required": true,
  41630. // "type": "string"
  41631. // }
  41632. // },
  41633. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  41634. // "response": {
  41635. // "$ref": "InstanceTemplate"
  41636. // },
  41637. // "scopes": [
  41638. // "https://www.googleapis.com/auth/cloud-platform",
  41639. // "https://www.googleapis.com/auth/compute",
  41640. // "https://www.googleapis.com/auth/compute.readonly"
  41641. // ]
  41642. // }
  41643. }
  41644. // method id "compute.instanceTemplates.insert":
  41645. type InstanceTemplatesInsertCall struct {
  41646. s *Service
  41647. project string
  41648. instancetemplate *InstanceTemplate
  41649. urlParams_ gensupport.URLParams
  41650. ctx_ context.Context
  41651. header_ http.Header
  41652. }
  41653. // Insert: Creates an instance template in the specified project using
  41654. // the data that is included in the request. If you are creating a new
  41655. // template to update an existing instance group, your new instance
  41656. // template must use the same network or, if applicable, the same
  41657. // subnetwork as the original template.
  41658. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  41659. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  41660. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41661. c.project = project
  41662. c.instancetemplate = instancetemplate
  41663. return c
  41664. }
  41665. // RequestId sets the optional parameter "requestId": An optional
  41666. // request ID to identify requests. Specify a unique request ID so that
  41667. // if you must retry your request, the server will know to ignore the
  41668. // request if it has already been completed.
  41669. //
  41670. // For example, consider a situation where you make an initial request
  41671. // and the request times out. If you make the request again with the
  41672. // same request ID, the server can check if original operation with the
  41673. // same request ID was received, and if so, will ignore the second
  41674. // request. This prevents clients from accidentally creating duplicate
  41675. // commitments.
  41676. //
  41677. // The request ID must be a valid UUID with the exception that zero UUID
  41678. // is not supported (00000000-0000-0000-0000-000000000000).
  41679. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  41680. c.urlParams_.Set("requestId", requestId)
  41681. return c
  41682. }
  41683. // Fields allows partial responses to be retrieved. See
  41684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41685. // for more information.
  41686. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  41687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41688. return c
  41689. }
  41690. // Context sets the context to be used in this call's Do method. Any
  41691. // pending HTTP request will be aborted if the provided context is
  41692. // canceled.
  41693. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  41694. c.ctx_ = ctx
  41695. return c
  41696. }
  41697. // Header returns an http.Header that can be modified by the caller to
  41698. // add HTTP headers to the request.
  41699. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  41700. if c.header_ == nil {
  41701. c.header_ = make(http.Header)
  41702. }
  41703. return c.header_
  41704. }
  41705. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  41706. reqHeaders := make(http.Header)
  41707. for k, v := range c.header_ {
  41708. reqHeaders[k] = v
  41709. }
  41710. reqHeaders.Set("User-Agent", c.s.userAgent())
  41711. var body io.Reader = nil
  41712. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  41713. if err != nil {
  41714. return nil, err
  41715. }
  41716. reqHeaders.Set("Content-Type", "application/json")
  41717. c.urlParams_.Set("alt", alt)
  41718. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  41719. urls += "?" + c.urlParams_.Encode()
  41720. req, _ := http.NewRequest("POST", urls, body)
  41721. req.Header = reqHeaders
  41722. googleapi.Expand(req.URL, map[string]string{
  41723. "project": c.project,
  41724. })
  41725. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41726. }
  41727. // Do executes the "compute.instanceTemplates.insert" call.
  41728. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41729. // status code is an error. Response headers are in either
  41730. // *Operation.ServerResponse.Header or (if a response was returned at
  41731. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41732. // to check whether the returned error was because
  41733. // http.StatusNotModified was returned.
  41734. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41735. gensupport.SetOptions(c.urlParams_, opts...)
  41736. res, err := c.doRequest("json")
  41737. if res != nil && res.StatusCode == http.StatusNotModified {
  41738. if res.Body != nil {
  41739. res.Body.Close()
  41740. }
  41741. return nil, &googleapi.Error{
  41742. Code: res.StatusCode,
  41743. Header: res.Header,
  41744. }
  41745. }
  41746. if err != nil {
  41747. return nil, err
  41748. }
  41749. defer googleapi.CloseBody(res)
  41750. if err := googleapi.CheckResponse(res); err != nil {
  41751. return nil, err
  41752. }
  41753. ret := &Operation{
  41754. ServerResponse: googleapi.ServerResponse{
  41755. Header: res.Header,
  41756. HTTPStatusCode: res.StatusCode,
  41757. },
  41758. }
  41759. target := &ret
  41760. if err := gensupport.DecodeResponse(target, res); err != nil {
  41761. return nil, err
  41762. }
  41763. return ret, nil
  41764. // {
  41765. // "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.",
  41766. // "httpMethod": "POST",
  41767. // "id": "compute.instanceTemplates.insert",
  41768. // "parameterOrder": [
  41769. // "project"
  41770. // ],
  41771. // "parameters": {
  41772. // "project": {
  41773. // "description": "Project ID for this request.",
  41774. // "location": "path",
  41775. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41776. // "required": true,
  41777. // "type": "string"
  41778. // },
  41779. // "requestId": {
  41780. // "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).",
  41781. // "location": "query",
  41782. // "type": "string"
  41783. // }
  41784. // },
  41785. // "path": "{project}/global/instanceTemplates",
  41786. // "request": {
  41787. // "$ref": "InstanceTemplate"
  41788. // },
  41789. // "response": {
  41790. // "$ref": "Operation"
  41791. // },
  41792. // "scopes": [
  41793. // "https://www.googleapis.com/auth/cloud-platform",
  41794. // "https://www.googleapis.com/auth/compute"
  41795. // ]
  41796. // }
  41797. }
  41798. // method id "compute.instanceTemplates.list":
  41799. type InstanceTemplatesListCall struct {
  41800. s *Service
  41801. project string
  41802. urlParams_ gensupport.URLParams
  41803. ifNoneMatch_ string
  41804. ctx_ context.Context
  41805. header_ http.Header
  41806. }
  41807. // List: Retrieves a list of instance templates that are contained
  41808. // within the specified project and zone.
  41809. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  41810. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  41811. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41812. c.project = project
  41813. return c
  41814. }
  41815. // Filter sets the optional parameter "filter": A filter expression that
  41816. // filters resources listed in the response. The expression must specify
  41817. // the field name, a comparison operator, and the value that you want to
  41818. // use for filtering. The value must be a string, a number, or a
  41819. // boolean. The comparison operator must be either =, !=, >, or <.
  41820. //
  41821. // For example, if you are filtering Compute Engine instances, you can
  41822. // exclude instances named example-instance by specifying name !=
  41823. // example-instance.
  41824. //
  41825. // You can also filter nested fields. For example, you could specify
  41826. // scheduling.automaticRestart = false to include instances only if they
  41827. // are not scheduled for automatic restarts. You can use filtering on
  41828. // nested fields to filter based on resource labels.
  41829. //
  41830. // To filter on multiple expressions, provide each separate expression
  41831. // within parentheses. For example, (scheduling.automaticRestart = true)
  41832. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41833. // AND expression. However, you can include AND and OR expressions
  41834. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41835. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41836. // true).
  41837. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  41838. c.urlParams_.Set("filter", filter)
  41839. return c
  41840. }
  41841. // MaxResults sets the optional parameter "maxResults": The maximum
  41842. // number of results per page that should be returned. If the number of
  41843. // available results is larger than maxResults, Compute Engine returns a
  41844. // nextPageToken that can be used to get the next page of results in
  41845. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41846. // (Default: 500)
  41847. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  41848. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41849. return c
  41850. }
  41851. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41852. // a certain order. By default, results are returned in alphanumerical
  41853. // order based on the resource name.
  41854. //
  41855. // You can also sort results in descending order based on the creation
  41856. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41857. // based on the creationTimestamp field in reverse chronological order
  41858. // (newest result first). Use this to sort resources like operations so
  41859. // that the newest operation is returned first.
  41860. //
  41861. // Currently, only sorting by name or creationTimestamp desc is
  41862. // supported.
  41863. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  41864. c.urlParams_.Set("orderBy", orderBy)
  41865. return c
  41866. }
  41867. // PageToken sets the optional parameter "pageToken": Specifies a page
  41868. // token to use. Set pageToken to the nextPageToken returned by a
  41869. // previous list request to get the next page of results.
  41870. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  41871. c.urlParams_.Set("pageToken", pageToken)
  41872. return c
  41873. }
  41874. // Fields allows partial responses to be retrieved. See
  41875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41876. // for more information.
  41877. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  41878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41879. return c
  41880. }
  41881. // IfNoneMatch sets the optional parameter which makes the operation
  41882. // fail if the object's ETag matches the given value. This is useful for
  41883. // getting updates only after the object has changed since the last
  41884. // request. Use googleapi.IsNotModified to check whether the response
  41885. // error from Do is the result of In-None-Match.
  41886. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  41887. c.ifNoneMatch_ = entityTag
  41888. return c
  41889. }
  41890. // Context sets the context to be used in this call's Do method. Any
  41891. // pending HTTP request will be aborted if the provided context is
  41892. // canceled.
  41893. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  41894. c.ctx_ = ctx
  41895. return c
  41896. }
  41897. // Header returns an http.Header that can be modified by the caller to
  41898. // add HTTP headers to the request.
  41899. func (c *InstanceTemplatesListCall) Header() http.Header {
  41900. if c.header_ == nil {
  41901. c.header_ = make(http.Header)
  41902. }
  41903. return c.header_
  41904. }
  41905. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  41906. reqHeaders := make(http.Header)
  41907. for k, v := range c.header_ {
  41908. reqHeaders[k] = v
  41909. }
  41910. reqHeaders.Set("User-Agent", c.s.userAgent())
  41911. if c.ifNoneMatch_ != "" {
  41912. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41913. }
  41914. var body io.Reader = nil
  41915. c.urlParams_.Set("alt", alt)
  41916. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  41917. urls += "?" + c.urlParams_.Encode()
  41918. req, _ := http.NewRequest("GET", urls, body)
  41919. req.Header = reqHeaders
  41920. googleapi.Expand(req.URL, map[string]string{
  41921. "project": c.project,
  41922. })
  41923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41924. }
  41925. // Do executes the "compute.instanceTemplates.list" call.
  41926. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  41927. // non-2xx status code is an error. Response headers are in either
  41928. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  41929. // returned at all) in error.(*googleapi.Error).Header. Use
  41930. // googleapi.IsNotModified to check whether the returned error was
  41931. // because http.StatusNotModified was returned.
  41932. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  41933. gensupport.SetOptions(c.urlParams_, opts...)
  41934. res, err := c.doRequest("json")
  41935. if res != nil && res.StatusCode == http.StatusNotModified {
  41936. if res.Body != nil {
  41937. res.Body.Close()
  41938. }
  41939. return nil, &googleapi.Error{
  41940. Code: res.StatusCode,
  41941. Header: res.Header,
  41942. }
  41943. }
  41944. if err != nil {
  41945. return nil, err
  41946. }
  41947. defer googleapi.CloseBody(res)
  41948. if err := googleapi.CheckResponse(res); err != nil {
  41949. return nil, err
  41950. }
  41951. ret := &InstanceTemplateList{
  41952. ServerResponse: googleapi.ServerResponse{
  41953. Header: res.Header,
  41954. HTTPStatusCode: res.StatusCode,
  41955. },
  41956. }
  41957. target := &ret
  41958. if err := gensupport.DecodeResponse(target, res); err != nil {
  41959. return nil, err
  41960. }
  41961. return ret, nil
  41962. // {
  41963. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  41964. // "httpMethod": "GET",
  41965. // "id": "compute.instanceTemplates.list",
  41966. // "parameterOrder": [
  41967. // "project"
  41968. // ],
  41969. // "parameters": {
  41970. // "filter": {
  41971. // "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).",
  41972. // "location": "query",
  41973. // "type": "string"
  41974. // },
  41975. // "maxResults": {
  41976. // "default": "500",
  41977. // "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)",
  41978. // "format": "uint32",
  41979. // "location": "query",
  41980. // "minimum": "0",
  41981. // "type": "integer"
  41982. // },
  41983. // "orderBy": {
  41984. // "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.",
  41985. // "location": "query",
  41986. // "type": "string"
  41987. // },
  41988. // "pageToken": {
  41989. // "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.",
  41990. // "location": "query",
  41991. // "type": "string"
  41992. // },
  41993. // "project": {
  41994. // "description": "Project ID for this request.",
  41995. // "location": "path",
  41996. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41997. // "required": true,
  41998. // "type": "string"
  41999. // }
  42000. // },
  42001. // "path": "{project}/global/instanceTemplates",
  42002. // "response": {
  42003. // "$ref": "InstanceTemplateList"
  42004. // },
  42005. // "scopes": [
  42006. // "https://www.googleapis.com/auth/cloud-platform",
  42007. // "https://www.googleapis.com/auth/compute",
  42008. // "https://www.googleapis.com/auth/compute.readonly"
  42009. // ]
  42010. // }
  42011. }
  42012. // Pages invokes f for each page of results.
  42013. // A non-nil error returned from f will halt the iteration.
  42014. // The provided context supersedes any context provided to the Context method.
  42015. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  42016. c.ctx_ = ctx
  42017. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42018. for {
  42019. x, err := c.Do()
  42020. if err != nil {
  42021. return err
  42022. }
  42023. if err := f(x); err != nil {
  42024. return err
  42025. }
  42026. if x.NextPageToken == "" {
  42027. return nil
  42028. }
  42029. c.PageToken(x.NextPageToken)
  42030. }
  42031. }
  42032. // method id "compute.instances.addAccessConfig":
  42033. type InstancesAddAccessConfigCall struct {
  42034. s *Service
  42035. project string
  42036. zone string
  42037. instance string
  42038. accessconfig *AccessConfig
  42039. urlParams_ gensupport.URLParams
  42040. ctx_ context.Context
  42041. header_ http.Header
  42042. }
  42043. // AddAccessConfig: Adds an access config to an instance's network
  42044. // interface.
  42045. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  42046. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  42047. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42048. c.project = project
  42049. c.zone = zone
  42050. c.instance = instance
  42051. c.urlParams_.Set("networkInterface", networkInterface)
  42052. c.accessconfig = accessconfig
  42053. return c
  42054. }
  42055. // RequestId sets the optional parameter "requestId": An optional
  42056. // request ID to identify requests. Specify a unique request ID so that
  42057. // if you must retry your request, the server will know to ignore the
  42058. // request if it has already been completed.
  42059. //
  42060. // For example, consider a situation where you make an initial request
  42061. // and the request times out. If you make the request again with the
  42062. // same request ID, the server can check if original operation with the
  42063. // same request ID was received, and if so, will ignore the second
  42064. // request. This prevents clients from accidentally creating duplicate
  42065. // commitments.
  42066. //
  42067. // The request ID must be a valid UUID with the exception that zero UUID
  42068. // is not supported (00000000-0000-0000-0000-000000000000).
  42069. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  42070. c.urlParams_.Set("requestId", requestId)
  42071. return c
  42072. }
  42073. // Fields allows partial responses to be retrieved. See
  42074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42075. // for more information.
  42076. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  42077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42078. return c
  42079. }
  42080. // Context sets the context to be used in this call's Do method. Any
  42081. // pending HTTP request will be aborted if the provided context is
  42082. // canceled.
  42083. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  42084. c.ctx_ = ctx
  42085. return c
  42086. }
  42087. // Header returns an http.Header that can be modified by the caller to
  42088. // add HTTP headers to the request.
  42089. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  42090. if c.header_ == nil {
  42091. c.header_ = make(http.Header)
  42092. }
  42093. return c.header_
  42094. }
  42095. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  42096. reqHeaders := make(http.Header)
  42097. for k, v := range c.header_ {
  42098. reqHeaders[k] = v
  42099. }
  42100. reqHeaders.Set("User-Agent", c.s.userAgent())
  42101. var body io.Reader = nil
  42102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  42103. if err != nil {
  42104. return nil, err
  42105. }
  42106. reqHeaders.Set("Content-Type", "application/json")
  42107. c.urlParams_.Set("alt", alt)
  42108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  42109. urls += "?" + c.urlParams_.Encode()
  42110. req, _ := http.NewRequest("POST", urls, body)
  42111. req.Header = reqHeaders
  42112. googleapi.Expand(req.URL, map[string]string{
  42113. "project": c.project,
  42114. "zone": c.zone,
  42115. "instance": c.instance,
  42116. })
  42117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42118. }
  42119. // Do executes the "compute.instances.addAccessConfig" call.
  42120. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42121. // status code is an error. Response headers are in either
  42122. // *Operation.ServerResponse.Header or (if a response was returned at
  42123. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42124. // to check whether the returned error was because
  42125. // http.StatusNotModified was returned.
  42126. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42127. gensupport.SetOptions(c.urlParams_, opts...)
  42128. res, err := c.doRequest("json")
  42129. if res != nil && res.StatusCode == http.StatusNotModified {
  42130. if res.Body != nil {
  42131. res.Body.Close()
  42132. }
  42133. return nil, &googleapi.Error{
  42134. Code: res.StatusCode,
  42135. Header: res.Header,
  42136. }
  42137. }
  42138. if err != nil {
  42139. return nil, err
  42140. }
  42141. defer googleapi.CloseBody(res)
  42142. if err := googleapi.CheckResponse(res); err != nil {
  42143. return nil, err
  42144. }
  42145. ret := &Operation{
  42146. ServerResponse: googleapi.ServerResponse{
  42147. Header: res.Header,
  42148. HTTPStatusCode: res.StatusCode,
  42149. },
  42150. }
  42151. target := &ret
  42152. if err := gensupport.DecodeResponse(target, res); err != nil {
  42153. return nil, err
  42154. }
  42155. return ret, nil
  42156. // {
  42157. // "description": "Adds an access config to an instance's network interface.",
  42158. // "httpMethod": "POST",
  42159. // "id": "compute.instances.addAccessConfig",
  42160. // "parameterOrder": [
  42161. // "project",
  42162. // "zone",
  42163. // "instance",
  42164. // "networkInterface"
  42165. // ],
  42166. // "parameters": {
  42167. // "instance": {
  42168. // "description": "The instance name for this request.",
  42169. // "location": "path",
  42170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42171. // "required": true,
  42172. // "type": "string"
  42173. // },
  42174. // "networkInterface": {
  42175. // "description": "The name of the network interface to add to this instance.",
  42176. // "location": "query",
  42177. // "required": true,
  42178. // "type": "string"
  42179. // },
  42180. // "project": {
  42181. // "description": "Project ID for this request.",
  42182. // "location": "path",
  42183. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42184. // "required": true,
  42185. // "type": "string"
  42186. // },
  42187. // "requestId": {
  42188. // "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).",
  42189. // "location": "query",
  42190. // "type": "string"
  42191. // },
  42192. // "zone": {
  42193. // "description": "The name of the zone for this request.",
  42194. // "location": "path",
  42195. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42196. // "required": true,
  42197. // "type": "string"
  42198. // }
  42199. // },
  42200. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  42201. // "request": {
  42202. // "$ref": "AccessConfig"
  42203. // },
  42204. // "response": {
  42205. // "$ref": "Operation"
  42206. // },
  42207. // "scopes": [
  42208. // "https://www.googleapis.com/auth/cloud-platform",
  42209. // "https://www.googleapis.com/auth/compute"
  42210. // ]
  42211. // }
  42212. }
  42213. // method id "compute.instances.aggregatedList":
  42214. type InstancesAggregatedListCall struct {
  42215. s *Service
  42216. project string
  42217. urlParams_ gensupport.URLParams
  42218. ifNoneMatch_ string
  42219. ctx_ context.Context
  42220. header_ http.Header
  42221. }
  42222. // AggregatedList: Retrieves aggregated list of instances.
  42223. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  42224. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  42225. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42226. c.project = project
  42227. return c
  42228. }
  42229. // Filter sets the optional parameter "filter": A filter expression that
  42230. // filters resources listed in the response. The expression must specify
  42231. // the field name, a comparison operator, and the value that you want to
  42232. // use for filtering. The value must be a string, a number, or a
  42233. // boolean. The comparison operator must be either =, !=, >, or <.
  42234. //
  42235. // For example, if you are filtering Compute Engine instances, you can
  42236. // exclude instances named example-instance by specifying name !=
  42237. // example-instance.
  42238. //
  42239. // You can also filter nested fields. For example, you could specify
  42240. // scheduling.automaticRestart = false to include instances only if they
  42241. // are not scheduled for automatic restarts. You can use filtering on
  42242. // nested fields to filter based on resource labels.
  42243. //
  42244. // To filter on multiple expressions, provide each separate expression
  42245. // within parentheses. For example, (scheduling.automaticRestart = true)
  42246. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42247. // AND expression. However, you can include AND and OR expressions
  42248. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42249. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42250. // true).
  42251. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  42252. c.urlParams_.Set("filter", filter)
  42253. return c
  42254. }
  42255. // MaxResults sets the optional parameter "maxResults": The maximum
  42256. // number of results per page that should be returned. If the number of
  42257. // available results is larger than maxResults, Compute Engine returns a
  42258. // nextPageToken that can be used to get the next page of results in
  42259. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42260. // (Default: 500)
  42261. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  42262. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42263. return c
  42264. }
  42265. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42266. // a certain order. By default, results are returned in alphanumerical
  42267. // order based on the resource name.
  42268. //
  42269. // You can also sort results in descending order based on the creation
  42270. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42271. // based on the creationTimestamp field in reverse chronological order
  42272. // (newest result first). Use this to sort resources like operations so
  42273. // that the newest operation is returned first.
  42274. //
  42275. // Currently, only sorting by name or creationTimestamp desc is
  42276. // supported.
  42277. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  42278. c.urlParams_.Set("orderBy", orderBy)
  42279. return c
  42280. }
  42281. // PageToken sets the optional parameter "pageToken": Specifies a page
  42282. // token to use. Set pageToken to the nextPageToken returned by a
  42283. // previous list request to get the next page of results.
  42284. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  42285. c.urlParams_.Set("pageToken", pageToken)
  42286. return c
  42287. }
  42288. // Fields allows partial responses to be retrieved. See
  42289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42290. // for more information.
  42291. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  42292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42293. return c
  42294. }
  42295. // IfNoneMatch sets the optional parameter which makes the operation
  42296. // fail if the object's ETag matches the given value. This is useful for
  42297. // getting updates only after the object has changed since the last
  42298. // request. Use googleapi.IsNotModified to check whether the response
  42299. // error from Do is the result of In-None-Match.
  42300. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  42301. c.ifNoneMatch_ = entityTag
  42302. return c
  42303. }
  42304. // Context sets the context to be used in this call's Do method. Any
  42305. // pending HTTP request will be aborted if the provided context is
  42306. // canceled.
  42307. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  42308. c.ctx_ = ctx
  42309. return c
  42310. }
  42311. // Header returns an http.Header that can be modified by the caller to
  42312. // add HTTP headers to the request.
  42313. func (c *InstancesAggregatedListCall) Header() http.Header {
  42314. if c.header_ == nil {
  42315. c.header_ = make(http.Header)
  42316. }
  42317. return c.header_
  42318. }
  42319. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  42320. reqHeaders := make(http.Header)
  42321. for k, v := range c.header_ {
  42322. reqHeaders[k] = v
  42323. }
  42324. reqHeaders.Set("User-Agent", c.s.userAgent())
  42325. if c.ifNoneMatch_ != "" {
  42326. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42327. }
  42328. var body io.Reader = nil
  42329. c.urlParams_.Set("alt", alt)
  42330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  42331. urls += "?" + c.urlParams_.Encode()
  42332. req, _ := http.NewRequest("GET", urls, body)
  42333. req.Header = reqHeaders
  42334. googleapi.Expand(req.URL, map[string]string{
  42335. "project": c.project,
  42336. })
  42337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42338. }
  42339. // Do executes the "compute.instances.aggregatedList" call.
  42340. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  42341. // non-2xx status code is an error. Response headers are in either
  42342. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  42343. // returned at all) in error.(*googleapi.Error).Header. Use
  42344. // googleapi.IsNotModified to check whether the returned error was
  42345. // because http.StatusNotModified was returned.
  42346. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  42347. gensupport.SetOptions(c.urlParams_, opts...)
  42348. res, err := c.doRequest("json")
  42349. if res != nil && res.StatusCode == http.StatusNotModified {
  42350. if res.Body != nil {
  42351. res.Body.Close()
  42352. }
  42353. return nil, &googleapi.Error{
  42354. Code: res.StatusCode,
  42355. Header: res.Header,
  42356. }
  42357. }
  42358. if err != nil {
  42359. return nil, err
  42360. }
  42361. defer googleapi.CloseBody(res)
  42362. if err := googleapi.CheckResponse(res); err != nil {
  42363. return nil, err
  42364. }
  42365. ret := &InstanceAggregatedList{
  42366. ServerResponse: googleapi.ServerResponse{
  42367. Header: res.Header,
  42368. HTTPStatusCode: res.StatusCode,
  42369. },
  42370. }
  42371. target := &ret
  42372. if err := gensupport.DecodeResponse(target, res); err != nil {
  42373. return nil, err
  42374. }
  42375. return ret, nil
  42376. // {
  42377. // "description": "Retrieves aggregated list of instances.",
  42378. // "httpMethod": "GET",
  42379. // "id": "compute.instances.aggregatedList",
  42380. // "parameterOrder": [
  42381. // "project"
  42382. // ],
  42383. // "parameters": {
  42384. // "filter": {
  42385. // "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).",
  42386. // "location": "query",
  42387. // "type": "string"
  42388. // },
  42389. // "maxResults": {
  42390. // "default": "500",
  42391. // "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)",
  42392. // "format": "uint32",
  42393. // "location": "query",
  42394. // "minimum": "0",
  42395. // "type": "integer"
  42396. // },
  42397. // "orderBy": {
  42398. // "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.",
  42399. // "location": "query",
  42400. // "type": "string"
  42401. // },
  42402. // "pageToken": {
  42403. // "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.",
  42404. // "location": "query",
  42405. // "type": "string"
  42406. // },
  42407. // "project": {
  42408. // "description": "Project ID for this request.",
  42409. // "location": "path",
  42410. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42411. // "required": true,
  42412. // "type": "string"
  42413. // }
  42414. // },
  42415. // "path": "{project}/aggregated/instances",
  42416. // "response": {
  42417. // "$ref": "InstanceAggregatedList"
  42418. // },
  42419. // "scopes": [
  42420. // "https://www.googleapis.com/auth/cloud-platform",
  42421. // "https://www.googleapis.com/auth/compute",
  42422. // "https://www.googleapis.com/auth/compute.readonly"
  42423. // ]
  42424. // }
  42425. }
  42426. // Pages invokes f for each page of results.
  42427. // A non-nil error returned from f will halt the iteration.
  42428. // The provided context supersedes any context provided to the Context method.
  42429. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  42430. c.ctx_ = ctx
  42431. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42432. for {
  42433. x, err := c.Do()
  42434. if err != nil {
  42435. return err
  42436. }
  42437. if err := f(x); err != nil {
  42438. return err
  42439. }
  42440. if x.NextPageToken == "" {
  42441. return nil
  42442. }
  42443. c.PageToken(x.NextPageToken)
  42444. }
  42445. }
  42446. // method id "compute.instances.attachDisk":
  42447. type InstancesAttachDiskCall struct {
  42448. s *Service
  42449. project string
  42450. zone string
  42451. instance string
  42452. attacheddisk *AttachedDisk
  42453. urlParams_ gensupport.URLParams
  42454. ctx_ context.Context
  42455. header_ http.Header
  42456. }
  42457. // AttachDisk: Attaches an existing Disk resource to an instance. You
  42458. // must first create the disk before you can attach it. It is not
  42459. // possible to create and attach a disk at the same time. For more
  42460. // information, read Adding a persistent disk to your instance.
  42461. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  42462. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  42463. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42464. c.project = project
  42465. c.zone = zone
  42466. c.instance = instance
  42467. c.attacheddisk = attacheddisk
  42468. return c
  42469. }
  42470. // ForceAttach sets the optional parameter "forceAttach": Whether to
  42471. // force attach the disk even if it's currently attached to another
  42472. // instance. This is only available for regional disks.
  42473. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  42474. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  42475. return c
  42476. }
  42477. // RequestId sets the optional parameter "requestId": An optional
  42478. // request ID to identify requests. Specify a unique request ID so that
  42479. // if you must retry your request, the server will know to ignore the
  42480. // request if it has already been completed.
  42481. //
  42482. // For example, consider a situation where you make an initial request
  42483. // and the request times out. If you make the request again with the
  42484. // same request ID, the server can check if original operation with the
  42485. // same request ID was received, and if so, will ignore the second
  42486. // request. This prevents clients from accidentally creating duplicate
  42487. // commitments.
  42488. //
  42489. // The request ID must be a valid UUID with the exception that zero UUID
  42490. // is not supported (00000000-0000-0000-0000-000000000000).
  42491. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  42492. c.urlParams_.Set("requestId", requestId)
  42493. return c
  42494. }
  42495. // Fields allows partial responses to be retrieved. See
  42496. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42497. // for more information.
  42498. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  42499. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42500. return c
  42501. }
  42502. // Context sets the context to be used in this call's Do method. Any
  42503. // pending HTTP request will be aborted if the provided context is
  42504. // canceled.
  42505. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  42506. c.ctx_ = ctx
  42507. return c
  42508. }
  42509. // Header returns an http.Header that can be modified by the caller to
  42510. // add HTTP headers to the request.
  42511. func (c *InstancesAttachDiskCall) Header() http.Header {
  42512. if c.header_ == nil {
  42513. c.header_ = make(http.Header)
  42514. }
  42515. return c.header_
  42516. }
  42517. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  42518. reqHeaders := make(http.Header)
  42519. for k, v := range c.header_ {
  42520. reqHeaders[k] = v
  42521. }
  42522. reqHeaders.Set("User-Agent", c.s.userAgent())
  42523. var body io.Reader = nil
  42524. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  42525. if err != nil {
  42526. return nil, err
  42527. }
  42528. reqHeaders.Set("Content-Type", "application/json")
  42529. c.urlParams_.Set("alt", alt)
  42530. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  42531. urls += "?" + c.urlParams_.Encode()
  42532. req, _ := http.NewRequest("POST", urls, body)
  42533. req.Header = reqHeaders
  42534. googleapi.Expand(req.URL, map[string]string{
  42535. "project": c.project,
  42536. "zone": c.zone,
  42537. "instance": c.instance,
  42538. })
  42539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42540. }
  42541. // Do executes the "compute.instances.attachDisk" call.
  42542. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42543. // status code is an error. Response headers are in either
  42544. // *Operation.ServerResponse.Header or (if a response was returned at
  42545. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42546. // to check whether the returned error was because
  42547. // http.StatusNotModified was returned.
  42548. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42549. gensupport.SetOptions(c.urlParams_, opts...)
  42550. res, err := c.doRequest("json")
  42551. if res != nil && res.StatusCode == http.StatusNotModified {
  42552. if res.Body != nil {
  42553. res.Body.Close()
  42554. }
  42555. return nil, &googleapi.Error{
  42556. Code: res.StatusCode,
  42557. Header: res.Header,
  42558. }
  42559. }
  42560. if err != nil {
  42561. return nil, err
  42562. }
  42563. defer googleapi.CloseBody(res)
  42564. if err := googleapi.CheckResponse(res); err != nil {
  42565. return nil, err
  42566. }
  42567. ret := &Operation{
  42568. ServerResponse: googleapi.ServerResponse{
  42569. Header: res.Header,
  42570. HTTPStatusCode: res.StatusCode,
  42571. },
  42572. }
  42573. target := &ret
  42574. if err := gensupport.DecodeResponse(target, res); err != nil {
  42575. return nil, err
  42576. }
  42577. return ret, nil
  42578. // {
  42579. // "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.",
  42580. // "httpMethod": "POST",
  42581. // "id": "compute.instances.attachDisk",
  42582. // "parameterOrder": [
  42583. // "project",
  42584. // "zone",
  42585. // "instance"
  42586. // ],
  42587. // "parameters": {
  42588. // "forceAttach": {
  42589. // "description": "Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks.",
  42590. // "location": "query",
  42591. // "type": "boolean"
  42592. // },
  42593. // "instance": {
  42594. // "description": "The instance name for this request.",
  42595. // "location": "path",
  42596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42597. // "required": true,
  42598. // "type": "string"
  42599. // },
  42600. // "project": {
  42601. // "description": "Project ID for this request.",
  42602. // "location": "path",
  42603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42604. // "required": true,
  42605. // "type": "string"
  42606. // },
  42607. // "requestId": {
  42608. // "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).",
  42609. // "location": "query",
  42610. // "type": "string"
  42611. // },
  42612. // "zone": {
  42613. // "description": "The name of the zone for this request.",
  42614. // "location": "path",
  42615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42616. // "required": true,
  42617. // "type": "string"
  42618. // }
  42619. // },
  42620. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  42621. // "request": {
  42622. // "$ref": "AttachedDisk"
  42623. // },
  42624. // "response": {
  42625. // "$ref": "Operation"
  42626. // },
  42627. // "scopes": [
  42628. // "https://www.googleapis.com/auth/cloud-platform",
  42629. // "https://www.googleapis.com/auth/compute"
  42630. // ]
  42631. // }
  42632. }
  42633. // method id "compute.instances.delete":
  42634. type InstancesDeleteCall struct {
  42635. s *Service
  42636. project string
  42637. zone string
  42638. instance string
  42639. urlParams_ gensupport.URLParams
  42640. ctx_ context.Context
  42641. header_ http.Header
  42642. }
  42643. // Delete: Deletes the specified Instance resource. For more
  42644. // information, see Stopping or Deleting an Instance.
  42645. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  42646. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  42647. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42648. c.project = project
  42649. c.zone = zone
  42650. c.instance = instance
  42651. return c
  42652. }
  42653. // RequestId sets the optional parameter "requestId": An optional
  42654. // request ID to identify requests. Specify a unique request ID so that
  42655. // if you must retry your request, the server will know to ignore the
  42656. // request if it has already been completed.
  42657. //
  42658. // For example, consider a situation where you make an initial request
  42659. // and the request times out. If you make the request again with the
  42660. // same request ID, the server can check if original operation with the
  42661. // same request ID was received, and if so, will ignore the second
  42662. // request. This prevents clients from accidentally creating duplicate
  42663. // commitments.
  42664. //
  42665. // The request ID must be a valid UUID with the exception that zero UUID
  42666. // is not supported (00000000-0000-0000-0000-000000000000).
  42667. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  42668. c.urlParams_.Set("requestId", requestId)
  42669. return c
  42670. }
  42671. // Fields allows partial responses to be retrieved. See
  42672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42673. // for more information.
  42674. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  42675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42676. return c
  42677. }
  42678. // Context sets the context to be used in this call's Do method. Any
  42679. // pending HTTP request will be aborted if the provided context is
  42680. // canceled.
  42681. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  42682. c.ctx_ = ctx
  42683. return c
  42684. }
  42685. // Header returns an http.Header that can be modified by the caller to
  42686. // add HTTP headers to the request.
  42687. func (c *InstancesDeleteCall) Header() http.Header {
  42688. if c.header_ == nil {
  42689. c.header_ = make(http.Header)
  42690. }
  42691. return c.header_
  42692. }
  42693. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  42694. reqHeaders := make(http.Header)
  42695. for k, v := range c.header_ {
  42696. reqHeaders[k] = v
  42697. }
  42698. reqHeaders.Set("User-Agent", c.s.userAgent())
  42699. var body io.Reader = nil
  42700. c.urlParams_.Set("alt", alt)
  42701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  42702. urls += "?" + c.urlParams_.Encode()
  42703. req, _ := http.NewRequest("DELETE", urls, body)
  42704. req.Header = reqHeaders
  42705. googleapi.Expand(req.URL, map[string]string{
  42706. "project": c.project,
  42707. "zone": c.zone,
  42708. "instance": c.instance,
  42709. })
  42710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42711. }
  42712. // Do executes the "compute.instances.delete" call.
  42713. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42714. // status code is an error. Response headers are in either
  42715. // *Operation.ServerResponse.Header or (if a response was returned at
  42716. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42717. // to check whether the returned error was because
  42718. // http.StatusNotModified was returned.
  42719. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42720. gensupport.SetOptions(c.urlParams_, opts...)
  42721. res, err := c.doRequest("json")
  42722. if res != nil && res.StatusCode == http.StatusNotModified {
  42723. if res.Body != nil {
  42724. res.Body.Close()
  42725. }
  42726. return nil, &googleapi.Error{
  42727. Code: res.StatusCode,
  42728. Header: res.Header,
  42729. }
  42730. }
  42731. if err != nil {
  42732. return nil, err
  42733. }
  42734. defer googleapi.CloseBody(res)
  42735. if err := googleapi.CheckResponse(res); err != nil {
  42736. return nil, err
  42737. }
  42738. ret := &Operation{
  42739. ServerResponse: googleapi.ServerResponse{
  42740. Header: res.Header,
  42741. HTTPStatusCode: res.StatusCode,
  42742. },
  42743. }
  42744. target := &ret
  42745. if err := gensupport.DecodeResponse(target, res); err != nil {
  42746. return nil, err
  42747. }
  42748. return ret, nil
  42749. // {
  42750. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  42751. // "httpMethod": "DELETE",
  42752. // "id": "compute.instances.delete",
  42753. // "parameterOrder": [
  42754. // "project",
  42755. // "zone",
  42756. // "instance"
  42757. // ],
  42758. // "parameters": {
  42759. // "instance": {
  42760. // "description": "Name of the instance resource to delete.",
  42761. // "location": "path",
  42762. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42763. // "required": true,
  42764. // "type": "string"
  42765. // },
  42766. // "project": {
  42767. // "description": "Project ID for this request.",
  42768. // "location": "path",
  42769. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42770. // "required": true,
  42771. // "type": "string"
  42772. // },
  42773. // "requestId": {
  42774. // "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).",
  42775. // "location": "query",
  42776. // "type": "string"
  42777. // },
  42778. // "zone": {
  42779. // "description": "The name of the zone for this request.",
  42780. // "location": "path",
  42781. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42782. // "required": true,
  42783. // "type": "string"
  42784. // }
  42785. // },
  42786. // "path": "{project}/zones/{zone}/instances/{instance}",
  42787. // "response": {
  42788. // "$ref": "Operation"
  42789. // },
  42790. // "scopes": [
  42791. // "https://www.googleapis.com/auth/cloud-platform",
  42792. // "https://www.googleapis.com/auth/compute"
  42793. // ]
  42794. // }
  42795. }
  42796. // method id "compute.instances.deleteAccessConfig":
  42797. type InstancesDeleteAccessConfigCall struct {
  42798. s *Service
  42799. project string
  42800. zone string
  42801. instance string
  42802. urlParams_ gensupport.URLParams
  42803. ctx_ context.Context
  42804. header_ http.Header
  42805. }
  42806. // DeleteAccessConfig: Deletes an access config from an instance's
  42807. // network interface.
  42808. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  42809. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  42810. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42811. c.project = project
  42812. c.zone = zone
  42813. c.instance = instance
  42814. c.urlParams_.Set("accessConfig", accessConfig)
  42815. c.urlParams_.Set("networkInterface", networkInterface)
  42816. return c
  42817. }
  42818. // RequestId sets the optional parameter "requestId": An optional
  42819. // request ID to identify requests. Specify a unique request ID so that
  42820. // if you must retry your request, the server will know to ignore the
  42821. // request if it has already been completed.
  42822. //
  42823. // For example, consider a situation where you make an initial request
  42824. // and the request times out. If you make the request again with the
  42825. // same request ID, the server can check if original operation with the
  42826. // same request ID was received, and if so, will ignore the second
  42827. // request. This prevents clients from accidentally creating duplicate
  42828. // commitments.
  42829. //
  42830. // The request ID must be a valid UUID with the exception that zero UUID
  42831. // is not supported (00000000-0000-0000-0000-000000000000).
  42832. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  42833. c.urlParams_.Set("requestId", requestId)
  42834. return c
  42835. }
  42836. // Fields allows partial responses to be retrieved. See
  42837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42838. // for more information.
  42839. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  42840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42841. return c
  42842. }
  42843. // Context sets the context to be used in this call's Do method. Any
  42844. // pending HTTP request will be aborted if the provided context is
  42845. // canceled.
  42846. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  42847. c.ctx_ = ctx
  42848. return c
  42849. }
  42850. // Header returns an http.Header that can be modified by the caller to
  42851. // add HTTP headers to the request.
  42852. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  42853. if c.header_ == nil {
  42854. c.header_ = make(http.Header)
  42855. }
  42856. return c.header_
  42857. }
  42858. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  42859. reqHeaders := make(http.Header)
  42860. for k, v := range c.header_ {
  42861. reqHeaders[k] = v
  42862. }
  42863. reqHeaders.Set("User-Agent", c.s.userAgent())
  42864. var body io.Reader = nil
  42865. c.urlParams_.Set("alt", alt)
  42866. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  42867. urls += "?" + c.urlParams_.Encode()
  42868. req, _ := http.NewRequest("POST", urls, body)
  42869. req.Header = reqHeaders
  42870. googleapi.Expand(req.URL, map[string]string{
  42871. "project": c.project,
  42872. "zone": c.zone,
  42873. "instance": c.instance,
  42874. })
  42875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42876. }
  42877. // Do executes the "compute.instances.deleteAccessConfig" call.
  42878. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42879. // status code is an error. Response headers are in either
  42880. // *Operation.ServerResponse.Header or (if a response was returned at
  42881. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42882. // to check whether the returned error was because
  42883. // http.StatusNotModified was returned.
  42884. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42885. gensupport.SetOptions(c.urlParams_, opts...)
  42886. res, err := c.doRequest("json")
  42887. if res != nil && res.StatusCode == http.StatusNotModified {
  42888. if res.Body != nil {
  42889. res.Body.Close()
  42890. }
  42891. return nil, &googleapi.Error{
  42892. Code: res.StatusCode,
  42893. Header: res.Header,
  42894. }
  42895. }
  42896. if err != nil {
  42897. return nil, err
  42898. }
  42899. defer googleapi.CloseBody(res)
  42900. if err := googleapi.CheckResponse(res); err != nil {
  42901. return nil, err
  42902. }
  42903. ret := &Operation{
  42904. ServerResponse: googleapi.ServerResponse{
  42905. Header: res.Header,
  42906. HTTPStatusCode: res.StatusCode,
  42907. },
  42908. }
  42909. target := &ret
  42910. if err := gensupport.DecodeResponse(target, res); err != nil {
  42911. return nil, err
  42912. }
  42913. return ret, nil
  42914. // {
  42915. // "description": "Deletes an access config from an instance's network interface.",
  42916. // "httpMethod": "POST",
  42917. // "id": "compute.instances.deleteAccessConfig",
  42918. // "parameterOrder": [
  42919. // "project",
  42920. // "zone",
  42921. // "instance",
  42922. // "accessConfig",
  42923. // "networkInterface"
  42924. // ],
  42925. // "parameters": {
  42926. // "accessConfig": {
  42927. // "description": "The name of the access config to delete.",
  42928. // "location": "query",
  42929. // "required": true,
  42930. // "type": "string"
  42931. // },
  42932. // "instance": {
  42933. // "description": "The instance name for this request.",
  42934. // "location": "path",
  42935. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42936. // "required": true,
  42937. // "type": "string"
  42938. // },
  42939. // "networkInterface": {
  42940. // "description": "The name of the network interface.",
  42941. // "location": "query",
  42942. // "required": true,
  42943. // "type": "string"
  42944. // },
  42945. // "project": {
  42946. // "description": "Project ID for this request.",
  42947. // "location": "path",
  42948. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42949. // "required": true,
  42950. // "type": "string"
  42951. // },
  42952. // "requestId": {
  42953. // "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).",
  42954. // "location": "query",
  42955. // "type": "string"
  42956. // },
  42957. // "zone": {
  42958. // "description": "The name of the zone for this request.",
  42959. // "location": "path",
  42960. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42961. // "required": true,
  42962. // "type": "string"
  42963. // }
  42964. // },
  42965. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  42966. // "response": {
  42967. // "$ref": "Operation"
  42968. // },
  42969. // "scopes": [
  42970. // "https://www.googleapis.com/auth/cloud-platform",
  42971. // "https://www.googleapis.com/auth/compute"
  42972. // ]
  42973. // }
  42974. }
  42975. // method id "compute.instances.detachDisk":
  42976. type InstancesDetachDiskCall struct {
  42977. s *Service
  42978. project string
  42979. zone string
  42980. instance string
  42981. urlParams_ gensupport.URLParams
  42982. ctx_ context.Context
  42983. header_ http.Header
  42984. }
  42985. // DetachDisk: Detaches a disk from an instance.
  42986. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  42987. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  42988. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42989. c.project = project
  42990. c.zone = zone
  42991. c.instance = instance
  42992. c.urlParams_.Set("deviceName", deviceName)
  42993. return c
  42994. }
  42995. // RequestId sets the optional parameter "requestId": An optional
  42996. // request ID to identify requests. Specify a unique request ID so that
  42997. // if you must retry your request, the server will know to ignore the
  42998. // request if it has already been completed.
  42999. //
  43000. // For example, consider a situation where you make an initial request
  43001. // and the request times out. If you make the request again with the
  43002. // same request ID, the server can check if original operation with the
  43003. // same request ID was received, and if so, will ignore the second
  43004. // request. This prevents clients from accidentally creating duplicate
  43005. // commitments.
  43006. //
  43007. // The request ID must be a valid UUID with the exception that zero UUID
  43008. // is not supported (00000000-0000-0000-0000-000000000000).
  43009. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  43010. c.urlParams_.Set("requestId", requestId)
  43011. return c
  43012. }
  43013. // Fields allows partial responses to be retrieved. See
  43014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43015. // for more information.
  43016. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  43017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43018. return c
  43019. }
  43020. // Context sets the context to be used in this call's Do method. Any
  43021. // pending HTTP request will be aborted if the provided context is
  43022. // canceled.
  43023. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  43024. c.ctx_ = ctx
  43025. return c
  43026. }
  43027. // Header returns an http.Header that can be modified by the caller to
  43028. // add HTTP headers to the request.
  43029. func (c *InstancesDetachDiskCall) Header() http.Header {
  43030. if c.header_ == nil {
  43031. c.header_ = make(http.Header)
  43032. }
  43033. return c.header_
  43034. }
  43035. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  43036. reqHeaders := make(http.Header)
  43037. for k, v := range c.header_ {
  43038. reqHeaders[k] = v
  43039. }
  43040. reqHeaders.Set("User-Agent", c.s.userAgent())
  43041. var body io.Reader = nil
  43042. c.urlParams_.Set("alt", alt)
  43043. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  43044. urls += "?" + c.urlParams_.Encode()
  43045. req, _ := http.NewRequest("POST", urls, body)
  43046. req.Header = reqHeaders
  43047. googleapi.Expand(req.URL, map[string]string{
  43048. "project": c.project,
  43049. "zone": c.zone,
  43050. "instance": c.instance,
  43051. })
  43052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43053. }
  43054. // Do executes the "compute.instances.detachDisk" call.
  43055. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43056. // status code is an error. Response headers are in either
  43057. // *Operation.ServerResponse.Header or (if a response was returned at
  43058. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43059. // to check whether the returned error was because
  43060. // http.StatusNotModified was returned.
  43061. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43062. gensupport.SetOptions(c.urlParams_, opts...)
  43063. res, err := c.doRequest("json")
  43064. if res != nil && res.StatusCode == http.StatusNotModified {
  43065. if res.Body != nil {
  43066. res.Body.Close()
  43067. }
  43068. return nil, &googleapi.Error{
  43069. Code: res.StatusCode,
  43070. Header: res.Header,
  43071. }
  43072. }
  43073. if err != nil {
  43074. return nil, err
  43075. }
  43076. defer googleapi.CloseBody(res)
  43077. if err := googleapi.CheckResponse(res); err != nil {
  43078. return nil, err
  43079. }
  43080. ret := &Operation{
  43081. ServerResponse: googleapi.ServerResponse{
  43082. Header: res.Header,
  43083. HTTPStatusCode: res.StatusCode,
  43084. },
  43085. }
  43086. target := &ret
  43087. if err := gensupport.DecodeResponse(target, res); err != nil {
  43088. return nil, err
  43089. }
  43090. return ret, nil
  43091. // {
  43092. // "description": "Detaches a disk from an instance.",
  43093. // "httpMethod": "POST",
  43094. // "id": "compute.instances.detachDisk",
  43095. // "parameterOrder": [
  43096. // "project",
  43097. // "zone",
  43098. // "instance",
  43099. // "deviceName"
  43100. // ],
  43101. // "parameters": {
  43102. // "deviceName": {
  43103. // "description": "Disk device name to detach.",
  43104. // "location": "query",
  43105. // "required": true,
  43106. // "type": "string"
  43107. // },
  43108. // "instance": {
  43109. // "description": "Instance name.",
  43110. // "location": "path",
  43111. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43112. // "required": true,
  43113. // "type": "string"
  43114. // },
  43115. // "project": {
  43116. // "description": "Project ID for this request.",
  43117. // "location": "path",
  43118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43119. // "required": true,
  43120. // "type": "string"
  43121. // },
  43122. // "requestId": {
  43123. // "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).",
  43124. // "location": "query",
  43125. // "type": "string"
  43126. // },
  43127. // "zone": {
  43128. // "description": "The name of the zone for this request.",
  43129. // "location": "path",
  43130. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43131. // "required": true,
  43132. // "type": "string"
  43133. // }
  43134. // },
  43135. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  43136. // "response": {
  43137. // "$ref": "Operation"
  43138. // },
  43139. // "scopes": [
  43140. // "https://www.googleapis.com/auth/cloud-platform",
  43141. // "https://www.googleapis.com/auth/compute"
  43142. // ]
  43143. // }
  43144. }
  43145. // method id "compute.instances.get":
  43146. type InstancesGetCall struct {
  43147. s *Service
  43148. project string
  43149. zone string
  43150. instance string
  43151. urlParams_ gensupport.URLParams
  43152. ifNoneMatch_ string
  43153. ctx_ context.Context
  43154. header_ http.Header
  43155. }
  43156. // Get: Returns the specified Instance resource. Gets a list of
  43157. // available instances by making a list() request.
  43158. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  43159. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  43160. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43161. c.project = project
  43162. c.zone = zone
  43163. c.instance = instance
  43164. return c
  43165. }
  43166. // Fields allows partial responses to be retrieved. See
  43167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43168. // for more information.
  43169. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  43170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43171. return c
  43172. }
  43173. // IfNoneMatch sets the optional parameter which makes the operation
  43174. // fail if the object's ETag matches the given value. This is useful for
  43175. // getting updates only after the object has changed since the last
  43176. // request. Use googleapi.IsNotModified to check whether the response
  43177. // error from Do is the result of In-None-Match.
  43178. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  43179. c.ifNoneMatch_ = entityTag
  43180. return c
  43181. }
  43182. // Context sets the context to be used in this call's Do method. Any
  43183. // pending HTTP request will be aborted if the provided context is
  43184. // canceled.
  43185. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  43186. c.ctx_ = ctx
  43187. return c
  43188. }
  43189. // Header returns an http.Header that can be modified by the caller to
  43190. // add HTTP headers to the request.
  43191. func (c *InstancesGetCall) Header() http.Header {
  43192. if c.header_ == nil {
  43193. c.header_ = make(http.Header)
  43194. }
  43195. return c.header_
  43196. }
  43197. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  43198. reqHeaders := make(http.Header)
  43199. for k, v := range c.header_ {
  43200. reqHeaders[k] = v
  43201. }
  43202. reqHeaders.Set("User-Agent", c.s.userAgent())
  43203. if c.ifNoneMatch_ != "" {
  43204. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43205. }
  43206. var body io.Reader = nil
  43207. c.urlParams_.Set("alt", alt)
  43208. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  43209. urls += "?" + c.urlParams_.Encode()
  43210. req, _ := http.NewRequest("GET", urls, body)
  43211. req.Header = reqHeaders
  43212. googleapi.Expand(req.URL, map[string]string{
  43213. "project": c.project,
  43214. "zone": c.zone,
  43215. "instance": c.instance,
  43216. })
  43217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43218. }
  43219. // Do executes the "compute.instances.get" call.
  43220. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  43221. // code is an error. Response headers are in either
  43222. // *Instance.ServerResponse.Header or (if a response was returned at
  43223. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43224. // to check whether the returned error was because
  43225. // http.StatusNotModified was returned.
  43226. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  43227. gensupport.SetOptions(c.urlParams_, opts...)
  43228. res, err := c.doRequest("json")
  43229. if res != nil && res.StatusCode == http.StatusNotModified {
  43230. if res.Body != nil {
  43231. res.Body.Close()
  43232. }
  43233. return nil, &googleapi.Error{
  43234. Code: res.StatusCode,
  43235. Header: res.Header,
  43236. }
  43237. }
  43238. if err != nil {
  43239. return nil, err
  43240. }
  43241. defer googleapi.CloseBody(res)
  43242. if err := googleapi.CheckResponse(res); err != nil {
  43243. return nil, err
  43244. }
  43245. ret := &Instance{
  43246. ServerResponse: googleapi.ServerResponse{
  43247. Header: res.Header,
  43248. HTTPStatusCode: res.StatusCode,
  43249. },
  43250. }
  43251. target := &ret
  43252. if err := gensupport.DecodeResponse(target, res); err != nil {
  43253. return nil, err
  43254. }
  43255. return ret, nil
  43256. // {
  43257. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  43258. // "httpMethod": "GET",
  43259. // "id": "compute.instances.get",
  43260. // "parameterOrder": [
  43261. // "project",
  43262. // "zone",
  43263. // "instance"
  43264. // ],
  43265. // "parameters": {
  43266. // "instance": {
  43267. // "description": "Name of the instance resource to return.",
  43268. // "location": "path",
  43269. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43270. // "required": true,
  43271. // "type": "string"
  43272. // },
  43273. // "project": {
  43274. // "description": "Project ID for this request.",
  43275. // "location": "path",
  43276. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43277. // "required": true,
  43278. // "type": "string"
  43279. // },
  43280. // "zone": {
  43281. // "description": "The name of the zone for this request.",
  43282. // "location": "path",
  43283. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43284. // "required": true,
  43285. // "type": "string"
  43286. // }
  43287. // },
  43288. // "path": "{project}/zones/{zone}/instances/{instance}",
  43289. // "response": {
  43290. // "$ref": "Instance"
  43291. // },
  43292. // "scopes": [
  43293. // "https://www.googleapis.com/auth/cloud-platform",
  43294. // "https://www.googleapis.com/auth/compute",
  43295. // "https://www.googleapis.com/auth/compute.readonly"
  43296. // ]
  43297. // }
  43298. }
  43299. // method id "compute.instances.getSerialPortOutput":
  43300. type InstancesGetSerialPortOutputCall struct {
  43301. s *Service
  43302. project string
  43303. zone string
  43304. instance string
  43305. urlParams_ gensupport.URLParams
  43306. ifNoneMatch_ string
  43307. ctx_ context.Context
  43308. header_ http.Header
  43309. }
  43310. // GetSerialPortOutput: Returns the specified instance's serial port
  43311. // output.
  43312. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  43313. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  43314. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43315. c.project = project
  43316. c.zone = zone
  43317. c.instance = instance
  43318. return c
  43319. }
  43320. // Port sets the optional parameter "port": Specifies which COM or
  43321. // serial port to retrieve data from.
  43322. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  43323. c.urlParams_.Set("port", fmt.Sprint(port))
  43324. return c
  43325. }
  43326. // Start sets the optional parameter "start": Returns output starting
  43327. // from a specific byte position. Use this to page through output when
  43328. // the output is too large to return in a single request. For the
  43329. // initial request, leave this field unspecified. For subsequent calls,
  43330. // this field should be set to the next value returned in the previous
  43331. // call.
  43332. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  43333. c.urlParams_.Set("start", fmt.Sprint(start))
  43334. return c
  43335. }
  43336. // Fields allows partial responses to be retrieved. See
  43337. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43338. // for more information.
  43339. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  43340. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43341. return c
  43342. }
  43343. // IfNoneMatch sets the optional parameter which makes the operation
  43344. // fail if the object's ETag matches the given value. This is useful for
  43345. // getting updates only after the object has changed since the last
  43346. // request. Use googleapi.IsNotModified to check whether the response
  43347. // error from Do is the result of In-None-Match.
  43348. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  43349. c.ifNoneMatch_ = entityTag
  43350. return c
  43351. }
  43352. // Context sets the context to be used in this call's Do method. Any
  43353. // pending HTTP request will be aborted if the provided context is
  43354. // canceled.
  43355. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  43356. c.ctx_ = ctx
  43357. return c
  43358. }
  43359. // Header returns an http.Header that can be modified by the caller to
  43360. // add HTTP headers to the request.
  43361. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  43362. if c.header_ == nil {
  43363. c.header_ = make(http.Header)
  43364. }
  43365. return c.header_
  43366. }
  43367. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  43368. reqHeaders := make(http.Header)
  43369. for k, v := range c.header_ {
  43370. reqHeaders[k] = v
  43371. }
  43372. reqHeaders.Set("User-Agent", c.s.userAgent())
  43373. if c.ifNoneMatch_ != "" {
  43374. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43375. }
  43376. var body io.Reader = nil
  43377. c.urlParams_.Set("alt", alt)
  43378. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  43379. urls += "?" + c.urlParams_.Encode()
  43380. req, _ := http.NewRequest("GET", urls, body)
  43381. req.Header = reqHeaders
  43382. googleapi.Expand(req.URL, map[string]string{
  43383. "project": c.project,
  43384. "zone": c.zone,
  43385. "instance": c.instance,
  43386. })
  43387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43388. }
  43389. // Do executes the "compute.instances.getSerialPortOutput" call.
  43390. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  43391. // non-2xx status code is an error. Response headers are in either
  43392. // *SerialPortOutput.ServerResponse.Header or (if a response was
  43393. // returned at all) in error.(*googleapi.Error).Header. Use
  43394. // googleapi.IsNotModified to check whether the returned error was
  43395. // because http.StatusNotModified was returned.
  43396. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  43397. gensupport.SetOptions(c.urlParams_, opts...)
  43398. res, err := c.doRequest("json")
  43399. if res != nil && res.StatusCode == http.StatusNotModified {
  43400. if res.Body != nil {
  43401. res.Body.Close()
  43402. }
  43403. return nil, &googleapi.Error{
  43404. Code: res.StatusCode,
  43405. Header: res.Header,
  43406. }
  43407. }
  43408. if err != nil {
  43409. return nil, err
  43410. }
  43411. defer googleapi.CloseBody(res)
  43412. if err := googleapi.CheckResponse(res); err != nil {
  43413. return nil, err
  43414. }
  43415. ret := &SerialPortOutput{
  43416. ServerResponse: googleapi.ServerResponse{
  43417. Header: res.Header,
  43418. HTTPStatusCode: res.StatusCode,
  43419. },
  43420. }
  43421. target := &ret
  43422. if err := gensupport.DecodeResponse(target, res); err != nil {
  43423. return nil, err
  43424. }
  43425. return ret, nil
  43426. // {
  43427. // "description": "Returns the specified instance's serial port output.",
  43428. // "httpMethod": "GET",
  43429. // "id": "compute.instances.getSerialPortOutput",
  43430. // "parameterOrder": [
  43431. // "project",
  43432. // "zone",
  43433. // "instance"
  43434. // ],
  43435. // "parameters": {
  43436. // "instance": {
  43437. // "description": "Name of the instance scoping this request.",
  43438. // "location": "path",
  43439. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43440. // "required": true,
  43441. // "type": "string"
  43442. // },
  43443. // "port": {
  43444. // "default": "1",
  43445. // "description": "Specifies which COM or serial port to retrieve data from.",
  43446. // "format": "int32",
  43447. // "location": "query",
  43448. // "maximum": "4",
  43449. // "minimum": "1",
  43450. // "type": "integer"
  43451. // },
  43452. // "project": {
  43453. // "description": "Project ID for this request.",
  43454. // "location": "path",
  43455. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43456. // "required": true,
  43457. // "type": "string"
  43458. // },
  43459. // "start": {
  43460. // "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.",
  43461. // "format": "int64",
  43462. // "location": "query",
  43463. // "type": "string"
  43464. // },
  43465. // "zone": {
  43466. // "description": "The name of the zone for this request.",
  43467. // "location": "path",
  43468. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43469. // "required": true,
  43470. // "type": "string"
  43471. // }
  43472. // },
  43473. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  43474. // "response": {
  43475. // "$ref": "SerialPortOutput"
  43476. // },
  43477. // "scopes": [
  43478. // "https://www.googleapis.com/auth/cloud-platform",
  43479. // "https://www.googleapis.com/auth/compute",
  43480. // "https://www.googleapis.com/auth/compute.readonly"
  43481. // ]
  43482. // }
  43483. }
  43484. // method id "compute.instances.insert":
  43485. type InstancesInsertCall struct {
  43486. s *Service
  43487. project string
  43488. zone string
  43489. instance *Instance
  43490. urlParams_ gensupport.URLParams
  43491. ctx_ context.Context
  43492. header_ http.Header
  43493. }
  43494. // Insert: Creates an instance resource in the specified project using
  43495. // the data included in the request.
  43496. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  43497. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  43498. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43499. c.project = project
  43500. c.zone = zone
  43501. c.instance = instance
  43502. return c
  43503. }
  43504. // RequestId sets the optional parameter "requestId": An optional
  43505. // request ID to identify requests. Specify a unique request ID so that
  43506. // if you must retry your request, the server will know to ignore the
  43507. // request if it has already been completed.
  43508. //
  43509. // For example, consider a situation where you make an initial request
  43510. // and the request times out. If you make the request again with the
  43511. // same request ID, the server can check if original operation with the
  43512. // same request ID was received, and if so, will ignore the second
  43513. // request. This prevents clients from accidentally creating duplicate
  43514. // commitments.
  43515. //
  43516. // The request ID must be a valid UUID with the exception that zero UUID
  43517. // is not supported (00000000-0000-0000-0000-000000000000).
  43518. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  43519. c.urlParams_.Set("requestId", requestId)
  43520. return c
  43521. }
  43522. // SourceInstanceTemplate sets the optional parameter
  43523. // "sourceInstanceTemplate": Specifies instance template to create the
  43524. // instance.
  43525. //
  43526. // This field is optional. It can be a full or partial URL. For example,
  43527. // the following are all valid URLs to an instance template:
  43528. // -
  43529. // https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate
  43530. // - projects/project/global/global/instanceTemplates/instanceTemplate
  43531. //
  43532. // - global/instancesTemplates/instanceTemplate
  43533. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  43534. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  43535. return c
  43536. }
  43537. // Fields allows partial responses to be retrieved. See
  43538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43539. // for more information.
  43540. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  43541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43542. return c
  43543. }
  43544. // Context sets the context to be used in this call's Do method. Any
  43545. // pending HTTP request will be aborted if the provided context is
  43546. // canceled.
  43547. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  43548. c.ctx_ = ctx
  43549. return c
  43550. }
  43551. // Header returns an http.Header that can be modified by the caller to
  43552. // add HTTP headers to the request.
  43553. func (c *InstancesInsertCall) Header() http.Header {
  43554. if c.header_ == nil {
  43555. c.header_ = make(http.Header)
  43556. }
  43557. return c.header_
  43558. }
  43559. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  43560. reqHeaders := make(http.Header)
  43561. for k, v := range c.header_ {
  43562. reqHeaders[k] = v
  43563. }
  43564. reqHeaders.Set("User-Agent", c.s.userAgent())
  43565. var body io.Reader = nil
  43566. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  43567. if err != nil {
  43568. return nil, err
  43569. }
  43570. reqHeaders.Set("Content-Type", "application/json")
  43571. c.urlParams_.Set("alt", alt)
  43572. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  43573. urls += "?" + c.urlParams_.Encode()
  43574. req, _ := http.NewRequest("POST", urls, body)
  43575. req.Header = reqHeaders
  43576. googleapi.Expand(req.URL, map[string]string{
  43577. "project": c.project,
  43578. "zone": c.zone,
  43579. })
  43580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43581. }
  43582. // Do executes the "compute.instances.insert" call.
  43583. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43584. // status code is an error. Response headers are in either
  43585. // *Operation.ServerResponse.Header or (if a response was returned at
  43586. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43587. // to check whether the returned error was because
  43588. // http.StatusNotModified was returned.
  43589. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43590. gensupport.SetOptions(c.urlParams_, opts...)
  43591. res, err := c.doRequest("json")
  43592. if res != nil && res.StatusCode == http.StatusNotModified {
  43593. if res.Body != nil {
  43594. res.Body.Close()
  43595. }
  43596. return nil, &googleapi.Error{
  43597. Code: res.StatusCode,
  43598. Header: res.Header,
  43599. }
  43600. }
  43601. if err != nil {
  43602. return nil, err
  43603. }
  43604. defer googleapi.CloseBody(res)
  43605. if err := googleapi.CheckResponse(res); err != nil {
  43606. return nil, err
  43607. }
  43608. ret := &Operation{
  43609. ServerResponse: googleapi.ServerResponse{
  43610. Header: res.Header,
  43611. HTTPStatusCode: res.StatusCode,
  43612. },
  43613. }
  43614. target := &ret
  43615. if err := gensupport.DecodeResponse(target, res); err != nil {
  43616. return nil, err
  43617. }
  43618. return ret, nil
  43619. // {
  43620. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  43621. // "httpMethod": "POST",
  43622. // "id": "compute.instances.insert",
  43623. // "parameterOrder": [
  43624. // "project",
  43625. // "zone"
  43626. // ],
  43627. // "parameters": {
  43628. // "project": {
  43629. // "description": "Project ID for this request.",
  43630. // "location": "path",
  43631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43632. // "required": true,
  43633. // "type": "string"
  43634. // },
  43635. // "requestId": {
  43636. // "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).",
  43637. // "location": "query",
  43638. // "type": "string"
  43639. // },
  43640. // "sourceInstanceTemplate": {
  43641. // "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/global/instanceTemplates/instanceTemplate \n- projects/project/global/global/instanceTemplates/instanceTemplate \n- global/instancesTemplates/instanceTemplate",
  43642. // "location": "query",
  43643. // "type": "string"
  43644. // },
  43645. // "zone": {
  43646. // "description": "The name of the zone for this request.",
  43647. // "location": "path",
  43648. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43649. // "required": true,
  43650. // "type": "string"
  43651. // }
  43652. // },
  43653. // "path": "{project}/zones/{zone}/instances",
  43654. // "request": {
  43655. // "$ref": "Instance"
  43656. // },
  43657. // "response": {
  43658. // "$ref": "Operation"
  43659. // },
  43660. // "scopes": [
  43661. // "https://www.googleapis.com/auth/cloud-platform",
  43662. // "https://www.googleapis.com/auth/compute"
  43663. // ]
  43664. // }
  43665. }
  43666. // method id "compute.instances.list":
  43667. type InstancesListCall struct {
  43668. s *Service
  43669. project string
  43670. zone string
  43671. urlParams_ gensupport.URLParams
  43672. ifNoneMatch_ string
  43673. ctx_ context.Context
  43674. header_ http.Header
  43675. }
  43676. // List: Retrieves the list of instances contained within the specified
  43677. // zone.
  43678. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  43679. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  43680. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43681. c.project = project
  43682. c.zone = zone
  43683. return c
  43684. }
  43685. // Filter sets the optional parameter "filter": A filter expression that
  43686. // filters resources listed in the response. The expression must specify
  43687. // the field name, a comparison operator, and the value that you want to
  43688. // use for filtering. The value must be a string, a number, or a
  43689. // boolean. The comparison operator must be either =, !=, >, or <.
  43690. //
  43691. // For example, if you are filtering Compute Engine instances, you can
  43692. // exclude instances named example-instance by specifying name !=
  43693. // example-instance.
  43694. //
  43695. // You can also filter nested fields. For example, you could specify
  43696. // scheduling.automaticRestart = false to include instances only if they
  43697. // are not scheduled for automatic restarts. You can use filtering on
  43698. // nested fields to filter based on resource labels.
  43699. //
  43700. // To filter on multiple expressions, provide each separate expression
  43701. // within parentheses. For example, (scheduling.automaticRestart = true)
  43702. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43703. // AND expression. However, you can include AND and OR expressions
  43704. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43705. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43706. // true).
  43707. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  43708. c.urlParams_.Set("filter", filter)
  43709. return c
  43710. }
  43711. // MaxResults sets the optional parameter "maxResults": The maximum
  43712. // number of results per page that should be returned. If the number of
  43713. // available results is larger than maxResults, Compute Engine returns a
  43714. // nextPageToken that can be used to get the next page of results in
  43715. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43716. // (Default: 500)
  43717. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  43718. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43719. return c
  43720. }
  43721. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43722. // a certain order. By default, results are returned in alphanumerical
  43723. // order based on the resource name.
  43724. //
  43725. // You can also sort results in descending order based on the creation
  43726. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43727. // based on the creationTimestamp field in reverse chronological order
  43728. // (newest result first). Use this to sort resources like operations so
  43729. // that the newest operation is returned first.
  43730. //
  43731. // Currently, only sorting by name or creationTimestamp desc is
  43732. // supported.
  43733. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  43734. c.urlParams_.Set("orderBy", orderBy)
  43735. return c
  43736. }
  43737. // PageToken sets the optional parameter "pageToken": Specifies a page
  43738. // token to use. Set pageToken to the nextPageToken returned by a
  43739. // previous list request to get the next page of results.
  43740. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  43741. c.urlParams_.Set("pageToken", pageToken)
  43742. return c
  43743. }
  43744. // Fields allows partial responses to be retrieved. See
  43745. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43746. // for more information.
  43747. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  43748. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43749. return c
  43750. }
  43751. // IfNoneMatch sets the optional parameter which makes the operation
  43752. // fail if the object's ETag matches the given value. This is useful for
  43753. // getting updates only after the object has changed since the last
  43754. // request. Use googleapi.IsNotModified to check whether the response
  43755. // error from Do is the result of In-None-Match.
  43756. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  43757. c.ifNoneMatch_ = entityTag
  43758. return c
  43759. }
  43760. // Context sets the context to be used in this call's Do method. Any
  43761. // pending HTTP request will be aborted if the provided context is
  43762. // canceled.
  43763. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  43764. c.ctx_ = ctx
  43765. return c
  43766. }
  43767. // Header returns an http.Header that can be modified by the caller to
  43768. // add HTTP headers to the request.
  43769. func (c *InstancesListCall) Header() http.Header {
  43770. if c.header_ == nil {
  43771. c.header_ = make(http.Header)
  43772. }
  43773. return c.header_
  43774. }
  43775. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  43776. reqHeaders := make(http.Header)
  43777. for k, v := range c.header_ {
  43778. reqHeaders[k] = v
  43779. }
  43780. reqHeaders.Set("User-Agent", c.s.userAgent())
  43781. if c.ifNoneMatch_ != "" {
  43782. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43783. }
  43784. var body io.Reader = nil
  43785. c.urlParams_.Set("alt", alt)
  43786. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  43787. urls += "?" + c.urlParams_.Encode()
  43788. req, _ := http.NewRequest("GET", urls, body)
  43789. req.Header = reqHeaders
  43790. googleapi.Expand(req.URL, map[string]string{
  43791. "project": c.project,
  43792. "zone": c.zone,
  43793. })
  43794. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43795. }
  43796. // Do executes the "compute.instances.list" call.
  43797. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  43798. // status code is an error. Response headers are in either
  43799. // *InstanceList.ServerResponse.Header or (if a response was returned at
  43800. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43801. // to check whether the returned error was because
  43802. // http.StatusNotModified was returned.
  43803. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  43804. gensupport.SetOptions(c.urlParams_, opts...)
  43805. res, err := c.doRequest("json")
  43806. if res != nil && res.StatusCode == http.StatusNotModified {
  43807. if res.Body != nil {
  43808. res.Body.Close()
  43809. }
  43810. return nil, &googleapi.Error{
  43811. Code: res.StatusCode,
  43812. Header: res.Header,
  43813. }
  43814. }
  43815. if err != nil {
  43816. return nil, err
  43817. }
  43818. defer googleapi.CloseBody(res)
  43819. if err := googleapi.CheckResponse(res); err != nil {
  43820. return nil, err
  43821. }
  43822. ret := &InstanceList{
  43823. ServerResponse: googleapi.ServerResponse{
  43824. Header: res.Header,
  43825. HTTPStatusCode: res.StatusCode,
  43826. },
  43827. }
  43828. target := &ret
  43829. if err := gensupport.DecodeResponse(target, res); err != nil {
  43830. return nil, err
  43831. }
  43832. return ret, nil
  43833. // {
  43834. // "description": "Retrieves the list of instances contained within the specified zone.",
  43835. // "httpMethod": "GET",
  43836. // "id": "compute.instances.list",
  43837. // "parameterOrder": [
  43838. // "project",
  43839. // "zone"
  43840. // ],
  43841. // "parameters": {
  43842. // "filter": {
  43843. // "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).",
  43844. // "location": "query",
  43845. // "type": "string"
  43846. // },
  43847. // "maxResults": {
  43848. // "default": "500",
  43849. // "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)",
  43850. // "format": "uint32",
  43851. // "location": "query",
  43852. // "minimum": "0",
  43853. // "type": "integer"
  43854. // },
  43855. // "orderBy": {
  43856. // "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.",
  43857. // "location": "query",
  43858. // "type": "string"
  43859. // },
  43860. // "pageToken": {
  43861. // "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.",
  43862. // "location": "query",
  43863. // "type": "string"
  43864. // },
  43865. // "project": {
  43866. // "description": "Project ID for this request.",
  43867. // "location": "path",
  43868. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43869. // "required": true,
  43870. // "type": "string"
  43871. // },
  43872. // "zone": {
  43873. // "description": "The name of the zone for this request.",
  43874. // "location": "path",
  43875. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43876. // "required": true,
  43877. // "type": "string"
  43878. // }
  43879. // },
  43880. // "path": "{project}/zones/{zone}/instances",
  43881. // "response": {
  43882. // "$ref": "InstanceList"
  43883. // },
  43884. // "scopes": [
  43885. // "https://www.googleapis.com/auth/cloud-platform",
  43886. // "https://www.googleapis.com/auth/compute",
  43887. // "https://www.googleapis.com/auth/compute.readonly"
  43888. // ]
  43889. // }
  43890. }
  43891. // Pages invokes f for each page of results.
  43892. // A non-nil error returned from f will halt the iteration.
  43893. // The provided context supersedes any context provided to the Context method.
  43894. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  43895. c.ctx_ = ctx
  43896. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43897. for {
  43898. x, err := c.Do()
  43899. if err != nil {
  43900. return err
  43901. }
  43902. if err := f(x); err != nil {
  43903. return err
  43904. }
  43905. if x.NextPageToken == "" {
  43906. return nil
  43907. }
  43908. c.PageToken(x.NextPageToken)
  43909. }
  43910. }
  43911. // method id "compute.instances.listReferrers":
  43912. type InstancesListReferrersCall struct {
  43913. s *Service
  43914. project string
  43915. zone string
  43916. instance string
  43917. urlParams_ gensupport.URLParams
  43918. ifNoneMatch_ string
  43919. ctx_ context.Context
  43920. header_ http.Header
  43921. }
  43922. // ListReferrers: Retrieves the list of referrers to instances contained
  43923. // within the specified zone.
  43924. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  43925. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43926. c.project = project
  43927. c.zone = zone
  43928. c.instance = instance
  43929. return c
  43930. }
  43931. // Filter sets the optional parameter "filter": A filter expression that
  43932. // filters resources listed in the response. The expression must specify
  43933. // the field name, a comparison operator, and the value that you want to
  43934. // use for filtering. The value must be a string, a number, or a
  43935. // boolean. The comparison operator must be either =, !=, >, or <.
  43936. //
  43937. // For example, if you are filtering Compute Engine instances, you can
  43938. // exclude instances named example-instance by specifying name !=
  43939. // example-instance.
  43940. //
  43941. // You can also filter nested fields. For example, you could specify
  43942. // scheduling.automaticRestart = false to include instances only if they
  43943. // are not scheduled for automatic restarts. You can use filtering on
  43944. // nested fields to filter based on resource labels.
  43945. //
  43946. // To filter on multiple expressions, provide each separate expression
  43947. // within parentheses. For example, (scheduling.automaticRestart = true)
  43948. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43949. // AND expression. However, you can include AND and OR expressions
  43950. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43951. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43952. // true).
  43953. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  43954. c.urlParams_.Set("filter", filter)
  43955. return c
  43956. }
  43957. // MaxResults sets the optional parameter "maxResults": The maximum
  43958. // number of results per page that should be returned. If the number of
  43959. // available results is larger than maxResults, Compute Engine returns a
  43960. // nextPageToken that can be used to get the next page of results in
  43961. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43962. // (Default: 500)
  43963. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  43964. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43965. return c
  43966. }
  43967. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43968. // a certain order. By default, results are returned in alphanumerical
  43969. // order based on the resource name.
  43970. //
  43971. // You can also sort results in descending order based on the creation
  43972. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43973. // based on the creationTimestamp field in reverse chronological order
  43974. // (newest result first). Use this to sort resources like operations so
  43975. // that the newest operation is returned first.
  43976. //
  43977. // Currently, only sorting by name or creationTimestamp desc is
  43978. // supported.
  43979. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  43980. c.urlParams_.Set("orderBy", orderBy)
  43981. return c
  43982. }
  43983. // PageToken sets the optional parameter "pageToken": Specifies a page
  43984. // token to use. Set pageToken to the nextPageToken returned by a
  43985. // previous list request to get the next page of results.
  43986. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  43987. c.urlParams_.Set("pageToken", pageToken)
  43988. return c
  43989. }
  43990. // Fields allows partial responses to be retrieved. See
  43991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43992. // for more information.
  43993. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  43994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43995. return c
  43996. }
  43997. // IfNoneMatch sets the optional parameter which makes the operation
  43998. // fail if the object's ETag matches the given value. This is useful for
  43999. // getting updates only after the object has changed since the last
  44000. // request. Use googleapi.IsNotModified to check whether the response
  44001. // error from Do is the result of In-None-Match.
  44002. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  44003. c.ifNoneMatch_ = entityTag
  44004. return c
  44005. }
  44006. // Context sets the context to be used in this call's Do method. Any
  44007. // pending HTTP request will be aborted if the provided context is
  44008. // canceled.
  44009. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  44010. c.ctx_ = ctx
  44011. return c
  44012. }
  44013. // Header returns an http.Header that can be modified by the caller to
  44014. // add HTTP headers to the request.
  44015. func (c *InstancesListReferrersCall) Header() http.Header {
  44016. if c.header_ == nil {
  44017. c.header_ = make(http.Header)
  44018. }
  44019. return c.header_
  44020. }
  44021. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  44022. reqHeaders := make(http.Header)
  44023. for k, v := range c.header_ {
  44024. reqHeaders[k] = v
  44025. }
  44026. reqHeaders.Set("User-Agent", c.s.userAgent())
  44027. if c.ifNoneMatch_ != "" {
  44028. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44029. }
  44030. var body io.Reader = nil
  44031. c.urlParams_.Set("alt", alt)
  44032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  44033. urls += "?" + c.urlParams_.Encode()
  44034. req, _ := http.NewRequest("GET", urls, body)
  44035. req.Header = reqHeaders
  44036. googleapi.Expand(req.URL, map[string]string{
  44037. "project": c.project,
  44038. "zone": c.zone,
  44039. "instance": c.instance,
  44040. })
  44041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44042. }
  44043. // Do executes the "compute.instances.listReferrers" call.
  44044. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  44045. // non-2xx status code is an error. Response headers are in either
  44046. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  44047. // returned at all) in error.(*googleapi.Error).Header. Use
  44048. // googleapi.IsNotModified to check whether the returned error was
  44049. // because http.StatusNotModified was returned.
  44050. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  44051. gensupport.SetOptions(c.urlParams_, opts...)
  44052. res, err := c.doRequest("json")
  44053. if res != nil && res.StatusCode == http.StatusNotModified {
  44054. if res.Body != nil {
  44055. res.Body.Close()
  44056. }
  44057. return nil, &googleapi.Error{
  44058. Code: res.StatusCode,
  44059. Header: res.Header,
  44060. }
  44061. }
  44062. if err != nil {
  44063. return nil, err
  44064. }
  44065. defer googleapi.CloseBody(res)
  44066. if err := googleapi.CheckResponse(res); err != nil {
  44067. return nil, err
  44068. }
  44069. ret := &InstanceListReferrers{
  44070. ServerResponse: googleapi.ServerResponse{
  44071. Header: res.Header,
  44072. HTTPStatusCode: res.StatusCode,
  44073. },
  44074. }
  44075. target := &ret
  44076. if err := gensupport.DecodeResponse(target, res); err != nil {
  44077. return nil, err
  44078. }
  44079. return ret, nil
  44080. // {
  44081. // "description": "Retrieves the list of referrers to instances contained within the specified zone.",
  44082. // "httpMethod": "GET",
  44083. // "id": "compute.instances.listReferrers",
  44084. // "parameterOrder": [
  44085. // "project",
  44086. // "zone",
  44087. // "instance"
  44088. // ],
  44089. // "parameters": {
  44090. // "filter": {
  44091. // "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).",
  44092. // "location": "query",
  44093. // "type": "string"
  44094. // },
  44095. // "instance": {
  44096. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  44097. // "location": "path",
  44098. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44099. // "required": true,
  44100. // "type": "string"
  44101. // },
  44102. // "maxResults": {
  44103. // "default": "500",
  44104. // "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)",
  44105. // "format": "uint32",
  44106. // "location": "query",
  44107. // "minimum": "0",
  44108. // "type": "integer"
  44109. // },
  44110. // "orderBy": {
  44111. // "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.",
  44112. // "location": "query",
  44113. // "type": "string"
  44114. // },
  44115. // "pageToken": {
  44116. // "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.",
  44117. // "location": "query",
  44118. // "type": "string"
  44119. // },
  44120. // "project": {
  44121. // "description": "Project ID for this request.",
  44122. // "location": "path",
  44123. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44124. // "required": true,
  44125. // "type": "string"
  44126. // },
  44127. // "zone": {
  44128. // "description": "The name of the zone for this request.",
  44129. // "location": "path",
  44130. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44131. // "required": true,
  44132. // "type": "string"
  44133. // }
  44134. // },
  44135. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  44136. // "response": {
  44137. // "$ref": "InstanceListReferrers"
  44138. // },
  44139. // "scopes": [
  44140. // "https://www.googleapis.com/auth/cloud-platform",
  44141. // "https://www.googleapis.com/auth/compute",
  44142. // "https://www.googleapis.com/auth/compute.readonly"
  44143. // ]
  44144. // }
  44145. }
  44146. // Pages invokes f for each page of results.
  44147. // A non-nil error returned from f will halt the iteration.
  44148. // The provided context supersedes any context provided to the Context method.
  44149. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  44150. c.ctx_ = ctx
  44151. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44152. for {
  44153. x, err := c.Do()
  44154. if err != nil {
  44155. return err
  44156. }
  44157. if err := f(x); err != nil {
  44158. return err
  44159. }
  44160. if x.NextPageToken == "" {
  44161. return nil
  44162. }
  44163. c.PageToken(x.NextPageToken)
  44164. }
  44165. }
  44166. // method id "compute.instances.reset":
  44167. type InstancesResetCall struct {
  44168. s *Service
  44169. project string
  44170. zone string
  44171. instance string
  44172. urlParams_ gensupport.URLParams
  44173. ctx_ context.Context
  44174. header_ http.Header
  44175. }
  44176. // Reset: Performs a reset on the instance. For more information, see
  44177. // Resetting an instance.
  44178. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  44179. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  44180. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44181. c.project = project
  44182. c.zone = zone
  44183. c.instance = instance
  44184. return c
  44185. }
  44186. // RequestId sets the optional parameter "requestId": An optional
  44187. // request ID to identify requests. Specify a unique request ID so that
  44188. // if you must retry your request, the server will know to ignore the
  44189. // request if it has already been completed.
  44190. //
  44191. // For example, consider a situation where you make an initial request
  44192. // and the request times out. If you make the request again with the
  44193. // same request ID, the server can check if original operation with the
  44194. // same request ID was received, and if so, will ignore the second
  44195. // request. This prevents clients from accidentally creating duplicate
  44196. // commitments.
  44197. //
  44198. // The request ID must be a valid UUID with the exception that zero UUID
  44199. // is not supported (00000000-0000-0000-0000-000000000000).
  44200. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  44201. c.urlParams_.Set("requestId", requestId)
  44202. return c
  44203. }
  44204. // Fields allows partial responses to be retrieved. See
  44205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44206. // for more information.
  44207. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  44208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44209. return c
  44210. }
  44211. // Context sets the context to be used in this call's Do method. Any
  44212. // pending HTTP request will be aborted if the provided context is
  44213. // canceled.
  44214. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  44215. c.ctx_ = ctx
  44216. return c
  44217. }
  44218. // Header returns an http.Header that can be modified by the caller to
  44219. // add HTTP headers to the request.
  44220. func (c *InstancesResetCall) Header() http.Header {
  44221. if c.header_ == nil {
  44222. c.header_ = make(http.Header)
  44223. }
  44224. return c.header_
  44225. }
  44226. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  44227. reqHeaders := make(http.Header)
  44228. for k, v := range c.header_ {
  44229. reqHeaders[k] = v
  44230. }
  44231. reqHeaders.Set("User-Agent", c.s.userAgent())
  44232. var body io.Reader = nil
  44233. c.urlParams_.Set("alt", alt)
  44234. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  44235. urls += "?" + c.urlParams_.Encode()
  44236. req, _ := http.NewRequest("POST", urls, body)
  44237. req.Header = reqHeaders
  44238. googleapi.Expand(req.URL, map[string]string{
  44239. "project": c.project,
  44240. "zone": c.zone,
  44241. "instance": c.instance,
  44242. })
  44243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44244. }
  44245. // Do executes the "compute.instances.reset" call.
  44246. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44247. // status code is an error. Response headers are in either
  44248. // *Operation.ServerResponse.Header or (if a response was returned at
  44249. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44250. // to check whether the returned error was because
  44251. // http.StatusNotModified was returned.
  44252. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44253. gensupport.SetOptions(c.urlParams_, opts...)
  44254. res, err := c.doRequest("json")
  44255. if res != nil && res.StatusCode == http.StatusNotModified {
  44256. if res.Body != nil {
  44257. res.Body.Close()
  44258. }
  44259. return nil, &googleapi.Error{
  44260. Code: res.StatusCode,
  44261. Header: res.Header,
  44262. }
  44263. }
  44264. if err != nil {
  44265. return nil, err
  44266. }
  44267. defer googleapi.CloseBody(res)
  44268. if err := googleapi.CheckResponse(res); err != nil {
  44269. return nil, err
  44270. }
  44271. ret := &Operation{
  44272. ServerResponse: googleapi.ServerResponse{
  44273. Header: res.Header,
  44274. HTTPStatusCode: res.StatusCode,
  44275. },
  44276. }
  44277. target := &ret
  44278. if err := gensupport.DecodeResponse(target, res); err != nil {
  44279. return nil, err
  44280. }
  44281. return ret, nil
  44282. // {
  44283. // "description": "Performs a reset on the instance. For more information, see Resetting an instance.",
  44284. // "httpMethod": "POST",
  44285. // "id": "compute.instances.reset",
  44286. // "parameterOrder": [
  44287. // "project",
  44288. // "zone",
  44289. // "instance"
  44290. // ],
  44291. // "parameters": {
  44292. // "instance": {
  44293. // "description": "Name of the instance scoping this request.",
  44294. // "location": "path",
  44295. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44296. // "required": true,
  44297. // "type": "string"
  44298. // },
  44299. // "project": {
  44300. // "description": "Project ID for this request.",
  44301. // "location": "path",
  44302. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44303. // "required": true,
  44304. // "type": "string"
  44305. // },
  44306. // "requestId": {
  44307. // "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).",
  44308. // "location": "query",
  44309. // "type": "string"
  44310. // },
  44311. // "zone": {
  44312. // "description": "The name of the zone for this request.",
  44313. // "location": "path",
  44314. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44315. // "required": true,
  44316. // "type": "string"
  44317. // }
  44318. // },
  44319. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  44320. // "response": {
  44321. // "$ref": "Operation"
  44322. // },
  44323. // "scopes": [
  44324. // "https://www.googleapis.com/auth/cloud-platform",
  44325. // "https://www.googleapis.com/auth/compute"
  44326. // ]
  44327. // }
  44328. }
  44329. // method id "compute.instances.setDeletionProtection":
  44330. type InstancesSetDeletionProtectionCall struct {
  44331. s *Service
  44332. project string
  44333. zone string
  44334. resource string
  44335. urlParams_ gensupport.URLParams
  44336. ctx_ context.Context
  44337. header_ http.Header
  44338. }
  44339. // SetDeletionProtection: Sets deletion protection on the instance.
  44340. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  44341. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44342. c.project = project
  44343. c.zone = zone
  44344. c.resource = resource
  44345. return c
  44346. }
  44347. // DeletionProtection sets the optional parameter "deletionProtection":
  44348. // Whether the resource should be protected against deletion.
  44349. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  44350. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  44351. return c
  44352. }
  44353. // RequestId sets the optional parameter "requestId": An optional
  44354. // request ID to identify requests. Specify a unique request ID so that
  44355. // if you must retry your request, the server will know to ignore the
  44356. // request if it has already been completed.
  44357. //
  44358. // For example, consider a situation where you make an initial request
  44359. // and the request times out. If you make the request again with the
  44360. // same request ID, the server can check if original operation with the
  44361. // same request ID was received, and if so, will ignore the second
  44362. // request. This prevents clients from accidentally creating duplicate
  44363. // commitments.
  44364. //
  44365. // The request ID must be a valid UUID with the exception that zero UUID
  44366. // is not supported (00000000-0000-0000-0000-000000000000).
  44367. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  44368. c.urlParams_.Set("requestId", requestId)
  44369. return c
  44370. }
  44371. // Fields allows partial responses to be retrieved. See
  44372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44373. // for more information.
  44374. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  44375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44376. return c
  44377. }
  44378. // Context sets the context to be used in this call's Do method. Any
  44379. // pending HTTP request will be aborted if the provided context is
  44380. // canceled.
  44381. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  44382. c.ctx_ = ctx
  44383. return c
  44384. }
  44385. // Header returns an http.Header that can be modified by the caller to
  44386. // add HTTP headers to the request.
  44387. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  44388. if c.header_ == nil {
  44389. c.header_ = make(http.Header)
  44390. }
  44391. return c.header_
  44392. }
  44393. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  44394. reqHeaders := make(http.Header)
  44395. for k, v := range c.header_ {
  44396. reqHeaders[k] = v
  44397. }
  44398. reqHeaders.Set("User-Agent", c.s.userAgent())
  44399. var body io.Reader = nil
  44400. c.urlParams_.Set("alt", alt)
  44401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  44402. urls += "?" + c.urlParams_.Encode()
  44403. req, _ := http.NewRequest("POST", urls, body)
  44404. req.Header = reqHeaders
  44405. googleapi.Expand(req.URL, map[string]string{
  44406. "project": c.project,
  44407. "zone": c.zone,
  44408. "resource": c.resource,
  44409. })
  44410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44411. }
  44412. // Do executes the "compute.instances.setDeletionProtection" call.
  44413. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44414. // status code is an error. Response headers are in either
  44415. // *Operation.ServerResponse.Header or (if a response was returned at
  44416. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44417. // to check whether the returned error was because
  44418. // http.StatusNotModified was returned.
  44419. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44420. gensupport.SetOptions(c.urlParams_, opts...)
  44421. res, err := c.doRequest("json")
  44422. if res != nil && res.StatusCode == http.StatusNotModified {
  44423. if res.Body != nil {
  44424. res.Body.Close()
  44425. }
  44426. return nil, &googleapi.Error{
  44427. Code: res.StatusCode,
  44428. Header: res.Header,
  44429. }
  44430. }
  44431. if err != nil {
  44432. return nil, err
  44433. }
  44434. defer googleapi.CloseBody(res)
  44435. if err := googleapi.CheckResponse(res); err != nil {
  44436. return nil, err
  44437. }
  44438. ret := &Operation{
  44439. ServerResponse: googleapi.ServerResponse{
  44440. Header: res.Header,
  44441. HTTPStatusCode: res.StatusCode,
  44442. },
  44443. }
  44444. target := &ret
  44445. if err := gensupport.DecodeResponse(target, res); err != nil {
  44446. return nil, err
  44447. }
  44448. return ret, nil
  44449. // {
  44450. // "description": "Sets deletion protection on the instance.",
  44451. // "httpMethod": "POST",
  44452. // "id": "compute.instances.setDeletionProtection",
  44453. // "parameterOrder": [
  44454. // "project",
  44455. // "zone",
  44456. // "resource"
  44457. // ],
  44458. // "parameters": {
  44459. // "deletionProtection": {
  44460. // "default": "true",
  44461. // "description": "Whether the resource should be protected against deletion.",
  44462. // "location": "query",
  44463. // "type": "boolean"
  44464. // },
  44465. // "project": {
  44466. // "description": "Project ID for this request.",
  44467. // "location": "path",
  44468. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44469. // "required": true,
  44470. // "type": "string"
  44471. // },
  44472. // "requestId": {
  44473. // "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).",
  44474. // "location": "query",
  44475. // "type": "string"
  44476. // },
  44477. // "resource": {
  44478. // "description": "Name of the resource for this request.",
  44479. // "location": "path",
  44480. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44481. // "required": true,
  44482. // "type": "string"
  44483. // },
  44484. // "zone": {
  44485. // "description": "The name of the zone for this request.",
  44486. // "location": "path",
  44487. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44488. // "required": true,
  44489. // "type": "string"
  44490. // }
  44491. // },
  44492. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  44493. // "response": {
  44494. // "$ref": "Operation"
  44495. // },
  44496. // "scopes": [
  44497. // "https://www.googleapis.com/auth/cloud-platform",
  44498. // "https://www.googleapis.com/auth/compute"
  44499. // ]
  44500. // }
  44501. }
  44502. // method id "compute.instances.setDiskAutoDelete":
  44503. type InstancesSetDiskAutoDeleteCall struct {
  44504. s *Service
  44505. project string
  44506. zone string
  44507. instance string
  44508. urlParams_ gensupport.URLParams
  44509. ctx_ context.Context
  44510. header_ http.Header
  44511. }
  44512. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  44513. // an instance.
  44514. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  44515. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  44516. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44517. c.project = project
  44518. c.zone = zone
  44519. c.instance = instance
  44520. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  44521. c.urlParams_.Set("deviceName", deviceName)
  44522. return c
  44523. }
  44524. // RequestId sets the optional parameter "requestId": An optional
  44525. // request ID to identify requests. Specify a unique request ID so that
  44526. // if you must retry your request, the server will know to ignore the
  44527. // request if it has already been completed.
  44528. //
  44529. // For example, consider a situation where you make an initial request
  44530. // and the request times out. If you make the request again with the
  44531. // same request ID, the server can check if original operation with the
  44532. // same request ID was received, and if so, will ignore the second
  44533. // request. This prevents clients from accidentally creating duplicate
  44534. // commitments.
  44535. //
  44536. // The request ID must be a valid UUID with the exception that zero UUID
  44537. // is not supported (00000000-0000-0000-0000-000000000000).
  44538. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  44539. c.urlParams_.Set("requestId", requestId)
  44540. return c
  44541. }
  44542. // Fields allows partial responses to be retrieved. See
  44543. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44544. // for more information.
  44545. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  44546. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44547. return c
  44548. }
  44549. // Context sets the context to be used in this call's Do method. Any
  44550. // pending HTTP request will be aborted if the provided context is
  44551. // canceled.
  44552. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  44553. c.ctx_ = ctx
  44554. return c
  44555. }
  44556. // Header returns an http.Header that can be modified by the caller to
  44557. // add HTTP headers to the request.
  44558. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  44559. if c.header_ == nil {
  44560. c.header_ = make(http.Header)
  44561. }
  44562. return c.header_
  44563. }
  44564. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  44565. reqHeaders := make(http.Header)
  44566. for k, v := range c.header_ {
  44567. reqHeaders[k] = v
  44568. }
  44569. reqHeaders.Set("User-Agent", c.s.userAgent())
  44570. var body io.Reader = nil
  44571. c.urlParams_.Set("alt", alt)
  44572. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  44573. urls += "?" + c.urlParams_.Encode()
  44574. req, _ := http.NewRequest("POST", urls, body)
  44575. req.Header = reqHeaders
  44576. googleapi.Expand(req.URL, map[string]string{
  44577. "project": c.project,
  44578. "zone": c.zone,
  44579. "instance": c.instance,
  44580. })
  44581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44582. }
  44583. // Do executes the "compute.instances.setDiskAutoDelete" call.
  44584. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44585. // status code is an error. Response headers are in either
  44586. // *Operation.ServerResponse.Header or (if a response was returned at
  44587. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44588. // to check whether the returned error was because
  44589. // http.StatusNotModified was returned.
  44590. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44591. gensupport.SetOptions(c.urlParams_, opts...)
  44592. res, err := c.doRequest("json")
  44593. if res != nil && res.StatusCode == http.StatusNotModified {
  44594. if res.Body != nil {
  44595. res.Body.Close()
  44596. }
  44597. return nil, &googleapi.Error{
  44598. Code: res.StatusCode,
  44599. Header: res.Header,
  44600. }
  44601. }
  44602. if err != nil {
  44603. return nil, err
  44604. }
  44605. defer googleapi.CloseBody(res)
  44606. if err := googleapi.CheckResponse(res); err != nil {
  44607. return nil, err
  44608. }
  44609. ret := &Operation{
  44610. ServerResponse: googleapi.ServerResponse{
  44611. Header: res.Header,
  44612. HTTPStatusCode: res.StatusCode,
  44613. },
  44614. }
  44615. target := &ret
  44616. if err := gensupport.DecodeResponse(target, res); err != nil {
  44617. return nil, err
  44618. }
  44619. return ret, nil
  44620. // {
  44621. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  44622. // "httpMethod": "POST",
  44623. // "id": "compute.instances.setDiskAutoDelete",
  44624. // "parameterOrder": [
  44625. // "project",
  44626. // "zone",
  44627. // "instance",
  44628. // "autoDelete",
  44629. // "deviceName"
  44630. // ],
  44631. // "parameters": {
  44632. // "autoDelete": {
  44633. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  44634. // "location": "query",
  44635. // "required": true,
  44636. // "type": "boolean"
  44637. // },
  44638. // "deviceName": {
  44639. // "description": "The device name of the disk to modify.",
  44640. // "location": "query",
  44641. // "pattern": "\\w[\\w.-]{0,254}",
  44642. // "required": true,
  44643. // "type": "string"
  44644. // },
  44645. // "instance": {
  44646. // "description": "The instance name.",
  44647. // "location": "path",
  44648. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44649. // "required": true,
  44650. // "type": "string"
  44651. // },
  44652. // "project": {
  44653. // "description": "Project ID for this request.",
  44654. // "location": "path",
  44655. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44656. // "required": true,
  44657. // "type": "string"
  44658. // },
  44659. // "requestId": {
  44660. // "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).",
  44661. // "location": "query",
  44662. // "type": "string"
  44663. // },
  44664. // "zone": {
  44665. // "description": "The name of the zone for this request.",
  44666. // "location": "path",
  44667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44668. // "required": true,
  44669. // "type": "string"
  44670. // }
  44671. // },
  44672. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  44673. // "response": {
  44674. // "$ref": "Operation"
  44675. // },
  44676. // "scopes": [
  44677. // "https://www.googleapis.com/auth/cloud-platform",
  44678. // "https://www.googleapis.com/auth/compute"
  44679. // ]
  44680. // }
  44681. }
  44682. // method id "compute.instances.setLabels":
  44683. type InstancesSetLabelsCall struct {
  44684. s *Service
  44685. project string
  44686. zone string
  44687. instance string
  44688. instancessetlabelsrequest *InstancesSetLabelsRequest
  44689. urlParams_ gensupport.URLParams
  44690. ctx_ context.Context
  44691. header_ http.Header
  44692. }
  44693. // SetLabels: Sets labels on an instance. To learn more about labels,
  44694. // read the Labeling Resources documentation.
  44695. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  44696. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44697. c.project = project
  44698. c.zone = zone
  44699. c.instance = instance
  44700. c.instancessetlabelsrequest = instancessetlabelsrequest
  44701. return c
  44702. }
  44703. // RequestId sets the optional parameter "requestId": An optional
  44704. // request ID to identify requests. Specify a unique request ID so that
  44705. // if you must retry your request, the server will know to ignore the
  44706. // request if it has already been completed.
  44707. //
  44708. // For example, consider a situation where you make an initial request
  44709. // and the request times out. If you make the request again with the
  44710. // same request ID, the server can check if original operation with the
  44711. // same request ID was received, and if so, will ignore the second
  44712. // request. This prevents clients from accidentally creating duplicate
  44713. // commitments.
  44714. //
  44715. // The request ID must be a valid UUID with the exception that zero UUID
  44716. // is not supported (00000000-0000-0000-0000-000000000000).
  44717. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  44718. c.urlParams_.Set("requestId", requestId)
  44719. return c
  44720. }
  44721. // Fields allows partial responses to be retrieved. See
  44722. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44723. // for more information.
  44724. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  44725. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44726. return c
  44727. }
  44728. // Context sets the context to be used in this call's Do method. Any
  44729. // pending HTTP request will be aborted if the provided context is
  44730. // canceled.
  44731. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  44732. c.ctx_ = ctx
  44733. return c
  44734. }
  44735. // Header returns an http.Header that can be modified by the caller to
  44736. // add HTTP headers to the request.
  44737. func (c *InstancesSetLabelsCall) Header() http.Header {
  44738. if c.header_ == nil {
  44739. c.header_ = make(http.Header)
  44740. }
  44741. return c.header_
  44742. }
  44743. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  44744. reqHeaders := make(http.Header)
  44745. for k, v := range c.header_ {
  44746. reqHeaders[k] = v
  44747. }
  44748. reqHeaders.Set("User-Agent", c.s.userAgent())
  44749. var body io.Reader = nil
  44750. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  44751. if err != nil {
  44752. return nil, err
  44753. }
  44754. reqHeaders.Set("Content-Type", "application/json")
  44755. c.urlParams_.Set("alt", alt)
  44756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  44757. urls += "?" + c.urlParams_.Encode()
  44758. req, _ := http.NewRequest("POST", urls, body)
  44759. req.Header = reqHeaders
  44760. googleapi.Expand(req.URL, map[string]string{
  44761. "project": c.project,
  44762. "zone": c.zone,
  44763. "instance": c.instance,
  44764. })
  44765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44766. }
  44767. // Do executes the "compute.instances.setLabels" call.
  44768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44769. // status code is an error. Response headers are in either
  44770. // *Operation.ServerResponse.Header or (if a response was returned at
  44771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44772. // to check whether the returned error was because
  44773. // http.StatusNotModified was returned.
  44774. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44775. gensupport.SetOptions(c.urlParams_, opts...)
  44776. res, err := c.doRequest("json")
  44777. if res != nil && res.StatusCode == http.StatusNotModified {
  44778. if res.Body != nil {
  44779. res.Body.Close()
  44780. }
  44781. return nil, &googleapi.Error{
  44782. Code: res.StatusCode,
  44783. Header: res.Header,
  44784. }
  44785. }
  44786. if err != nil {
  44787. return nil, err
  44788. }
  44789. defer googleapi.CloseBody(res)
  44790. if err := googleapi.CheckResponse(res); err != nil {
  44791. return nil, err
  44792. }
  44793. ret := &Operation{
  44794. ServerResponse: googleapi.ServerResponse{
  44795. Header: res.Header,
  44796. HTTPStatusCode: res.StatusCode,
  44797. },
  44798. }
  44799. target := &ret
  44800. if err := gensupport.DecodeResponse(target, res); err != nil {
  44801. return nil, err
  44802. }
  44803. return ret, nil
  44804. // {
  44805. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  44806. // "httpMethod": "POST",
  44807. // "id": "compute.instances.setLabels",
  44808. // "parameterOrder": [
  44809. // "project",
  44810. // "zone",
  44811. // "instance"
  44812. // ],
  44813. // "parameters": {
  44814. // "instance": {
  44815. // "description": "Name of the instance scoping this request.",
  44816. // "location": "path",
  44817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44818. // "required": true,
  44819. // "type": "string"
  44820. // },
  44821. // "project": {
  44822. // "description": "Project ID for this request.",
  44823. // "location": "path",
  44824. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44825. // "required": true,
  44826. // "type": "string"
  44827. // },
  44828. // "requestId": {
  44829. // "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).",
  44830. // "location": "query",
  44831. // "type": "string"
  44832. // },
  44833. // "zone": {
  44834. // "description": "The name of the zone for this request.",
  44835. // "location": "path",
  44836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44837. // "required": true,
  44838. // "type": "string"
  44839. // }
  44840. // },
  44841. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  44842. // "request": {
  44843. // "$ref": "InstancesSetLabelsRequest"
  44844. // },
  44845. // "response": {
  44846. // "$ref": "Operation"
  44847. // },
  44848. // "scopes": [
  44849. // "https://www.googleapis.com/auth/cloud-platform",
  44850. // "https://www.googleapis.com/auth/compute"
  44851. // ]
  44852. // }
  44853. }
  44854. // method id "compute.instances.setMachineResources":
  44855. type InstancesSetMachineResourcesCall struct {
  44856. s *Service
  44857. project string
  44858. zone string
  44859. instance string
  44860. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  44861. urlParams_ gensupport.URLParams
  44862. ctx_ context.Context
  44863. header_ http.Header
  44864. }
  44865. // SetMachineResources: Changes the number and/or type of accelerator
  44866. // for a stopped instance to the values specified in the request.
  44867. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  44868. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44869. c.project = project
  44870. c.zone = zone
  44871. c.instance = instance
  44872. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  44873. return c
  44874. }
  44875. // RequestId sets the optional parameter "requestId": An optional
  44876. // request ID to identify requests. Specify a unique request ID so that
  44877. // if you must retry your request, the server will know to ignore the
  44878. // request if it has already been completed.
  44879. //
  44880. // For example, consider a situation where you make an initial request
  44881. // and the request times out. If you make the request again with the
  44882. // same request ID, the server can check if original operation with the
  44883. // same request ID was received, and if so, will ignore the second
  44884. // request. This prevents clients from accidentally creating duplicate
  44885. // commitments.
  44886. //
  44887. // The request ID must be a valid UUID with the exception that zero UUID
  44888. // is not supported (00000000-0000-0000-0000-000000000000).
  44889. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  44890. c.urlParams_.Set("requestId", requestId)
  44891. return c
  44892. }
  44893. // Fields allows partial responses to be retrieved. See
  44894. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44895. // for more information.
  44896. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  44897. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44898. return c
  44899. }
  44900. // Context sets the context to be used in this call's Do method. Any
  44901. // pending HTTP request will be aborted if the provided context is
  44902. // canceled.
  44903. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  44904. c.ctx_ = ctx
  44905. return c
  44906. }
  44907. // Header returns an http.Header that can be modified by the caller to
  44908. // add HTTP headers to the request.
  44909. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  44910. if c.header_ == nil {
  44911. c.header_ = make(http.Header)
  44912. }
  44913. return c.header_
  44914. }
  44915. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  44916. reqHeaders := make(http.Header)
  44917. for k, v := range c.header_ {
  44918. reqHeaders[k] = v
  44919. }
  44920. reqHeaders.Set("User-Agent", c.s.userAgent())
  44921. var body io.Reader = nil
  44922. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  44923. if err != nil {
  44924. return nil, err
  44925. }
  44926. reqHeaders.Set("Content-Type", "application/json")
  44927. c.urlParams_.Set("alt", alt)
  44928. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  44929. urls += "?" + c.urlParams_.Encode()
  44930. req, _ := http.NewRequest("POST", urls, body)
  44931. req.Header = reqHeaders
  44932. googleapi.Expand(req.URL, map[string]string{
  44933. "project": c.project,
  44934. "zone": c.zone,
  44935. "instance": c.instance,
  44936. })
  44937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44938. }
  44939. // Do executes the "compute.instances.setMachineResources" call.
  44940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44941. // status code is an error. Response headers are in either
  44942. // *Operation.ServerResponse.Header or (if a response was returned at
  44943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44944. // to check whether the returned error was because
  44945. // http.StatusNotModified was returned.
  44946. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44947. gensupport.SetOptions(c.urlParams_, opts...)
  44948. res, err := c.doRequest("json")
  44949. if res != nil && res.StatusCode == http.StatusNotModified {
  44950. if res.Body != nil {
  44951. res.Body.Close()
  44952. }
  44953. return nil, &googleapi.Error{
  44954. Code: res.StatusCode,
  44955. Header: res.Header,
  44956. }
  44957. }
  44958. if err != nil {
  44959. return nil, err
  44960. }
  44961. defer googleapi.CloseBody(res)
  44962. if err := googleapi.CheckResponse(res); err != nil {
  44963. return nil, err
  44964. }
  44965. ret := &Operation{
  44966. ServerResponse: googleapi.ServerResponse{
  44967. Header: res.Header,
  44968. HTTPStatusCode: res.StatusCode,
  44969. },
  44970. }
  44971. target := &ret
  44972. if err := gensupport.DecodeResponse(target, res); err != nil {
  44973. return nil, err
  44974. }
  44975. return ret, nil
  44976. // {
  44977. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  44978. // "httpMethod": "POST",
  44979. // "id": "compute.instances.setMachineResources",
  44980. // "parameterOrder": [
  44981. // "project",
  44982. // "zone",
  44983. // "instance"
  44984. // ],
  44985. // "parameters": {
  44986. // "instance": {
  44987. // "description": "Name of the instance scoping this request.",
  44988. // "location": "path",
  44989. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44990. // "required": true,
  44991. // "type": "string"
  44992. // },
  44993. // "project": {
  44994. // "description": "Project ID for this request.",
  44995. // "location": "path",
  44996. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44997. // "required": true,
  44998. // "type": "string"
  44999. // },
  45000. // "requestId": {
  45001. // "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).",
  45002. // "location": "query",
  45003. // "type": "string"
  45004. // },
  45005. // "zone": {
  45006. // "description": "The name of the zone for this request.",
  45007. // "location": "path",
  45008. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45009. // "required": true,
  45010. // "type": "string"
  45011. // }
  45012. // },
  45013. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  45014. // "request": {
  45015. // "$ref": "InstancesSetMachineResourcesRequest"
  45016. // },
  45017. // "response": {
  45018. // "$ref": "Operation"
  45019. // },
  45020. // "scopes": [
  45021. // "https://www.googleapis.com/auth/cloud-platform",
  45022. // "https://www.googleapis.com/auth/compute"
  45023. // ]
  45024. // }
  45025. }
  45026. // method id "compute.instances.setMachineType":
  45027. type InstancesSetMachineTypeCall struct {
  45028. s *Service
  45029. project string
  45030. zone string
  45031. instance string
  45032. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  45033. urlParams_ gensupport.URLParams
  45034. ctx_ context.Context
  45035. header_ http.Header
  45036. }
  45037. // SetMachineType: Changes the machine type for a stopped instance to
  45038. // the machine type specified in the request.
  45039. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  45040. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45041. c.project = project
  45042. c.zone = zone
  45043. c.instance = instance
  45044. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  45045. return c
  45046. }
  45047. // RequestId sets the optional parameter "requestId": An optional
  45048. // request ID to identify requests. Specify a unique request ID so that
  45049. // if you must retry your request, the server will know to ignore the
  45050. // request if it has already been completed.
  45051. //
  45052. // For example, consider a situation where you make an initial request
  45053. // and the request times out. If you make the request again with the
  45054. // same request ID, the server can check if original operation with the
  45055. // same request ID was received, and if so, will ignore the second
  45056. // request. This prevents clients from accidentally creating duplicate
  45057. // commitments.
  45058. //
  45059. // The request ID must be a valid UUID with the exception that zero UUID
  45060. // is not supported (00000000-0000-0000-0000-000000000000).
  45061. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  45062. c.urlParams_.Set("requestId", requestId)
  45063. return c
  45064. }
  45065. // Fields allows partial responses to be retrieved. See
  45066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45067. // for more information.
  45068. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  45069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45070. return c
  45071. }
  45072. // Context sets the context to be used in this call's Do method. Any
  45073. // pending HTTP request will be aborted if the provided context is
  45074. // canceled.
  45075. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  45076. c.ctx_ = ctx
  45077. return c
  45078. }
  45079. // Header returns an http.Header that can be modified by the caller to
  45080. // add HTTP headers to the request.
  45081. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  45082. if c.header_ == nil {
  45083. c.header_ = make(http.Header)
  45084. }
  45085. return c.header_
  45086. }
  45087. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  45088. reqHeaders := make(http.Header)
  45089. for k, v := range c.header_ {
  45090. reqHeaders[k] = v
  45091. }
  45092. reqHeaders.Set("User-Agent", c.s.userAgent())
  45093. var body io.Reader = nil
  45094. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  45095. if err != nil {
  45096. return nil, err
  45097. }
  45098. reqHeaders.Set("Content-Type", "application/json")
  45099. c.urlParams_.Set("alt", alt)
  45100. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  45101. urls += "?" + c.urlParams_.Encode()
  45102. req, _ := http.NewRequest("POST", urls, body)
  45103. req.Header = reqHeaders
  45104. googleapi.Expand(req.URL, map[string]string{
  45105. "project": c.project,
  45106. "zone": c.zone,
  45107. "instance": c.instance,
  45108. })
  45109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45110. }
  45111. // Do executes the "compute.instances.setMachineType" call.
  45112. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45113. // status code is an error. Response headers are in either
  45114. // *Operation.ServerResponse.Header or (if a response was returned at
  45115. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45116. // to check whether the returned error was because
  45117. // http.StatusNotModified was returned.
  45118. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45119. gensupport.SetOptions(c.urlParams_, opts...)
  45120. res, err := c.doRequest("json")
  45121. if res != nil && res.StatusCode == http.StatusNotModified {
  45122. if res.Body != nil {
  45123. res.Body.Close()
  45124. }
  45125. return nil, &googleapi.Error{
  45126. Code: res.StatusCode,
  45127. Header: res.Header,
  45128. }
  45129. }
  45130. if err != nil {
  45131. return nil, err
  45132. }
  45133. defer googleapi.CloseBody(res)
  45134. if err := googleapi.CheckResponse(res); err != nil {
  45135. return nil, err
  45136. }
  45137. ret := &Operation{
  45138. ServerResponse: googleapi.ServerResponse{
  45139. Header: res.Header,
  45140. HTTPStatusCode: res.StatusCode,
  45141. },
  45142. }
  45143. target := &ret
  45144. if err := gensupport.DecodeResponse(target, res); err != nil {
  45145. return nil, err
  45146. }
  45147. return ret, nil
  45148. // {
  45149. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  45150. // "httpMethod": "POST",
  45151. // "id": "compute.instances.setMachineType",
  45152. // "parameterOrder": [
  45153. // "project",
  45154. // "zone",
  45155. // "instance"
  45156. // ],
  45157. // "parameters": {
  45158. // "instance": {
  45159. // "description": "Name of the instance scoping this request.",
  45160. // "location": "path",
  45161. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45162. // "required": true,
  45163. // "type": "string"
  45164. // },
  45165. // "project": {
  45166. // "description": "Project ID for this request.",
  45167. // "location": "path",
  45168. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45169. // "required": true,
  45170. // "type": "string"
  45171. // },
  45172. // "requestId": {
  45173. // "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).",
  45174. // "location": "query",
  45175. // "type": "string"
  45176. // },
  45177. // "zone": {
  45178. // "description": "The name of the zone for this request.",
  45179. // "location": "path",
  45180. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45181. // "required": true,
  45182. // "type": "string"
  45183. // }
  45184. // },
  45185. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  45186. // "request": {
  45187. // "$ref": "InstancesSetMachineTypeRequest"
  45188. // },
  45189. // "response": {
  45190. // "$ref": "Operation"
  45191. // },
  45192. // "scopes": [
  45193. // "https://www.googleapis.com/auth/cloud-platform",
  45194. // "https://www.googleapis.com/auth/compute"
  45195. // ]
  45196. // }
  45197. }
  45198. // method id "compute.instances.setMetadata":
  45199. type InstancesSetMetadataCall struct {
  45200. s *Service
  45201. project string
  45202. zone string
  45203. instance string
  45204. metadata *Metadata
  45205. urlParams_ gensupport.URLParams
  45206. ctx_ context.Context
  45207. header_ http.Header
  45208. }
  45209. // SetMetadata: Sets metadata for the specified instance to the data
  45210. // included in the request.
  45211. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  45212. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  45213. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45214. c.project = project
  45215. c.zone = zone
  45216. c.instance = instance
  45217. c.metadata = metadata
  45218. return c
  45219. }
  45220. // RequestId sets the optional parameter "requestId": An optional
  45221. // request ID to identify requests. Specify a unique request ID so that
  45222. // if you must retry your request, the server will know to ignore the
  45223. // request if it has already been completed.
  45224. //
  45225. // For example, consider a situation where you make an initial request
  45226. // and the request times out. If you make the request again with the
  45227. // same request ID, the server can check if original operation with the
  45228. // same request ID was received, and if so, will ignore the second
  45229. // request. This prevents clients from accidentally creating duplicate
  45230. // commitments.
  45231. //
  45232. // The request ID must be a valid UUID with the exception that zero UUID
  45233. // is not supported (00000000-0000-0000-0000-000000000000).
  45234. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  45235. c.urlParams_.Set("requestId", requestId)
  45236. return c
  45237. }
  45238. // Fields allows partial responses to be retrieved. See
  45239. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45240. // for more information.
  45241. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  45242. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45243. return c
  45244. }
  45245. // Context sets the context to be used in this call's Do method. Any
  45246. // pending HTTP request will be aborted if the provided context is
  45247. // canceled.
  45248. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  45249. c.ctx_ = ctx
  45250. return c
  45251. }
  45252. // Header returns an http.Header that can be modified by the caller to
  45253. // add HTTP headers to the request.
  45254. func (c *InstancesSetMetadataCall) Header() http.Header {
  45255. if c.header_ == nil {
  45256. c.header_ = make(http.Header)
  45257. }
  45258. return c.header_
  45259. }
  45260. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  45261. reqHeaders := make(http.Header)
  45262. for k, v := range c.header_ {
  45263. reqHeaders[k] = v
  45264. }
  45265. reqHeaders.Set("User-Agent", c.s.userAgent())
  45266. var body io.Reader = nil
  45267. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  45268. if err != nil {
  45269. return nil, err
  45270. }
  45271. reqHeaders.Set("Content-Type", "application/json")
  45272. c.urlParams_.Set("alt", alt)
  45273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  45274. urls += "?" + c.urlParams_.Encode()
  45275. req, _ := http.NewRequest("POST", urls, body)
  45276. req.Header = reqHeaders
  45277. googleapi.Expand(req.URL, map[string]string{
  45278. "project": c.project,
  45279. "zone": c.zone,
  45280. "instance": c.instance,
  45281. })
  45282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45283. }
  45284. // Do executes the "compute.instances.setMetadata" call.
  45285. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45286. // status code is an error. Response headers are in either
  45287. // *Operation.ServerResponse.Header or (if a response was returned at
  45288. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45289. // to check whether the returned error was because
  45290. // http.StatusNotModified was returned.
  45291. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45292. gensupport.SetOptions(c.urlParams_, opts...)
  45293. res, err := c.doRequest("json")
  45294. if res != nil && res.StatusCode == http.StatusNotModified {
  45295. if res.Body != nil {
  45296. res.Body.Close()
  45297. }
  45298. return nil, &googleapi.Error{
  45299. Code: res.StatusCode,
  45300. Header: res.Header,
  45301. }
  45302. }
  45303. if err != nil {
  45304. return nil, err
  45305. }
  45306. defer googleapi.CloseBody(res)
  45307. if err := googleapi.CheckResponse(res); err != nil {
  45308. return nil, err
  45309. }
  45310. ret := &Operation{
  45311. ServerResponse: googleapi.ServerResponse{
  45312. Header: res.Header,
  45313. HTTPStatusCode: res.StatusCode,
  45314. },
  45315. }
  45316. target := &ret
  45317. if err := gensupport.DecodeResponse(target, res); err != nil {
  45318. return nil, err
  45319. }
  45320. return ret, nil
  45321. // {
  45322. // "description": "Sets metadata for the specified instance to the data included in the request.",
  45323. // "httpMethod": "POST",
  45324. // "id": "compute.instances.setMetadata",
  45325. // "parameterOrder": [
  45326. // "project",
  45327. // "zone",
  45328. // "instance"
  45329. // ],
  45330. // "parameters": {
  45331. // "instance": {
  45332. // "description": "Name of the instance scoping this request.",
  45333. // "location": "path",
  45334. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45335. // "required": true,
  45336. // "type": "string"
  45337. // },
  45338. // "project": {
  45339. // "description": "Project ID for this request.",
  45340. // "location": "path",
  45341. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45342. // "required": true,
  45343. // "type": "string"
  45344. // },
  45345. // "requestId": {
  45346. // "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).",
  45347. // "location": "query",
  45348. // "type": "string"
  45349. // },
  45350. // "zone": {
  45351. // "description": "The name of the zone for this request.",
  45352. // "location": "path",
  45353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45354. // "required": true,
  45355. // "type": "string"
  45356. // }
  45357. // },
  45358. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  45359. // "request": {
  45360. // "$ref": "Metadata"
  45361. // },
  45362. // "response": {
  45363. // "$ref": "Operation"
  45364. // },
  45365. // "scopes": [
  45366. // "https://www.googleapis.com/auth/cloud-platform",
  45367. // "https://www.googleapis.com/auth/compute"
  45368. // ]
  45369. // }
  45370. }
  45371. // method id "compute.instances.setMinCpuPlatform":
  45372. type InstancesSetMinCpuPlatformCall struct {
  45373. s *Service
  45374. project string
  45375. zone string
  45376. instance string
  45377. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  45378. urlParams_ gensupport.URLParams
  45379. ctx_ context.Context
  45380. header_ http.Header
  45381. }
  45382. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  45383. // instance should use. This method can only be called on a stopped
  45384. // instance. For more information, read Specifying a Minimum CPU
  45385. // Platform.
  45386. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  45387. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45388. c.project = project
  45389. c.zone = zone
  45390. c.instance = instance
  45391. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  45392. return c
  45393. }
  45394. // RequestId sets the optional parameter "requestId": An optional
  45395. // request ID to identify requests. Specify a unique request ID so that
  45396. // if you must retry your request, the server will know to ignore the
  45397. // request if it has already been completed.
  45398. //
  45399. // For example, consider a situation where you make an initial request
  45400. // and the request times out. If you make the request again with the
  45401. // same request ID, the server can check if original operation with the
  45402. // same request ID was received, and if so, will ignore the second
  45403. // request. This prevents clients from accidentally creating duplicate
  45404. // commitments.
  45405. //
  45406. // The request ID must be a valid UUID with the exception that zero UUID
  45407. // is not supported (00000000-0000-0000-0000-000000000000).
  45408. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  45409. c.urlParams_.Set("requestId", requestId)
  45410. return c
  45411. }
  45412. // Fields allows partial responses to be retrieved. See
  45413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45414. // for more information.
  45415. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  45416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45417. return c
  45418. }
  45419. // Context sets the context to be used in this call's Do method. Any
  45420. // pending HTTP request will be aborted if the provided context is
  45421. // canceled.
  45422. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  45423. c.ctx_ = ctx
  45424. return c
  45425. }
  45426. // Header returns an http.Header that can be modified by the caller to
  45427. // add HTTP headers to the request.
  45428. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  45429. if c.header_ == nil {
  45430. c.header_ = make(http.Header)
  45431. }
  45432. return c.header_
  45433. }
  45434. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  45435. reqHeaders := make(http.Header)
  45436. for k, v := range c.header_ {
  45437. reqHeaders[k] = v
  45438. }
  45439. reqHeaders.Set("User-Agent", c.s.userAgent())
  45440. var body io.Reader = nil
  45441. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  45442. if err != nil {
  45443. return nil, err
  45444. }
  45445. reqHeaders.Set("Content-Type", "application/json")
  45446. c.urlParams_.Set("alt", alt)
  45447. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  45448. urls += "?" + c.urlParams_.Encode()
  45449. req, _ := http.NewRequest("POST", urls, body)
  45450. req.Header = reqHeaders
  45451. googleapi.Expand(req.URL, map[string]string{
  45452. "project": c.project,
  45453. "zone": c.zone,
  45454. "instance": c.instance,
  45455. })
  45456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45457. }
  45458. // Do executes the "compute.instances.setMinCpuPlatform" call.
  45459. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45460. // status code is an error. Response headers are in either
  45461. // *Operation.ServerResponse.Header or (if a response was returned at
  45462. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45463. // to check whether the returned error was because
  45464. // http.StatusNotModified was returned.
  45465. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45466. gensupport.SetOptions(c.urlParams_, opts...)
  45467. res, err := c.doRequest("json")
  45468. if res != nil && res.StatusCode == http.StatusNotModified {
  45469. if res.Body != nil {
  45470. res.Body.Close()
  45471. }
  45472. return nil, &googleapi.Error{
  45473. Code: res.StatusCode,
  45474. Header: res.Header,
  45475. }
  45476. }
  45477. if err != nil {
  45478. return nil, err
  45479. }
  45480. defer googleapi.CloseBody(res)
  45481. if err := googleapi.CheckResponse(res); err != nil {
  45482. return nil, err
  45483. }
  45484. ret := &Operation{
  45485. ServerResponse: googleapi.ServerResponse{
  45486. Header: res.Header,
  45487. HTTPStatusCode: res.StatusCode,
  45488. },
  45489. }
  45490. target := &ret
  45491. if err := gensupport.DecodeResponse(target, res); err != nil {
  45492. return nil, err
  45493. }
  45494. return ret, nil
  45495. // {
  45496. // "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.",
  45497. // "httpMethod": "POST",
  45498. // "id": "compute.instances.setMinCpuPlatform",
  45499. // "parameterOrder": [
  45500. // "project",
  45501. // "zone",
  45502. // "instance"
  45503. // ],
  45504. // "parameters": {
  45505. // "instance": {
  45506. // "description": "Name of the instance scoping this request.",
  45507. // "location": "path",
  45508. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45509. // "required": true,
  45510. // "type": "string"
  45511. // },
  45512. // "project": {
  45513. // "description": "Project ID for this request.",
  45514. // "location": "path",
  45515. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45516. // "required": true,
  45517. // "type": "string"
  45518. // },
  45519. // "requestId": {
  45520. // "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).",
  45521. // "location": "query",
  45522. // "type": "string"
  45523. // },
  45524. // "zone": {
  45525. // "description": "The name of the zone for this request.",
  45526. // "location": "path",
  45527. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45528. // "required": true,
  45529. // "type": "string"
  45530. // }
  45531. // },
  45532. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  45533. // "request": {
  45534. // "$ref": "InstancesSetMinCpuPlatformRequest"
  45535. // },
  45536. // "response": {
  45537. // "$ref": "Operation"
  45538. // },
  45539. // "scopes": [
  45540. // "https://www.googleapis.com/auth/cloud-platform",
  45541. // "https://www.googleapis.com/auth/compute"
  45542. // ]
  45543. // }
  45544. }
  45545. // method id "compute.instances.setScheduling":
  45546. type InstancesSetSchedulingCall struct {
  45547. s *Service
  45548. project string
  45549. zone string
  45550. instance string
  45551. scheduling *Scheduling
  45552. urlParams_ gensupport.URLParams
  45553. ctx_ context.Context
  45554. header_ http.Header
  45555. }
  45556. // SetScheduling: Sets an instance's scheduling options.
  45557. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  45558. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  45559. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45560. c.project = project
  45561. c.zone = zone
  45562. c.instance = instance
  45563. c.scheduling = scheduling
  45564. return c
  45565. }
  45566. // RequestId sets the optional parameter "requestId": An optional
  45567. // request ID to identify requests. Specify a unique request ID so that
  45568. // if you must retry your request, the server will know to ignore the
  45569. // request if it has already been completed.
  45570. //
  45571. // For example, consider a situation where you make an initial request
  45572. // and the request times out. If you make the request again with the
  45573. // same request ID, the server can check if original operation with the
  45574. // same request ID was received, and if so, will ignore the second
  45575. // request. This prevents clients from accidentally creating duplicate
  45576. // commitments.
  45577. //
  45578. // The request ID must be a valid UUID with the exception that zero UUID
  45579. // is not supported (00000000-0000-0000-0000-000000000000).
  45580. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  45581. c.urlParams_.Set("requestId", requestId)
  45582. return c
  45583. }
  45584. // Fields allows partial responses to be retrieved. See
  45585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45586. // for more information.
  45587. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  45588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45589. return c
  45590. }
  45591. // Context sets the context to be used in this call's Do method. Any
  45592. // pending HTTP request will be aborted if the provided context is
  45593. // canceled.
  45594. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  45595. c.ctx_ = ctx
  45596. return c
  45597. }
  45598. // Header returns an http.Header that can be modified by the caller to
  45599. // add HTTP headers to the request.
  45600. func (c *InstancesSetSchedulingCall) Header() http.Header {
  45601. if c.header_ == nil {
  45602. c.header_ = make(http.Header)
  45603. }
  45604. return c.header_
  45605. }
  45606. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  45607. reqHeaders := make(http.Header)
  45608. for k, v := range c.header_ {
  45609. reqHeaders[k] = v
  45610. }
  45611. reqHeaders.Set("User-Agent", c.s.userAgent())
  45612. var body io.Reader = nil
  45613. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  45614. if err != nil {
  45615. return nil, err
  45616. }
  45617. reqHeaders.Set("Content-Type", "application/json")
  45618. c.urlParams_.Set("alt", alt)
  45619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  45620. urls += "?" + c.urlParams_.Encode()
  45621. req, _ := http.NewRequest("POST", urls, body)
  45622. req.Header = reqHeaders
  45623. googleapi.Expand(req.URL, map[string]string{
  45624. "project": c.project,
  45625. "zone": c.zone,
  45626. "instance": c.instance,
  45627. })
  45628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45629. }
  45630. // Do executes the "compute.instances.setScheduling" call.
  45631. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45632. // status code is an error. Response headers are in either
  45633. // *Operation.ServerResponse.Header or (if a response was returned at
  45634. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45635. // to check whether the returned error was because
  45636. // http.StatusNotModified was returned.
  45637. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45638. gensupport.SetOptions(c.urlParams_, opts...)
  45639. res, err := c.doRequest("json")
  45640. if res != nil && res.StatusCode == http.StatusNotModified {
  45641. if res.Body != nil {
  45642. res.Body.Close()
  45643. }
  45644. return nil, &googleapi.Error{
  45645. Code: res.StatusCode,
  45646. Header: res.Header,
  45647. }
  45648. }
  45649. if err != nil {
  45650. return nil, err
  45651. }
  45652. defer googleapi.CloseBody(res)
  45653. if err := googleapi.CheckResponse(res); err != nil {
  45654. return nil, err
  45655. }
  45656. ret := &Operation{
  45657. ServerResponse: googleapi.ServerResponse{
  45658. Header: res.Header,
  45659. HTTPStatusCode: res.StatusCode,
  45660. },
  45661. }
  45662. target := &ret
  45663. if err := gensupport.DecodeResponse(target, res); err != nil {
  45664. return nil, err
  45665. }
  45666. return ret, nil
  45667. // {
  45668. // "description": "Sets an instance's scheduling options.",
  45669. // "httpMethod": "POST",
  45670. // "id": "compute.instances.setScheduling",
  45671. // "parameterOrder": [
  45672. // "project",
  45673. // "zone",
  45674. // "instance"
  45675. // ],
  45676. // "parameters": {
  45677. // "instance": {
  45678. // "description": "Instance name.",
  45679. // "location": "path",
  45680. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45681. // "required": true,
  45682. // "type": "string"
  45683. // },
  45684. // "project": {
  45685. // "description": "Project ID for this request.",
  45686. // "location": "path",
  45687. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45688. // "required": true,
  45689. // "type": "string"
  45690. // },
  45691. // "requestId": {
  45692. // "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).",
  45693. // "location": "query",
  45694. // "type": "string"
  45695. // },
  45696. // "zone": {
  45697. // "description": "The name of the zone for this request.",
  45698. // "location": "path",
  45699. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45700. // "required": true,
  45701. // "type": "string"
  45702. // }
  45703. // },
  45704. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  45705. // "request": {
  45706. // "$ref": "Scheduling"
  45707. // },
  45708. // "response": {
  45709. // "$ref": "Operation"
  45710. // },
  45711. // "scopes": [
  45712. // "https://www.googleapis.com/auth/cloud-platform",
  45713. // "https://www.googleapis.com/auth/compute"
  45714. // ]
  45715. // }
  45716. }
  45717. // method id "compute.instances.setServiceAccount":
  45718. type InstancesSetServiceAccountCall struct {
  45719. s *Service
  45720. project string
  45721. zone string
  45722. instance string
  45723. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  45724. urlParams_ gensupport.URLParams
  45725. ctx_ context.Context
  45726. header_ http.Header
  45727. }
  45728. // SetServiceAccount: Sets the service account on the instance. For more
  45729. // information, read Changing the service account and access scopes for
  45730. // an instance.
  45731. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  45732. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45733. c.project = project
  45734. c.zone = zone
  45735. c.instance = instance
  45736. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  45737. return c
  45738. }
  45739. // RequestId sets the optional parameter "requestId": An optional
  45740. // request ID to identify requests. Specify a unique request ID so that
  45741. // if you must retry your request, the server will know to ignore the
  45742. // request if it has already been completed.
  45743. //
  45744. // For example, consider a situation where you make an initial request
  45745. // and the request times out. If you make the request again with the
  45746. // same request ID, the server can check if original operation with the
  45747. // same request ID was received, and if so, will ignore the second
  45748. // request. This prevents clients from accidentally creating duplicate
  45749. // commitments.
  45750. //
  45751. // The request ID must be a valid UUID with the exception that zero UUID
  45752. // is not supported (00000000-0000-0000-0000-000000000000).
  45753. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  45754. c.urlParams_.Set("requestId", requestId)
  45755. return c
  45756. }
  45757. // Fields allows partial responses to be retrieved. See
  45758. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45759. // for more information.
  45760. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  45761. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45762. return c
  45763. }
  45764. // Context sets the context to be used in this call's Do method. Any
  45765. // pending HTTP request will be aborted if the provided context is
  45766. // canceled.
  45767. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  45768. c.ctx_ = ctx
  45769. return c
  45770. }
  45771. // Header returns an http.Header that can be modified by the caller to
  45772. // add HTTP headers to the request.
  45773. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  45774. if c.header_ == nil {
  45775. c.header_ = make(http.Header)
  45776. }
  45777. return c.header_
  45778. }
  45779. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  45780. reqHeaders := make(http.Header)
  45781. for k, v := range c.header_ {
  45782. reqHeaders[k] = v
  45783. }
  45784. reqHeaders.Set("User-Agent", c.s.userAgent())
  45785. var body io.Reader = nil
  45786. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  45787. if err != nil {
  45788. return nil, err
  45789. }
  45790. reqHeaders.Set("Content-Type", "application/json")
  45791. c.urlParams_.Set("alt", alt)
  45792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  45793. urls += "?" + c.urlParams_.Encode()
  45794. req, _ := http.NewRequest("POST", urls, body)
  45795. req.Header = reqHeaders
  45796. googleapi.Expand(req.URL, map[string]string{
  45797. "project": c.project,
  45798. "zone": c.zone,
  45799. "instance": c.instance,
  45800. })
  45801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45802. }
  45803. // Do executes the "compute.instances.setServiceAccount" call.
  45804. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45805. // status code is an error. Response headers are in either
  45806. // *Operation.ServerResponse.Header or (if a response was returned at
  45807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45808. // to check whether the returned error was because
  45809. // http.StatusNotModified was returned.
  45810. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45811. gensupport.SetOptions(c.urlParams_, opts...)
  45812. res, err := c.doRequest("json")
  45813. if res != nil && res.StatusCode == http.StatusNotModified {
  45814. if res.Body != nil {
  45815. res.Body.Close()
  45816. }
  45817. return nil, &googleapi.Error{
  45818. Code: res.StatusCode,
  45819. Header: res.Header,
  45820. }
  45821. }
  45822. if err != nil {
  45823. return nil, err
  45824. }
  45825. defer googleapi.CloseBody(res)
  45826. if err := googleapi.CheckResponse(res); err != nil {
  45827. return nil, err
  45828. }
  45829. ret := &Operation{
  45830. ServerResponse: googleapi.ServerResponse{
  45831. Header: res.Header,
  45832. HTTPStatusCode: res.StatusCode,
  45833. },
  45834. }
  45835. target := &ret
  45836. if err := gensupport.DecodeResponse(target, res); err != nil {
  45837. return nil, err
  45838. }
  45839. return ret, nil
  45840. // {
  45841. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  45842. // "httpMethod": "POST",
  45843. // "id": "compute.instances.setServiceAccount",
  45844. // "parameterOrder": [
  45845. // "project",
  45846. // "zone",
  45847. // "instance"
  45848. // ],
  45849. // "parameters": {
  45850. // "instance": {
  45851. // "description": "Name of the instance resource to start.",
  45852. // "location": "path",
  45853. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45854. // "required": true,
  45855. // "type": "string"
  45856. // },
  45857. // "project": {
  45858. // "description": "Project ID for this request.",
  45859. // "location": "path",
  45860. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45861. // "required": true,
  45862. // "type": "string"
  45863. // },
  45864. // "requestId": {
  45865. // "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).",
  45866. // "location": "query",
  45867. // "type": "string"
  45868. // },
  45869. // "zone": {
  45870. // "description": "The name of the zone for this request.",
  45871. // "location": "path",
  45872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45873. // "required": true,
  45874. // "type": "string"
  45875. // }
  45876. // },
  45877. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  45878. // "request": {
  45879. // "$ref": "InstancesSetServiceAccountRequest"
  45880. // },
  45881. // "response": {
  45882. // "$ref": "Operation"
  45883. // },
  45884. // "scopes": [
  45885. // "https://www.googleapis.com/auth/cloud-platform",
  45886. // "https://www.googleapis.com/auth/compute"
  45887. // ]
  45888. // }
  45889. }
  45890. // method id "compute.instances.setTags":
  45891. type InstancesSetTagsCall struct {
  45892. s *Service
  45893. project string
  45894. zone string
  45895. instance string
  45896. tags *Tags
  45897. urlParams_ gensupport.URLParams
  45898. ctx_ context.Context
  45899. header_ http.Header
  45900. }
  45901. // SetTags: Sets tags for the specified instance to the data included in
  45902. // the request.
  45903. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  45904. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  45905. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45906. c.project = project
  45907. c.zone = zone
  45908. c.instance = instance
  45909. c.tags = tags
  45910. return c
  45911. }
  45912. // RequestId sets the optional parameter "requestId": An optional
  45913. // request ID to identify requests. Specify a unique request ID so that
  45914. // if you must retry your request, the server will know to ignore the
  45915. // request if it has already been completed.
  45916. //
  45917. // For example, consider a situation where you make an initial request
  45918. // and the request times out. If you make the request again with the
  45919. // same request ID, the server can check if original operation with the
  45920. // same request ID was received, and if so, will ignore the second
  45921. // request. This prevents clients from accidentally creating duplicate
  45922. // commitments.
  45923. //
  45924. // The request ID must be a valid UUID with the exception that zero UUID
  45925. // is not supported (00000000-0000-0000-0000-000000000000).
  45926. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  45927. c.urlParams_.Set("requestId", requestId)
  45928. return c
  45929. }
  45930. // Fields allows partial responses to be retrieved. See
  45931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45932. // for more information.
  45933. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  45934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45935. return c
  45936. }
  45937. // Context sets the context to be used in this call's Do method. Any
  45938. // pending HTTP request will be aborted if the provided context is
  45939. // canceled.
  45940. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  45941. c.ctx_ = ctx
  45942. return c
  45943. }
  45944. // Header returns an http.Header that can be modified by the caller to
  45945. // add HTTP headers to the request.
  45946. func (c *InstancesSetTagsCall) Header() http.Header {
  45947. if c.header_ == nil {
  45948. c.header_ = make(http.Header)
  45949. }
  45950. return c.header_
  45951. }
  45952. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  45953. reqHeaders := make(http.Header)
  45954. for k, v := range c.header_ {
  45955. reqHeaders[k] = v
  45956. }
  45957. reqHeaders.Set("User-Agent", c.s.userAgent())
  45958. var body io.Reader = nil
  45959. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  45960. if err != nil {
  45961. return nil, err
  45962. }
  45963. reqHeaders.Set("Content-Type", "application/json")
  45964. c.urlParams_.Set("alt", alt)
  45965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  45966. urls += "?" + c.urlParams_.Encode()
  45967. req, _ := http.NewRequest("POST", urls, body)
  45968. req.Header = reqHeaders
  45969. googleapi.Expand(req.URL, map[string]string{
  45970. "project": c.project,
  45971. "zone": c.zone,
  45972. "instance": c.instance,
  45973. })
  45974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45975. }
  45976. // Do executes the "compute.instances.setTags" call.
  45977. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45978. // status code is an error. Response headers are in either
  45979. // *Operation.ServerResponse.Header or (if a response was returned at
  45980. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45981. // to check whether the returned error was because
  45982. // http.StatusNotModified was returned.
  45983. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45984. gensupport.SetOptions(c.urlParams_, opts...)
  45985. res, err := c.doRequest("json")
  45986. if res != nil && res.StatusCode == http.StatusNotModified {
  45987. if res.Body != nil {
  45988. res.Body.Close()
  45989. }
  45990. return nil, &googleapi.Error{
  45991. Code: res.StatusCode,
  45992. Header: res.Header,
  45993. }
  45994. }
  45995. if err != nil {
  45996. return nil, err
  45997. }
  45998. defer googleapi.CloseBody(res)
  45999. if err := googleapi.CheckResponse(res); err != nil {
  46000. return nil, err
  46001. }
  46002. ret := &Operation{
  46003. ServerResponse: googleapi.ServerResponse{
  46004. Header: res.Header,
  46005. HTTPStatusCode: res.StatusCode,
  46006. },
  46007. }
  46008. target := &ret
  46009. if err := gensupport.DecodeResponse(target, res); err != nil {
  46010. return nil, err
  46011. }
  46012. return ret, nil
  46013. // {
  46014. // "description": "Sets tags for the specified instance to the data included in the request.",
  46015. // "httpMethod": "POST",
  46016. // "id": "compute.instances.setTags",
  46017. // "parameterOrder": [
  46018. // "project",
  46019. // "zone",
  46020. // "instance"
  46021. // ],
  46022. // "parameters": {
  46023. // "instance": {
  46024. // "description": "Name of the instance scoping this request.",
  46025. // "location": "path",
  46026. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46027. // "required": true,
  46028. // "type": "string"
  46029. // },
  46030. // "project": {
  46031. // "description": "Project ID for this request.",
  46032. // "location": "path",
  46033. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46034. // "required": true,
  46035. // "type": "string"
  46036. // },
  46037. // "requestId": {
  46038. // "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).",
  46039. // "location": "query",
  46040. // "type": "string"
  46041. // },
  46042. // "zone": {
  46043. // "description": "The name of the zone for this request.",
  46044. // "location": "path",
  46045. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46046. // "required": true,
  46047. // "type": "string"
  46048. // }
  46049. // },
  46050. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  46051. // "request": {
  46052. // "$ref": "Tags"
  46053. // },
  46054. // "response": {
  46055. // "$ref": "Operation"
  46056. // },
  46057. // "scopes": [
  46058. // "https://www.googleapis.com/auth/cloud-platform",
  46059. // "https://www.googleapis.com/auth/compute"
  46060. // ]
  46061. // }
  46062. }
  46063. // method id "compute.instances.start":
  46064. type InstancesStartCall struct {
  46065. s *Service
  46066. project string
  46067. zone string
  46068. instance string
  46069. urlParams_ gensupport.URLParams
  46070. ctx_ context.Context
  46071. header_ http.Header
  46072. }
  46073. // Start: Starts an instance that was stopped using the instances().stop
  46074. // method. For more information, see Restart an instance.
  46075. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  46076. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  46077. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46078. c.project = project
  46079. c.zone = zone
  46080. c.instance = instance
  46081. return c
  46082. }
  46083. // RequestId sets the optional parameter "requestId": An optional
  46084. // request ID to identify requests. Specify a unique request ID so that
  46085. // if you must retry your request, the server will know to ignore the
  46086. // request if it has already been completed.
  46087. //
  46088. // For example, consider a situation where you make an initial request
  46089. // and the request times out. If you make the request again with the
  46090. // same request ID, the server can check if original operation with the
  46091. // same request ID was received, and if so, will ignore the second
  46092. // request. This prevents clients from accidentally creating duplicate
  46093. // commitments.
  46094. //
  46095. // The request ID must be a valid UUID with the exception that zero UUID
  46096. // is not supported (00000000-0000-0000-0000-000000000000).
  46097. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  46098. c.urlParams_.Set("requestId", requestId)
  46099. return c
  46100. }
  46101. // Fields allows partial responses to be retrieved. See
  46102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46103. // for more information.
  46104. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  46105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46106. return c
  46107. }
  46108. // Context sets the context to be used in this call's Do method. Any
  46109. // pending HTTP request will be aborted if the provided context is
  46110. // canceled.
  46111. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  46112. c.ctx_ = ctx
  46113. return c
  46114. }
  46115. // Header returns an http.Header that can be modified by the caller to
  46116. // add HTTP headers to the request.
  46117. func (c *InstancesStartCall) Header() http.Header {
  46118. if c.header_ == nil {
  46119. c.header_ = make(http.Header)
  46120. }
  46121. return c.header_
  46122. }
  46123. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  46124. reqHeaders := make(http.Header)
  46125. for k, v := range c.header_ {
  46126. reqHeaders[k] = v
  46127. }
  46128. reqHeaders.Set("User-Agent", c.s.userAgent())
  46129. var body io.Reader = nil
  46130. c.urlParams_.Set("alt", alt)
  46131. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  46132. urls += "?" + c.urlParams_.Encode()
  46133. req, _ := http.NewRequest("POST", urls, body)
  46134. req.Header = reqHeaders
  46135. googleapi.Expand(req.URL, map[string]string{
  46136. "project": c.project,
  46137. "zone": c.zone,
  46138. "instance": c.instance,
  46139. })
  46140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46141. }
  46142. // Do executes the "compute.instances.start" call.
  46143. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46144. // status code is an error. Response headers are in either
  46145. // *Operation.ServerResponse.Header or (if a response was returned at
  46146. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46147. // to check whether the returned error was because
  46148. // http.StatusNotModified was returned.
  46149. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46150. gensupport.SetOptions(c.urlParams_, opts...)
  46151. res, err := c.doRequest("json")
  46152. if res != nil && res.StatusCode == http.StatusNotModified {
  46153. if res.Body != nil {
  46154. res.Body.Close()
  46155. }
  46156. return nil, &googleapi.Error{
  46157. Code: res.StatusCode,
  46158. Header: res.Header,
  46159. }
  46160. }
  46161. if err != nil {
  46162. return nil, err
  46163. }
  46164. defer googleapi.CloseBody(res)
  46165. if err := googleapi.CheckResponse(res); err != nil {
  46166. return nil, err
  46167. }
  46168. ret := &Operation{
  46169. ServerResponse: googleapi.ServerResponse{
  46170. Header: res.Header,
  46171. HTTPStatusCode: res.StatusCode,
  46172. },
  46173. }
  46174. target := &ret
  46175. if err := gensupport.DecodeResponse(target, res); err != nil {
  46176. return nil, err
  46177. }
  46178. return ret, nil
  46179. // {
  46180. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  46181. // "httpMethod": "POST",
  46182. // "id": "compute.instances.start",
  46183. // "parameterOrder": [
  46184. // "project",
  46185. // "zone",
  46186. // "instance"
  46187. // ],
  46188. // "parameters": {
  46189. // "instance": {
  46190. // "description": "Name of the instance resource to start.",
  46191. // "location": "path",
  46192. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46193. // "required": true,
  46194. // "type": "string"
  46195. // },
  46196. // "project": {
  46197. // "description": "Project ID for this request.",
  46198. // "location": "path",
  46199. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46200. // "required": true,
  46201. // "type": "string"
  46202. // },
  46203. // "requestId": {
  46204. // "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).",
  46205. // "location": "query",
  46206. // "type": "string"
  46207. // },
  46208. // "zone": {
  46209. // "description": "The name of the zone for this request.",
  46210. // "location": "path",
  46211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46212. // "required": true,
  46213. // "type": "string"
  46214. // }
  46215. // },
  46216. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  46217. // "response": {
  46218. // "$ref": "Operation"
  46219. // },
  46220. // "scopes": [
  46221. // "https://www.googleapis.com/auth/cloud-platform",
  46222. // "https://www.googleapis.com/auth/compute"
  46223. // ]
  46224. // }
  46225. }
  46226. // method id "compute.instances.startWithEncryptionKey":
  46227. type InstancesStartWithEncryptionKeyCall struct {
  46228. s *Service
  46229. project string
  46230. zone string
  46231. instance string
  46232. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  46233. urlParams_ gensupport.URLParams
  46234. ctx_ context.Context
  46235. header_ http.Header
  46236. }
  46237. // StartWithEncryptionKey: Starts an instance that was stopped using the
  46238. // instances().stop method. For more information, see Restart an
  46239. // instance.
  46240. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  46241. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46242. c.project = project
  46243. c.zone = zone
  46244. c.instance = instance
  46245. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  46246. return c
  46247. }
  46248. // RequestId sets the optional parameter "requestId": An optional
  46249. // request ID to identify requests. Specify a unique request ID so that
  46250. // if you must retry your request, the server will know to ignore the
  46251. // request if it has already been completed.
  46252. //
  46253. // For example, consider a situation where you make an initial request
  46254. // and the request times out. If you make the request again with the
  46255. // same request ID, the server can check if original operation with the
  46256. // same request ID was received, and if so, will ignore the second
  46257. // request. This prevents clients from accidentally creating duplicate
  46258. // commitments.
  46259. //
  46260. // The request ID must be a valid UUID with the exception that zero UUID
  46261. // is not supported (00000000-0000-0000-0000-000000000000).
  46262. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  46263. c.urlParams_.Set("requestId", requestId)
  46264. return c
  46265. }
  46266. // Fields allows partial responses to be retrieved. See
  46267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46268. // for more information.
  46269. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  46270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46271. return c
  46272. }
  46273. // Context sets the context to be used in this call's Do method. Any
  46274. // pending HTTP request will be aborted if the provided context is
  46275. // canceled.
  46276. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  46277. c.ctx_ = ctx
  46278. return c
  46279. }
  46280. // Header returns an http.Header that can be modified by the caller to
  46281. // add HTTP headers to the request.
  46282. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  46283. if c.header_ == nil {
  46284. c.header_ = make(http.Header)
  46285. }
  46286. return c.header_
  46287. }
  46288. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  46289. reqHeaders := make(http.Header)
  46290. for k, v := range c.header_ {
  46291. reqHeaders[k] = v
  46292. }
  46293. reqHeaders.Set("User-Agent", c.s.userAgent())
  46294. var body io.Reader = nil
  46295. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  46296. if err != nil {
  46297. return nil, err
  46298. }
  46299. reqHeaders.Set("Content-Type", "application/json")
  46300. c.urlParams_.Set("alt", alt)
  46301. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  46302. urls += "?" + c.urlParams_.Encode()
  46303. req, _ := http.NewRequest("POST", urls, body)
  46304. req.Header = reqHeaders
  46305. googleapi.Expand(req.URL, map[string]string{
  46306. "project": c.project,
  46307. "zone": c.zone,
  46308. "instance": c.instance,
  46309. })
  46310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46311. }
  46312. // Do executes the "compute.instances.startWithEncryptionKey" call.
  46313. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46314. // status code is an error. Response headers are in either
  46315. // *Operation.ServerResponse.Header or (if a response was returned at
  46316. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46317. // to check whether the returned error was because
  46318. // http.StatusNotModified was returned.
  46319. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46320. gensupport.SetOptions(c.urlParams_, opts...)
  46321. res, err := c.doRequest("json")
  46322. if res != nil && res.StatusCode == http.StatusNotModified {
  46323. if res.Body != nil {
  46324. res.Body.Close()
  46325. }
  46326. return nil, &googleapi.Error{
  46327. Code: res.StatusCode,
  46328. Header: res.Header,
  46329. }
  46330. }
  46331. if err != nil {
  46332. return nil, err
  46333. }
  46334. defer googleapi.CloseBody(res)
  46335. if err := googleapi.CheckResponse(res); err != nil {
  46336. return nil, err
  46337. }
  46338. ret := &Operation{
  46339. ServerResponse: googleapi.ServerResponse{
  46340. Header: res.Header,
  46341. HTTPStatusCode: res.StatusCode,
  46342. },
  46343. }
  46344. target := &ret
  46345. if err := gensupport.DecodeResponse(target, res); err != nil {
  46346. return nil, err
  46347. }
  46348. return ret, nil
  46349. // {
  46350. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  46351. // "httpMethod": "POST",
  46352. // "id": "compute.instances.startWithEncryptionKey",
  46353. // "parameterOrder": [
  46354. // "project",
  46355. // "zone",
  46356. // "instance"
  46357. // ],
  46358. // "parameters": {
  46359. // "instance": {
  46360. // "description": "Name of the instance resource to start.",
  46361. // "location": "path",
  46362. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46363. // "required": true,
  46364. // "type": "string"
  46365. // },
  46366. // "project": {
  46367. // "description": "Project ID for this request.",
  46368. // "location": "path",
  46369. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46370. // "required": true,
  46371. // "type": "string"
  46372. // },
  46373. // "requestId": {
  46374. // "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).",
  46375. // "location": "query",
  46376. // "type": "string"
  46377. // },
  46378. // "zone": {
  46379. // "description": "The name of the zone for this request.",
  46380. // "location": "path",
  46381. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46382. // "required": true,
  46383. // "type": "string"
  46384. // }
  46385. // },
  46386. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  46387. // "request": {
  46388. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  46389. // },
  46390. // "response": {
  46391. // "$ref": "Operation"
  46392. // },
  46393. // "scopes": [
  46394. // "https://www.googleapis.com/auth/cloud-platform",
  46395. // "https://www.googleapis.com/auth/compute"
  46396. // ]
  46397. // }
  46398. }
  46399. // method id "compute.instances.stop":
  46400. type InstancesStopCall struct {
  46401. s *Service
  46402. project string
  46403. zone string
  46404. instance string
  46405. urlParams_ gensupport.URLParams
  46406. ctx_ context.Context
  46407. header_ http.Header
  46408. }
  46409. // Stop: Stops a running instance, shutting it down cleanly, and allows
  46410. // you to restart the instance at a later time. Stopped instances do not
  46411. // incur VM usage charges while they are stopped. However, resources
  46412. // that the VM is using, such as persistent disks and static IP
  46413. // addresses, will continue to be charged until they are deleted. For
  46414. // more information, see Stopping an instance.
  46415. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  46416. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  46417. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46418. c.project = project
  46419. c.zone = zone
  46420. c.instance = instance
  46421. return c
  46422. }
  46423. // RequestId sets the optional parameter "requestId": An optional
  46424. // request ID to identify requests. Specify a unique request ID so that
  46425. // if you must retry your request, the server will know to ignore the
  46426. // request if it has already been completed.
  46427. //
  46428. // For example, consider a situation where you make an initial request
  46429. // and the request times out. If you make the request again with the
  46430. // same request ID, the server can check if original operation with the
  46431. // same request ID was received, and if so, will ignore the second
  46432. // request. This prevents clients from accidentally creating duplicate
  46433. // commitments.
  46434. //
  46435. // The request ID must be a valid UUID with the exception that zero UUID
  46436. // is not supported (00000000-0000-0000-0000-000000000000).
  46437. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  46438. c.urlParams_.Set("requestId", requestId)
  46439. return c
  46440. }
  46441. // Fields allows partial responses to be retrieved. See
  46442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46443. // for more information.
  46444. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  46445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46446. return c
  46447. }
  46448. // Context sets the context to be used in this call's Do method. Any
  46449. // pending HTTP request will be aborted if the provided context is
  46450. // canceled.
  46451. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  46452. c.ctx_ = ctx
  46453. return c
  46454. }
  46455. // Header returns an http.Header that can be modified by the caller to
  46456. // add HTTP headers to the request.
  46457. func (c *InstancesStopCall) Header() http.Header {
  46458. if c.header_ == nil {
  46459. c.header_ = make(http.Header)
  46460. }
  46461. return c.header_
  46462. }
  46463. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  46464. reqHeaders := make(http.Header)
  46465. for k, v := range c.header_ {
  46466. reqHeaders[k] = v
  46467. }
  46468. reqHeaders.Set("User-Agent", c.s.userAgent())
  46469. var body io.Reader = nil
  46470. c.urlParams_.Set("alt", alt)
  46471. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  46472. urls += "?" + c.urlParams_.Encode()
  46473. req, _ := http.NewRequest("POST", urls, body)
  46474. req.Header = reqHeaders
  46475. googleapi.Expand(req.URL, map[string]string{
  46476. "project": c.project,
  46477. "zone": c.zone,
  46478. "instance": c.instance,
  46479. })
  46480. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46481. }
  46482. // Do executes the "compute.instances.stop" call.
  46483. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46484. // status code is an error. Response headers are in either
  46485. // *Operation.ServerResponse.Header or (if a response was returned at
  46486. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46487. // to check whether the returned error was because
  46488. // http.StatusNotModified was returned.
  46489. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46490. gensupport.SetOptions(c.urlParams_, opts...)
  46491. res, err := c.doRequest("json")
  46492. if res != nil && res.StatusCode == http.StatusNotModified {
  46493. if res.Body != nil {
  46494. res.Body.Close()
  46495. }
  46496. return nil, &googleapi.Error{
  46497. Code: res.StatusCode,
  46498. Header: res.Header,
  46499. }
  46500. }
  46501. if err != nil {
  46502. return nil, err
  46503. }
  46504. defer googleapi.CloseBody(res)
  46505. if err := googleapi.CheckResponse(res); err != nil {
  46506. return nil, err
  46507. }
  46508. ret := &Operation{
  46509. ServerResponse: googleapi.ServerResponse{
  46510. Header: res.Header,
  46511. HTTPStatusCode: res.StatusCode,
  46512. },
  46513. }
  46514. target := &ret
  46515. if err := gensupport.DecodeResponse(target, res); err != nil {
  46516. return nil, err
  46517. }
  46518. return ret, nil
  46519. // {
  46520. // "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.",
  46521. // "httpMethod": "POST",
  46522. // "id": "compute.instances.stop",
  46523. // "parameterOrder": [
  46524. // "project",
  46525. // "zone",
  46526. // "instance"
  46527. // ],
  46528. // "parameters": {
  46529. // "instance": {
  46530. // "description": "Name of the instance resource to stop.",
  46531. // "location": "path",
  46532. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46533. // "required": true,
  46534. // "type": "string"
  46535. // },
  46536. // "project": {
  46537. // "description": "Project ID for this request.",
  46538. // "location": "path",
  46539. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46540. // "required": true,
  46541. // "type": "string"
  46542. // },
  46543. // "requestId": {
  46544. // "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).",
  46545. // "location": "query",
  46546. // "type": "string"
  46547. // },
  46548. // "zone": {
  46549. // "description": "The name of the zone for this request.",
  46550. // "location": "path",
  46551. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46552. // "required": true,
  46553. // "type": "string"
  46554. // }
  46555. // },
  46556. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  46557. // "response": {
  46558. // "$ref": "Operation"
  46559. // },
  46560. // "scopes": [
  46561. // "https://www.googleapis.com/auth/cloud-platform",
  46562. // "https://www.googleapis.com/auth/compute"
  46563. // ]
  46564. // }
  46565. }
  46566. // method id "compute.instances.updateAccessConfig":
  46567. type InstancesUpdateAccessConfigCall struct {
  46568. s *Service
  46569. project string
  46570. zone string
  46571. instance string
  46572. accessconfig *AccessConfig
  46573. urlParams_ gensupport.URLParams
  46574. ctx_ context.Context
  46575. header_ http.Header
  46576. }
  46577. // UpdateAccessConfig: Updates the specified access config from an
  46578. // instance's network interface with the data included in the request.
  46579. // This method supports PATCH semantics and uses the JSON merge patch
  46580. // format and processing rules.
  46581. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  46582. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46583. c.project = project
  46584. c.zone = zone
  46585. c.instance = instance
  46586. c.urlParams_.Set("networkInterface", networkInterface)
  46587. c.accessconfig = accessconfig
  46588. return c
  46589. }
  46590. // RequestId sets the optional parameter "requestId": An optional
  46591. // request ID to identify requests. Specify a unique request ID so that
  46592. // if you must retry your request, the server will know to ignore the
  46593. // request if it has already been completed.
  46594. //
  46595. // For example, consider a situation where you make an initial request
  46596. // and the request times out. If you make the request again with the
  46597. // same request ID, the server can check if original operation with the
  46598. // same request ID was received, and if so, will ignore the second
  46599. // request. This prevents clients from accidentally creating duplicate
  46600. // commitments.
  46601. //
  46602. // The request ID must be a valid UUID with the exception that zero UUID
  46603. // is not supported (00000000-0000-0000-0000-000000000000).
  46604. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  46605. c.urlParams_.Set("requestId", requestId)
  46606. return c
  46607. }
  46608. // Fields allows partial responses to be retrieved. See
  46609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46610. // for more information.
  46611. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  46612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46613. return c
  46614. }
  46615. // Context sets the context to be used in this call's Do method. Any
  46616. // pending HTTP request will be aborted if the provided context is
  46617. // canceled.
  46618. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  46619. c.ctx_ = ctx
  46620. return c
  46621. }
  46622. // Header returns an http.Header that can be modified by the caller to
  46623. // add HTTP headers to the request.
  46624. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  46625. if c.header_ == nil {
  46626. c.header_ = make(http.Header)
  46627. }
  46628. return c.header_
  46629. }
  46630. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  46631. reqHeaders := make(http.Header)
  46632. for k, v := range c.header_ {
  46633. reqHeaders[k] = v
  46634. }
  46635. reqHeaders.Set("User-Agent", c.s.userAgent())
  46636. var body io.Reader = nil
  46637. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  46638. if err != nil {
  46639. return nil, err
  46640. }
  46641. reqHeaders.Set("Content-Type", "application/json")
  46642. c.urlParams_.Set("alt", alt)
  46643. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  46644. urls += "?" + c.urlParams_.Encode()
  46645. req, _ := http.NewRequest("POST", urls, body)
  46646. req.Header = reqHeaders
  46647. googleapi.Expand(req.URL, map[string]string{
  46648. "project": c.project,
  46649. "zone": c.zone,
  46650. "instance": c.instance,
  46651. })
  46652. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46653. }
  46654. // Do executes the "compute.instances.updateAccessConfig" call.
  46655. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46656. // status code is an error. Response headers are in either
  46657. // *Operation.ServerResponse.Header or (if a response was returned at
  46658. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46659. // to check whether the returned error was because
  46660. // http.StatusNotModified was returned.
  46661. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46662. gensupport.SetOptions(c.urlParams_, opts...)
  46663. res, err := c.doRequest("json")
  46664. if res != nil && res.StatusCode == http.StatusNotModified {
  46665. if res.Body != nil {
  46666. res.Body.Close()
  46667. }
  46668. return nil, &googleapi.Error{
  46669. Code: res.StatusCode,
  46670. Header: res.Header,
  46671. }
  46672. }
  46673. if err != nil {
  46674. return nil, err
  46675. }
  46676. defer googleapi.CloseBody(res)
  46677. if err := googleapi.CheckResponse(res); err != nil {
  46678. return nil, err
  46679. }
  46680. ret := &Operation{
  46681. ServerResponse: googleapi.ServerResponse{
  46682. Header: res.Header,
  46683. HTTPStatusCode: res.StatusCode,
  46684. },
  46685. }
  46686. target := &ret
  46687. if err := gensupport.DecodeResponse(target, res); err != nil {
  46688. return nil, err
  46689. }
  46690. return ret, nil
  46691. // {
  46692. // "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.",
  46693. // "httpMethod": "POST",
  46694. // "id": "compute.instances.updateAccessConfig",
  46695. // "parameterOrder": [
  46696. // "project",
  46697. // "zone",
  46698. // "instance",
  46699. // "networkInterface"
  46700. // ],
  46701. // "parameters": {
  46702. // "instance": {
  46703. // "description": "The instance name for this request.",
  46704. // "location": "path",
  46705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46706. // "required": true,
  46707. // "type": "string"
  46708. // },
  46709. // "networkInterface": {
  46710. // "description": "The name of the network interface where the access config is attached.",
  46711. // "location": "query",
  46712. // "required": true,
  46713. // "type": "string"
  46714. // },
  46715. // "project": {
  46716. // "description": "Project ID for this request.",
  46717. // "location": "path",
  46718. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46719. // "required": true,
  46720. // "type": "string"
  46721. // },
  46722. // "requestId": {
  46723. // "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).",
  46724. // "location": "query",
  46725. // "type": "string"
  46726. // },
  46727. // "zone": {
  46728. // "description": "The name of the zone for this request.",
  46729. // "location": "path",
  46730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46731. // "required": true,
  46732. // "type": "string"
  46733. // }
  46734. // },
  46735. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  46736. // "request": {
  46737. // "$ref": "AccessConfig"
  46738. // },
  46739. // "response": {
  46740. // "$ref": "Operation"
  46741. // },
  46742. // "scopes": [
  46743. // "https://www.googleapis.com/auth/cloud-platform",
  46744. // "https://www.googleapis.com/auth/compute"
  46745. // ]
  46746. // }
  46747. }
  46748. // method id "compute.instances.updateNetworkInterface":
  46749. type InstancesUpdateNetworkInterfaceCall struct {
  46750. s *Service
  46751. project string
  46752. zone string
  46753. instance string
  46754. networkinterface *NetworkInterface
  46755. urlParams_ gensupport.URLParams
  46756. ctx_ context.Context
  46757. header_ http.Header
  46758. }
  46759. // UpdateNetworkInterface: Updates an instance's network interface. This
  46760. // method follows PATCH semantics.
  46761. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  46762. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46763. c.project = project
  46764. c.zone = zone
  46765. c.instance = instance
  46766. c.urlParams_.Set("networkInterface", networkInterface)
  46767. c.networkinterface = networkinterface
  46768. return c
  46769. }
  46770. // RequestId sets the optional parameter "requestId": An optional
  46771. // request ID to identify requests. Specify a unique request ID so that
  46772. // if you must retry your request, the server will know to ignore the
  46773. // request if it has already been completed.
  46774. //
  46775. // For example, consider a situation where you make an initial request
  46776. // and the request times out. If you make the request again with the
  46777. // same request ID, the server can check if original operation with the
  46778. // same request ID was received, and if so, will ignore the second
  46779. // request. This prevents clients from accidentally creating duplicate
  46780. // commitments.
  46781. //
  46782. // The request ID must be a valid UUID with the exception that zero UUID
  46783. // is not supported (00000000-0000-0000-0000-000000000000).
  46784. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  46785. c.urlParams_.Set("requestId", requestId)
  46786. return c
  46787. }
  46788. // Fields allows partial responses to be retrieved. See
  46789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46790. // for more information.
  46791. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  46792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46793. return c
  46794. }
  46795. // Context sets the context to be used in this call's Do method. Any
  46796. // pending HTTP request will be aborted if the provided context is
  46797. // canceled.
  46798. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  46799. c.ctx_ = ctx
  46800. return c
  46801. }
  46802. // Header returns an http.Header that can be modified by the caller to
  46803. // add HTTP headers to the request.
  46804. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  46805. if c.header_ == nil {
  46806. c.header_ = make(http.Header)
  46807. }
  46808. return c.header_
  46809. }
  46810. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  46811. reqHeaders := make(http.Header)
  46812. for k, v := range c.header_ {
  46813. reqHeaders[k] = v
  46814. }
  46815. reqHeaders.Set("User-Agent", c.s.userAgent())
  46816. var body io.Reader = nil
  46817. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  46818. if err != nil {
  46819. return nil, err
  46820. }
  46821. reqHeaders.Set("Content-Type", "application/json")
  46822. c.urlParams_.Set("alt", alt)
  46823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  46824. urls += "?" + c.urlParams_.Encode()
  46825. req, _ := http.NewRequest("PATCH", urls, body)
  46826. req.Header = reqHeaders
  46827. googleapi.Expand(req.URL, map[string]string{
  46828. "project": c.project,
  46829. "zone": c.zone,
  46830. "instance": c.instance,
  46831. })
  46832. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46833. }
  46834. // Do executes the "compute.instances.updateNetworkInterface" call.
  46835. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46836. // status code is an error. Response headers are in either
  46837. // *Operation.ServerResponse.Header or (if a response was returned at
  46838. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46839. // to check whether the returned error was because
  46840. // http.StatusNotModified was returned.
  46841. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46842. gensupport.SetOptions(c.urlParams_, opts...)
  46843. res, err := c.doRequest("json")
  46844. if res != nil && res.StatusCode == http.StatusNotModified {
  46845. if res.Body != nil {
  46846. res.Body.Close()
  46847. }
  46848. return nil, &googleapi.Error{
  46849. Code: res.StatusCode,
  46850. Header: res.Header,
  46851. }
  46852. }
  46853. if err != nil {
  46854. return nil, err
  46855. }
  46856. defer googleapi.CloseBody(res)
  46857. if err := googleapi.CheckResponse(res); err != nil {
  46858. return nil, err
  46859. }
  46860. ret := &Operation{
  46861. ServerResponse: googleapi.ServerResponse{
  46862. Header: res.Header,
  46863. HTTPStatusCode: res.StatusCode,
  46864. },
  46865. }
  46866. target := &ret
  46867. if err := gensupport.DecodeResponse(target, res); err != nil {
  46868. return nil, err
  46869. }
  46870. return ret, nil
  46871. // {
  46872. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  46873. // "httpMethod": "PATCH",
  46874. // "id": "compute.instances.updateNetworkInterface",
  46875. // "parameterOrder": [
  46876. // "project",
  46877. // "zone",
  46878. // "instance",
  46879. // "networkInterface"
  46880. // ],
  46881. // "parameters": {
  46882. // "instance": {
  46883. // "description": "The instance name for this request.",
  46884. // "location": "path",
  46885. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46886. // "required": true,
  46887. // "type": "string"
  46888. // },
  46889. // "networkInterface": {
  46890. // "description": "The name of the network interface to update.",
  46891. // "location": "query",
  46892. // "required": true,
  46893. // "type": "string"
  46894. // },
  46895. // "project": {
  46896. // "description": "Project ID for this request.",
  46897. // "location": "path",
  46898. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46899. // "required": true,
  46900. // "type": "string"
  46901. // },
  46902. // "requestId": {
  46903. // "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).",
  46904. // "location": "query",
  46905. // "type": "string"
  46906. // },
  46907. // "zone": {
  46908. // "description": "The name of the zone for this request.",
  46909. // "location": "path",
  46910. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46911. // "required": true,
  46912. // "type": "string"
  46913. // }
  46914. // },
  46915. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  46916. // "request": {
  46917. // "$ref": "NetworkInterface"
  46918. // },
  46919. // "response": {
  46920. // "$ref": "Operation"
  46921. // },
  46922. // "scopes": [
  46923. // "https://www.googleapis.com/auth/cloud-platform",
  46924. // "https://www.googleapis.com/auth/compute"
  46925. // ]
  46926. // }
  46927. }
  46928. // method id "compute.interconnectAttachments.aggregatedList":
  46929. type InterconnectAttachmentsAggregatedListCall struct {
  46930. s *Service
  46931. project string
  46932. urlParams_ gensupport.URLParams
  46933. ifNoneMatch_ string
  46934. ctx_ context.Context
  46935. header_ http.Header
  46936. }
  46937. // AggregatedList: Retrieves an aggregated list of interconnect
  46938. // attachments.
  46939. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  46940. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46941. c.project = project
  46942. return c
  46943. }
  46944. // Filter sets the optional parameter "filter": A filter expression that
  46945. // filters resources listed in the response. The expression must specify
  46946. // the field name, a comparison operator, and the value that you want to
  46947. // use for filtering. The value must be a string, a number, or a
  46948. // boolean. The comparison operator must be either =, !=, >, or <.
  46949. //
  46950. // For example, if you are filtering Compute Engine instances, you can
  46951. // exclude instances named example-instance by specifying name !=
  46952. // example-instance.
  46953. //
  46954. // You can also filter nested fields. For example, you could specify
  46955. // scheduling.automaticRestart = false to include instances only if they
  46956. // are not scheduled for automatic restarts. You can use filtering on
  46957. // nested fields to filter based on resource labels.
  46958. //
  46959. // To filter on multiple expressions, provide each separate expression
  46960. // within parentheses. For example, (scheduling.automaticRestart = true)
  46961. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46962. // AND expression. However, you can include AND and OR expressions
  46963. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46964. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46965. // true).
  46966. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  46967. c.urlParams_.Set("filter", filter)
  46968. return c
  46969. }
  46970. // MaxResults sets the optional parameter "maxResults": The maximum
  46971. // number of results per page that should be returned. If the number of
  46972. // available results is larger than maxResults, Compute Engine returns a
  46973. // nextPageToken that can be used to get the next page of results in
  46974. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46975. // (Default: 500)
  46976. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  46977. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46978. return c
  46979. }
  46980. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46981. // a certain order. By default, results are returned in alphanumerical
  46982. // order based on the resource name.
  46983. //
  46984. // You can also sort results in descending order based on the creation
  46985. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46986. // based on the creationTimestamp field in reverse chronological order
  46987. // (newest result first). Use this to sort resources like operations so
  46988. // that the newest operation is returned first.
  46989. //
  46990. // Currently, only sorting by name or creationTimestamp desc is
  46991. // supported.
  46992. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  46993. c.urlParams_.Set("orderBy", orderBy)
  46994. return c
  46995. }
  46996. // PageToken sets the optional parameter "pageToken": Specifies a page
  46997. // token to use. Set pageToken to the nextPageToken returned by a
  46998. // previous list request to get the next page of results.
  46999. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  47000. c.urlParams_.Set("pageToken", pageToken)
  47001. return c
  47002. }
  47003. // Fields allows partial responses to be retrieved. See
  47004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47005. // for more information.
  47006. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  47007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47008. return c
  47009. }
  47010. // IfNoneMatch sets the optional parameter which makes the operation
  47011. // fail if the object's ETag matches the given value. This is useful for
  47012. // getting updates only after the object has changed since the last
  47013. // request. Use googleapi.IsNotModified to check whether the response
  47014. // error from Do is the result of In-None-Match.
  47015. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  47016. c.ifNoneMatch_ = entityTag
  47017. return c
  47018. }
  47019. // Context sets the context to be used in this call's Do method. Any
  47020. // pending HTTP request will be aborted if the provided context is
  47021. // canceled.
  47022. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  47023. c.ctx_ = ctx
  47024. return c
  47025. }
  47026. // Header returns an http.Header that can be modified by the caller to
  47027. // add HTTP headers to the request.
  47028. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  47029. if c.header_ == nil {
  47030. c.header_ = make(http.Header)
  47031. }
  47032. return c.header_
  47033. }
  47034. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  47035. reqHeaders := make(http.Header)
  47036. for k, v := range c.header_ {
  47037. reqHeaders[k] = v
  47038. }
  47039. reqHeaders.Set("User-Agent", c.s.userAgent())
  47040. if c.ifNoneMatch_ != "" {
  47041. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47042. }
  47043. var body io.Reader = nil
  47044. c.urlParams_.Set("alt", alt)
  47045. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  47046. urls += "?" + c.urlParams_.Encode()
  47047. req, _ := http.NewRequest("GET", urls, body)
  47048. req.Header = reqHeaders
  47049. googleapi.Expand(req.URL, map[string]string{
  47050. "project": c.project,
  47051. })
  47052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47053. }
  47054. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  47055. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  47056. // non-nil. Any non-2xx status code is an error. Response headers are in
  47057. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  47058. // (if a response was returned at all) in
  47059. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  47060. // whether the returned error was because http.StatusNotModified was
  47061. // returned.
  47062. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  47063. gensupport.SetOptions(c.urlParams_, opts...)
  47064. res, err := c.doRequest("json")
  47065. if res != nil && res.StatusCode == http.StatusNotModified {
  47066. if res.Body != nil {
  47067. res.Body.Close()
  47068. }
  47069. return nil, &googleapi.Error{
  47070. Code: res.StatusCode,
  47071. Header: res.Header,
  47072. }
  47073. }
  47074. if err != nil {
  47075. return nil, err
  47076. }
  47077. defer googleapi.CloseBody(res)
  47078. if err := googleapi.CheckResponse(res); err != nil {
  47079. return nil, err
  47080. }
  47081. ret := &InterconnectAttachmentAggregatedList{
  47082. ServerResponse: googleapi.ServerResponse{
  47083. Header: res.Header,
  47084. HTTPStatusCode: res.StatusCode,
  47085. },
  47086. }
  47087. target := &ret
  47088. if err := gensupport.DecodeResponse(target, res); err != nil {
  47089. return nil, err
  47090. }
  47091. return ret, nil
  47092. // {
  47093. // "description": "Retrieves an aggregated list of interconnect attachments.",
  47094. // "httpMethod": "GET",
  47095. // "id": "compute.interconnectAttachments.aggregatedList",
  47096. // "parameterOrder": [
  47097. // "project"
  47098. // ],
  47099. // "parameters": {
  47100. // "filter": {
  47101. // "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).",
  47102. // "location": "query",
  47103. // "type": "string"
  47104. // },
  47105. // "maxResults": {
  47106. // "default": "500",
  47107. // "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)",
  47108. // "format": "uint32",
  47109. // "location": "query",
  47110. // "minimum": "0",
  47111. // "type": "integer"
  47112. // },
  47113. // "orderBy": {
  47114. // "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.",
  47115. // "location": "query",
  47116. // "type": "string"
  47117. // },
  47118. // "pageToken": {
  47119. // "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.",
  47120. // "location": "query",
  47121. // "type": "string"
  47122. // },
  47123. // "project": {
  47124. // "description": "Project ID for this request.",
  47125. // "location": "path",
  47126. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47127. // "required": true,
  47128. // "type": "string"
  47129. // }
  47130. // },
  47131. // "path": "{project}/aggregated/interconnectAttachments",
  47132. // "response": {
  47133. // "$ref": "InterconnectAttachmentAggregatedList"
  47134. // },
  47135. // "scopes": [
  47136. // "https://www.googleapis.com/auth/cloud-platform",
  47137. // "https://www.googleapis.com/auth/compute",
  47138. // "https://www.googleapis.com/auth/compute.readonly"
  47139. // ]
  47140. // }
  47141. }
  47142. // Pages invokes f for each page of results.
  47143. // A non-nil error returned from f will halt the iteration.
  47144. // The provided context supersedes any context provided to the Context method.
  47145. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  47146. c.ctx_ = ctx
  47147. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47148. for {
  47149. x, err := c.Do()
  47150. if err != nil {
  47151. return err
  47152. }
  47153. if err := f(x); err != nil {
  47154. return err
  47155. }
  47156. if x.NextPageToken == "" {
  47157. return nil
  47158. }
  47159. c.PageToken(x.NextPageToken)
  47160. }
  47161. }
  47162. // method id "compute.interconnectAttachments.delete":
  47163. type InterconnectAttachmentsDeleteCall struct {
  47164. s *Service
  47165. project string
  47166. region string
  47167. interconnectAttachment string
  47168. urlParams_ gensupport.URLParams
  47169. ctx_ context.Context
  47170. header_ http.Header
  47171. }
  47172. // Delete: Deletes the specified interconnect attachment.
  47173. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  47174. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47175. c.project = project
  47176. c.region = region
  47177. c.interconnectAttachment = interconnectAttachment
  47178. return c
  47179. }
  47180. // RequestId sets the optional parameter "requestId": An optional
  47181. // request ID to identify requests. Specify a unique request ID so that
  47182. // if you must retry your request, the server will know to ignore the
  47183. // request if it has already been completed.
  47184. //
  47185. // For example, consider a situation where you make an initial request
  47186. // and the request times out. If you make the request again with the
  47187. // same request ID, the server can check if original operation with the
  47188. // same request ID was received, and if so, will ignore the second
  47189. // request. This prevents clients from accidentally creating duplicate
  47190. // commitments.
  47191. //
  47192. // The request ID must be a valid UUID with the exception that zero UUID
  47193. // is not supported (00000000-0000-0000-0000-000000000000).
  47194. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  47195. c.urlParams_.Set("requestId", requestId)
  47196. return c
  47197. }
  47198. // Fields allows partial responses to be retrieved. See
  47199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47200. // for more information.
  47201. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  47202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47203. return c
  47204. }
  47205. // Context sets the context to be used in this call's Do method. Any
  47206. // pending HTTP request will be aborted if the provided context is
  47207. // canceled.
  47208. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  47209. c.ctx_ = ctx
  47210. return c
  47211. }
  47212. // Header returns an http.Header that can be modified by the caller to
  47213. // add HTTP headers to the request.
  47214. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  47215. if c.header_ == nil {
  47216. c.header_ = make(http.Header)
  47217. }
  47218. return c.header_
  47219. }
  47220. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  47221. reqHeaders := make(http.Header)
  47222. for k, v := range c.header_ {
  47223. reqHeaders[k] = v
  47224. }
  47225. reqHeaders.Set("User-Agent", c.s.userAgent())
  47226. var body io.Reader = nil
  47227. c.urlParams_.Set("alt", alt)
  47228. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  47229. urls += "?" + c.urlParams_.Encode()
  47230. req, _ := http.NewRequest("DELETE", urls, body)
  47231. req.Header = reqHeaders
  47232. googleapi.Expand(req.URL, map[string]string{
  47233. "project": c.project,
  47234. "region": c.region,
  47235. "interconnectAttachment": c.interconnectAttachment,
  47236. })
  47237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47238. }
  47239. // Do executes the "compute.interconnectAttachments.delete" call.
  47240. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47241. // status code is an error. Response headers are in either
  47242. // *Operation.ServerResponse.Header or (if a response was returned at
  47243. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47244. // to check whether the returned error was because
  47245. // http.StatusNotModified was returned.
  47246. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47247. gensupport.SetOptions(c.urlParams_, opts...)
  47248. res, err := c.doRequest("json")
  47249. if res != nil && res.StatusCode == http.StatusNotModified {
  47250. if res.Body != nil {
  47251. res.Body.Close()
  47252. }
  47253. return nil, &googleapi.Error{
  47254. Code: res.StatusCode,
  47255. Header: res.Header,
  47256. }
  47257. }
  47258. if err != nil {
  47259. return nil, err
  47260. }
  47261. defer googleapi.CloseBody(res)
  47262. if err := googleapi.CheckResponse(res); err != nil {
  47263. return nil, err
  47264. }
  47265. ret := &Operation{
  47266. ServerResponse: googleapi.ServerResponse{
  47267. Header: res.Header,
  47268. HTTPStatusCode: res.StatusCode,
  47269. },
  47270. }
  47271. target := &ret
  47272. if err := gensupport.DecodeResponse(target, res); err != nil {
  47273. return nil, err
  47274. }
  47275. return ret, nil
  47276. // {
  47277. // "description": "Deletes the specified interconnect attachment.",
  47278. // "httpMethod": "DELETE",
  47279. // "id": "compute.interconnectAttachments.delete",
  47280. // "parameterOrder": [
  47281. // "project",
  47282. // "region",
  47283. // "interconnectAttachment"
  47284. // ],
  47285. // "parameters": {
  47286. // "interconnectAttachment": {
  47287. // "description": "Name of the interconnect attachment to delete.",
  47288. // "location": "path",
  47289. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47290. // "required": true,
  47291. // "type": "string"
  47292. // },
  47293. // "project": {
  47294. // "description": "Project ID for this request.",
  47295. // "location": "path",
  47296. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47297. // "required": true,
  47298. // "type": "string"
  47299. // },
  47300. // "region": {
  47301. // "description": "Name of the region for this request.",
  47302. // "location": "path",
  47303. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47304. // "required": true,
  47305. // "type": "string"
  47306. // },
  47307. // "requestId": {
  47308. // "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).",
  47309. // "location": "query",
  47310. // "type": "string"
  47311. // }
  47312. // },
  47313. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  47314. // "response": {
  47315. // "$ref": "Operation"
  47316. // },
  47317. // "scopes": [
  47318. // "https://www.googleapis.com/auth/cloud-platform",
  47319. // "https://www.googleapis.com/auth/compute"
  47320. // ]
  47321. // }
  47322. }
  47323. // method id "compute.interconnectAttachments.get":
  47324. type InterconnectAttachmentsGetCall struct {
  47325. s *Service
  47326. project string
  47327. region string
  47328. interconnectAttachment string
  47329. urlParams_ gensupport.URLParams
  47330. ifNoneMatch_ string
  47331. ctx_ context.Context
  47332. header_ http.Header
  47333. }
  47334. // Get: Returns the specified interconnect attachment.
  47335. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  47336. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47337. c.project = project
  47338. c.region = region
  47339. c.interconnectAttachment = interconnectAttachment
  47340. return c
  47341. }
  47342. // Fields allows partial responses to be retrieved. See
  47343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47344. // for more information.
  47345. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  47346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47347. return c
  47348. }
  47349. // IfNoneMatch sets the optional parameter which makes the operation
  47350. // fail if the object's ETag matches the given value. This is useful for
  47351. // getting updates only after the object has changed since the last
  47352. // request. Use googleapi.IsNotModified to check whether the response
  47353. // error from Do is the result of In-None-Match.
  47354. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  47355. c.ifNoneMatch_ = entityTag
  47356. return c
  47357. }
  47358. // Context sets the context to be used in this call's Do method. Any
  47359. // pending HTTP request will be aborted if the provided context is
  47360. // canceled.
  47361. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  47362. c.ctx_ = ctx
  47363. return c
  47364. }
  47365. // Header returns an http.Header that can be modified by the caller to
  47366. // add HTTP headers to the request.
  47367. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  47368. if c.header_ == nil {
  47369. c.header_ = make(http.Header)
  47370. }
  47371. return c.header_
  47372. }
  47373. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  47374. reqHeaders := make(http.Header)
  47375. for k, v := range c.header_ {
  47376. reqHeaders[k] = v
  47377. }
  47378. reqHeaders.Set("User-Agent", c.s.userAgent())
  47379. if c.ifNoneMatch_ != "" {
  47380. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47381. }
  47382. var body io.Reader = nil
  47383. c.urlParams_.Set("alt", alt)
  47384. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  47385. urls += "?" + c.urlParams_.Encode()
  47386. req, _ := http.NewRequest("GET", urls, body)
  47387. req.Header = reqHeaders
  47388. googleapi.Expand(req.URL, map[string]string{
  47389. "project": c.project,
  47390. "region": c.region,
  47391. "interconnectAttachment": c.interconnectAttachment,
  47392. })
  47393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47394. }
  47395. // Do executes the "compute.interconnectAttachments.get" call.
  47396. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  47397. // non-2xx status code is an error. Response headers are in either
  47398. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  47399. // returned at all) in error.(*googleapi.Error).Header. Use
  47400. // googleapi.IsNotModified to check whether the returned error was
  47401. // because http.StatusNotModified was returned.
  47402. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  47403. gensupport.SetOptions(c.urlParams_, opts...)
  47404. res, err := c.doRequest("json")
  47405. if res != nil && res.StatusCode == http.StatusNotModified {
  47406. if res.Body != nil {
  47407. res.Body.Close()
  47408. }
  47409. return nil, &googleapi.Error{
  47410. Code: res.StatusCode,
  47411. Header: res.Header,
  47412. }
  47413. }
  47414. if err != nil {
  47415. return nil, err
  47416. }
  47417. defer googleapi.CloseBody(res)
  47418. if err := googleapi.CheckResponse(res); err != nil {
  47419. return nil, err
  47420. }
  47421. ret := &InterconnectAttachment{
  47422. ServerResponse: googleapi.ServerResponse{
  47423. Header: res.Header,
  47424. HTTPStatusCode: res.StatusCode,
  47425. },
  47426. }
  47427. target := &ret
  47428. if err := gensupport.DecodeResponse(target, res); err != nil {
  47429. return nil, err
  47430. }
  47431. return ret, nil
  47432. // {
  47433. // "description": "Returns the specified interconnect attachment.",
  47434. // "httpMethod": "GET",
  47435. // "id": "compute.interconnectAttachments.get",
  47436. // "parameterOrder": [
  47437. // "project",
  47438. // "region",
  47439. // "interconnectAttachment"
  47440. // ],
  47441. // "parameters": {
  47442. // "interconnectAttachment": {
  47443. // "description": "Name of the interconnect attachment to return.",
  47444. // "location": "path",
  47445. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47446. // "required": true,
  47447. // "type": "string"
  47448. // },
  47449. // "project": {
  47450. // "description": "Project ID for this request.",
  47451. // "location": "path",
  47452. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47453. // "required": true,
  47454. // "type": "string"
  47455. // },
  47456. // "region": {
  47457. // "description": "Name of the region for this request.",
  47458. // "location": "path",
  47459. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47460. // "required": true,
  47461. // "type": "string"
  47462. // }
  47463. // },
  47464. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  47465. // "response": {
  47466. // "$ref": "InterconnectAttachment"
  47467. // },
  47468. // "scopes": [
  47469. // "https://www.googleapis.com/auth/cloud-platform",
  47470. // "https://www.googleapis.com/auth/compute",
  47471. // "https://www.googleapis.com/auth/compute.readonly"
  47472. // ]
  47473. // }
  47474. }
  47475. // method id "compute.interconnectAttachments.insert":
  47476. type InterconnectAttachmentsInsertCall struct {
  47477. s *Service
  47478. project string
  47479. region string
  47480. interconnectattachment *InterconnectAttachment
  47481. urlParams_ gensupport.URLParams
  47482. ctx_ context.Context
  47483. header_ http.Header
  47484. }
  47485. // Insert: Creates an InterconnectAttachment in the specified project
  47486. // using the data included in the request.
  47487. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  47488. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47489. c.project = project
  47490. c.region = region
  47491. c.interconnectattachment = interconnectattachment
  47492. return c
  47493. }
  47494. // RequestId sets the optional parameter "requestId": An optional
  47495. // request ID to identify requests. Specify a unique request ID so that
  47496. // if you must retry your request, the server will know to ignore the
  47497. // request if it has already been completed.
  47498. //
  47499. // For example, consider a situation where you make an initial request
  47500. // and the request times out. If you make the request again with the
  47501. // same request ID, the server can check if original operation with the
  47502. // same request ID was received, and if so, will ignore the second
  47503. // request. This prevents clients from accidentally creating duplicate
  47504. // commitments.
  47505. //
  47506. // The request ID must be a valid UUID with the exception that zero UUID
  47507. // is not supported (00000000-0000-0000-0000-000000000000).
  47508. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  47509. c.urlParams_.Set("requestId", requestId)
  47510. return c
  47511. }
  47512. // Fields allows partial responses to be retrieved. See
  47513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47514. // for more information.
  47515. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  47516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47517. return c
  47518. }
  47519. // Context sets the context to be used in this call's Do method. Any
  47520. // pending HTTP request will be aborted if the provided context is
  47521. // canceled.
  47522. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  47523. c.ctx_ = ctx
  47524. return c
  47525. }
  47526. // Header returns an http.Header that can be modified by the caller to
  47527. // add HTTP headers to the request.
  47528. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  47529. if c.header_ == nil {
  47530. c.header_ = make(http.Header)
  47531. }
  47532. return c.header_
  47533. }
  47534. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  47535. reqHeaders := make(http.Header)
  47536. for k, v := range c.header_ {
  47537. reqHeaders[k] = v
  47538. }
  47539. reqHeaders.Set("User-Agent", c.s.userAgent())
  47540. var body io.Reader = nil
  47541. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  47542. if err != nil {
  47543. return nil, err
  47544. }
  47545. reqHeaders.Set("Content-Type", "application/json")
  47546. c.urlParams_.Set("alt", alt)
  47547. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  47548. urls += "?" + c.urlParams_.Encode()
  47549. req, _ := http.NewRequest("POST", urls, body)
  47550. req.Header = reqHeaders
  47551. googleapi.Expand(req.URL, map[string]string{
  47552. "project": c.project,
  47553. "region": c.region,
  47554. })
  47555. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47556. }
  47557. // Do executes the "compute.interconnectAttachments.insert" call.
  47558. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47559. // status code is an error. Response headers are in either
  47560. // *Operation.ServerResponse.Header or (if a response was returned at
  47561. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47562. // to check whether the returned error was because
  47563. // http.StatusNotModified was returned.
  47564. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47565. gensupport.SetOptions(c.urlParams_, opts...)
  47566. res, err := c.doRequest("json")
  47567. if res != nil && res.StatusCode == http.StatusNotModified {
  47568. if res.Body != nil {
  47569. res.Body.Close()
  47570. }
  47571. return nil, &googleapi.Error{
  47572. Code: res.StatusCode,
  47573. Header: res.Header,
  47574. }
  47575. }
  47576. if err != nil {
  47577. return nil, err
  47578. }
  47579. defer googleapi.CloseBody(res)
  47580. if err := googleapi.CheckResponse(res); err != nil {
  47581. return nil, err
  47582. }
  47583. ret := &Operation{
  47584. ServerResponse: googleapi.ServerResponse{
  47585. Header: res.Header,
  47586. HTTPStatusCode: res.StatusCode,
  47587. },
  47588. }
  47589. target := &ret
  47590. if err := gensupport.DecodeResponse(target, res); err != nil {
  47591. return nil, err
  47592. }
  47593. return ret, nil
  47594. // {
  47595. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  47596. // "httpMethod": "POST",
  47597. // "id": "compute.interconnectAttachments.insert",
  47598. // "parameterOrder": [
  47599. // "project",
  47600. // "region"
  47601. // ],
  47602. // "parameters": {
  47603. // "project": {
  47604. // "description": "Project ID for this request.",
  47605. // "location": "path",
  47606. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47607. // "required": true,
  47608. // "type": "string"
  47609. // },
  47610. // "region": {
  47611. // "description": "Name of the region for this request.",
  47612. // "location": "path",
  47613. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47614. // "required": true,
  47615. // "type": "string"
  47616. // },
  47617. // "requestId": {
  47618. // "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).",
  47619. // "location": "query",
  47620. // "type": "string"
  47621. // }
  47622. // },
  47623. // "path": "{project}/regions/{region}/interconnectAttachments",
  47624. // "request": {
  47625. // "$ref": "InterconnectAttachment"
  47626. // },
  47627. // "response": {
  47628. // "$ref": "Operation"
  47629. // },
  47630. // "scopes": [
  47631. // "https://www.googleapis.com/auth/cloud-platform",
  47632. // "https://www.googleapis.com/auth/compute"
  47633. // ]
  47634. // }
  47635. }
  47636. // method id "compute.interconnectAttachments.list":
  47637. type InterconnectAttachmentsListCall struct {
  47638. s *Service
  47639. project string
  47640. region string
  47641. urlParams_ gensupport.URLParams
  47642. ifNoneMatch_ string
  47643. ctx_ context.Context
  47644. header_ http.Header
  47645. }
  47646. // List: Retrieves the list of interconnect attachments contained within
  47647. // the specified region.
  47648. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  47649. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47650. c.project = project
  47651. c.region = region
  47652. return c
  47653. }
  47654. // Filter sets the optional parameter "filter": A filter expression that
  47655. // filters resources listed in the response. The expression must specify
  47656. // the field name, a comparison operator, and the value that you want to
  47657. // use for filtering. The value must be a string, a number, or a
  47658. // boolean. The comparison operator must be either =, !=, >, or <.
  47659. //
  47660. // For example, if you are filtering Compute Engine instances, you can
  47661. // exclude instances named example-instance by specifying name !=
  47662. // example-instance.
  47663. //
  47664. // You can also filter nested fields. For example, you could specify
  47665. // scheduling.automaticRestart = false to include instances only if they
  47666. // are not scheduled for automatic restarts. You can use filtering on
  47667. // nested fields to filter based on resource labels.
  47668. //
  47669. // To filter on multiple expressions, provide each separate expression
  47670. // within parentheses. For example, (scheduling.automaticRestart = true)
  47671. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47672. // AND expression. However, you can include AND and OR expressions
  47673. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47674. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47675. // true).
  47676. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  47677. c.urlParams_.Set("filter", filter)
  47678. return c
  47679. }
  47680. // MaxResults sets the optional parameter "maxResults": The maximum
  47681. // number of results per page that should be returned. If the number of
  47682. // available results is larger than maxResults, Compute Engine returns a
  47683. // nextPageToken that can be used to get the next page of results in
  47684. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47685. // (Default: 500)
  47686. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  47687. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47688. return c
  47689. }
  47690. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47691. // a certain order. By default, results are returned in alphanumerical
  47692. // order based on the resource name.
  47693. //
  47694. // You can also sort results in descending order based on the creation
  47695. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47696. // based on the creationTimestamp field in reverse chronological order
  47697. // (newest result first). Use this to sort resources like operations so
  47698. // that the newest operation is returned first.
  47699. //
  47700. // Currently, only sorting by name or creationTimestamp desc is
  47701. // supported.
  47702. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  47703. c.urlParams_.Set("orderBy", orderBy)
  47704. return c
  47705. }
  47706. // PageToken sets the optional parameter "pageToken": Specifies a page
  47707. // token to use. Set pageToken to the nextPageToken returned by a
  47708. // previous list request to get the next page of results.
  47709. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  47710. c.urlParams_.Set("pageToken", pageToken)
  47711. return c
  47712. }
  47713. // Fields allows partial responses to be retrieved. See
  47714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47715. // for more information.
  47716. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  47717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47718. return c
  47719. }
  47720. // IfNoneMatch sets the optional parameter which makes the operation
  47721. // fail if the object's ETag matches the given value. This is useful for
  47722. // getting updates only after the object has changed since the last
  47723. // request. Use googleapi.IsNotModified to check whether the response
  47724. // error from Do is the result of In-None-Match.
  47725. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  47726. c.ifNoneMatch_ = entityTag
  47727. return c
  47728. }
  47729. // Context sets the context to be used in this call's Do method. Any
  47730. // pending HTTP request will be aborted if the provided context is
  47731. // canceled.
  47732. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  47733. c.ctx_ = ctx
  47734. return c
  47735. }
  47736. // Header returns an http.Header that can be modified by the caller to
  47737. // add HTTP headers to the request.
  47738. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  47739. if c.header_ == nil {
  47740. c.header_ = make(http.Header)
  47741. }
  47742. return c.header_
  47743. }
  47744. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  47745. reqHeaders := make(http.Header)
  47746. for k, v := range c.header_ {
  47747. reqHeaders[k] = v
  47748. }
  47749. reqHeaders.Set("User-Agent", c.s.userAgent())
  47750. if c.ifNoneMatch_ != "" {
  47751. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47752. }
  47753. var body io.Reader = nil
  47754. c.urlParams_.Set("alt", alt)
  47755. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  47756. urls += "?" + c.urlParams_.Encode()
  47757. req, _ := http.NewRequest("GET", urls, body)
  47758. req.Header = reqHeaders
  47759. googleapi.Expand(req.URL, map[string]string{
  47760. "project": c.project,
  47761. "region": c.region,
  47762. })
  47763. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47764. }
  47765. // Do executes the "compute.interconnectAttachments.list" call.
  47766. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  47767. // Any non-2xx status code is an error. Response headers are in either
  47768. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  47769. // was returned at all) in error.(*googleapi.Error).Header. Use
  47770. // googleapi.IsNotModified to check whether the returned error was
  47771. // because http.StatusNotModified was returned.
  47772. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  47773. gensupport.SetOptions(c.urlParams_, opts...)
  47774. res, err := c.doRequest("json")
  47775. if res != nil && res.StatusCode == http.StatusNotModified {
  47776. if res.Body != nil {
  47777. res.Body.Close()
  47778. }
  47779. return nil, &googleapi.Error{
  47780. Code: res.StatusCode,
  47781. Header: res.Header,
  47782. }
  47783. }
  47784. if err != nil {
  47785. return nil, err
  47786. }
  47787. defer googleapi.CloseBody(res)
  47788. if err := googleapi.CheckResponse(res); err != nil {
  47789. return nil, err
  47790. }
  47791. ret := &InterconnectAttachmentList{
  47792. ServerResponse: googleapi.ServerResponse{
  47793. Header: res.Header,
  47794. HTTPStatusCode: res.StatusCode,
  47795. },
  47796. }
  47797. target := &ret
  47798. if err := gensupport.DecodeResponse(target, res); err != nil {
  47799. return nil, err
  47800. }
  47801. return ret, nil
  47802. // {
  47803. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  47804. // "httpMethod": "GET",
  47805. // "id": "compute.interconnectAttachments.list",
  47806. // "parameterOrder": [
  47807. // "project",
  47808. // "region"
  47809. // ],
  47810. // "parameters": {
  47811. // "filter": {
  47812. // "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).",
  47813. // "location": "query",
  47814. // "type": "string"
  47815. // },
  47816. // "maxResults": {
  47817. // "default": "500",
  47818. // "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)",
  47819. // "format": "uint32",
  47820. // "location": "query",
  47821. // "minimum": "0",
  47822. // "type": "integer"
  47823. // },
  47824. // "orderBy": {
  47825. // "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.",
  47826. // "location": "query",
  47827. // "type": "string"
  47828. // },
  47829. // "pageToken": {
  47830. // "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.",
  47831. // "location": "query",
  47832. // "type": "string"
  47833. // },
  47834. // "project": {
  47835. // "description": "Project ID for this request.",
  47836. // "location": "path",
  47837. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47838. // "required": true,
  47839. // "type": "string"
  47840. // },
  47841. // "region": {
  47842. // "description": "Name of the region for this request.",
  47843. // "location": "path",
  47844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47845. // "required": true,
  47846. // "type": "string"
  47847. // }
  47848. // },
  47849. // "path": "{project}/regions/{region}/interconnectAttachments",
  47850. // "response": {
  47851. // "$ref": "InterconnectAttachmentList"
  47852. // },
  47853. // "scopes": [
  47854. // "https://www.googleapis.com/auth/cloud-platform",
  47855. // "https://www.googleapis.com/auth/compute",
  47856. // "https://www.googleapis.com/auth/compute.readonly"
  47857. // ]
  47858. // }
  47859. }
  47860. // Pages invokes f for each page of results.
  47861. // A non-nil error returned from f will halt the iteration.
  47862. // The provided context supersedes any context provided to the Context method.
  47863. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  47864. c.ctx_ = ctx
  47865. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47866. for {
  47867. x, err := c.Do()
  47868. if err != nil {
  47869. return err
  47870. }
  47871. if err := f(x); err != nil {
  47872. return err
  47873. }
  47874. if x.NextPageToken == "" {
  47875. return nil
  47876. }
  47877. c.PageToken(x.NextPageToken)
  47878. }
  47879. }
  47880. // method id "compute.interconnectAttachments.patch":
  47881. type InterconnectAttachmentsPatchCall struct {
  47882. s *Service
  47883. project string
  47884. region string
  47885. interconnectAttachment string
  47886. interconnectattachment *InterconnectAttachment
  47887. urlParams_ gensupport.URLParams
  47888. ctx_ context.Context
  47889. header_ http.Header
  47890. }
  47891. // Patch: Updates the specified interconnect attachment with the data
  47892. // included in the request. This method supports PATCH semantics and
  47893. // uses the JSON merge patch format and processing rules.
  47894. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  47895. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47896. c.project = project
  47897. c.region = region
  47898. c.interconnectAttachment = interconnectAttachment
  47899. c.interconnectattachment = interconnectattachment
  47900. return c
  47901. }
  47902. // RequestId sets the optional parameter "requestId": An optional
  47903. // request ID to identify requests. Specify a unique request ID so that
  47904. // if you must retry your request, the server will know to ignore the
  47905. // request if it has already been completed.
  47906. //
  47907. // For example, consider a situation where you make an initial request
  47908. // and the request times out. If you make the request again with the
  47909. // same request ID, the server can check if original operation with the
  47910. // same request ID was received, and if so, will ignore the second
  47911. // request. This prevents clients from accidentally creating duplicate
  47912. // commitments.
  47913. //
  47914. // The request ID must be a valid UUID with the exception that zero UUID
  47915. // is not supported (00000000-0000-0000-0000-000000000000).
  47916. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  47917. c.urlParams_.Set("requestId", requestId)
  47918. return c
  47919. }
  47920. // Fields allows partial responses to be retrieved. See
  47921. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47922. // for more information.
  47923. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  47924. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47925. return c
  47926. }
  47927. // Context sets the context to be used in this call's Do method. Any
  47928. // pending HTTP request will be aborted if the provided context is
  47929. // canceled.
  47930. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  47931. c.ctx_ = ctx
  47932. return c
  47933. }
  47934. // Header returns an http.Header that can be modified by the caller to
  47935. // add HTTP headers to the request.
  47936. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  47937. if c.header_ == nil {
  47938. c.header_ = make(http.Header)
  47939. }
  47940. return c.header_
  47941. }
  47942. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  47943. reqHeaders := make(http.Header)
  47944. for k, v := range c.header_ {
  47945. reqHeaders[k] = v
  47946. }
  47947. reqHeaders.Set("User-Agent", c.s.userAgent())
  47948. var body io.Reader = nil
  47949. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  47950. if err != nil {
  47951. return nil, err
  47952. }
  47953. reqHeaders.Set("Content-Type", "application/json")
  47954. c.urlParams_.Set("alt", alt)
  47955. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  47956. urls += "?" + c.urlParams_.Encode()
  47957. req, _ := http.NewRequest("PATCH", urls, body)
  47958. req.Header = reqHeaders
  47959. googleapi.Expand(req.URL, map[string]string{
  47960. "project": c.project,
  47961. "region": c.region,
  47962. "interconnectAttachment": c.interconnectAttachment,
  47963. })
  47964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47965. }
  47966. // Do executes the "compute.interconnectAttachments.patch" call.
  47967. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47968. // status code is an error. Response headers are in either
  47969. // *Operation.ServerResponse.Header or (if a response was returned at
  47970. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47971. // to check whether the returned error was because
  47972. // http.StatusNotModified was returned.
  47973. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47974. gensupport.SetOptions(c.urlParams_, opts...)
  47975. res, err := c.doRequest("json")
  47976. if res != nil && res.StatusCode == http.StatusNotModified {
  47977. if res.Body != nil {
  47978. res.Body.Close()
  47979. }
  47980. return nil, &googleapi.Error{
  47981. Code: res.StatusCode,
  47982. Header: res.Header,
  47983. }
  47984. }
  47985. if err != nil {
  47986. return nil, err
  47987. }
  47988. defer googleapi.CloseBody(res)
  47989. if err := googleapi.CheckResponse(res); err != nil {
  47990. return nil, err
  47991. }
  47992. ret := &Operation{
  47993. ServerResponse: googleapi.ServerResponse{
  47994. Header: res.Header,
  47995. HTTPStatusCode: res.StatusCode,
  47996. },
  47997. }
  47998. target := &ret
  47999. if err := gensupport.DecodeResponse(target, res); err != nil {
  48000. return nil, err
  48001. }
  48002. return ret, nil
  48003. // {
  48004. // "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.",
  48005. // "httpMethod": "PATCH",
  48006. // "id": "compute.interconnectAttachments.patch",
  48007. // "parameterOrder": [
  48008. // "project",
  48009. // "region",
  48010. // "interconnectAttachment"
  48011. // ],
  48012. // "parameters": {
  48013. // "interconnectAttachment": {
  48014. // "description": "Name of the interconnect attachment to patch.",
  48015. // "location": "path",
  48016. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48017. // "required": true,
  48018. // "type": "string"
  48019. // },
  48020. // "project": {
  48021. // "description": "Project ID for this request.",
  48022. // "location": "path",
  48023. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48024. // "required": true,
  48025. // "type": "string"
  48026. // },
  48027. // "region": {
  48028. // "description": "Name of the region scoping this request.",
  48029. // "location": "path",
  48030. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48031. // "required": true,
  48032. // "type": "string"
  48033. // },
  48034. // "requestId": {
  48035. // "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).",
  48036. // "location": "query",
  48037. // "type": "string"
  48038. // }
  48039. // },
  48040. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  48041. // "request": {
  48042. // "$ref": "InterconnectAttachment"
  48043. // },
  48044. // "response": {
  48045. // "$ref": "Operation"
  48046. // },
  48047. // "scopes": [
  48048. // "https://www.googleapis.com/auth/cloud-platform",
  48049. // "https://www.googleapis.com/auth/compute"
  48050. // ]
  48051. // }
  48052. }
  48053. // method id "compute.interconnectLocations.get":
  48054. type InterconnectLocationsGetCall struct {
  48055. s *Service
  48056. project string
  48057. interconnectLocation string
  48058. urlParams_ gensupport.URLParams
  48059. ifNoneMatch_ string
  48060. ctx_ context.Context
  48061. header_ http.Header
  48062. }
  48063. // Get: Returns the details for the specified interconnect location.
  48064. // Gets a list of available interconnect locations by making a list()
  48065. // request.
  48066. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  48067. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48068. c.project = project
  48069. c.interconnectLocation = interconnectLocation
  48070. return c
  48071. }
  48072. // Fields allows partial responses to be retrieved. See
  48073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48074. // for more information.
  48075. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  48076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48077. return c
  48078. }
  48079. // IfNoneMatch sets the optional parameter which makes the operation
  48080. // fail if the object's ETag matches the given value. This is useful for
  48081. // getting updates only after the object has changed since the last
  48082. // request. Use googleapi.IsNotModified to check whether the response
  48083. // error from Do is the result of In-None-Match.
  48084. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  48085. c.ifNoneMatch_ = entityTag
  48086. return c
  48087. }
  48088. // Context sets the context to be used in this call's Do method. Any
  48089. // pending HTTP request will be aborted if the provided context is
  48090. // canceled.
  48091. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  48092. c.ctx_ = ctx
  48093. return c
  48094. }
  48095. // Header returns an http.Header that can be modified by the caller to
  48096. // add HTTP headers to the request.
  48097. func (c *InterconnectLocationsGetCall) Header() http.Header {
  48098. if c.header_ == nil {
  48099. c.header_ = make(http.Header)
  48100. }
  48101. return c.header_
  48102. }
  48103. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  48104. reqHeaders := make(http.Header)
  48105. for k, v := range c.header_ {
  48106. reqHeaders[k] = v
  48107. }
  48108. reqHeaders.Set("User-Agent", c.s.userAgent())
  48109. if c.ifNoneMatch_ != "" {
  48110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48111. }
  48112. var body io.Reader = nil
  48113. c.urlParams_.Set("alt", alt)
  48114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  48115. urls += "?" + c.urlParams_.Encode()
  48116. req, _ := http.NewRequest("GET", urls, body)
  48117. req.Header = reqHeaders
  48118. googleapi.Expand(req.URL, map[string]string{
  48119. "project": c.project,
  48120. "interconnectLocation": c.interconnectLocation,
  48121. })
  48122. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48123. }
  48124. // Do executes the "compute.interconnectLocations.get" call.
  48125. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  48126. // non-2xx status code is an error. Response headers are in either
  48127. // *InterconnectLocation.ServerResponse.Header or (if a response was
  48128. // returned at all) in error.(*googleapi.Error).Header. Use
  48129. // googleapi.IsNotModified to check whether the returned error was
  48130. // because http.StatusNotModified was returned.
  48131. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  48132. gensupport.SetOptions(c.urlParams_, opts...)
  48133. res, err := c.doRequest("json")
  48134. if res != nil && res.StatusCode == http.StatusNotModified {
  48135. if res.Body != nil {
  48136. res.Body.Close()
  48137. }
  48138. return nil, &googleapi.Error{
  48139. Code: res.StatusCode,
  48140. Header: res.Header,
  48141. }
  48142. }
  48143. if err != nil {
  48144. return nil, err
  48145. }
  48146. defer googleapi.CloseBody(res)
  48147. if err := googleapi.CheckResponse(res); err != nil {
  48148. return nil, err
  48149. }
  48150. ret := &InterconnectLocation{
  48151. ServerResponse: googleapi.ServerResponse{
  48152. Header: res.Header,
  48153. HTTPStatusCode: res.StatusCode,
  48154. },
  48155. }
  48156. target := &ret
  48157. if err := gensupport.DecodeResponse(target, res); err != nil {
  48158. return nil, err
  48159. }
  48160. return ret, nil
  48161. // {
  48162. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  48163. // "httpMethod": "GET",
  48164. // "id": "compute.interconnectLocations.get",
  48165. // "parameterOrder": [
  48166. // "project",
  48167. // "interconnectLocation"
  48168. // ],
  48169. // "parameters": {
  48170. // "interconnectLocation": {
  48171. // "description": "Name of the interconnect location to return.",
  48172. // "location": "path",
  48173. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48174. // "required": true,
  48175. // "type": "string"
  48176. // },
  48177. // "project": {
  48178. // "description": "Project ID for this request.",
  48179. // "location": "path",
  48180. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48181. // "required": true,
  48182. // "type": "string"
  48183. // }
  48184. // },
  48185. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  48186. // "response": {
  48187. // "$ref": "InterconnectLocation"
  48188. // },
  48189. // "scopes": [
  48190. // "https://www.googleapis.com/auth/cloud-platform",
  48191. // "https://www.googleapis.com/auth/compute",
  48192. // "https://www.googleapis.com/auth/compute.readonly"
  48193. // ]
  48194. // }
  48195. }
  48196. // method id "compute.interconnectLocations.list":
  48197. type InterconnectLocationsListCall struct {
  48198. s *Service
  48199. project string
  48200. urlParams_ gensupport.URLParams
  48201. ifNoneMatch_ string
  48202. ctx_ context.Context
  48203. header_ http.Header
  48204. }
  48205. // List: Retrieves the list of interconnect locations available to the
  48206. // specified project.
  48207. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  48208. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48209. c.project = project
  48210. return c
  48211. }
  48212. // Filter sets the optional parameter "filter": A filter expression that
  48213. // filters resources listed in the response. The expression must specify
  48214. // the field name, a comparison operator, and the value that you want to
  48215. // use for filtering. The value must be a string, a number, or a
  48216. // boolean. The comparison operator must be either =, !=, >, or <.
  48217. //
  48218. // For example, if you are filtering Compute Engine instances, you can
  48219. // exclude instances named example-instance by specifying name !=
  48220. // example-instance.
  48221. //
  48222. // You can also filter nested fields. For example, you could specify
  48223. // scheduling.automaticRestart = false to include instances only if they
  48224. // are not scheduled for automatic restarts. You can use filtering on
  48225. // nested fields to filter based on resource labels.
  48226. //
  48227. // To filter on multiple expressions, provide each separate expression
  48228. // within parentheses. For example, (scheduling.automaticRestart = true)
  48229. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48230. // AND expression. However, you can include AND and OR expressions
  48231. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48232. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48233. // true).
  48234. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  48235. c.urlParams_.Set("filter", filter)
  48236. return c
  48237. }
  48238. // MaxResults sets the optional parameter "maxResults": The maximum
  48239. // number of results per page that should be returned. If the number of
  48240. // available results is larger than maxResults, Compute Engine returns a
  48241. // nextPageToken that can be used to get the next page of results in
  48242. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48243. // (Default: 500)
  48244. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  48245. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48246. return c
  48247. }
  48248. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48249. // a certain order. By default, results are returned in alphanumerical
  48250. // order based on the resource name.
  48251. //
  48252. // You can also sort results in descending order based on the creation
  48253. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48254. // based on the creationTimestamp field in reverse chronological order
  48255. // (newest result first). Use this to sort resources like operations so
  48256. // that the newest operation is returned first.
  48257. //
  48258. // Currently, only sorting by name or creationTimestamp desc is
  48259. // supported.
  48260. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  48261. c.urlParams_.Set("orderBy", orderBy)
  48262. return c
  48263. }
  48264. // PageToken sets the optional parameter "pageToken": Specifies a page
  48265. // token to use. Set pageToken to the nextPageToken returned by a
  48266. // previous list request to get the next page of results.
  48267. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  48268. c.urlParams_.Set("pageToken", pageToken)
  48269. return c
  48270. }
  48271. // Fields allows partial responses to be retrieved. See
  48272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48273. // for more information.
  48274. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  48275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48276. return c
  48277. }
  48278. // IfNoneMatch sets the optional parameter which makes the operation
  48279. // fail if the object's ETag matches the given value. This is useful for
  48280. // getting updates only after the object has changed since the last
  48281. // request. Use googleapi.IsNotModified to check whether the response
  48282. // error from Do is the result of In-None-Match.
  48283. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  48284. c.ifNoneMatch_ = entityTag
  48285. return c
  48286. }
  48287. // Context sets the context to be used in this call's Do method. Any
  48288. // pending HTTP request will be aborted if the provided context is
  48289. // canceled.
  48290. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  48291. c.ctx_ = ctx
  48292. return c
  48293. }
  48294. // Header returns an http.Header that can be modified by the caller to
  48295. // add HTTP headers to the request.
  48296. func (c *InterconnectLocationsListCall) Header() http.Header {
  48297. if c.header_ == nil {
  48298. c.header_ = make(http.Header)
  48299. }
  48300. return c.header_
  48301. }
  48302. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  48303. reqHeaders := make(http.Header)
  48304. for k, v := range c.header_ {
  48305. reqHeaders[k] = v
  48306. }
  48307. reqHeaders.Set("User-Agent", c.s.userAgent())
  48308. if c.ifNoneMatch_ != "" {
  48309. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48310. }
  48311. var body io.Reader = nil
  48312. c.urlParams_.Set("alt", alt)
  48313. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  48314. urls += "?" + c.urlParams_.Encode()
  48315. req, _ := http.NewRequest("GET", urls, body)
  48316. req.Header = reqHeaders
  48317. googleapi.Expand(req.URL, map[string]string{
  48318. "project": c.project,
  48319. })
  48320. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48321. }
  48322. // Do executes the "compute.interconnectLocations.list" call.
  48323. // Exactly one of *InterconnectLocationList or error will be non-nil.
  48324. // Any non-2xx status code is an error. Response headers are in either
  48325. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  48326. // returned at all) in error.(*googleapi.Error).Header. Use
  48327. // googleapi.IsNotModified to check whether the returned error was
  48328. // because http.StatusNotModified was returned.
  48329. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  48330. gensupport.SetOptions(c.urlParams_, opts...)
  48331. res, err := c.doRequest("json")
  48332. if res != nil && res.StatusCode == http.StatusNotModified {
  48333. if res.Body != nil {
  48334. res.Body.Close()
  48335. }
  48336. return nil, &googleapi.Error{
  48337. Code: res.StatusCode,
  48338. Header: res.Header,
  48339. }
  48340. }
  48341. if err != nil {
  48342. return nil, err
  48343. }
  48344. defer googleapi.CloseBody(res)
  48345. if err := googleapi.CheckResponse(res); err != nil {
  48346. return nil, err
  48347. }
  48348. ret := &InterconnectLocationList{
  48349. ServerResponse: googleapi.ServerResponse{
  48350. Header: res.Header,
  48351. HTTPStatusCode: res.StatusCode,
  48352. },
  48353. }
  48354. target := &ret
  48355. if err := gensupport.DecodeResponse(target, res); err != nil {
  48356. return nil, err
  48357. }
  48358. return ret, nil
  48359. // {
  48360. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  48361. // "httpMethod": "GET",
  48362. // "id": "compute.interconnectLocations.list",
  48363. // "parameterOrder": [
  48364. // "project"
  48365. // ],
  48366. // "parameters": {
  48367. // "filter": {
  48368. // "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).",
  48369. // "location": "query",
  48370. // "type": "string"
  48371. // },
  48372. // "maxResults": {
  48373. // "default": "500",
  48374. // "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)",
  48375. // "format": "uint32",
  48376. // "location": "query",
  48377. // "minimum": "0",
  48378. // "type": "integer"
  48379. // },
  48380. // "orderBy": {
  48381. // "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.",
  48382. // "location": "query",
  48383. // "type": "string"
  48384. // },
  48385. // "pageToken": {
  48386. // "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.",
  48387. // "location": "query",
  48388. // "type": "string"
  48389. // },
  48390. // "project": {
  48391. // "description": "Project ID for this request.",
  48392. // "location": "path",
  48393. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48394. // "required": true,
  48395. // "type": "string"
  48396. // }
  48397. // },
  48398. // "path": "{project}/global/interconnectLocations",
  48399. // "response": {
  48400. // "$ref": "InterconnectLocationList"
  48401. // },
  48402. // "scopes": [
  48403. // "https://www.googleapis.com/auth/cloud-platform",
  48404. // "https://www.googleapis.com/auth/compute",
  48405. // "https://www.googleapis.com/auth/compute.readonly"
  48406. // ]
  48407. // }
  48408. }
  48409. // Pages invokes f for each page of results.
  48410. // A non-nil error returned from f will halt the iteration.
  48411. // The provided context supersedes any context provided to the Context method.
  48412. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  48413. c.ctx_ = ctx
  48414. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48415. for {
  48416. x, err := c.Do()
  48417. if err != nil {
  48418. return err
  48419. }
  48420. if err := f(x); err != nil {
  48421. return err
  48422. }
  48423. if x.NextPageToken == "" {
  48424. return nil
  48425. }
  48426. c.PageToken(x.NextPageToken)
  48427. }
  48428. }
  48429. // method id "compute.interconnects.delete":
  48430. type InterconnectsDeleteCall struct {
  48431. s *Service
  48432. project string
  48433. interconnect string
  48434. urlParams_ gensupport.URLParams
  48435. ctx_ context.Context
  48436. header_ http.Header
  48437. }
  48438. // Delete: Deletes the specified interconnect.
  48439. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  48440. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48441. c.project = project
  48442. c.interconnect = interconnect
  48443. return c
  48444. }
  48445. // RequestId sets the optional parameter "requestId": An optional
  48446. // request ID to identify requests. Specify a unique request ID so that
  48447. // if you must retry your request, the server will know to ignore the
  48448. // request if it has already been completed.
  48449. //
  48450. // For example, consider a situation where you make an initial request
  48451. // and the request times out. If you make the request again with the
  48452. // same request ID, the server can check if original operation with the
  48453. // same request ID was received, and if so, will ignore the second
  48454. // request. This prevents clients from accidentally creating duplicate
  48455. // commitments.
  48456. //
  48457. // The request ID must be a valid UUID with the exception that zero UUID
  48458. // is not supported (00000000-0000-0000-0000-000000000000).
  48459. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  48460. c.urlParams_.Set("requestId", requestId)
  48461. return c
  48462. }
  48463. // Fields allows partial responses to be retrieved. See
  48464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48465. // for more information.
  48466. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  48467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48468. return c
  48469. }
  48470. // Context sets the context to be used in this call's Do method. Any
  48471. // pending HTTP request will be aborted if the provided context is
  48472. // canceled.
  48473. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  48474. c.ctx_ = ctx
  48475. return c
  48476. }
  48477. // Header returns an http.Header that can be modified by the caller to
  48478. // add HTTP headers to the request.
  48479. func (c *InterconnectsDeleteCall) Header() http.Header {
  48480. if c.header_ == nil {
  48481. c.header_ = make(http.Header)
  48482. }
  48483. return c.header_
  48484. }
  48485. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  48486. reqHeaders := make(http.Header)
  48487. for k, v := range c.header_ {
  48488. reqHeaders[k] = v
  48489. }
  48490. reqHeaders.Set("User-Agent", c.s.userAgent())
  48491. var body io.Reader = nil
  48492. c.urlParams_.Set("alt", alt)
  48493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  48494. urls += "?" + c.urlParams_.Encode()
  48495. req, _ := http.NewRequest("DELETE", urls, body)
  48496. req.Header = reqHeaders
  48497. googleapi.Expand(req.URL, map[string]string{
  48498. "project": c.project,
  48499. "interconnect": c.interconnect,
  48500. })
  48501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48502. }
  48503. // Do executes the "compute.interconnects.delete" call.
  48504. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48505. // status code is an error. Response headers are in either
  48506. // *Operation.ServerResponse.Header or (if a response was returned at
  48507. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48508. // to check whether the returned error was because
  48509. // http.StatusNotModified was returned.
  48510. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48511. gensupport.SetOptions(c.urlParams_, opts...)
  48512. res, err := c.doRequest("json")
  48513. if res != nil && res.StatusCode == http.StatusNotModified {
  48514. if res.Body != nil {
  48515. res.Body.Close()
  48516. }
  48517. return nil, &googleapi.Error{
  48518. Code: res.StatusCode,
  48519. Header: res.Header,
  48520. }
  48521. }
  48522. if err != nil {
  48523. return nil, err
  48524. }
  48525. defer googleapi.CloseBody(res)
  48526. if err := googleapi.CheckResponse(res); err != nil {
  48527. return nil, err
  48528. }
  48529. ret := &Operation{
  48530. ServerResponse: googleapi.ServerResponse{
  48531. Header: res.Header,
  48532. HTTPStatusCode: res.StatusCode,
  48533. },
  48534. }
  48535. target := &ret
  48536. if err := gensupport.DecodeResponse(target, res); err != nil {
  48537. return nil, err
  48538. }
  48539. return ret, nil
  48540. // {
  48541. // "description": "Deletes the specified interconnect.",
  48542. // "httpMethod": "DELETE",
  48543. // "id": "compute.interconnects.delete",
  48544. // "parameterOrder": [
  48545. // "project",
  48546. // "interconnect"
  48547. // ],
  48548. // "parameters": {
  48549. // "interconnect": {
  48550. // "description": "Name of the interconnect to delete.",
  48551. // "location": "path",
  48552. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48553. // "required": true,
  48554. // "type": "string"
  48555. // },
  48556. // "project": {
  48557. // "description": "Project ID for this request.",
  48558. // "location": "path",
  48559. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48560. // "required": true,
  48561. // "type": "string"
  48562. // },
  48563. // "requestId": {
  48564. // "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).",
  48565. // "location": "query",
  48566. // "type": "string"
  48567. // }
  48568. // },
  48569. // "path": "{project}/global/interconnects/{interconnect}",
  48570. // "response": {
  48571. // "$ref": "Operation"
  48572. // },
  48573. // "scopes": [
  48574. // "https://www.googleapis.com/auth/cloud-platform",
  48575. // "https://www.googleapis.com/auth/compute"
  48576. // ]
  48577. // }
  48578. }
  48579. // method id "compute.interconnects.get":
  48580. type InterconnectsGetCall struct {
  48581. s *Service
  48582. project string
  48583. interconnect string
  48584. urlParams_ gensupport.URLParams
  48585. ifNoneMatch_ string
  48586. ctx_ context.Context
  48587. header_ http.Header
  48588. }
  48589. // Get: Returns the specified interconnect. Get a list of available
  48590. // interconnects by making a list() request.
  48591. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  48592. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48593. c.project = project
  48594. c.interconnect = interconnect
  48595. return c
  48596. }
  48597. // Fields allows partial responses to be retrieved. See
  48598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48599. // for more information.
  48600. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  48601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48602. return c
  48603. }
  48604. // IfNoneMatch sets the optional parameter which makes the operation
  48605. // fail if the object's ETag matches the given value. This is useful for
  48606. // getting updates only after the object has changed since the last
  48607. // request. Use googleapi.IsNotModified to check whether the response
  48608. // error from Do is the result of In-None-Match.
  48609. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  48610. c.ifNoneMatch_ = entityTag
  48611. return c
  48612. }
  48613. // Context sets the context to be used in this call's Do method. Any
  48614. // pending HTTP request will be aborted if the provided context is
  48615. // canceled.
  48616. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  48617. c.ctx_ = ctx
  48618. return c
  48619. }
  48620. // Header returns an http.Header that can be modified by the caller to
  48621. // add HTTP headers to the request.
  48622. func (c *InterconnectsGetCall) Header() http.Header {
  48623. if c.header_ == nil {
  48624. c.header_ = make(http.Header)
  48625. }
  48626. return c.header_
  48627. }
  48628. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  48629. reqHeaders := make(http.Header)
  48630. for k, v := range c.header_ {
  48631. reqHeaders[k] = v
  48632. }
  48633. reqHeaders.Set("User-Agent", c.s.userAgent())
  48634. if c.ifNoneMatch_ != "" {
  48635. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48636. }
  48637. var body io.Reader = nil
  48638. c.urlParams_.Set("alt", alt)
  48639. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  48640. urls += "?" + c.urlParams_.Encode()
  48641. req, _ := http.NewRequest("GET", urls, body)
  48642. req.Header = reqHeaders
  48643. googleapi.Expand(req.URL, map[string]string{
  48644. "project": c.project,
  48645. "interconnect": c.interconnect,
  48646. })
  48647. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48648. }
  48649. // Do executes the "compute.interconnects.get" call.
  48650. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  48651. // status code is an error. Response headers are in either
  48652. // *Interconnect.ServerResponse.Header or (if a response was returned at
  48653. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48654. // to check whether the returned error was because
  48655. // http.StatusNotModified was returned.
  48656. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  48657. gensupport.SetOptions(c.urlParams_, opts...)
  48658. res, err := c.doRequest("json")
  48659. if res != nil && res.StatusCode == http.StatusNotModified {
  48660. if res.Body != nil {
  48661. res.Body.Close()
  48662. }
  48663. return nil, &googleapi.Error{
  48664. Code: res.StatusCode,
  48665. Header: res.Header,
  48666. }
  48667. }
  48668. if err != nil {
  48669. return nil, err
  48670. }
  48671. defer googleapi.CloseBody(res)
  48672. if err := googleapi.CheckResponse(res); err != nil {
  48673. return nil, err
  48674. }
  48675. ret := &Interconnect{
  48676. ServerResponse: googleapi.ServerResponse{
  48677. Header: res.Header,
  48678. HTTPStatusCode: res.StatusCode,
  48679. },
  48680. }
  48681. target := &ret
  48682. if err := gensupport.DecodeResponse(target, res); err != nil {
  48683. return nil, err
  48684. }
  48685. return ret, nil
  48686. // {
  48687. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  48688. // "httpMethod": "GET",
  48689. // "id": "compute.interconnects.get",
  48690. // "parameterOrder": [
  48691. // "project",
  48692. // "interconnect"
  48693. // ],
  48694. // "parameters": {
  48695. // "interconnect": {
  48696. // "description": "Name of the interconnect to return.",
  48697. // "location": "path",
  48698. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48699. // "required": true,
  48700. // "type": "string"
  48701. // },
  48702. // "project": {
  48703. // "description": "Project ID for this request.",
  48704. // "location": "path",
  48705. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48706. // "required": true,
  48707. // "type": "string"
  48708. // }
  48709. // },
  48710. // "path": "{project}/global/interconnects/{interconnect}",
  48711. // "response": {
  48712. // "$ref": "Interconnect"
  48713. // },
  48714. // "scopes": [
  48715. // "https://www.googleapis.com/auth/cloud-platform",
  48716. // "https://www.googleapis.com/auth/compute",
  48717. // "https://www.googleapis.com/auth/compute.readonly"
  48718. // ]
  48719. // }
  48720. }
  48721. // method id "compute.interconnects.insert":
  48722. type InterconnectsInsertCall struct {
  48723. s *Service
  48724. project string
  48725. interconnect *Interconnect
  48726. urlParams_ gensupport.URLParams
  48727. ctx_ context.Context
  48728. header_ http.Header
  48729. }
  48730. // Insert: Creates a Interconnect in the specified project using the
  48731. // data included in the request.
  48732. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  48733. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48734. c.project = project
  48735. c.interconnect = interconnect
  48736. return c
  48737. }
  48738. // RequestId sets the optional parameter "requestId": An optional
  48739. // request ID to identify requests. Specify a unique request ID so that
  48740. // if you must retry your request, the server will know to ignore the
  48741. // request if it has already been completed.
  48742. //
  48743. // For example, consider a situation where you make an initial request
  48744. // and the request times out. If you make the request again with the
  48745. // same request ID, the server can check if original operation with the
  48746. // same request ID was received, and if so, will ignore the second
  48747. // request. This prevents clients from accidentally creating duplicate
  48748. // commitments.
  48749. //
  48750. // The request ID must be a valid UUID with the exception that zero UUID
  48751. // is not supported (00000000-0000-0000-0000-000000000000).
  48752. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  48753. c.urlParams_.Set("requestId", requestId)
  48754. return c
  48755. }
  48756. // Fields allows partial responses to be retrieved. See
  48757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48758. // for more information.
  48759. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  48760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48761. return c
  48762. }
  48763. // Context sets the context to be used in this call's Do method. Any
  48764. // pending HTTP request will be aborted if the provided context is
  48765. // canceled.
  48766. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  48767. c.ctx_ = ctx
  48768. return c
  48769. }
  48770. // Header returns an http.Header that can be modified by the caller to
  48771. // add HTTP headers to the request.
  48772. func (c *InterconnectsInsertCall) Header() http.Header {
  48773. if c.header_ == nil {
  48774. c.header_ = make(http.Header)
  48775. }
  48776. return c.header_
  48777. }
  48778. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  48779. reqHeaders := make(http.Header)
  48780. for k, v := range c.header_ {
  48781. reqHeaders[k] = v
  48782. }
  48783. reqHeaders.Set("User-Agent", c.s.userAgent())
  48784. var body io.Reader = nil
  48785. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  48786. if err != nil {
  48787. return nil, err
  48788. }
  48789. reqHeaders.Set("Content-Type", "application/json")
  48790. c.urlParams_.Set("alt", alt)
  48791. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  48792. urls += "?" + c.urlParams_.Encode()
  48793. req, _ := http.NewRequest("POST", urls, body)
  48794. req.Header = reqHeaders
  48795. googleapi.Expand(req.URL, map[string]string{
  48796. "project": c.project,
  48797. })
  48798. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48799. }
  48800. // Do executes the "compute.interconnects.insert" call.
  48801. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48802. // status code is an error. Response headers are in either
  48803. // *Operation.ServerResponse.Header or (if a response was returned at
  48804. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48805. // to check whether the returned error was because
  48806. // http.StatusNotModified was returned.
  48807. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48808. gensupport.SetOptions(c.urlParams_, opts...)
  48809. res, err := c.doRequest("json")
  48810. if res != nil && res.StatusCode == http.StatusNotModified {
  48811. if res.Body != nil {
  48812. res.Body.Close()
  48813. }
  48814. return nil, &googleapi.Error{
  48815. Code: res.StatusCode,
  48816. Header: res.Header,
  48817. }
  48818. }
  48819. if err != nil {
  48820. return nil, err
  48821. }
  48822. defer googleapi.CloseBody(res)
  48823. if err := googleapi.CheckResponse(res); err != nil {
  48824. return nil, err
  48825. }
  48826. ret := &Operation{
  48827. ServerResponse: googleapi.ServerResponse{
  48828. Header: res.Header,
  48829. HTTPStatusCode: res.StatusCode,
  48830. },
  48831. }
  48832. target := &ret
  48833. if err := gensupport.DecodeResponse(target, res); err != nil {
  48834. return nil, err
  48835. }
  48836. return ret, nil
  48837. // {
  48838. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  48839. // "httpMethod": "POST",
  48840. // "id": "compute.interconnects.insert",
  48841. // "parameterOrder": [
  48842. // "project"
  48843. // ],
  48844. // "parameters": {
  48845. // "project": {
  48846. // "description": "Project ID for this request.",
  48847. // "location": "path",
  48848. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48849. // "required": true,
  48850. // "type": "string"
  48851. // },
  48852. // "requestId": {
  48853. // "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).",
  48854. // "location": "query",
  48855. // "type": "string"
  48856. // }
  48857. // },
  48858. // "path": "{project}/global/interconnects",
  48859. // "request": {
  48860. // "$ref": "Interconnect"
  48861. // },
  48862. // "response": {
  48863. // "$ref": "Operation"
  48864. // },
  48865. // "scopes": [
  48866. // "https://www.googleapis.com/auth/cloud-platform",
  48867. // "https://www.googleapis.com/auth/compute"
  48868. // ]
  48869. // }
  48870. }
  48871. // method id "compute.interconnects.list":
  48872. type InterconnectsListCall struct {
  48873. s *Service
  48874. project string
  48875. urlParams_ gensupport.URLParams
  48876. ifNoneMatch_ string
  48877. ctx_ context.Context
  48878. header_ http.Header
  48879. }
  48880. // List: Retrieves the list of interconnect available to the specified
  48881. // project.
  48882. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  48883. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48884. c.project = project
  48885. return c
  48886. }
  48887. // Filter sets the optional parameter "filter": A filter expression that
  48888. // filters resources listed in the response. The expression must specify
  48889. // the field name, a comparison operator, and the value that you want to
  48890. // use for filtering. The value must be a string, a number, or a
  48891. // boolean. The comparison operator must be either =, !=, >, or <.
  48892. //
  48893. // For example, if you are filtering Compute Engine instances, you can
  48894. // exclude instances named example-instance by specifying name !=
  48895. // example-instance.
  48896. //
  48897. // You can also filter nested fields. For example, you could specify
  48898. // scheduling.automaticRestart = false to include instances only if they
  48899. // are not scheduled for automatic restarts. You can use filtering on
  48900. // nested fields to filter based on resource labels.
  48901. //
  48902. // To filter on multiple expressions, provide each separate expression
  48903. // within parentheses. For example, (scheduling.automaticRestart = true)
  48904. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48905. // AND expression. However, you can include AND and OR expressions
  48906. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48907. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48908. // true).
  48909. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  48910. c.urlParams_.Set("filter", filter)
  48911. return c
  48912. }
  48913. // MaxResults sets the optional parameter "maxResults": The maximum
  48914. // number of results per page that should be returned. If the number of
  48915. // available results is larger than maxResults, Compute Engine returns a
  48916. // nextPageToken that can be used to get the next page of results in
  48917. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48918. // (Default: 500)
  48919. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  48920. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48921. return c
  48922. }
  48923. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48924. // a certain order. By default, results are returned in alphanumerical
  48925. // order based on the resource name.
  48926. //
  48927. // You can also sort results in descending order based on the creation
  48928. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48929. // based on the creationTimestamp field in reverse chronological order
  48930. // (newest result first). Use this to sort resources like operations so
  48931. // that the newest operation is returned first.
  48932. //
  48933. // Currently, only sorting by name or creationTimestamp desc is
  48934. // supported.
  48935. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  48936. c.urlParams_.Set("orderBy", orderBy)
  48937. return c
  48938. }
  48939. // PageToken sets the optional parameter "pageToken": Specifies a page
  48940. // token to use. Set pageToken to the nextPageToken returned by a
  48941. // previous list request to get the next page of results.
  48942. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  48943. c.urlParams_.Set("pageToken", pageToken)
  48944. return c
  48945. }
  48946. // Fields allows partial responses to be retrieved. See
  48947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48948. // for more information.
  48949. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  48950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48951. return c
  48952. }
  48953. // IfNoneMatch sets the optional parameter which makes the operation
  48954. // fail if the object's ETag matches the given value. This is useful for
  48955. // getting updates only after the object has changed since the last
  48956. // request. Use googleapi.IsNotModified to check whether the response
  48957. // error from Do is the result of In-None-Match.
  48958. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  48959. c.ifNoneMatch_ = entityTag
  48960. return c
  48961. }
  48962. // Context sets the context to be used in this call's Do method. Any
  48963. // pending HTTP request will be aborted if the provided context is
  48964. // canceled.
  48965. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  48966. c.ctx_ = ctx
  48967. return c
  48968. }
  48969. // Header returns an http.Header that can be modified by the caller to
  48970. // add HTTP headers to the request.
  48971. func (c *InterconnectsListCall) Header() http.Header {
  48972. if c.header_ == nil {
  48973. c.header_ = make(http.Header)
  48974. }
  48975. return c.header_
  48976. }
  48977. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  48978. reqHeaders := make(http.Header)
  48979. for k, v := range c.header_ {
  48980. reqHeaders[k] = v
  48981. }
  48982. reqHeaders.Set("User-Agent", c.s.userAgent())
  48983. if c.ifNoneMatch_ != "" {
  48984. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48985. }
  48986. var body io.Reader = nil
  48987. c.urlParams_.Set("alt", alt)
  48988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  48989. urls += "?" + c.urlParams_.Encode()
  48990. req, _ := http.NewRequest("GET", urls, body)
  48991. req.Header = reqHeaders
  48992. googleapi.Expand(req.URL, map[string]string{
  48993. "project": c.project,
  48994. })
  48995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48996. }
  48997. // Do executes the "compute.interconnects.list" call.
  48998. // Exactly one of *InterconnectList or error will be non-nil. Any
  48999. // non-2xx status code is an error. Response headers are in either
  49000. // *InterconnectList.ServerResponse.Header or (if a response was
  49001. // returned at all) in error.(*googleapi.Error).Header. Use
  49002. // googleapi.IsNotModified to check whether the returned error was
  49003. // because http.StatusNotModified was returned.
  49004. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  49005. gensupport.SetOptions(c.urlParams_, opts...)
  49006. res, err := c.doRequest("json")
  49007. if res != nil && res.StatusCode == http.StatusNotModified {
  49008. if res.Body != nil {
  49009. res.Body.Close()
  49010. }
  49011. return nil, &googleapi.Error{
  49012. Code: res.StatusCode,
  49013. Header: res.Header,
  49014. }
  49015. }
  49016. if err != nil {
  49017. return nil, err
  49018. }
  49019. defer googleapi.CloseBody(res)
  49020. if err := googleapi.CheckResponse(res); err != nil {
  49021. return nil, err
  49022. }
  49023. ret := &InterconnectList{
  49024. ServerResponse: googleapi.ServerResponse{
  49025. Header: res.Header,
  49026. HTTPStatusCode: res.StatusCode,
  49027. },
  49028. }
  49029. target := &ret
  49030. if err := gensupport.DecodeResponse(target, res); err != nil {
  49031. return nil, err
  49032. }
  49033. return ret, nil
  49034. // {
  49035. // "description": "Retrieves the list of interconnect available to the specified project.",
  49036. // "httpMethod": "GET",
  49037. // "id": "compute.interconnects.list",
  49038. // "parameterOrder": [
  49039. // "project"
  49040. // ],
  49041. // "parameters": {
  49042. // "filter": {
  49043. // "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).",
  49044. // "location": "query",
  49045. // "type": "string"
  49046. // },
  49047. // "maxResults": {
  49048. // "default": "500",
  49049. // "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)",
  49050. // "format": "uint32",
  49051. // "location": "query",
  49052. // "minimum": "0",
  49053. // "type": "integer"
  49054. // },
  49055. // "orderBy": {
  49056. // "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.",
  49057. // "location": "query",
  49058. // "type": "string"
  49059. // },
  49060. // "pageToken": {
  49061. // "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.",
  49062. // "location": "query",
  49063. // "type": "string"
  49064. // },
  49065. // "project": {
  49066. // "description": "Project ID for this request.",
  49067. // "location": "path",
  49068. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49069. // "required": true,
  49070. // "type": "string"
  49071. // }
  49072. // },
  49073. // "path": "{project}/global/interconnects",
  49074. // "response": {
  49075. // "$ref": "InterconnectList"
  49076. // },
  49077. // "scopes": [
  49078. // "https://www.googleapis.com/auth/cloud-platform",
  49079. // "https://www.googleapis.com/auth/compute",
  49080. // "https://www.googleapis.com/auth/compute.readonly"
  49081. // ]
  49082. // }
  49083. }
  49084. // Pages invokes f for each page of results.
  49085. // A non-nil error returned from f will halt the iteration.
  49086. // The provided context supersedes any context provided to the Context method.
  49087. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  49088. c.ctx_ = ctx
  49089. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49090. for {
  49091. x, err := c.Do()
  49092. if err != nil {
  49093. return err
  49094. }
  49095. if err := f(x); err != nil {
  49096. return err
  49097. }
  49098. if x.NextPageToken == "" {
  49099. return nil
  49100. }
  49101. c.PageToken(x.NextPageToken)
  49102. }
  49103. }
  49104. // method id "compute.interconnects.patch":
  49105. type InterconnectsPatchCall struct {
  49106. s *Service
  49107. project string
  49108. interconnect string
  49109. interconnect2 *Interconnect
  49110. urlParams_ gensupport.URLParams
  49111. ctx_ context.Context
  49112. header_ http.Header
  49113. }
  49114. // Patch: Updates the specified interconnect with the data included in
  49115. // the request. This method supports PATCH semantics and uses the JSON
  49116. // merge patch format and processing rules.
  49117. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  49118. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49119. c.project = project
  49120. c.interconnect = interconnect
  49121. c.interconnect2 = interconnect2
  49122. return c
  49123. }
  49124. // RequestId sets the optional parameter "requestId": An optional
  49125. // request ID to identify requests. Specify a unique request ID so that
  49126. // if you must retry your request, the server will know to ignore the
  49127. // request if it has already been completed.
  49128. //
  49129. // For example, consider a situation where you make an initial request
  49130. // and the request times out. If you make the request again with the
  49131. // same request ID, the server can check if original operation with the
  49132. // same request ID was received, and if so, will ignore the second
  49133. // request. This prevents clients from accidentally creating duplicate
  49134. // commitments.
  49135. //
  49136. // The request ID must be a valid UUID with the exception that zero UUID
  49137. // is not supported (00000000-0000-0000-0000-000000000000).
  49138. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  49139. c.urlParams_.Set("requestId", requestId)
  49140. return c
  49141. }
  49142. // Fields allows partial responses to be retrieved. See
  49143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49144. // for more information.
  49145. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  49146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49147. return c
  49148. }
  49149. // Context sets the context to be used in this call's Do method. Any
  49150. // pending HTTP request will be aborted if the provided context is
  49151. // canceled.
  49152. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  49153. c.ctx_ = ctx
  49154. return c
  49155. }
  49156. // Header returns an http.Header that can be modified by the caller to
  49157. // add HTTP headers to the request.
  49158. func (c *InterconnectsPatchCall) Header() http.Header {
  49159. if c.header_ == nil {
  49160. c.header_ = make(http.Header)
  49161. }
  49162. return c.header_
  49163. }
  49164. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  49165. reqHeaders := make(http.Header)
  49166. for k, v := range c.header_ {
  49167. reqHeaders[k] = v
  49168. }
  49169. reqHeaders.Set("User-Agent", c.s.userAgent())
  49170. var body io.Reader = nil
  49171. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  49172. if err != nil {
  49173. return nil, err
  49174. }
  49175. reqHeaders.Set("Content-Type", "application/json")
  49176. c.urlParams_.Set("alt", alt)
  49177. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  49178. urls += "?" + c.urlParams_.Encode()
  49179. req, _ := http.NewRequest("PATCH", urls, body)
  49180. req.Header = reqHeaders
  49181. googleapi.Expand(req.URL, map[string]string{
  49182. "project": c.project,
  49183. "interconnect": c.interconnect,
  49184. })
  49185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49186. }
  49187. // Do executes the "compute.interconnects.patch" call.
  49188. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49189. // status code is an error. Response headers are in either
  49190. // *Operation.ServerResponse.Header or (if a response was returned at
  49191. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49192. // to check whether the returned error was because
  49193. // http.StatusNotModified was returned.
  49194. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49195. gensupport.SetOptions(c.urlParams_, opts...)
  49196. res, err := c.doRequest("json")
  49197. if res != nil && res.StatusCode == http.StatusNotModified {
  49198. if res.Body != nil {
  49199. res.Body.Close()
  49200. }
  49201. return nil, &googleapi.Error{
  49202. Code: res.StatusCode,
  49203. Header: res.Header,
  49204. }
  49205. }
  49206. if err != nil {
  49207. return nil, err
  49208. }
  49209. defer googleapi.CloseBody(res)
  49210. if err := googleapi.CheckResponse(res); err != nil {
  49211. return nil, err
  49212. }
  49213. ret := &Operation{
  49214. ServerResponse: googleapi.ServerResponse{
  49215. Header: res.Header,
  49216. HTTPStatusCode: res.StatusCode,
  49217. },
  49218. }
  49219. target := &ret
  49220. if err := gensupport.DecodeResponse(target, res); err != nil {
  49221. return nil, err
  49222. }
  49223. return ret, nil
  49224. // {
  49225. // "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.",
  49226. // "httpMethod": "PATCH",
  49227. // "id": "compute.interconnects.patch",
  49228. // "parameterOrder": [
  49229. // "project",
  49230. // "interconnect"
  49231. // ],
  49232. // "parameters": {
  49233. // "interconnect": {
  49234. // "description": "Name of the interconnect to update.",
  49235. // "location": "path",
  49236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49237. // "required": true,
  49238. // "type": "string"
  49239. // },
  49240. // "project": {
  49241. // "description": "Project ID for this request.",
  49242. // "location": "path",
  49243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49244. // "required": true,
  49245. // "type": "string"
  49246. // },
  49247. // "requestId": {
  49248. // "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).",
  49249. // "location": "query",
  49250. // "type": "string"
  49251. // }
  49252. // },
  49253. // "path": "{project}/global/interconnects/{interconnect}",
  49254. // "request": {
  49255. // "$ref": "Interconnect"
  49256. // },
  49257. // "response": {
  49258. // "$ref": "Operation"
  49259. // },
  49260. // "scopes": [
  49261. // "https://www.googleapis.com/auth/cloud-platform",
  49262. // "https://www.googleapis.com/auth/compute"
  49263. // ]
  49264. // }
  49265. }
  49266. // method id "compute.licenseCodes.get":
  49267. type LicenseCodesGetCall struct {
  49268. s *Service
  49269. project string
  49270. licenseCode string
  49271. urlParams_ gensupport.URLParams
  49272. ifNoneMatch_ string
  49273. ctx_ context.Context
  49274. header_ http.Header
  49275. }
  49276. // Get: Return a specified license code. License codes are mirrored
  49277. // across all projects that have permissions to read the License Code.
  49278. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  49279. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49280. c.project = project
  49281. c.licenseCode = licenseCode
  49282. return c
  49283. }
  49284. // Fields allows partial responses to be retrieved. See
  49285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49286. // for more information.
  49287. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  49288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49289. return c
  49290. }
  49291. // IfNoneMatch sets the optional parameter which makes the operation
  49292. // fail if the object's ETag matches the given value. This is useful for
  49293. // getting updates only after the object has changed since the last
  49294. // request. Use googleapi.IsNotModified to check whether the response
  49295. // error from Do is the result of In-None-Match.
  49296. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  49297. c.ifNoneMatch_ = entityTag
  49298. return c
  49299. }
  49300. // Context sets the context to be used in this call's Do method. Any
  49301. // pending HTTP request will be aborted if the provided context is
  49302. // canceled.
  49303. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  49304. c.ctx_ = ctx
  49305. return c
  49306. }
  49307. // Header returns an http.Header that can be modified by the caller to
  49308. // add HTTP headers to the request.
  49309. func (c *LicenseCodesGetCall) Header() http.Header {
  49310. if c.header_ == nil {
  49311. c.header_ = make(http.Header)
  49312. }
  49313. return c.header_
  49314. }
  49315. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  49316. reqHeaders := make(http.Header)
  49317. for k, v := range c.header_ {
  49318. reqHeaders[k] = v
  49319. }
  49320. reqHeaders.Set("User-Agent", c.s.userAgent())
  49321. if c.ifNoneMatch_ != "" {
  49322. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49323. }
  49324. var body io.Reader = nil
  49325. c.urlParams_.Set("alt", alt)
  49326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  49327. urls += "?" + c.urlParams_.Encode()
  49328. req, _ := http.NewRequest("GET", urls, body)
  49329. req.Header = reqHeaders
  49330. googleapi.Expand(req.URL, map[string]string{
  49331. "project": c.project,
  49332. "licenseCode": c.licenseCode,
  49333. })
  49334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49335. }
  49336. // Do executes the "compute.licenseCodes.get" call.
  49337. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  49338. // status code is an error. Response headers are in either
  49339. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  49340. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49341. // to check whether the returned error was because
  49342. // http.StatusNotModified was returned.
  49343. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  49344. gensupport.SetOptions(c.urlParams_, opts...)
  49345. res, err := c.doRequest("json")
  49346. if res != nil && res.StatusCode == http.StatusNotModified {
  49347. if res.Body != nil {
  49348. res.Body.Close()
  49349. }
  49350. return nil, &googleapi.Error{
  49351. Code: res.StatusCode,
  49352. Header: res.Header,
  49353. }
  49354. }
  49355. if err != nil {
  49356. return nil, err
  49357. }
  49358. defer googleapi.CloseBody(res)
  49359. if err := googleapi.CheckResponse(res); err != nil {
  49360. return nil, err
  49361. }
  49362. ret := &LicenseCode{
  49363. ServerResponse: googleapi.ServerResponse{
  49364. Header: res.Header,
  49365. HTTPStatusCode: res.StatusCode,
  49366. },
  49367. }
  49368. target := &ret
  49369. if err := gensupport.DecodeResponse(target, res); err != nil {
  49370. return nil, err
  49371. }
  49372. return ret, nil
  49373. // {
  49374. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  49375. // "httpMethod": "GET",
  49376. // "id": "compute.licenseCodes.get",
  49377. // "parameterOrder": [
  49378. // "project",
  49379. // "licenseCode"
  49380. // ],
  49381. // "parameters": {
  49382. // "licenseCode": {
  49383. // "description": "Number corresponding to the License code resource to return.",
  49384. // "location": "path",
  49385. // "pattern": "[0-9]{0,61}?",
  49386. // "required": true,
  49387. // "type": "string"
  49388. // },
  49389. // "project": {
  49390. // "description": "Project ID for this request.",
  49391. // "location": "path",
  49392. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49393. // "required": true,
  49394. // "type": "string"
  49395. // }
  49396. // },
  49397. // "path": "{project}/global/licenseCodes/{licenseCode}",
  49398. // "response": {
  49399. // "$ref": "LicenseCode"
  49400. // },
  49401. // "scopes": [
  49402. // "https://www.googleapis.com/auth/cloud-platform",
  49403. // "https://www.googleapis.com/auth/compute",
  49404. // "https://www.googleapis.com/auth/compute.readonly"
  49405. // ]
  49406. // }
  49407. }
  49408. // method id "compute.licenseCodes.testIamPermissions":
  49409. type LicenseCodesTestIamPermissionsCall struct {
  49410. s *Service
  49411. project string
  49412. resource string
  49413. testpermissionsrequest *TestPermissionsRequest
  49414. urlParams_ gensupport.URLParams
  49415. ctx_ context.Context
  49416. header_ http.Header
  49417. }
  49418. // TestIamPermissions: Returns permissions that a caller has on the
  49419. // specified resource.
  49420. func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
  49421. c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49422. c.project = project
  49423. c.resource = resource
  49424. c.testpermissionsrequest = testpermissionsrequest
  49425. return c
  49426. }
  49427. // Fields allows partial responses to be retrieved. See
  49428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49429. // for more information.
  49430. func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
  49431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49432. return c
  49433. }
  49434. // Context sets the context to be used in this call's Do method. Any
  49435. // pending HTTP request will be aborted if the provided context is
  49436. // canceled.
  49437. func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
  49438. c.ctx_ = ctx
  49439. return c
  49440. }
  49441. // Header returns an http.Header that can be modified by the caller to
  49442. // add HTTP headers to the request.
  49443. func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header {
  49444. if c.header_ == nil {
  49445. c.header_ = make(http.Header)
  49446. }
  49447. return c.header_
  49448. }
  49449. func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  49450. reqHeaders := make(http.Header)
  49451. for k, v := range c.header_ {
  49452. reqHeaders[k] = v
  49453. }
  49454. reqHeaders.Set("User-Agent", c.s.userAgent())
  49455. var body io.Reader = nil
  49456. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  49457. if err != nil {
  49458. return nil, err
  49459. }
  49460. reqHeaders.Set("Content-Type", "application/json")
  49461. c.urlParams_.Set("alt", alt)
  49462. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
  49463. urls += "?" + c.urlParams_.Encode()
  49464. req, _ := http.NewRequest("POST", urls, body)
  49465. req.Header = reqHeaders
  49466. googleapi.Expand(req.URL, map[string]string{
  49467. "project": c.project,
  49468. "resource": c.resource,
  49469. })
  49470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49471. }
  49472. // Do executes the "compute.licenseCodes.testIamPermissions" call.
  49473. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  49474. // non-2xx status code is an error. Response headers are in either
  49475. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  49476. // returned at all) in error.(*googleapi.Error).Header. Use
  49477. // googleapi.IsNotModified to check whether the returned error was
  49478. // because http.StatusNotModified was returned.
  49479. func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  49480. gensupport.SetOptions(c.urlParams_, opts...)
  49481. res, err := c.doRequest("json")
  49482. if res != nil && res.StatusCode == http.StatusNotModified {
  49483. if res.Body != nil {
  49484. res.Body.Close()
  49485. }
  49486. return nil, &googleapi.Error{
  49487. Code: res.StatusCode,
  49488. Header: res.Header,
  49489. }
  49490. }
  49491. if err != nil {
  49492. return nil, err
  49493. }
  49494. defer googleapi.CloseBody(res)
  49495. if err := googleapi.CheckResponse(res); err != nil {
  49496. return nil, err
  49497. }
  49498. ret := &TestPermissionsResponse{
  49499. ServerResponse: googleapi.ServerResponse{
  49500. Header: res.Header,
  49501. HTTPStatusCode: res.StatusCode,
  49502. },
  49503. }
  49504. target := &ret
  49505. if err := gensupport.DecodeResponse(target, res); err != nil {
  49506. return nil, err
  49507. }
  49508. return ret, nil
  49509. // {
  49510. // "description": "Returns permissions that a caller has on the specified resource.",
  49511. // "httpMethod": "POST",
  49512. // "id": "compute.licenseCodes.testIamPermissions",
  49513. // "parameterOrder": [
  49514. // "project",
  49515. // "resource"
  49516. // ],
  49517. // "parameters": {
  49518. // "project": {
  49519. // "description": "Project ID for this request.",
  49520. // "location": "path",
  49521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49522. // "required": true,
  49523. // "type": "string"
  49524. // },
  49525. // "resource": {
  49526. // "description": "Name of the resource for this request.",
  49527. // "location": "path",
  49528. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  49529. // "required": true,
  49530. // "type": "string"
  49531. // }
  49532. // },
  49533. // "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
  49534. // "request": {
  49535. // "$ref": "TestPermissionsRequest"
  49536. // },
  49537. // "response": {
  49538. // "$ref": "TestPermissionsResponse"
  49539. // },
  49540. // "scopes": [
  49541. // "https://www.googleapis.com/auth/cloud-platform",
  49542. // "https://www.googleapis.com/auth/compute",
  49543. // "https://www.googleapis.com/auth/compute.readonly"
  49544. // ]
  49545. // }
  49546. }
  49547. // method id "compute.licenses.delete":
  49548. type LicensesDeleteCall struct {
  49549. s *Service
  49550. project string
  49551. license string
  49552. urlParams_ gensupport.URLParams
  49553. ctx_ context.Context
  49554. header_ http.Header
  49555. }
  49556. // Delete: Deletes the specified license.
  49557. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  49558. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49559. c.project = project
  49560. c.license = license
  49561. return c
  49562. }
  49563. // RequestId sets the optional parameter "requestId": An optional
  49564. // request ID to identify requests. Specify a unique request ID so that
  49565. // if you must retry your request, the server will know to ignore the
  49566. // request if it has already been completed.
  49567. //
  49568. // For example, consider a situation where you make an initial request
  49569. // and the request times out. If you make the request again with the
  49570. // same request ID, the server can check if original operation with the
  49571. // same request ID was received, and if so, will ignore the second
  49572. // request. This prevents clients from accidentally creating duplicate
  49573. // commitments.
  49574. //
  49575. // The request ID must be a valid UUID with the exception that zero UUID
  49576. // is not supported (00000000-0000-0000-0000-000000000000).
  49577. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  49578. c.urlParams_.Set("requestId", requestId)
  49579. return c
  49580. }
  49581. // Fields allows partial responses to be retrieved. See
  49582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49583. // for more information.
  49584. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  49585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49586. return c
  49587. }
  49588. // Context sets the context to be used in this call's Do method. Any
  49589. // pending HTTP request will be aborted if the provided context is
  49590. // canceled.
  49591. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  49592. c.ctx_ = ctx
  49593. return c
  49594. }
  49595. // Header returns an http.Header that can be modified by the caller to
  49596. // add HTTP headers to the request.
  49597. func (c *LicensesDeleteCall) Header() http.Header {
  49598. if c.header_ == nil {
  49599. c.header_ = make(http.Header)
  49600. }
  49601. return c.header_
  49602. }
  49603. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  49604. reqHeaders := make(http.Header)
  49605. for k, v := range c.header_ {
  49606. reqHeaders[k] = v
  49607. }
  49608. reqHeaders.Set("User-Agent", c.s.userAgent())
  49609. var body io.Reader = nil
  49610. c.urlParams_.Set("alt", alt)
  49611. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  49612. urls += "?" + c.urlParams_.Encode()
  49613. req, _ := http.NewRequest("DELETE", urls, body)
  49614. req.Header = reqHeaders
  49615. googleapi.Expand(req.URL, map[string]string{
  49616. "project": c.project,
  49617. "license": c.license,
  49618. })
  49619. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49620. }
  49621. // Do executes the "compute.licenses.delete" call.
  49622. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49623. // status code is an error. Response headers are in either
  49624. // *Operation.ServerResponse.Header or (if a response was returned at
  49625. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49626. // to check whether the returned error was because
  49627. // http.StatusNotModified was returned.
  49628. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49629. gensupport.SetOptions(c.urlParams_, opts...)
  49630. res, err := c.doRequest("json")
  49631. if res != nil && res.StatusCode == http.StatusNotModified {
  49632. if res.Body != nil {
  49633. res.Body.Close()
  49634. }
  49635. return nil, &googleapi.Error{
  49636. Code: res.StatusCode,
  49637. Header: res.Header,
  49638. }
  49639. }
  49640. if err != nil {
  49641. return nil, err
  49642. }
  49643. defer googleapi.CloseBody(res)
  49644. if err := googleapi.CheckResponse(res); err != nil {
  49645. return nil, err
  49646. }
  49647. ret := &Operation{
  49648. ServerResponse: googleapi.ServerResponse{
  49649. Header: res.Header,
  49650. HTTPStatusCode: res.StatusCode,
  49651. },
  49652. }
  49653. target := &ret
  49654. if err := gensupport.DecodeResponse(target, res); err != nil {
  49655. return nil, err
  49656. }
  49657. return ret, nil
  49658. // {
  49659. // "description": "Deletes the specified license.",
  49660. // "httpMethod": "DELETE",
  49661. // "id": "compute.licenses.delete",
  49662. // "parameterOrder": [
  49663. // "project",
  49664. // "license"
  49665. // ],
  49666. // "parameters": {
  49667. // "license": {
  49668. // "description": "Name of the license resource to delete.",
  49669. // "location": "path",
  49670. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49671. // "required": true,
  49672. // "type": "string"
  49673. // },
  49674. // "project": {
  49675. // "description": "Project ID for this request.",
  49676. // "location": "path",
  49677. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49678. // "required": true,
  49679. // "type": "string"
  49680. // },
  49681. // "requestId": {
  49682. // "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).",
  49683. // "location": "query",
  49684. // "type": "string"
  49685. // }
  49686. // },
  49687. // "path": "{project}/global/licenses/{license}",
  49688. // "response": {
  49689. // "$ref": "Operation"
  49690. // },
  49691. // "scopes": [
  49692. // "https://www.googleapis.com/auth/cloud-platform",
  49693. // "https://www.googleapis.com/auth/compute"
  49694. // ]
  49695. // }
  49696. }
  49697. // method id "compute.licenses.get":
  49698. type LicensesGetCall struct {
  49699. s *Service
  49700. project string
  49701. license string
  49702. urlParams_ gensupport.URLParams
  49703. ifNoneMatch_ string
  49704. ctx_ context.Context
  49705. header_ http.Header
  49706. }
  49707. // Get: Returns the specified License resource.
  49708. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  49709. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  49710. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49711. c.project = project
  49712. c.license = license
  49713. return c
  49714. }
  49715. // Fields allows partial responses to be retrieved. See
  49716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49717. // for more information.
  49718. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  49719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49720. return c
  49721. }
  49722. // IfNoneMatch sets the optional parameter which makes the operation
  49723. // fail if the object's ETag matches the given value. This is useful for
  49724. // getting updates only after the object has changed since the last
  49725. // request. Use googleapi.IsNotModified to check whether the response
  49726. // error from Do is the result of In-None-Match.
  49727. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  49728. c.ifNoneMatch_ = entityTag
  49729. return c
  49730. }
  49731. // Context sets the context to be used in this call's Do method. Any
  49732. // pending HTTP request will be aborted if the provided context is
  49733. // canceled.
  49734. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  49735. c.ctx_ = ctx
  49736. return c
  49737. }
  49738. // Header returns an http.Header that can be modified by the caller to
  49739. // add HTTP headers to the request.
  49740. func (c *LicensesGetCall) Header() http.Header {
  49741. if c.header_ == nil {
  49742. c.header_ = make(http.Header)
  49743. }
  49744. return c.header_
  49745. }
  49746. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  49747. reqHeaders := make(http.Header)
  49748. for k, v := range c.header_ {
  49749. reqHeaders[k] = v
  49750. }
  49751. reqHeaders.Set("User-Agent", c.s.userAgent())
  49752. if c.ifNoneMatch_ != "" {
  49753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49754. }
  49755. var body io.Reader = nil
  49756. c.urlParams_.Set("alt", alt)
  49757. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  49758. urls += "?" + c.urlParams_.Encode()
  49759. req, _ := http.NewRequest("GET", urls, body)
  49760. req.Header = reqHeaders
  49761. googleapi.Expand(req.URL, map[string]string{
  49762. "project": c.project,
  49763. "license": c.license,
  49764. })
  49765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49766. }
  49767. // Do executes the "compute.licenses.get" call.
  49768. // Exactly one of *License or error will be non-nil. Any non-2xx status
  49769. // code is an error. Response headers are in either
  49770. // *License.ServerResponse.Header or (if a response was returned at all)
  49771. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  49772. // check whether the returned error was because http.StatusNotModified
  49773. // was returned.
  49774. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  49775. gensupport.SetOptions(c.urlParams_, opts...)
  49776. res, err := c.doRequest("json")
  49777. if res != nil && res.StatusCode == http.StatusNotModified {
  49778. if res.Body != nil {
  49779. res.Body.Close()
  49780. }
  49781. return nil, &googleapi.Error{
  49782. Code: res.StatusCode,
  49783. Header: res.Header,
  49784. }
  49785. }
  49786. if err != nil {
  49787. return nil, err
  49788. }
  49789. defer googleapi.CloseBody(res)
  49790. if err := googleapi.CheckResponse(res); err != nil {
  49791. return nil, err
  49792. }
  49793. ret := &License{
  49794. ServerResponse: googleapi.ServerResponse{
  49795. Header: res.Header,
  49796. HTTPStatusCode: res.StatusCode,
  49797. },
  49798. }
  49799. target := &ret
  49800. if err := gensupport.DecodeResponse(target, res); err != nil {
  49801. return nil, err
  49802. }
  49803. return ret, nil
  49804. // {
  49805. // "description": "Returns the specified License resource.",
  49806. // "httpMethod": "GET",
  49807. // "id": "compute.licenses.get",
  49808. // "parameterOrder": [
  49809. // "project",
  49810. // "license"
  49811. // ],
  49812. // "parameters": {
  49813. // "license": {
  49814. // "description": "Name of the License resource to return.",
  49815. // "location": "path",
  49816. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49817. // "required": true,
  49818. // "type": "string"
  49819. // },
  49820. // "project": {
  49821. // "description": "Project ID for this request.",
  49822. // "location": "path",
  49823. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49824. // "required": true,
  49825. // "type": "string"
  49826. // }
  49827. // },
  49828. // "path": "{project}/global/licenses/{license}",
  49829. // "response": {
  49830. // "$ref": "License"
  49831. // },
  49832. // "scopes": [
  49833. // "https://www.googleapis.com/auth/cloud-platform",
  49834. // "https://www.googleapis.com/auth/compute",
  49835. // "https://www.googleapis.com/auth/compute.readonly"
  49836. // ]
  49837. // }
  49838. }
  49839. // method id "compute.licenses.insert":
  49840. type LicensesInsertCall struct {
  49841. s *Service
  49842. project string
  49843. license *License
  49844. urlParams_ gensupport.URLParams
  49845. ctx_ context.Context
  49846. header_ http.Header
  49847. }
  49848. // Insert: Create a License resource in the specified project.
  49849. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  49850. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49851. c.project = project
  49852. c.license = license
  49853. return c
  49854. }
  49855. // RequestId sets the optional parameter "requestId": An optional
  49856. // request ID to identify requests. Specify a unique request ID so that
  49857. // if you must retry your request, the server will know to ignore the
  49858. // request if it has already been completed.
  49859. //
  49860. // For example, consider a situation where you make an initial request
  49861. // and the request times out. If you make the request again with the
  49862. // same request ID, the server can check if original operation with the
  49863. // same request ID was received, and if so, will ignore the second
  49864. // request. This prevents clients from accidentally creating duplicate
  49865. // commitments.
  49866. //
  49867. // The request ID must be a valid UUID with the exception that zero UUID
  49868. // is not supported (00000000-0000-0000-0000-000000000000).
  49869. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  49870. c.urlParams_.Set("requestId", requestId)
  49871. return c
  49872. }
  49873. // Fields allows partial responses to be retrieved. See
  49874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49875. // for more information.
  49876. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  49877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49878. return c
  49879. }
  49880. // Context sets the context to be used in this call's Do method. Any
  49881. // pending HTTP request will be aborted if the provided context is
  49882. // canceled.
  49883. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  49884. c.ctx_ = ctx
  49885. return c
  49886. }
  49887. // Header returns an http.Header that can be modified by the caller to
  49888. // add HTTP headers to the request.
  49889. func (c *LicensesInsertCall) Header() http.Header {
  49890. if c.header_ == nil {
  49891. c.header_ = make(http.Header)
  49892. }
  49893. return c.header_
  49894. }
  49895. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  49896. reqHeaders := make(http.Header)
  49897. for k, v := range c.header_ {
  49898. reqHeaders[k] = v
  49899. }
  49900. reqHeaders.Set("User-Agent", c.s.userAgent())
  49901. var body io.Reader = nil
  49902. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  49903. if err != nil {
  49904. return nil, err
  49905. }
  49906. reqHeaders.Set("Content-Type", "application/json")
  49907. c.urlParams_.Set("alt", alt)
  49908. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  49909. urls += "?" + c.urlParams_.Encode()
  49910. req, _ := http.NewRequest("POST", urls, body)
  49911. req.Header = reqHeaders
  49912. googleapi.Expand(req.URL, map[string]string{
  49913. "project": c.project,
  49914. })
  49915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49916. }
  49917. // Do executes the "compute.licenses.insert" call.
  49918. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49919. // status code is an error. Response headers are in either
  49920. // *Operation.ServerResponse.Header or (if a response was returned at
  49921. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49922. // to check whether the returned error was because
  49923. // http.StatusNotModified was returned.
  49924. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49925. gensupport.SetOptions(c.urlParams_, opts...)
  49926. res, err := c.doRequest("json")
  49927. if res != nil && res.StatusCode == http.StatusNotModified {
  49928. if res.Body != nil {
  49929. res.Body.Close()
  49930. }
  49931. return nil, &googleapi.Error{
  49932. Code: res.StatusCode,
  49933. Header: res.Header,
  49934. }
  49935. }
  49936. if err != nil {
  49937. return nil, err
  49938. }
  49939. defer googleapi.CloseBody(res)
  49940. if err := googleapi.CheckResponse(res); err != nil {
  49941. return nil, err
  49942. }
  49943. ret := &Operation{
  49944. ServerResponse: googleapi.ServerResponse{
  49945. Header: res.Header,
  49946. HTTPStatusCode: res.StatusCode,
  49947. },
  49948. }
  49949. target := &ret
  49950. if err := gensupport.DecodeResponse(target, res); err != nil {
  49951. return nil, err
  49952. }
  49953. return ret, nil
  49954. // {
  49955. // "description": "Create a License resource in the specified project.",
  49956. // "httpMethod": "POST",
  49957. // "id": "compute.licenses.insert",
  49958. // "parameterOrder": [
  49959. // "project"
  49960. // ],
  49961. // "parameters": {
  49962. // "project": {
  49963. // "description": "Project ID for this request.",
  49964. // "location": "path",
  49965. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49966. // "required": true,
  49967. // "type": "string"
  49968. // },
  49969. // "requestId": {
  49970. // "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).",
  49971. // "location": "query",
  49972. // "type": "string"
  49973. // }
  49974. // },
  49975. // "path": "{project}/global/licenses",
  49976. // "request": {
  49977. // "$ref": "License"
  49978. // },
  49979. // "response": {
  49980. // "$ref": "Operation"
  49981. // },
  49982. // "scopes": [
  49983. // "https://www.googleapis.com/auth/cloud-platform",
  49984. // "https://www.googleapis.com/auth/compute",
  49985. // "https://www.googleapis.com/auth/devstorage.full_control",
  49986. // "https://www.googleapis.com/auth/devstorage.read_only",
  49987. // "https://www.googleapis.com/auth/devstorage.read_write"
  49988. // ]
  49989. // }
  49990. }
  49991. // method id "compute.licenses.list":
  49992. type LicensesListCall struct {
  49993. s *Service
  49994. project string
  49995. urlParams_ gensupport.URLParams
  49996. ifNoneMatch_ string
  49997. ctx_ context.Context
  49998. header_ http.Header
  49999. }
  50000. // List: Retrieves the list of licenses available in the specified
  50001. // project. This method does not get any licenses that belong to other
  50002. // projects, including licenses attached to publicly-available images,
  50003. // like Debian 9. If you want to get a list of publicly-available
  50004. // licenses, use this method to make a request to the respective image
  50005. // project, such as debian-cloud or windows-cloud.
  50006. func (r *LicensesService) List(project string) *LicensesListCall {
  50007. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50008. c.project = project
  50009. return c
  50010. }
  50011. // Filter sets the optional parameter "filter": A filter expression that
  50012. // filters resources listed in the response. The expression must specify
  50013. // the field name, a comparison operator, and the value that you want to
  50014. // use for filtering. The value must be a string, a number, or a
  50015. // boolean. The comparison operator must be either =, !=, >, or <.
  50016. //
  50017. // For example, if you are filtering Compute Engine instances, you can
  50018. // exclude instances named example-instance by specifying name !=
  50019. // example-instance.
  50020. //
  50021. // You can also filter nested fields. For example, you could specify
  50022. // scheduling.automaticRestart = false to include instances only if they
  50023. // are not scheduled for automatic restarts. You can use filtering on
  50024. // nested fields to filter based on resource labels.
  50025. //
  50026. // To filter on multiple expressions, provide each separate expression
  50027. // within parentheses. For example, (scheduling.automaticRestart = true)
  50028. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50029. // AND expression. However, you can include AND and OR expressions
  50030. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50031. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50032. // true).
  50033. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  50034. c.urlParams_.Set("filter", filter)
  50035. return c
  50036. }
  50037. // MaxResults sets the optional parameter "maxResults": The maximum
  50038. // number of results per page that should be returned. If the number of
  50039. // available results is larger than maxResults, Compute Engine returns a
  50040. // nextPageToken that can be used to get the next page of results in
  50041. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50042. // (Default: 500)
  50043. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  50044. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50045. return c
  50046. }
  50047. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50048. // a certain order. By default, results are returned in alphanumerical
  50049. // order based on the resource name.
  50050. //
  50051. // You can also sort results in descending order based on the creation
  50052. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50053. // based on the creationTimestamp field in reverse chronological order
  50054. // (newest result first). Use this to sort resources like operations so
  50055. // that the newest operation is returned first.
  50056. //
  50057. // Currently, only sorting by name or creationTimestamp desc is
  50058. // supported.
  50059. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  50060. c.urlParams_.Set("orderBy", orderBy)
  50061. return c
  50062. }
  50063. // PageToken sets the optional parameter "pageToken": Specifies a page
  50064. // token to use. Set pageToken to the nextPageToken returned by a
  50065. // previous list request to get the next page of results.
  50066. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  50067. c.urlParams_.Set("pageToken", pageToken)
  50068. return c
  50069. }
  50070. // Fields allows partial responses to be retrieved. See
  50071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50072. // for more information.
  50073. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  50074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50075. return c
  50076. }
  50077. // IfNoneMatch sets the optional parameter which makes the operation
  50078. // fail if the object's ETag matches the given value. This is useful for
  50079. // getting updates only after the object has changed since the last
  50080. // request. Use googleapi.IsNotModified to check whether the response
  50081. // error from Do is the result of In-None-Match.
  50082. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  50083. c.ifNoneMatch_ = entityTag
  50084. return c
  50085. }
  50086. // Context sets the context to be used in this call's Do method. Any
  50087. // pending HTTP request will be aborted if the provided context is
  50088. // canceled.
  50089. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  50090. c.ctx_ = ctx
  50091. return c
  50092. }
  50093. // Header returns an http.Header that can be modified by the caller to
  50094. // add HTTP headers to the request.
  50095. func (c *LicensesListCall) Header() http.Header {
  50096. if c.header_ == nil {
  50097. c.header_ = make(http.Header)
  50098. }
  50099. return c.header_
  50100. }
  50101. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  50102. reqHeaders := make(http.Header)
  50103. for k, v := range c.header_ {
  50104. reqHeaders[k] = v
  50105. }
  50106. reqHeaders.Set("User-Agent", c.s.userAgent())
  50107. if c.ifNoneMatch_ != "" {
  50108. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50109. }
  50110. var body io.Reader = nil
  50111. c.urlParams_.Set("alt", alt)
  50112. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  50113. urls += "?" + c.urlParams_.Encode()
  50114. req, _ := http.NewRequest("GET", urls, body)
  50115. req.Header = reqHeaders
  50116. googleapi.Expand(req.URL, map[string]string{
  50117. "project": c.project,
  50118. })
  50119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50120. }
  50121. // Do executes the "compute.licenses.list" call.
  50122. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  50123. // non-2xx status code is an error. Response headers are in either
  50124. // *LicensesListResponse.ServerResponse.Header or (if a response was
  50125. // returned at all) in error.(*googleapi.Error).Header. Use
  50126. // googleapi.IsNotModified to check whether the returned error was
  50127. // because http.StatusNotModified was returned.
  50128. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  50129. gensupport.SetOptions(c.urlParams_, opts...)
  50130. res, err := c.doRequest("json")
  50131. if res != nil && res.StatusCode == http.StatusNotModified {
  50132. if res.Body != nil {
  50133. res.Body.Close()
  50134. }
  50135. return nil, &googleapi.Error{
  50136. Code: res.StatusCode,
  50137. Header: res.Header,
  50138. }
  50139. }
  50140. if err != nil {
  50141. return nil, err
  50142. }
  50143. defer googleapi.CloseBody(res)
  50144. if err := googleapi.CheckResponse(res); err != nil {
  50145. return nil, err
  50146. }
  50147. ret := &LicensesListResponse{
  50148. ServerResponse: googleapi.ServerResponse{
  50149. Header: res.Header,
  50150. HTTPStatusCode: res.StatusCode,
  50151. },
  50152. }
  50153. target := &ret
  50154. if err := gensupport.DecodeResponse(target, res); err != nil {
  50155. return nil, err
  50156. }
  50157. return ret, nil
  50158. // {
  50159. // "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.",
  50160. // "httpMethod": "GET",
  50161. // "id": "compute.licenses.list",
  50162. // "parameterOrder": [
  50163. // "project"
  50164. // ],
  50165. // "parameters": {
  50166. // "filter": {
  50167. // "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).",
  50168. // "location": "query",
  50169. // "type": "string"
  50170. // },
  50171. // "maxResults": {
  50172. // "default": "500",
  50173. // "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)",
  50174. // "format": "uint32",
  50175. // "location": "query",
  50176. // "minimum": "0",
  50177. // "type": "integer"
  50178. // },
  50179. // "orderBy": {
  50180. // "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.",
  50181. // "location": "query",
  50182. // "type": "string"
  50183. // },
  50184. // "pageToken": {
  50185. // "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.",
  50186. // "location": "query",
  50187. // "type": "string"
  50188. // },
  50189. // "project": {
  50190. // "description": "Project ID for this request.",
  50191. // "location": "path",
  50192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50193. // "required": true,
  50194. // "type": "string"
  50195. // }
  50196. // },
  50197. // "path": "{project}/global/licenses",
  50198. // "response": {
  50199. // "$ref": "LicensesListResponse"
  50200. // },
  50201. // "scopes": [
  50202. // "https://www.googleapis.com/auth/cloud-platform",
  50203. // "https://www.googleapis.com/auth/compute",
  50204. // "https://www.googleapis.com/auth/compute.readonly"
  50205. // ]
  50206. // }
  50207. }
  50208. // Pages invokes f for each page of results.
  50209. // A non-nil error returned from f will halt the iteration.
  50210. // The provided context supersedes any context provided to the Context method.
  50211. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  50212. c.ctx_ = ctx
  50213. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50214. for {
  50215. x, err := c.Do()
  50216. if err != nil {
  50217. return err
  50218. }
  50219. if err := f(x); err != nil {
  50220. return err
  50221. }
  50222. if x.NextPageToken == "" {
  50223. return nil
  50224. }
  50225. c.PageToken(x.NextPageToken)
  50226. }
  50227. }
  50228. // method id "compute.licenses.testIamPermissions":
  50229. type LicensesTestIamPermissionsCall struct {
  50230. s *Service
  50231. project string
  50232. resource string
  50233. testpermissionsrequest *TestPermissionsRequest
  50234. urlParams_ gensupport.URLParams
  50235. ctx_ context.Context
  50236. header_ http.Header
  50237. }
  50238. // TestIamPermissions: Returns permissions that a caller has on the
  50239. // specified resource.
  50240. func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
  50241. c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50242. c.project = project
  50243. c.resource = resource
  50244. c.testpermissionsrequest = testpermissionsrequest
  50245. return c
  50246. }
  50247. // Fields allows partial responses to be retrieved. See
  50248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50249. // for more information.
  50250. func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
  50251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50252. return c
  50253. }
  50254. // Context sets the context to be used in this call's Do method. Any
  50255. // pending HTTP request will be aborted if the provided context is
  50256. // canceled.
  50257. func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
  50258. c.ctx_ = ctx
  50259. return c
  50260. }
  50261. // Header returns an http.Header that can be modified by the caller to
  50262. // add HTTP headers to the request.
  50263. func (c *LicensesTestIamPermissionsCall) Header() http.Header {
  50264. if c.header_ == nil {
  50265. c.header_ = make(http.Header)
  50266. }
  50267. return c.header_
  50268. }
  50269. func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50270. reqHeaders := make(http.Header)
  50271. for k, v := range c.header_ {
  50272. reqHeaders[k] = v
  50273. }
  50274. reqHeaders.Set("User-Agent", c.s.userAgent())
  50275. var body io.Reader = nil
  50276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50277. if err != nil {
  50278. return nil, err
  50279. }
  50280. reqHeaders.Set("Content-Type", "application/json")
  50281. c.urlParams_.Set("alt", alt)
  50282. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/testIamPermissions")
  50283. urls += "?" + c.urlParams_.Encode()
  50284. req, _ := http.NewRequest("POST", urls, body)
  50285. req.Header = reqHeaders
  50286. googleapi.Expand(req.URL, map[string]string{
  50287. "project": c.project,
  50288. "resource": c.resource,
  50289. })
  50290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50291. }
  50292. // Do executes the "compute.licenses.testIamPermissions" call.
  50293. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50294. // non-2xx status code is an error. Response headers are in either
  50295. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50296. // returned at all) in error.(*googleapi.Error).Header. Use
  50297. // googleapi.IsNotModified to check whether the returned error was
  50298. // because http.StatusNotModified was returned.
  50299. func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50300. gensupport.SetOptions(c.urlParams_, opts...)
  50301. res, err := c.doRequest("json")
  50302. if res != nil && res.StatusCode == http.StatusNotModified {
  50303. if res.Body != nil {
  50304. res.Body.Close()
  50305. }
  50306. return nil, &googleapi.Error{
  50307. Code: res.StatusCode,
  50308. Header: res.Header,
  50309. }
  50310. }
  50311. if err != nil {
  50312. return nil, err
  50313. }
  50314. defer googleapi.CloseBody(res)
  50315. if err := googleapi.CheckResponse(res); err != nil {
  50316. return nil, err
  50317. }
  50318. ret := &TestPermissionsResponse{
  50319. ServerResponse: googleapi.ServerResponse{
  50320. Header: res.Header,
  50321. HTTPStatusCode: res.StatusCode,
  50322. },
  50323. }
  50324. target := &ret
  50325. if err := gensupport.DecodeResponse(target, res); err != nil {
  50326. return nil, err
  50327. }
  50328. return ret, nil
  50329. // {
  50330. // "description": "Returns permissions that a caller has on the specified resource.",
  50331. // "httpMethod": "POST",
  50332. // "id": "compute.licenses.testIamPermissions",
  50333. // "parameterOrder": [
  50334. // "project",
  50335. // "resource"
  50336. // ],
  50337. // "parameters": {
  50338. // "project": {
  50339. // "description": "Project ID for this request.",
  50340. // "location": "path",
  50341. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50342. // "required": true,
  50343. // "type": "string"
  50344. // },
  50345. // "resource": {
  50346. // "description": "Name of the resource for this request.",
  50347. // "location": "path",
  50348. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  50349. // "required": true,
  50350. // "type": "string"
  50351. // }
  50352. // },
  50353. // "path": "{project}/global/licenses/{resource}/testIamPermissions",
  50354. // "request": {
  50355. // "$ref": "TestPermissionsRequest"
  50356. // },
  50357. // "response": {
  50358. // "$ref": "TestPermissionsResponse"
  50359. // },
  50360. // "scopes": [
  50361. // "https://www.googleapis.com/auth/cloud-platform",
  50362. // "https://www.googleapis.com/auth/compute",
  50363. // "https://www.googleapis.com/auth/compute.readonly"
  50364. // ]
  50365. // }
  50366. }
  50367. // method id "compute.machineTypes.aggregatedList":
  50368. type MachineTypesAggregatedListCall struct {
  50369. s *Service
  50370. project string
  50371. urlParams_ gensupport.URLParams
  50372. ifNoneMatch_ string
  50373. ctx_ context.Context
  50374. header_ http.Header
  50375. }
  50376. // AggregatedList: Retrieves an aggregated list of machine types.
  50377. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  50378. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  50379. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50380. c.project = project
  50381. return c
  50382. }
  50383. // Filter sets the optional parameter "filter": A filter expression that
  50384. // filters resources listed in the response. The expression must specify
  50385. // the field name, a comparison operator, and the value that you want to
  50386. // use for filtering. The value must be a string, a number, or a
  50387. // boolean. The comparison operator must be either =, !=, >, or <.
  50388. //
  50389. // For example, if you are filtering Compute Engine instances, you can
  50390. // exclude instances named example-instance by specifying name !=
  50391. // example-instance.
  50392. //
  50393. // You can also filter nested fields. For example, you could specify
  50394. // scheduling.automaticRestart = false to include instances only if they
  50395. // are not scheduled for automatic restarts. You can use filtering on
  50396. // nested fields to filter based on resource labels.
  50397. //
  50398. // To filter on multiple expressions, provide each separate expression
  50399. // within parentheses. For example, (scheduling.automaticRestart = true)
  50400. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50401. // AND expression. However, you can include AND and OR expressions
  50402. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50403. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50404. // true).
  50405. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  50406. c.urlParams_.Set("filter", filter)
  50407. return c
  50408. }
  50409. // MaxResults sets the optional parameter "maxResults": The maximum
  50410. // number of results per page that should be returned. If the number of
  50411. // available results is larger than maxResults, Compute Engine returns a
  50412. // nextPageToken that can be used to get the next page of results in
  50413. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50414. // (Default: 500)
  50415. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  50416. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50417. return c
  50418. }
  50419. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50420. // a certain order. By default, results are returned in alphanumerical
  50421. // order based on the resource name.
  50422. //
  50423. // You can also sort results in descending order based on the creation
  50424. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50425. // based on the creationTimestamp field in reverse chronological order
  50426. // (newest result first). Use this to sort resources like operations so
  50427. // that the newest operation is returned first.
  50428. //
  50429. // Currently, only sorting by name or creationTimestamp desc is
  50430. // supported.
  50431. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  50432. c.urlParams_.Set("orderBy", orderBy)
  50433. return c
  50434. }
  50435. // PageToken sets the optional parameter "pageToken": Specifies a page
  50436. // token to use. Set pageToken to the nextPageToken returned by a
  50437. // previous list request to get the next page of results.
  50438. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  50439. c.urlParams_.Set("pageToken", pageToken)
  50440. return c
  50441. }
  50442. // Fields allows partial responses to be retrieved. See
  50443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50444. // for more information.
  50445. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  50446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50447. return c
  50448. }
  50449. // IfNoneMatch sets the optional parameter which makes the operation
  50450. // fail if the object's ETag matches the given value. This is useful for
  50451. // getting updates only after the object has changed since the last
  50452. // request. Use googleapi.IsNotModified to check whether the response
  50453. // error from Do is the result of In-None-Match.
  50454. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  50455. c.ifNoneMatch_ = entityTag
  50456. return c
  50457. }
  50458. // Context sets the context to be used in this call's Do method. Any
  50459. // pending HTTP request will be aborted if the provided context is
  50460. // canceled.
  50461. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  50462. c.ctx_ = ctx
  50463. return c
  50464. }
  50465. // Header returns an http.Header that can be modified by the caller to
  50466. // add HTTP headers to the request.
  50467. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  50468. if c.header_ == nil {
  50469. c.header_ = make(http.Header)
  50470. }
  50471. return c.header_
  50472. }
  50473. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  50474. reqHeaders := make(http.Header)
  50475. for k, v := range c.header_ {
  50476. reqHeaders[k] = v
  50477. }
  50478. reqHeaders.Set("User-Agent", c.s.userAgent())
  50479. if c.ifNoneMatch_ != "" {
  50480. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50481. }
  50482. var body io.Reader = nil
  50483. c.urlParams_.Set("alt", alt)
  50484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  50485. urls += "?" + c.urlParams_.Encode()
  50486. req, _ := http.NewRequest("GET", urls, body)
  50487. req.Header = reqHeaders
  50488. googleapi.Expand(req.URL, map[string]string{
  50489. "project": c.project,
  50490. })
  50491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50492. }
  50493. // Do executes the "compute.machineTypes.aggregatedList" call.
  50494. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  50495. // Any non-2xx status code is an error. Response headers are in either
  50496. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  50497. // was returned at all) in error.(*googleapi.Error).Header. Use
  50498. // googleapi.IsNotModified to check whether the returned error was
  50499. // because http.StatusNotModified was returned.
  50500. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  50501. gensupport.SetOptions(c.urlParams_, opts...)
  50502. res, err := c.doRequest("json")
  50503. if res != nil && res.StatusCode == http.StatusNotModified {
  50504. if res.Body != nil {
  50505. res.Body.Close()
  50506. }
  50507. return nil, &googleapi.Error{
  50508. Code: res.StatusCode,
  50509. Header: res.Header,
  50510. }
  50511. }
  50512. if err != nil {
  50513. return nil, err
  50514. }
  50515. defer googleapi.CloseBody(res)
  50516. if err := googleapi.CheckResponse(res); err != nil {
  50517. return nil, err
  50518. }
  50519. ret := &MachineTypeAggregatedList{
  50520. ServerResponse: googleapi.ServerResponse{
  50521. Header: res.Header,
  50522. HTTPStatusCode: res.StatusCode,
  50523. },
  50524. }
  50525. target := &ret
  50526. if err := gensupport.DecodeResponse(target, res); err != nil {
  50527. return nil, err
  50528. }
  50529. return ret, nil
  50530. // {
  50531. // "description": "Retrieves an aggregated list of machine types.",
  50532. // "httpMethod": "GET",
  50533. // "id": "compute.machineTypes.aggregatedList",
  50534. // "parameterOrder": [
  50535. // "project"
  50536. // ],
  50537. // "parameters": {
  50538. // "filter": {
  50539. // "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).",
  50540. // "location": "query",
  50541. // "type": "string"
  50542. // },
  50543. // "maxResults": {
  50544. // "default": "500",
  50545. // "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)",
  50546. // "format": "uint32",
  50547. // "location": "query",
  50548. // "minimum": "0",
  50549. // "type": "integer"
  50550. // },
  50551. // "orderBy": {
  50552. // "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.",
  50553. // "location": "query",
  50554. // "type": "string"
  50555. // },
  50556. // "pageToken": {
  50557. // "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.",
  50558. // "location": "query",
  50559. // "type": "string"
  50560. // },
  50561. // "project": {
  50562. // "description": "Project ID for this request.",
  50563. // "location": "path",
  50564. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50565. // "required": true,
  50566. // "type": "string"
  50567. // }
  50568. // },
  50569. // "path": "{project}/aggregated/machineTypes",
  50570. // "response": {
  50571. // "$ref": "MachineTypeAggregatedList"
  50572. // },
  50573. // "scopes": [
  50574. // "https://www.googleapis.com/auth/cloud-platform",
  50575. // "https://www.googleapis.com/auth/compute",
  50576. // "https://www.googleapis.com/auth/compute.readonly"
  50577. // ]
  50578. // }
  50579. }
  50580. // Pages invokes f for each page of results.
  50581. // A non-nil error returned from f will halt the iteration.
  50582. // The provided context supersedes any context provided to the Context method.
  50583. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  50584. c.ctx_ = ctx
  50585. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50586. for {
  50587. x, err := c.Do()
  50588. if err != nil {
  50589. return err
  50590. }
  50591. if err := f(x); err != nil {
  50592. return err
  50593. }
  50594. if x.NextPageToken == "" {
  50595. return nil
  50596. }
  50597. c.PageToken(x.NextPageToken)
  50598. }
  50599. }
  50600. // method id "compute.machineTypes.get":
  50601. type MachineTypesGetCall struct {
  50602. s *Service
  50603. project string
  50604. zone string
  50605. machineType string
  50606. urlParams_ gensupport.URLParams
  50607. ifNoneMatch_ string
  50608. ctx_ context.Context
  50609. header_ http.Header
  50610. }
  50611. // Get: Returns the specified machine type. Gets a list of available
  50612. // machine types by making a list() request.
  50613. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  50614. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  50615. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50616. c.project = project
  50617. c.zone = zone
  50618. c.machineType = machineType
  50619. return c
  50620. }
  50621. // Fields allows partial responses to be retrieved. See
  50622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50623. // for more information.
  50624. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  50625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50626. return c
  50627. }
  50628. // IfNoneMatch sets the optional parameter which makes the operation
  50629. // fail if the object's ETag matches the given value. This is useful for
  50630. // getting updates only after the object has changed since the last
  50631. // request. Use googleapi.IsNotModified to check whether the response
  50632. // error from Do is the result of In-None-Match.
  50633. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  50634. c.ifNoneMatch_ = entityTag
  50635. return c
  50636. }
  50637. // Context sets the context to be used in this call's Do method. Any
  50638. // pending HTTP request will be aborted if the provided context is
  50639. // canceled.
  50640. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  50641. c.ctx_ = ctx
  50642. return c
  50643. }
  50644. // Header returns an http.Header that can be modified by the caller to
  50645. // add HTTP headers to the request.
  50646. func (c *MachineTypesGetCall) Header() http.Header {
  50647. if c.header_ == nil {
  50648. c.header_ = make(http.Header)
  50649. }
  50650. return c.header_
  50651. }
  50652. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  50653. reqHeaders := make(http.Header)
  50654. for k, v := range c.header_ {
  50655. reqHeaders[k] = v
  50656. }
  50657. reqHeaders.Set("User-Agent", c.s.userAgent())
  50658. if c.ifNoneMatch_ != "" {
  50659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50660. }
  50661. var body io.Reader = nil
  50662. c.urlParams_.Set("alt", alt)
  50663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  50664. urls += "?" + c.urlParams_.Encode()
  50665. req, _ := http.NewRequest("GET", urls, body)
  50666. req.Header = reqHeaders
  50667. googleapi.Expand(req.URL, map[string]string{
  50668. "project": c.project,
  50669. "zone": c.zone,
  50670. "machineType": c.machineType,
  50671. })
  50672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50673. }
  50674. // Do executes the "compute.machineTypes.get" call.
  50675. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  50676. // status code is an error. Response headers are in either
  50677. // *MachineType.ServerResponse.Header or (if a response was returned at
  50678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50679. // to check whether the returned error was because
  50680. // http.StatusNotModified was returned.
  50681. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  50682. gensupport.SetOptions(c.urlParams_, opts...)
  50683. res, err := c.doRequest("json")
  50684. if res != nil && res.StatusCode == http.StatusNotModified {
  50685. if res.Body != nil {
  50686. res.Body.Close()
  50687. }
  50688. return nil, &googleapi.Error{
  50689. Code: res.StatusCode,
  50690. Header: res.Header,
  50691. }
  50692. }
  50693. if err != nil {
  50694. return nil, err
  50695. }
  50696. defer googleapi.CloseBody(res)
  50697. if err := googleapi.CheckResponse(res); err != nil {
  50698. return nil, err
  50699. }
  50700. ret := &MachineType{
  50701. ServerResponse: googleapi.ServerResponse{
  50702. Header: res.Header,
  50703. HTTPStatusCode: res.StatusCode,
  50704. },
  50705. }
  50706. target := &ret
  50707. if err := gensupport.DecodeResponse(target, res); err != nil {
  50708. return nil, err
  50709. }
  50710. return ret, nil
  50711. // {
  50712. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  50713. // "httpMethod": "GET",
  50714. // "id": "compute.machineTypes.get",
  50715. // "parameterOrder": [
  50716. // "project",
  50717. // "zone",
  50718. // "machineType"
  50719. // ],
  50720. // "parameters": {
  50721. // "machineType": {
  50722. // "description": "Name of the machine type to return.",
  50723. // "location": "path",
  50724. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50725. // "required": true,
  50726. // "type": "string"
  50727. // },
  50728. // "project": {
  50729. // "description": "Project ID for this request.",
  50730. // "location": "path",
  50731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50732. // "required": true,
  50733. // "type": "string"
  50734. // },
  50735. // "zone": {
  50736. // "description": "The name of the zone for this request.",
  50737. // "location": "path",
  50738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50739. // "required": true,
  50740. // "type": "string"
  50741. // }
  50742. // },
  50743. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  50744. // "response": {
  50745. // "$ref": "MachineType"
  50746. // },
  50747. // "scopes": [
  50748. // "https://www.googleapis.com/auth/cloud-platform",
  50749. // "https://www.googleapis.com/auth/compute",
  50750. // "https://www.googleapis.com/auth/compute.readonly"
  50751. // ]
  50752. // }
  50753. }
  50754. // method id "compute.machineTypes.list":
  50755. type MachineTypesListCall struct {
  50756. s *Service
  50757. project string
  50758. zone string
  50759. urlParams_ gensupport.URLParams
  50760. ifNoneMatch_ string
  50761. ctx_ context.Context
  50762. header_ http.Header
  50763. }
  50764. // List: Retrieves a list of machine types available to the specified
  50765. // project.
  50766. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  50767. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  50768. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50769. c.project = project
  50770. c.zone = zone
  50771. return c
  50772. }
  50773. // Filter sets the optional parameter "filter": A filter expression that
  50774. // filters resources listed in the response. The expression must specify
  50775. // the field name, a comparison operator, and the value that you want to
  50776. // use for filtering. The value must be a string, a number, or a
  50777. // boolean. The comparison operator must be either =, !=, >, or <.
  50778. //
  50779. // For example, if you are filtering Compute Engine instances, you can
  50780. // exclude instances named example-instance by specifying name !=
  50781. // example-instance.
  50782. //
  50783. // You can also filter nested fields. For example, you could specify
  50784. // scheduling.automaticRestart = false to include instances only if they
  50785. // are not scheduled for automatic restarts. You can use filtering on
  50786. // nested fields to filter based on resource labels.
  50787. //
  50788. // To filter on multiple expressions, provide each separate expression
  50789. // within parentheses. For example, (scheduling.automaticRestart = true)
  50790. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50791. // AND expression. However, you can include AND and OR expressions
  50792. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50793. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50794. // true).
  50795. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  50796. c.urlParams_.Set("filter", filter)
  50797. return c
  50798. }
  50799. // MaxResults sets the optional parameter "maxResults": The maximum
  50800. // number of results per page that should be returned. If the number of
  50801. // available results is larger than maxResults, Compute Engine returns a
  50802. // nextPageToken that can be used to get the next page of results in
  50803. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50804. // (Default: 500)
  50805. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  50806. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50807. return c
  50808. }
  50809. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50810. // a certain order. By default, results are returned in alphanumerical
  50811. // order based on the resource name.
  50812. //
  50813. // You can also sort results in descending order based on the creation
  50814. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50815. // based on the creationTimestamp field in reverse chronological order
  50816. // (newest result first). Use this to sort resources like operations so
  50817. // that the newest operation is returned first.
  50818. //
  50819. // Currently, only sorting by name or creationTimestamp desc is
  50820. // supported.
  50821. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  50822. c.urlParams_.Set("orderBy", orderBy)
  50823. return c
  50824. }
  50825. // PageToken sets the optional parameter "pageToken": Specifies a page
  50826. // token to use. Set pageToken to the nextPageToken returned by a
  50827. // previous list request to get the next page of results.
  50828. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  50829. c.urlParams_.Set("pageToken", pageToken)
  50830. return c
  50831. }
  50832. // Fields allows partial responses to be retrieved. See
  50833. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50834. // for more information.
  50835. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  50836. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50837. return c
  50838. }
  50839. // IfNoneMatch sets the optional parameter which makes the operation
  50840. // fail if the object's ETag matches the given value. This is useful for
  50841. // getting updates only after the object has changed since the last
  50842. // request. Use googleapi.IsNotModified to check whether the response
  50843. // error from Do is the result of In-None-Match.
  50844. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  50845. c.ifNoneMatch_ = entityTag
  50846. return c
  50847. }
  50848. // Context sets the context to be used in this call's Do method. Any
  50849. // pending HTTP request will be aborted if the provided context is
  50850. // canceled.
  50851. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  50852. c.ctx_ = ctx
  50853. return c
  50854. }
  50855. // Header returns an http.Header that can be modified by the caller to
  50856. // add HTTP headers to the request.
  50857. func (c *MachineTypesListCall) Header() http.Header {
  50858. if c.header_ == nil {
  50859. c.header_ = make(http.Header)
  50860. }
  50861. return c.header_
  50862. }
  50863. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  50864. reqHeaders := make(http.Header)
  50865. for k, v := range c.header_ {
  50866. reqHeaders[k] = v
  50867. }
  50868. reqHeaders.Set("User-Agent", c.s.userAgent())
  50869. if c.ifNoneMatch_ != "" {
  50870. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50871. }
  50872. var body io.Reader = nil
  50873. c.urlParams_.Set("alt", alt)
  50874. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  50875. urls += "?" + c.urlParams_.Encode()
  50876. req, _ := http.NewRequest("GET", urls, body)
  50877. req.Header = reqHeaders
  50878. googleapi.Expand(req.URL, map[string]string{
  50879. "project": c.project,
  50880. "zone": c.zone,
  50881. })
  50882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50883. }
  50884. // Do executes the "compute.machineTypes.list" call.
  50885. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  50886. // status code is an error. Response headers are in either
  50887. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  50888. // at all) in error.(*googleapi.Error).Header. Use
  50889. // googleapi.IsNotModified to check whether the returned error was
  50890. // because http.StatusNotModified was returned.
  50891. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  50892. gensupport.SetOptions(c.urlParams_, opts...)
  50893. res, err := c.doRequest("json")
  50894. if res != nil && res.StatusCode == http.StatusNotModified {
  50895. if res.Body != nil {
  50896. res.Body.Close()
  50897. }
  50898. return nil, &googleapi.Error{
  50899. Code: res.StatusCode,
  50900. Header: res.Header,
  50901. }
  50902. }
  50903. if err != nil {
  50904. return nil, err
  50905. }
  50906. defer googleapi.CloseBody(res)
  50907. if err := googleapi.CheckResponse(res); err != nil {
  50908. return nil, err
  50909. }
  50910. ret := &MachineTypeList{
  50911. ServerResponse: googleapi.ServerResponse{
  50912. Header: res.Header,
  50913. HTTPStatusCode: res.StatusCode,
  50914. },
  50915. }
  50916. target := &ret
  50917. if err := gensupport.DecodeResponse(target, res); err != nil {
  50918. return nil, err
  50919. }
  50920. return ret, nil
  50921. // {
  50922. // "description": "Retrieves a list of machine types available to the specified project.",
  50923. // "httpMethod": "GET",
  50924. // "id": "compute.machineTypes.list",
  50925. // "parameterOrder": [
  50926. // "project",
  50927. // "zone"
  50928. // ],
  50929. // "parameters": {
  50930. // "filter": {
  50931. // "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).",
  50932. // "location": "query",
  50933. // "type": "string"
  50934. // },
  50935. // "maxResults": {
  50936. // "default": "500",
  50937. // "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)",
  50938. // "format": "uint32",
  50939. // "location": "query",
  50940. // "minimum": "0",
  50941. // "type": "integer"
  50942. // },
  50943. // "orderBy": {
  50944. // "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.",
  50945. // "location": "query",
  50946. // "type": "string"
  50947. // },
  50948. // "pageToken": {
  50949. // "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.",
  50950. // "location": "query",
  50951. // "type": "string"
  50952. // },
  50953. // "project": {
  50954. // "description": "Project ID for this request.",
  50955. // "location": "path",
  50956. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50957. // "required": true,
  50958. // "type": "string"
  50959. // },
  50960. // "zone": {
  50961. // "description": "The name of the zone for this request.",
  50962. // "location": "path",
  50963. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50964. // "required": true,
  50965. // "type": "string"
  50966. // }
  50967. // },
  50968. // "path": "{project}/zones/{zone}/machineTypes",
  50969. // "response": {
  50970. // "$ref": "MachineTypeList"
  50971. // },
  50972. // "scopes": [
  50973. // "https://www.googleapis.com/auth/cloud-platform",
  50974. // "https://www.googleapis.com/auth/compute",
  50975. // "https://www.googleapis.com/auth/compute.readonly"
  50976. // ]
  50977. // }
  50978. }
  50979. // Pages invokes f for each page of results.
  50980. // A non-nil error returned from f will halt the iteration.
  50981. // The provided context supersedes any context provided to the Context method.
  50982. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  50983. c.ctx_ = ctx
  50984. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50985. for {
  50986. x, err := c.Do()
  50987. if err != nil {
  50988. return err
  50989. }
  50990. if err := f(x); err != nil {
  50991. return err
  50992. }
  50993. if x.NextPageToken == "" {
  50994. return nil
  50995. }
  50996. c.PageToken(x.NextPageToken)
  50997. }
  50998. }
  50999. // method id "compute.networks.addPeering":
  51000. type NetworksAddPeeringCall struct {
  51001. s *Service
  51002. project string
  51003. network string
  51004. networksaddpeeringrequest *NetworksAddPeeringRequest
  51005. urlParams_ gensupport.URLParams
  51006. ctx_ context.Context
  51007. header_ http.Header
  51008. }
  51009. // AddPeering: Adds a peering to the specified network.
  51010. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  51011. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51012. c.project = project
  51013. c.network = network
  51014. c.networksaddpeeringrequest = networksaddpeeringrequest
  51015. return c
  51016. }
  51017. // RequestId sets the optional parameter "requestId": An optional
  51018. // request ID to identify requests. Specify a unique request ID so that
  51019. // if you must retry your request, the server will know to ignore the
  51020. // request if it has already been completed.
  51021. //
  51022. // For example, consider a situation where you make an initial request
  51023. // and the request times out. If you make the request again with the
  51024. // same request ID, the server can check if original operation with the
  51025. // same request ID was received, and if so, will ignore the second
  51026. // request. This prevents clients from accidentally creating duplicate
  51027. // commitments.
  51028. //
  51029. // The request ID must be a valid UUID with the exception that zero UUID
  51030. // is not supported (00000000-0000-0000-0000-000000000000).
  51031. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  51032. c.urlParams_.Set("requestId", requestId)
  51033. return c
  51034. }
  51035. // Fields allows partial responses to be retrieved. See
  51036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51037. // for more information.
  51038. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  51039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51040. return c
  51041. }
  51042. // Context sets the context to be used in this call's Do method. Any
  51043. // pending HTTP request will be aborted if the provided context is
  51044. // canceled.
  51045. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  51046. c.ctx_ = ctx
  51047. return c
  51048. }
  51049. // Header returns an http.Header that can be modified by the caller to
  51050. // add HTTP headers to the request.
  51051. func (c *NetworksAddPeeringCall) Header() http.Header {
  51052. if c.header_ == nil {
  51053. c.header_ = make(http.Header)
  51054. }
  51055. return c.header_
  51056. }
  51057. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  51058. reqHeaders := make(http.Header)
  51059. for k, v := range c.header_ {
  51060. reqHeaders[k] = v
  51061. }
  51062. reqHeaders.Set("User-Agent", c.s.userAgent())
  51063. var body io.Reader = nil
  51064. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  51065. if err != nil {
  51066. return nil, err
  51067. }
  51068. reqHeaders.Set("Content-Type", "application/json")
  51069. c.urlParams_.Set("alt", alt)
  51070. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  51071. urls += "?" + c.urlParams_.Encode()
  51072. req, _ := http.NewRequest("POST", urls, body)
  51073. req.Header = reqHeaders
  51074. googleapi.Expand(req.URL, map[string]string{
  51075. "project": c.project,
  51076. "network": c.network,
  51077. })
  51078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51079. }
  51080. // Do executes the "compute.networks.addPeering" call.
  51081. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51082. // status code is an error. Response headers are in either
  51083. // *Operation.ServerResponse.Header or (if a response was returned at
  51084. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51085. // to check whether the returned error was because
  51086. // http.StatusNotModified was returned.
  51087. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51088. gensupport.SetOptions(c.urlParams_, opts...)
  51089. res, err := c.doRequest("json")
  51090. if res != nil && res.StatusCode == http.StatusNotModified {
  51091. if res.Body != nil {
  51092. res.Body.Close()
  51093. }
  51094. return nil, &googleapi.Error{
  51095. Code: res.StatusCode,
  51096. Header: res.Header,
  51097. }
  51098. }
  51099. if err != nil {
  51100. return nil, err
  51101. }
  51102. defer googleapi.CloseBody(res)
  51103. if err := googleapi.CheckResponse(res); err != nil {
  51104. return nil, err
  51105. }
  51106. ret := &Operation{
  51107. ServerResponse: googleapi.ServerResponse{
  51108. Header: res.Header,
  51109. HTTPStatusCode: res.StatusCode,
  51110. },
  51111. }
  51112. target := &ret
  51113. if err := gensupport.DecodeResponse(target, res); err != nil {
  51114. return nil, err
  51115. }
  51116. return ret, nil
  51117. // {
  51118. // "description": "Adds a peering to the specified network.",
  51119. // "httpMethod": "POST",
  51120. // "id": "compute.networks.addPeering",
  51121. // "parameterOrder": [
  51122. // "project",
  51123. // "network"
  51124. // ],
  51125. // "parameters": {
  51126. // "network": {
  51127. // "description": "Name of the network resource to add peering to.",
  51128. // "location": "path",
  51129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51130. // "required": true,
  51131. // "type": "string"
  51132. // },
  51133. // "project": {
  51134. // "description": "Project ID for this request.",
  51135. // "location": "path",
  51136. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51137. // "required": true,
  51138. // "type": "string"
  51139. // },
  51140. // "requestId": {
  51141. // "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).",
  51142. // "location": "query",
  51143. // "type": "string"
  51144. // }
  51145. // },
  51146. // "path": "{project}/global/networks/{network}/addPeering",
  51147. // "request": {
  51148. // "$ref": "NetworksAddPeeringRequest"
  51149. // },
  51150. // "response": {
  51151. // "$ref": "Operation"
  51152. // },
  51153. // "scopes": [
  51154. // "https://www.googleapis.com/auth/cloud-platform",
  51155. // "https://www.googleapis.com/auth/compute"
  51156. // ]
  51157. // }
  51158. }
  51159. // method id "compute.networks.delete":
  51160. type NetworksDeleteCall struct {
  51161. s *Service
  51162. project string
  51163. network string
  51164. urlParams_ gensupport.URLParams
  51165. ctx_ context.Context
  51166. header_ http.Header
  51167. }
  51168. // Delete: Deletes the specified network.
  51169. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  51170. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  51171. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51172. c.project = project
  51173. c.network = network
  51174. return c
  51175. }
  51176. // RequestId sets the optional parameter "requestId": An optional
  51177. // request ID to identify requests. Specify a unique request ID so that
  51178. // if you must retry your request, the server will know to ignore the
  51179. // request if it has already been completed.
  51180. //
  51181. // For example, consider a situation where you make an initial request
  51182. // and the request times out. If you make the request again with the
  51183. // same request ID, the server can check if original operation with the
  51184. // same request ID was received, and if so, will ignore the second
  51185. // request. This prevents clients from accidentally creating duplicate
  51186. // commitments.
  51187. //
  51188. // The request ID must be a valid UUID with the exception that zero UUID
  51189. // is not supported (00000000-0000-0000-0000-000000000000).
  51190. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  51191. c.urlParams_.Set("requestId", requestId)
  51192. return c
  51193. }
  51194. // Fields allows partial responses to be retrieved. See
  51195. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51196. // for more information.
  51197. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  51198. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51199. return c
  51200. }
  51201. // Context sets the context to be used in this call's Do method. Any
  51202. // pending HTTP request will be aborted if the provided context is
  51203. // canceled.
  51204. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  51205. c.ctx_ = ctx
  51206. return c
  51207. }
  51208. // Header returns an http.Header that can be modified by the caller to
  51209. // add HTTP headers to the request.
  51210. func (c *NetworksDeleteCall) Header() http.Header {
  51211. if c.header_ == nil {
  51212. c.header_ = make(http.Header)
  51213. }
  51214. return c.header_
  51215. }
  51216. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  51217. reqHeaders := make(http.Header)
  51218. for k, v := range c.header_ {
  51219. reqHeaders[k] = v
  51220. }
  51221. reqHeaders.Set("User-Agent", c.s.userAgent())
  51222. var body io.Reader = nil
  51223. c.urlParams_.Set("alt", alt)
  51224. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  51225. urls += "?" + c.urlParams_.Encode()
  51226. req, _ := http.NewRequest("DELETE", urls, body)
  51227. req.Header = reqHeaders
  51228. googleapi.Expand(req.URL, map[string]string{
  51229. "project": c.project,
  51230. "network": c.network,
  51231. })
  51232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51233. }
  51234. // Do executes the "compute.networks.delete" call.
  51235. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51236. // status code is an error. Response headers are in either
  51237. // *Operation.ServerResponse.Header or (if a response was returned at
  51238. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51239. // to check whether the returned error was because
  51240. // http.StatusNotModified was returned.
  51241. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51242. gensupport.SetOptions(c.urlParams_, opts...)
  51243. res, err := c.doRequest("json")
  51244. if res != nil && res.StatusCode == http.StatusNotModified {
  51245. if res.Body != nil {
  51246. res.Body.Close()
  51247. }
  51248. return nil, &googleapi.Error{
  51249. Code: res.StatusCode,
  51250. Header: res.Header,
  51251. }
  51252. }
  51253. if err != nil {
  51254. return nil, err
  51255. }
  51256. defer googleapi.CloseBody(res)
  51257. if err := googleapi.CheckResponse(res); err != nil {
  51258. return nil, err
  51259. }
  51260. ret := &Operation{
  51261. ServerResponse: googleapi.ServerResponse{
  51262. Header: res.Header,
  51263. HTTPStatusCode: res.StatusCode,
  51264. },
  51265. }
  51266. target := &ret
  51267. if err := gensupport.DecodeResponse(target, res); err != nil {
  51268. return nil, err
  51269. }
  51270. return ret, nil
  51271. // {
  51272. // "description": "Deletes the specified network.",
  51273. // "httpMethod": "DELETE",
  51274. // "id": "compute.networks.delete",
  51275. // "parameterOrder": [
  51276. // "project",
  51277. // "network"
  51278. // ],
  51279. // "parameters": {
  51280. // "network": {
  51281. // "description": "Name of the network to delete.",
  51282. // "location": "path",
  51283. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51284. // "required": true,
  51285. // "type": "string"
  51286. // },
  51287. // "project": {
  51288. // "description": "Project ID for this request.",
  51289. // "location": "path",
  51290. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51291. // "required": true,
  51292. // "type": "string"
  51293. // },
  51294. // "requestId": {
  51295. // "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).",
  51296. // "location": "query",
  51297. // "type": "string"
  51298. // }
  51299. // },
  51300. // "path": "{project}/global/networks/{network}",
  51301. // "response": {
  51302. // "$ref": "Operation"
  51303. // },
  51304. // "scopes": [
  51305. // "https://www.googleapis.com/auth/cloud-platform",
  51306. // "https://www.googleapis.com/auth/compute"
  51307. // ]
  51308. // }
  51309. }
  51310. // method id "compute.networks.get":
  51311. type NetworksGetCall struct {
  51312. s *Service
  51313. project string
  51314. network string
  51315. urlParams_ gensupport.URLParams
  51316. ifNoneMatch_ string
  51317. ctx_ context.Context
  51318. header_ http.Header
  51319. }
  51320. // Get: Returns the specified network. Gets a list of available networks
  51321. // by making a list() request.
  51322. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  51323. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  51324. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51325. c.project = project
  51326. c.network = network
  51327. return c
  51328. }
  51329. // Fields allows partial responses to be retrieved. See
  51330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51331. // for more information.
  51332. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  51333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51334. return c
  51335. }
  51336. // IfNoneMatch sets the optional parameter which makes the operation
  51337. // fail if the object's ETag matches the given value. This is useful for
  51338. // getting updates only after the object has changed since the last
  51339. // request. Use googleapi.IsNotModified to check whether the response
  51340. // error from Do is the result of In-None-Match.
  51341. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  51342. c.ifNoneMatch_ = entityTag
  51343. return c
  51344. }
  51345. // Context sets the context to be used in this call's Do method. Any
  51346. // pending HTTP request will be aborted if the provided context is
  51347. // canceled.
  51348. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  51349. c.ctx_ = ctx
  51350. return c
  51351. }
  51352. // Header returns an http.Header that can be modified by the caller to
  51353. // add HTTP headers to the request.
  51354. func (c *NetworksGetCall) Header() http.Header {
  51355. if c.header_ == nil {
  51356. c.header_ = make(http.Header)
  51357. }
  51358. return c.header_
  51359. }
  51360. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  51361. reqHeaders := make(http.Header)
  51362. for k, v := range c.header_ {
  51363. reqHeaders[k] = v
  51364. }
  51365. reqHeaders.Set("User-Agent", c.s.userAgent())
  51366. if c.ifNoneMatch_ != "" {
  51367. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51368. }
  51369. var body io.Reader = nil
  51370. c.urlParams_.Set("alt", alt)
  51371. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  51372. urls += "?" + c.urlParams_.Encode()
  51373. req, _ := http.NewRequest("GET", urls, body)
  51374. req.Header = reqHeaders
  51375. googleapi.Expand(req.URL, map[string]string{
  51376. "project": c.project,
  51377. "network": c.network,
  51378. })
  51379. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51380. }
  51381. // Do executes the "compute.networks.get" call.
  51382. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  51383. // code is an error. Response headers are in either
  51384. // *Network.ServerResponse.Header or (if a response was returned at all)
  51385. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  51386. // check whether the returned error was because http.StatusNotModified
  51387. // was returned.
  51388. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  51389. gensupport.SetOptions(c.urlParams_, opts...)
  51390. res, err := c.doRequest("json")
  51391. if res != nil && res.StatusCode == http.StatusNotModified {
  51392. if res.Body != nil {
  51393. res.Body.Close()
  51394. }
  51395. return nil, &googleapi.Error{
  51396. Code: res.StatusCode,
  51397. Header: res.Header,
  51398. }
  51399. }
  51400. if err != nil {
  51401. return nil, err
  51402. }
  51403. defer googleapi.CloseBody(res)
  51404. if err := googleapi.CheckResponse(res); err != nil {
  51405. return nil, err
  51406. }
  51407. ret := &Network{
  51408. ServerResponse: googleapi.ServerResponse{
  51409. Header: res.Header,
  51410. HTTPStatusCode: res.StatusCode,
  51411. },
  51412. }
  51413. target := &ret
  51414. if err := gensupport.DecodeResponse(target, res); err != nil {
  51415. return nil, err
  51416. }
  51417. return ret, nil
  51418. // {
  51419. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  51420. // "httpMethod": "GET",
  51421. // "id": "compute.networks.get",
  51422. // "parameterOrder": [
  51423. // "project",
  51424. // "network"
  51425. // ],
  51426. // "parameters": {
  51427. // "network": {
  51428. // "description": "Name of the network to return.",
  51429. // "location": "path",
  51430. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51431. // "required": true,
  51432. // "type": "string"
  51433. // },
  51434. // "project": {
  51435. // "description": "Project ID for this request.",
  51436. // "location": "path",
  51437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51438. // "required": true,
  51439. // "type": "string"
  51440. // }
  51441. // },
  51442. // "path": "{project}/global/networks/{network}",
  51443. // "response": {
  51444. // "$ref": "Network"
  51445. // },
  51446. // "scopes": [
  51447. // "https://www.googleapis.com/auth/cloud-platform",
  51448. // "https://www.googleapis.com/auth/compute",
  51449. // "https://www.googleapis.com/auth/compute.readonly"
  51450. // ]
  51451. // }
  51452. }
  51453. // method id "compute.networks.insert":
  51454. type NetworksInsertCall struct {
  51455. s *Service
  51456. project string
  51457. network *Network
  51458. urlParams_ gensupport.URLParams
  51459. ctx_ context.Context
  51460. header_ http.Header
  51461. }
  51462. // Insert: Creates a network in the specified project using the data
  51463. // included in the request.
  51464. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  51465. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  51466. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51467. c.project = project
  51468. c.network = network
  51469. return c
  51470. }
  51471. // RequestId sets the optional parameter "requestId": An optional
  51472. // request ID to identify requests. Specify a unique request ID so that
  51473. // if you must retry your request, the server will know to ignore the
  51474. // request if it has already been completed.
  51475. //
  51476. // For example, consider a situation where you make an initial request
  51477. // and the request times out. If you make the request again with the
  51478. // same request ID, the server can check if original operation with the
  51479. // same request ID was received, and if so, will ignore the second
  51480. // request. This prevents clients from accidentally creating duplicate
  51481. // commitments.
  51482. //
  51483. // The request ID must be a valid UUID with the exception that zero UUID
  51484. // is not supported (00000000-0000-0000-0000-000000000000).
  51485. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  51486. c.urlParams_.Set("requestId", requestId)
  51487. return c
  51488. }
  51489. // Fields allows partial responses to be retrieved. See
  51490. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51491. // for more information.
  51492. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  51493. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51494. return c
  51495. }
  51496. // Context sets the context to be used in this call's Do method. Any
  51497. // pending HTTP request will be aborted if the provided context is
  51498. // canceled.
  51499. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  51500. c.ctx_ = ctx
  51501. return c
  51502. }
  51503. // Header returns an http.Header that can be modified by the caller to
  51504. // add HTTP headers to the request.
  51505. func (c *NetworksInsertCall) Header() http.Header {
  51506. if c.header_ == nil {
  51507. c.header_ = make(http.Header)
  51508. }
  51509. return c.header_
  51510. }
  51511. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  51512. reqHeaders := make(http.Header)
  51513. for k, v := range c.header_ {
  51514. reqHeaders[k] = v
  51515. }
  51516. reqHeaders.Set("User-Agent", c.s.userAgent())
  51517. var body io.Reader = nil
  51518. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  51519. if err != nil {
  51520. return nil, err
  51521. }
  51522. reqHeaders.Set("Content-Type", "application/json")
  51523. c.urlParams_.Set("alt", alt)
  51524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  51525. urls += "?" + c.urlParams_.Encode()
  51526. req, _ := http.NewRequest("POST", urls, body)
  51527. req.Header = reqHeaders
  51528. googleapi.Expand(req.URL, map[string]string{
  51529. "project": c.project,
  51530. })
  51531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51532. }
  51533. // Do executes the "compute.networks.insert" call.
  51534. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51535. // status code is an error. Response headers are in either
  51536. // *Operation.ServerResponse.Header or (if a response was returned at
  51537. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51538. // to check whether the returned error was because
  51539. // http.StatusNotModified was returned.
  51540. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51541. gensupport.SetOptions(c.urlParams_, opts...)
  51542. res, err := c.doRequest("json")
  51543. if res != nil && res.StatusCode == http.StatusNotModified {
  51544. if res.Body != nil {
  51545. res.Body.Close()
  51546. }
  51547. return nil, &googleapi.Error{
  51548. Code: res.StatusCode,
  51549. Header: res.Header,
  51550. }
  51551. }
  51552. if err != nil {
  51553. return nil, err
  51554. }
  51555. defer googleapi.CloseBody(res)
  51556. if err := googleapi.CheckResponse(res); err != nil {
  51557. return nil, err
  51558. }
  51559. ret := &Operation{
  51560. ServerResponse: googleapi.ServerResponse{
  51561. Header: res.Header,
  51562. HTTPStatusCode: res.StatusCode,
  51563. },
  51564. }
  51565. target := &ret
  51566. if err := gensupport.DecodeResponse(target, res); err != nil {
  51567. return nil, err
  51568. }
  51569. return ret, nil
  51570. // {
  51571. // "description": "Creates a network in the specified project using the data included in the request.",
  51572. // "httpMethod": "POST",
  51573. // "id": "compute.networks.insert",
  51574. // "parameterOrder": [
  51575. // "project"
  51576. // ],
  51577. // "parameters": {
  51578. // "project": {
  51579. // "description": "Project ID for this request.",
  51580. // "location": "path",
  51581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51582. // "required": true,
  51583. // "type": "string"
  51584. // },
  51585. // "requestId": {
  51586. // "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).",
  51587. // "location": "query",
  51588. // "type": "string"
  51589. // }
  51590. // },
  51591. // "path": "{project}/global/networks",
  51592. // "request": {
  51593. // "$ref": "Network"
  51594. // },
  51595. // "response": {
  51596. // "$ref": "Operation"
  51597. // },
  51598. // "scopes": [
  51599. // "https://www.googleapis.com/auth/cloud-platform",
  51600. // "https://www.googleapis.com/auth/compute"
  51601. // ]
  51602. // }
  51603. }
  51604. // method id "compute.networks.list":
  51605. type NetworksListCall struct {
  51606. s *Service
  51607. project string
  51608. urlParams_ gensupport.URLParams
  51609. ifNoneMatch_ string
  51610. ctx_ context.Context
  51611. header_ http.Header
  51612. }
  51613. // List: Retrieves the list of networks available to the specified
  51614. // project.
  51615. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  51616. func (r *NetworksService) List(project string) *NetworksListCall {
  51617. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51618. c.project = project
  51619. return c
  51620. }
  51621. // Filter sets the optional parameter "filter": A filter expression that
  51622. // filters resources listed in the response. The expression must specify
  51623. // the field name, a comparison operator, and the value that you want to
  51624. // use for filtering. The value must be a string, a number, or a
  51625. // boolean. The comparison operator must be either =, !=, >, or <.
  51626. //
  51627. // For example, if you are filtering Compute Engine instances, you can
  51628. // exclude instances named example-instance by specifying name !=
  51629. // example-instance.
  51630. //
  51631. // You can also filter nested fields. For example, you could specify
  51632. // scheduling.automaticRestart = false to include instances only if they
  51633. // are not scheduled for automatic restarts. You can use filtering on
  51634. // nested fields to filter based on resource labels.
  51635. //
  51636. // To filter on multiple expressions, provide each separate expression
  51637. // within parentheses. For example, (scheduling.automaticRestart = true)
  51638. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51639. // AND expression. However, you can include AND and OR expressions
  51640. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51641. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51642. // true).
  51643. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  51644. c.urlParams_.Set("filter", filter)
  51645. return c
  51646. }
  51647. // MaxResults sets the optional parameter "maxResults": The maximum
  51648. // number of results per page that should be returned. If the number of
  51649. // available results is larger than maxResults, Compute Engine returns a
  51650. // nextPageToken that can be used to get the next page of results in
  51651. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51652. // (Default: 500)
  51653. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  51654. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51655. return c
  51656. }
  51657. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51658. // a certain order. By default, results are returned in alphanumerical
  51659. // order based on the resource name.
  51660. //
  51661. // You can also sort results in descending order based on the creation
  51662. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51663. // based on the creationTimestamp field in reverse chronological order
  51664. // (newest result first). Use this to sort resources like operations so
  51665. // that the newest operation is returned first.
  51666. //
  51667. // Currently, only sorting by name or creationTimestamp desc is
  51668. // supported.
  51669. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  51670. c.urlParams_.Set("orderBy", orderBy)
  51671. return c
  51672. }
  51673. // PageToken sets the optional parameter "pageToken": Specifies a page
  51674. // token to use. Set pageToken to the nextPageToken returned by a
  51675. // previous list request to get the next page of results.
  51676. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  51677. c.urlParams_.Set("pageToken", pageToken)
  51678. return c
  51679. }
  51680. // Fields allows partial responses to be retrieved. See
  51681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51682. // for more information.
  51683. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  51684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51685. return c
  51686. }
  51687. // IfNoneMatch sets the optional parameter which makes the operation
  51688. // fail if the object's ETag matches the given value. This is useful for
  51689. // getting updates only after the object has changed since the last
  51690. // request. Use googleapi.IsNotModified to check whether the response
  51691. // error from Do is the result of In-None-Match.
  51692. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  51693. c.ifNoneMatch_ = entityTag
  51694. return c
  51695. }
  51696. // Context sets the context to be used in this call's Do method. Any
  51697. // pending HTTP request will be aborted if the provided context is
  51698. // canceled.
  51699. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  51700. c.ctx_ = ctx
  51701. return c
  51702. }
  51703. // Header returns an http.Header that can be modified by the caller to
  51704. // add HTTP headers to the request.
  51705. func (c *NetworksListCall) Header() http.Header {
  51706. if c.header_ == nil {
  51707. c.header_ = make(http.Header)
  51708. }
  51709. return c.header_
  51710. }
  51711. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  51712. reqHeaders := make(http.Header)
  51713. for k, v := range c.header_ {
  51714. reqHeaders[k] = v
  51715. }
  51716. reqHeaders.Set("User-Agent", c.s.userAgent())
  51717. if c.ifNoneMatch_ != "" {
  51718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51719. }
  51720. var body io.Reader = nil
  51721. c.urlParams_.Set("alt", alt)
  51722. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  51723. urls += "?" + c.urlParams_.Encode()
  51724. req, _ := http.NewRequest("GET", urls, body)
  51725. req.Header = reqHeaders
  51726. googleapi.Expand(req.URL, map[string]string{
  51727. "project": c.project,
  51728. })
  51729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51730. }
  51731. // Do executes the "compute.networks.list" call.
  51732. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  51733. // status code is an error. Response headers are in either
  51734. // *NetworkList.ServerResponse.Header or (if a response was returned at
  51735. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51736. // to check whether the returned error was because
  51737. // http.StatusNotModified was returned.
  51738. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  51739. gensupport.SetOptions(c.urlParams_, opts...)
  51740. res, err := c.doRequest("json")
  51741. if res != nil && res.StatusCode == http.StatusNotModified {
  51742. if res.Body != nil {
  51743. res.Body.Close()
  51744. }
  51745. return nil, &googleapi.Error{
  51746. Code: res.StatusCode,
  51747. Header: res.Header,
  51748. }
  51749. }
  51750. if err != nil {
  51751. return nil, err
  51752. }
  51753. defer googleapi.CloseBody(res)
  51754. if err := googleapi.CheckResponse(res); err != nil {
  51755. return nil, err
  51756. }
  51757. ret := &NetworkList{
  51758. ServerResponse: googleapi.ServerResponse{
  51759. Header: res.Header,
  51760. HTTPStatusCode: res.StatusCode,
  51761. },
  51762. }
  51763. target := &ret
  51764. if err := gensupport.DecodeResponse(target, res); err != nil {
  51765. return nil, err
  51766. }
  51767. return ret, nil
  51768. // {
  51769. // "description": "Retrieves the list of networks available to the specified project.",
  51770. // "httpMethod": "GET",
  51771. // "id": "compute.networks.list",
  51772. // "parameterOrder": [
  51773. // "project"
  51774. // ],
  51775. // "parameters": {
  51776. // "filter": {
  51777. // "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).",
  51778. // "location": "query",
  51779. // "type": "string"
  51780. // },
  51781. // "maxResults": {
  51782. // "default": "500",
  51783. // "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)",
  51784. // "format": "uint32",
  51785. // "location": "query",
  51786. // "minimum": "0",
  51787. // "type": "integer"
  51788. // },
  51789. // "orderBy": {
  51790. // "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.",
  51791. // "location": "query",
  51792. // "type": "string"
  51793. // },
  51794. // "pageToken": {
  51795. // "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.",
  51796. // "location": "query",
  51797. // "type": "string"
  51798. // },
  51799. // "project": {
  51800. // "description": "Project ID for this request.",
  51801. // "location": "path",
  51802. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51803. // "required": true,
  51804. // "type": "string"
  51805. // }
  51806. // },
  51807. // "path": "{project}/global/networks",
  51808. // "response": {
  51809. // "$ref": "NetworkList"
  51810. // },
  51811. // "scopes": [
  51812. // "https://www.googleapis.com/auth/cloud-platform",
  51813. // "https://www.googleapis.com/auth/compute",
  51814. // "https://www.googleapis.com/auth/compute.readonly"
  51815. // ]
  51816. // }
  51817. }
  51818. // Pages invokes f for each page of results.
  51819. // A non-nil error returned from f will halt the iteration.
  51820. // The provided context supersedes any context provided to the Context method.
  51821. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  51822. c.ctx_ = ctx
  51823. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51824. for {
  51825. x, err := c.Do()
  51826. if err != nil {
  51827. return err
  51828. }
  51829. if err := f(x); err != nil {
  51830. return err
  51831. }
  51832. if x.NextPageToken == "" {
  51833. return nil
  51834. }
  51835. c.PageToken(x.NextPageToken)
  51836. }
  51837. }
  51838. // method id "compute.networks.patch":
  51839. type NetworksPatchCall struct {
  51840. s *Service
  51841. project string
  51842. network string
  51843. network2 *Network
  51844. urlParams_ gensupport.URLParams
  51845. ctx_ context.Context
  51846. header_ http.Header
  51847. }
  51848. // Patch: Patches the specified network with the data included in the
  51849. // request. Only the following fields can be modified:
  51850. // routingConfig.routingMode.
  51851. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  51852. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51853. c.project = project
  51854. c.network = network
  51855. c.network2 = network2
  51856. return c
  51857. }
  51858. // RequestId sets the optional parameter "requestId": An optional
  51859. // request ID to identify requests. Specify a unique request ID so that
  51860. // if you must retry your request, the server will know to ignore the
  51861. // request if it has already been completed.
  51862. //
  51863. // For example, consider a situation where you make an initial request
  51864. // and the request times out. If you make the request again with the
  51865. // same request ID, the server can check if original operation with the
  51866. // same request ID was received, and if so, will ignore the second
  51867. // request. This prevents clients from accidentally creating duplicate
  51868. // commitments.
  51869. //
  51870. // The request ID must be a valid UUID with the exception that zero UUID
  51871. // is not supported (00000000-0000-0000-0000-000000000000).
  51872. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  51873. c.urlParams_.Set("requestId", requestId)
  51874. return c
  51875. }
  51876. // Fields allows partial responses to be retrieved. See
  51877. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51878. // for more information.
  51879. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  51880. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51881. return c
  51882. }
  51883. // Context sets the context to be used in this call's Do method. Any
  51884. // pending HTTP request will be aborted if the provided context is
  51885. // canceled.
  51886. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  51887. c.ctx_ = ctx
  51888. return c
  51889. }
  51890. // Header returns an http.Header that can be modified by the caller to
  51891. // add HTTP headers to the request.
  51892. func (c *NetworksPatchCall) Header() http.Header {
  51893. if c.header_ == nil {
  51894. c.header_ = make(http.Header)
  51895. }
  51896. return c.header_
  51897. }
  51898. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  51899. reqHeaders := make(http.Header)
  51900. for k, v := range c.header_ {
  51901. reqHeaders[k] = v
  51902. }
  51903. reqHeaders.Set("User-Agent", c.s.userAgent())
  51904. var body io.Reader = nil
  51905. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  51906. if err != nil {
  51907. return nil, err
  51908. }
  51909. reqHeaders.Set("Content-Type", "application/json")
  51910. c.urlParams_.Set("alt", alt)
  51911. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  51912. urls += "?" + c.urlParams_.Encode()
  51913. req, _ := http.NewRequest("PATCH", urls, body)
  51914. req.Header = reqHeaders
  51915. googleapi.Expand(req.URL, map[string]string{
  51916. "project": c.project,
  51917. "network": c.network,
  51918. })
  51919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51920. }
  51921. // Do executes the "compute.networks.patch" call.
  51922. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51923. // status code is an error. Response headers are in either
  51924. // *Operation.ServerResponse.Header or (if a response was returned at
  51925. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51926. // to check whether the returned error was because
  51927. // http.StatusNotModified was returned.
  51928. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51929. gensupport.SetOptions(c.urlParams_, opts...)
  51930. res, err := c.doRequest("json")
  51931. if res != nil && res.StatusCode == http.StatusNotModified {
  51932. if res.Body != nil {
  51933. res.Body.Close()
  51934. }
  51935. return nil, &googleapi.Error{
  51936. Code: res.StatusCode,
  51937. Header: res.Header,
  51938. }
  51939. }
  51940. if err != nil {
  51941. return nil, err
  51942. }
  51943. defer googleapi.CloseBody(res)
  51944. if err := googleapi.CheckResponse(res); err != nil {
  51945. return nil, err
  51946. }
  51947. ret := &Operation{
  51948. ServerResponse: googleapi.ServerResponse{
  51949. Header: res.Header,
  51950. HTTPStatusCode: res.StatusCode,
  51951. },
  51952. }
  51953. target := &ret
  51954. if err := gensupport.DecodeResponse(target, res); err != nil {
  51955. return nil, err
  51956. }
  51957. return ret, nil
  51958. // {
  51959. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  51960. // "httpMethod": "PATCH",
  51961. // "id": "compute.networks.patch",
  51962. // "parameterOrder": [
  51963. // "project",
  51964. // "network"
  51965. // ],
  51966. // "parameters": {
  51967. // "network": {
  51968. // "description": "Name of the network to update.",
  51969. // "location": "path",
  51970. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51971. // "required": true,
  51972. // "type": "string"
  51973. // },
  51974. // "project": {
  51975. // "description": "Project ID for this request.",
  51976. // "location": "path",
  51977. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51978. // "required": true,
  51979. // "type": "string"
  51980. // },
  51981. // "requestId": {
  51982. // "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).",
  51983. // "location": "query",
  51984. // "type": "string"
  51985. // }
  51986. // },
  51987. // "path": "{project}/global/networks/{network}",
  51988. // "request": {
  51989. // "$ref": "Network"
  51990. // },
  51991. // "response": {
  51992. // "$ref": "Operation"
  51993. // },
  51994. // "scopes": [
  51995. // "https://www.googleapis.com/auth/cloud-platform",
  51996. // "https://www.googleapis.com/auth/compute"
  51997. // ]
  51998. // }
  51999. }
  52000. // method id "compute.networks.removePeering":
  52001. type NetworksRemovePeeringCall struct {
  52002. s *Service
  52003. project string
  52004. network string
  52005. networksremovepeeringrequest *NetworksRemovePeeringRequest
  52006. urlParams_ gensupport.URLParams
  52007. ctx_ context.Context
  52008. header_ http.Header
  52009. }
  52010. // RemovePeering: Removes a peering from the specified network.
  52011. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  52012. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52013. c.project = project
  52014. c.network = network
  52015. c.networksremovepeeringrequest = networksremovepeeringrequest
  52016. return c
  52017. }
  52018. // RequestId sets the optional parameter "requestId": An optional
  52019. // request ID to identify requests. Specify a unique request ID so that
  52020. // if you must retry your request, the server will know to ignore the
  52021. // request if it has already been completed.
  52022. //
  52023. // For example, consider a situation where you make an initial request
  52024. // and the request times out. If you make the request again with the
  52025. // same request ID, the server can check if original operation with the
  52026. // same request ID was received, and if so, will ignore the second
  52027. // request. This prevents clients from accidentally creating duplicate
  52028. // commitments.
  52029. //
  52030. // The request ID must be a valid UUID with the exception that zero UUID
  52031. // is not supported (00000000-0000-0000-0000-000000000000).
  52032. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  52033. c.urlParams_.Set("requestId", requestId)
  52034. return c
  52035. }
  52036. // Fields allows partial responses to be retrieved. See
  52037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52038. // for more information.
  52039. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  52040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52041. return c
  52042. }
  52043. // Context sets the context to be used in this call's Do method. Any
  52044. // pending HTTP request will be aborted if the provided context is
  52045. // canceled.
  52046. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  52047. c.ctx_ = ctx
  52048. return c
  52049. }
  52050. // Header returns an http.Header that can be modified by the caller to
  52051. // add HTTP headers to the request.
  52052. func (c *NetworksRemovePeeringCall) Header() http.Header {
  52053. if c.header_ == nil {
  52054. c.header_ = make(http.Header)
  52055. }
  52056. return c.header_
  52057. }
  52058. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  52059. reqHeaders := make(http.Header)
  52060. for k, v := range c.header_ {
  52061. reqHeaders[k] = v
  52062. }
  52063. reqHeaders.Set("User-Agent", c.s.userAgent())
  52064. var body io.Reader = nil
  52065. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  52066. if err != nil {
  52067. return nil, err
  52068. }
  52069. reqHeaders.Set("Content-Type", "application/json")
  52070. c.urlParams_.Set("alt", alt)
  52071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  52072. urls += "?" + c.urlParams_.Encode()
  52073. req, _ := http.NewRequest("POST", urls, body)
  52074. req.Header = reqHeaders
  52075. googleapi.Expand(req.URL, map[string]string{
  52076. "project": c.project,
  52077. "network": c.network,
  52078. })
  52079. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52080. }
  52081. // Do executes the "compute.networks.removePeering" call.
  52082. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52083. // status code is an error. Response headers are in either
  52084. // *Operation.ServerResponse.Header or (if a response was returned at
  52085. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52086. // to check whether the returned error was because
  52087. // http.StatusNotModified was returned.
  52088. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52089. gensupport.SetOptions(c.urlParams_, opts...)
  52090. res, err := c.doRequest("json")
  52091. if res != nil && res.StatusCode == http.StatusNotModified {
  52092. if res.Body != nil {
  52093. res.Body.Close()
  52094. }
  52095. return nil, &googleapi.Error{
  52096. Code: res.StatusCode,
  52097. Header: res.Header,
  52098. }
  52099. }
  52100. if err != nil {
  52101. return nil, err
  52102. }
  52103. defer googleapi.CloseBody(res)
  52104. if err := googleapi.CheckResponse(res); err != nil {
  52105. return nil, err
  52106. }
  52107. ret := &Operation{
  52108. ServerResponse: googleapi.ServerResponse{
  52109. Header: res.Header,
  52110. HTTPStatusCode: res.StatusCode,
  52111. },
  52112. }
  52113. target := &ret
  52114. if err := gensupport.DecodeResponse(target, res); err != nil {
  52115. return nil, err
  52116. }
  52117. return ret, nil
  52118. // {
  52119. // "description": "Removes a peering from the specified network.",
  52120. // "httpMethod": "POST",
  52121. // "id": "compute.networks.removePeering",
  52122. // "parameterOrder": [
  52123. // "project",
  52124. // "network"
  52125. // ],
  52126. // "parameters": {
  52127. // "network": {
  52128. // "description": "Name of the network resource to remove peering from.",
  52129. // "location": "path",
  52130. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52131. // "required": true,
  52132. // "type": "string"
  52133. // },
  52134. // "project": {
  52135. // "description": "Project ID for this request.",
  52136. // "location": "path",
  52137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52138. // "required": true,
  52139. // "type": "string"
  52140. // },
  52141. // "requestId": {
  52142. // "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).",
  52143. // "location": "query",
  52144. // "type": "string"
  52145. // }
  52146. // },
  52147. // "path": "{project}/global/networks/{network}/removePeering",
  52148. // "request": {
  52149. // "$ref": "NetworksRemovePeeringRequest"
  52150. // },
  52151. // "response": {
  52152. // "$ref": "Operation"
  52153. // },
  52154. // "scopes": [
  52155. // "https://www.googleapis.com/auth/cloud-platform",
  52156. // "https://www.googleapis.com/auth/compute"
  52157. // ]
  52158. // }
  52159. }
  52160. // method id "compute.networks.switchToCustomMode":
  52161. type NetworksSwitchToCustomModeCall struct {
  52162. s *Service
  52163. project string
  52164. network string
  52165. urlParams_ gensupport.URLParams
  52166. ctx_ context.Context
  52167. header_ http.Header
  52168. }
  52169. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  52170. // to custom subnet mode.
  52171. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  52172. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52173. c.project = project
  52174. c.network = network
  52175. return c
  52176. }
  52177. // RequestId sets the optional parameter "requestId": An optional
  52178. // request ID to identify requests. Specify a unique request ID so that
  52179. // if you must retry your request, the server will know to ignore the
  52180. // request if it has already been completed.
  52181. //
  52182. // For example, consider a situation where you make an initial request
  52183. // and the request times out. If you make the request again with the
  52184. // same request ID, the server can check if original operation with the
  52185. // same request ID was received, and if so, will ignore the second
  52186. // request. This prevents clients from accidentally creating duplicate
  52187. // commitments.
  52188. //
  52189. // The request ID must be a valid UUID with the exception that zero UUID
  52190. // is not supported (00000000-0000-0000-0000-000000000000).
  52191. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  52192. c.urlParams_.Set("requestId", requestId)
  52193. return c
  52194. }
  52195. // Fields allows partial responses to be retrieved. See
  52196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52197. // for more information.
  52198. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  52199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52200. return c
  52201. }
  52202. // Context sets the context to be used in this call's Do method. Any
  52203. // pending HTTP request will be aborted if the provided context is
  52204. // canceled.
  52205. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  52206. c.ctx_ = ctx
  52207. return c
  52208. }
  52209. // Header returns an http.Header that can be modified by the caller to
  52210. // add HTTP headers to the request.
  52211. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  52212. if c.header_ == nil {
  52213. c.header_ = make(http.Header)
  52214. }
  52215. return c.header_
  52216. }
  52217. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  52218. reqHeaders := make(http.Header)
  52219. for k, v := range c.header_ {
  52220. reqHeaders[k] = v
  52221. }
  52222. reqHeaders.Set("User-Agent", c.s.userAgent())
  52223. var body io.Reader = nil
  52224. c.urlParams_.Set("alt", alt)
  52225. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  52226. urls += "?" + c.urlParams_.Encode()
  52227. req, _ := http.NewRequest("POST", urls, body)
  52228. req.Header = reqHeaders
  52229. googleapi.Expand(req.URL, map[string]string{
  52230. "project": c.project,
  52231. "network": c.network,
  52232. })
  52233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52234. }
  52235. // Do executes the "compute.networks.switchToCustomMode" call.
  52236. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52237. // status code is an error. Response headers are in either
  52238. // *Operation.ServerResponse.Header or (if a response was returned at
  52239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52240. // to check whether the returned error was because
  52241. // http.StatusNotModified was returned.
  52242. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52243. gensupport.SetOptions(c.urlParams_, opts...)
  52244. res, err := c.doRequest("json")
  52245. if res != nil && res.StatusCode == http.StatusNotModified {
  52246. if res.Body != nil {
  52247. res.Body.Close()
  52248. }
  52249. return nil, &googleapi.Error{
  52250. Code: res.StatusCode,
  52251. Header: res.Header,
  52252. }
  52253. }
  52254. if err != nil {
  52255. return nil, err
  52256. }
  52257. defer googleapi.CloseBody(res)
  52258. if err := googleapi.CheckResponse(res); err != nil {
  52259. return nil, err
  52260. }
  52261. ret := &Operation{
  52262. ServerResponse: googleapi.ServerResponse{
  52263. Header: res.Header,
  52264. HTTPStatusCode: res.StatusCode,
  52265. },
  52266. }
  52267. target := &ret
  52268. if err := gensupport.DecodeResponse(target, res); err != nil {
  52269. return nil, err
  52270. }
  52271. return ret, nil
  52272. // {
  52273. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  52274. // "httpMethod": "POST",
  52275. // "id": "compute.networks.switchToCustomMode",
  52276. // "parameterOrder": [
  52277. // "project",
  52278. // "network"
  52279. // ],
  52280. // "parameters": {
  52281. // "network": {
  52282. // "description": "Name of the network to be updated.",
  52283. // "location": "path",
  52284. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52285. // "required": true,
  52286. // "type": "string"
  52287. // },
  52288. // "project": {
  52289. // "description": "Project ID for this request.",
  52290. // "location": "path",
  52291. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52292. // "required": true,
  52293. // "type": "string"
  52294. // },
  52295. // "requestId": {
  52296. // "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).",
  52297. // "location": "query",
  52298. // "type": "string"
  52299. // }
  52300. // },
  52301. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  52302. // "response": {
  52303. // "$ref": "Operation"
  52304. // },
  52305. // "scopes": [
  52306. // "https://www.googleapis.com/auth/cloud-platform",
  52307. // "https://www.googleapis.com/auth/compute"
  52308. // ]
  52309. // }
  52310. }
  52311. // method id "compute.projects.disableXpnHost":
  52312. type ProjectsDisableXpnHostCall struct {
  52313. s *Service
  52314. project string
  52315. urlParams_ gensupport.URLParams
  52316. ctx_ context.Context
  52317. header_ http.Header
  52318. }
  52319. // DisableXpnHost: Disable this project as a shared VPC host project.
  52320. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  52321. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52322. c.project = project
  52323. return c
  52324. }
  52325. // RequestId sets the optional parameter "requestId": An optional
  52326. // request ID to identify requests. Specify a unique request ID so that
  52327. // if you must retry your request, the server will know to ignore the
  52328. // request if it has already been completed.
  52329. //
  52330. // For example, consider a situation where you make an initial request
  52331. // and the request times out. If you make the request again with the
  52332. // same request ID, the server can check if original operation with the
  52333. // same request ID was received, and if so, will ignore the second
  52334. // request. This prevents clients from accidentally creating duplicate
  52335. // commitments.
  52336. //
  52337. // The request ID must be a valid UUID with the exception that zero UUID
  52338. // is not supported (00000000-0000-0000-0000-000000000000).
  52339. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  52340. c.urlParams_.Set("requestId", requestId)
  52341. return c
  52342. }
  52343. // Fields allows partial responses to be retrieved. See
  52344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52345. // for more information.
  52346. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  52347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52348. return c
  52349. }
  52350. // Context sets the context to be used in this call's Do method. Any
  52351. // pending HTTP request will be aborted if the provided context is
  52352. // canceled.
  52353. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  52354. c.ctx_ = ctx
  52355. return c
  52356. }
  52357. // Header returns an http.Header that can be modified by the caller to
  52358. // add HTTP headers to the request.
  52359. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  52360. if c.header_ == nil {
  52361. c.header_ = make(http.Header)
  52362. }
  52363. return c.header_
  52364. }
  52365. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  52366. reqHeaders := make(http.Header)
  52367. for k, v := range c.header_ {
  52368. reqHeaders[k] = v
  52369. }
  52370. reqHeaders.Set("User-Agent", c.s.userAgent())
  52371. var body io.Reader = nil
  52372. c.urlParams_.Set("alt", alt)
  52373. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  52374. urls += "?" + c.urlParams_.Encode()
  52375. req, _ := http.NewRequest("POST", urls, body)
  52376. req.Header = reqHeaders
  52377. googleapi.Expand(req.URL, map[string]string{
  52378. "project": c.project,
  52379. })
  52380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52381. }
  52382. // Do executes the "compute.projects.disableXpnHost" call.
  52383. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52384. // status code is an error. Response headers are in either
  52385. // *Operation.ServerResponse.Header or (if a response was returned at
  52386. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52387. // to check whether the returned error was because
  52388. // http.StatusNotModified was returned.
  52389. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52390. gensupport.SetOptions(c.urlParams_, opts...)
  52391. res, err := c.doRequest("json")
  52392. if res != nil && res.StatusCode == http.StatusNotModified {
  52393. if res.Body != nil {
  52394. res.Body.Close()
  52395. }
  52396. return nil, &googleapi.Error{
  52397. Code: res.StatusCode,
  52398. Header: res.Header,
  52399. }
  52400. }
  52401. if err != nil {
  52402. return nil, err
  52403. }
  52404. defer googleapi.CloseBody(res)
  52405. if err := googleapi.CheckResponse(res); err != nil {
  52406. return nil, err
  52407. }
  52408. ret := &Operation{
  52409. ServerResponse: googleapi.ServerResponse{
  52410. Header: res.Header,
  52411. HTTPStatusCode: res.StatusCode,
  52412. },
  52413. }
  52414. target := &ret
  52415. if err := gensupport.DecodeResponse(target, res); err != nil {
  52416. return nil, err
  52417. }
  52418. return ret, nil
  52419. // {
  52420. // "description": "Disable this project as a shared VPC host project.",
  52421. // "httpMethod": "POST",
  52422. // "id": "compute.projects.disableXpnHost",
  52423. // "parameterOrder": [
  52424. // "project"
  52425. // ],
  52426. // "parameters": {
  52427. // "project": {
  52428. // "description": "Project ID for this request.",
  52429. // "location": "path",
  52430. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52431. // "required": true,
  52432. // "type": "string"
  52433. // },
  52434. // "requestId": {
  52435. // "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).",
  52436. // "location": "query",
  52437. // "type": "string"
  52438. // }
  52439. // },
  52440. // "path": "{project}/disableXpnHost",
  52441. // "response": {
  52442. // "$ref": "Operation"
  52443. // },
  52444. // "scopes": [
  52445. // "https://www.googleapis.com/auth/cloud-platform",
  52446. // "https://www.googleapis.com/auth/compute"
  52447. // ]
  52448. // }
  52449. }
  52450. // method id "compute.projects.disableXpnResource":
  52451. type ProjectsDisableXpnResourceCall struct {
  52452. s *Service
  52453. project string
  52454. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  52455. urlParams_ gensupport.URLParams
  52456. ctx_ context.Context
  52457. header_ http.Header
  52458. }
  52459. // DisableXpnResource: Disable a serivce resource (a.k.a service
  52460. // project) associated with this host project.
  52461. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  52462. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52463. c.project = project
  52464. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  52465. return c
  52466. }
  52467. // RequestId sets the optional parameter "requestId": An optional
  52468. // request ID to identify requests. Specify a unique request ID so that
  52469. // if you must retry your request, the server will know to ignore the
  52470. // request if it has already been completed.
  52471. //
  52472. // For example, consider a situation where you make an initial request
  52473. // and the request times out. If you make the request again with the
  52474. // same request ID, the server can check if original operation with the
  52475. // same request ID was received, and if so, will ignore the second
  52476. // request. This prevents clients from accidentally creating duplicate
  52477. // commitments.
  52478. //
  52479. // The request ID must be a valid UUID with the exception that zero UUID
  52480. // is not supported (00000000-0000-0000-0000-000000000000).
  52481. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  52482. c.urlParams_.Set("requestId", requestId)
  52483. return c
  52484. }
  52485. // Fields allows partial responses to be retrieved. See
  52486. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52487. // for more information.
  52488. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  52489. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52490. return c
  52491. }
  52492. // Context sets the context to be used in this call's Do method. Any
  52493. // pending HTTP request will be aborted if the provided context is
  52494. // canceled.
  52495. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  52496. c.ctx_ = ctx
  52497. return c
  52498. }
  52499. // Header returns an http.Header that can be modified by the caller to
  52500. // add HTTP headers to the request.
  52501. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  52502. if c.header_ == nil {
  52503. c.header_ = make(http.Header)
  52504. }
  52505. return c.header_
  52506. }
  52507. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  52508. reqHeaders := make(http.Header)
  52509. for k, v := range c.header_ {
  52510. reqHeaders[k] = v
  52511. }
  52512. reqHeaders.Set("User-Agent", c.s.userAgent())
  52513. var body io.Reader = nil
  52514. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  52515. if err != nil {
  52516. return nil, err
  52517. }
  52518. reqHeaders.Set("Content-Type", "application/json")
  52519. c.urlParams_.Set("alt", alt)
  52520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  52521. urls += "?" + c.urlParams_.Encode()
  52522. req, _ := http.NewRequest("POST", urls, body)
  52523. req.Header = reqHeaders
  52524. googleapi.Expand(req.URL, map[string]string{
  52525. "project": c.project,
  52526. })
  52527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52528. }
  52529. // Do executes the "compute.projects.disableXpnResource" call.
  52530. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52531. // status code is an error. Response headers are in either
  52532. // *Operation.ServerResponse.Header or (if a response was returned at
  52533. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52534. // to check whether the returned error was because
  52535. // http.StatusNotModified was returned.
  52536. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52537. gensupport.SetOptions(c.urlParams_, opts...)
  52538. res, err := c.doRequest("json")
  52539. if res != nil && res.StatusCode == http.StatusNotModified {
  52540. if res.Body != nil {
  52541. res.Body.Close()
  52542. }
  52543. return nil, &googleapi.Error{
  52544. Code: res.StatusCode,
  52545. Header: res.Header,
  52546. }
  52547. }
  52548. if err != nil {
  52549. return nil, err
  52550. }
  52551. defer googleapi.CloseBody(res)
  52552. if err := googleapi.CheckResponse(res); err != nil {
  52553. return nil, err
  52554. }
  52555. ret := &Operation{
  52556. ServerResponse: googleapi.ServerResponse{
  52557. Header: res.Header,
  52558. HTTPStatusCode: res.StatusCode,
  52559. },
  52560. }
  52561. target := &ret
  52562. if err := gensupport.DecodeResponse(target, res); err != nil {
  52563. return nil, err
  52564. }
  52565. return ret, nil
  52566. // {
  52567. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  52568. // "httpMethod": "POST",
  52569. // "id": "compute.projects.disableXpnResource",
  52570. // "parameterOrder": [
  52571. // "project"
  52572. // ],
  52573. // "parameters": {
  52574. // "project": {
  52575. // "description": "Project ID for this request.",
  52576. // "location": "path",
  52577. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52578. // "required": true,
  52579. // "type": "string"
  52580. // },
  52581. // "requestId": {
  52582. // "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).",
  52583. // "location": "query",
  52584. // "type": "string"
  52585. // }
  52586. // },
  52587. // "path": "{project}/disableXpnResource",
  52588. // "request": {
  52589. // "$ref": "ProjectsDisableXpnResourceRequest"
  52590. // },
  52591. // "response": {
  52592. // "$ref": "Operation"
  52593. // },
  52594. // "scopes": [
  52595. // "https://www.googleapis.com/auth/cloud-platform",
  52596. // "https://www.googleapis.com/auth/compute"
  52597. // ]
  52598. // }
  52599. }
  52600. // method id "compute.projects.enableXpnHost":
  52601. type ProjectsEnableXpnHostCall struct {
  52602. s *Service
  52603. project string
  52604. urlParams_ gensupport.URLParams
  52605. ctx_ context.Context
  52606. header_ http.Header
  52607. }
  52608. // EnableXpnHost: Enable this project as a shared VPC host project.
  52609. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  52610. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52611. c.project = project
  52612. return c
  52613. }
  52614. // RequestId sets the optional parameter "requestId": An optional
  52615. // request ID to identify requests. Specify a unique request ID so that
  52616. // if you must retry your request, the server will know to ignore the
  52617. // request if it has already been completed.
  52618. //
  52619. // For example, consider a situation where you make an initial request
  52620. // and the request times out. If you make the request again with the
  52621. // same request ID, the server can check if original operation with the
  52622. // same request ID was received, and if so, will ignore the second
  52623. // request. This prevents clients from accidentally creating duplicate
  52624. // commitments.
  52625. //
  52626. // The request ID must be a valid UUID with the exception that zero UUID
  52627. // is not supported (00000000-0000-0000-0000-000000000000).
  52628. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  52629. c.urlParams_.Set("requestId", requestId)
  52630. return c
  52631. }
  52632. // Fields allows partial responses to be retrieved. See
  52633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52634. // for more information.
  52635. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  52636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52637. return c
  52638. }
  52639. // Context sets the context to be used in this call's Do method. Any
  52640. // pending HTTP request will be aborted if the provided context is
  52641. // canceled.
  52642. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  52643. c.ctx_ = ctx
  52644. return c
  52645. }
  52646. // Header returns an http.Header that can be modified by the caller to
  52647. // add HTTP headers to the request.
  52648. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  52649. if c.header_ == nil {
  52650. c.header_ = make(http.Header)
  52651. }
  52652. return c.header_
  52653. }
  52654. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  52655. reqHeaders := make(http.Header)
  52656. for k, v := range c.header_ {
  52657. reqHeaders[k] = v
  52658. }
  52659. reqHeaders.Set("User-Agent", c.s.userAgent())
  52660. var body io.Reader = nil
  52661. c.urlParams_.Set("alt", alt)
  52662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  52663. urls += "?" + c.urlParams_.Encode()
  52664. req, _ := http.NewRequest("POST", urls, body)
  52665. req.Header = reqHeaders
  52666. googleapi.Expand(req.URL, map[string]string{
  52667. "project": c.project,
  52668. })
  52669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52670. }
  52671. // Do executes the "compute.projects.enableXpnHost" call.
  52672. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52673. // status code is an error. Response headers are in either
  52674. // *Operation.ServerResponse.Header or (if a response was returned at
  52675. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52676. // to check whether the returned error was because
  52677. // http.StatusNotModified was returned.
  52678. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52679. gensupport.SetOptions(c.urlParams_, opts...)
  52680. res, err := c.doRequest("json")
  52681. if res != nil && res.StatusCode == http.StatusNotModified {
  52682. if res.Body != nil {
  52683. res.Body.Close()
  52684. }
  52685. return nil, &googleapi.Error{
  52686. Code: res.StatusCode,
  52687. Header: res.Header,
  52688. }
  52689. }
  52690. if err != nil {
  52691. return nil, err
  52692. }
  52693. defer googleapi.CloseBody(res)
  52694. if err := googleapi.CheckResponse(res); err != nil {
  52695. return nil, err
  52696. }
  52697. ret := &Operation{
  52698. ServerResponse: googleapi.ServerResponse{
  52699. Header: res.Header,
  52700. HTTPStatusCode: res.StatusCode,
  52701. },
  52702. }
  52703. target := &ret
  52704. if err := gensupport.DecodeResponse(target, res); err != nil {
  52705. return nil, err
  52706. }
  52707. return ret, nil
  52708. // {
  52709. // "description": "Enable this project as a shared VPC host project.",
  52710. // "httpMethod": "POST",
  52711. // "id": "compute.projects.enableXpnHost",
  52712. // "parameterOrder": [
  52713. // "project"
  52714. // ],
  52715. // "parameters": {
  52716. // "project": {
  52717. // "description": "Project ID for this request.",
  52718. // "location": "path",
  52719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52720. // "required": true,
  52721. // "type": "string"
  52722. // },
  52723. // "requestId": {
  52724. // "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).",
  52725. // "location": "query",
  52726. // "type": "string"
  52727. // }
  52728. // },
  52729. // "path": "{project}/enableXpnHost",
  52730. // "response": {
  52731. // "$ref": "Operation"
  52732. // },
  52733. // "scopes": [
  52734. // "https://www.googleapis.com/auth/cloud-platform",
  52735. // "https://www.googleapis.com/auth/compute"
  52736. // ]
  52737. // }
  52738. }
  52739. // method id "compute.projects.enableXpnResource":
  52740. type ProjectsEnableXpnResourceCall struct {
  52741. s *Service
  52742. project string
  52743. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  52744. urlParams_ gensupport.URLParams
  52745. ctx_ context.Context
  52746. header_ http.Header
  52747. }
  52748. // EnableXpnResource: Enable service resource (a.k.a service project)
  52749. // for a host project, so that subnets in the host project can be used
  52750. // by instances in the service project.
  52751. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  52752. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52753. c.project = project
  52754. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  52755. return c
  52756. }
  52757. // RequestId sets the optional parameter "requestId": An optional
  52758. // request ID to identify requests. Specify a unique request ID so that
  52759. // if you must retry your request, the server will know to ignore the
  52760. // request if it has already been completed.
  52761. //
  52762. // For example, consider a situation where you make an initial request
  52763. // and the request times out. If you make the request again with the
  52764. // same request ID, the server can check if original operation with the
  52765. // same request ID was received, and if so, will ignore the second
  52766. // request. This prevents clients from accidentally creating duplicate
  52767. // commitments.
  52768. //
  52769. // The request ID must be a valid UUID with the exception that zero UUID
  52770. // is not supported (00000000-0000-0000-0000-000000000000).
  52771. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  52772. c.urlParams_.Set("requestId", requestId)
  52773. return c
  52774. }
  52775. // Fields allows partial responses to be retrieved. See
  52776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52777. // for more information.
  52778. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  52779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52780. return c
  52781. }
  52782. // Context sets the context to be used in this call's Do method. Any
  52783. // pending HTTP request will be aborted if the provided context is
  52784. // canceled.
  52785. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  52786. c.ctx_ = ctx
  52787. return c
  52788. }
  52789. // Header returns an http.Header that can be modified by the caller to
  52790. // add HTTP headers to the request.
  52791. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  52792. if c.header_ == nil {
  52793. c.header_ = make(http.Header)
  52794. }
  52795. return c.header_
  52796. }
  52797. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  52798. reqHeaders := make(http.Header)
  52799. for k, v := range c.header_ {
  52800. reqHeaders[k] = v
  52801. }
  52802. reqHeaders.Set("User-Agent", c.s.userAgent())
  52803. var body io.Reader = nil
  52804. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  52805. if err != nil {
  52806. return nil, err
  52807. }
  52808. reqHeaders.Set("Content-Type", "application/json")
  52809. c.urlParams_.Set("alt", alt)
  52810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  52811. urls += "?" + c.urlParams_.Encode()
  52812. req, _ := http.NewRequest("POST", urls, body)
  52813. req.Header = reqHeaders
  52814. googleapi.Expand(req.URL, map[string]string{
  52815. "project": c.project,
  52816. })
  52817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52818. }
  52819. // Do executes the "compute.projects.enableXpnResource" call.
  52820. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52821. // status code is an error. Response headers are in either
  52822. // *Operation.ServerResponse.Header or (if a response was returned at
  52823. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52824. // to check whether the returned error was because
  52825. // http.StatusNotModified was returned.
  52826. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52827. gensupport.SetOptions(c.urlParams_, opts...)
  52828. res, err := c.doRequest("json")
  52829. if res != nil && res.StatusCode == http.StatusNotModified {
  52830. if res.Body != nil {
  52831. res.Body.Close()
  52832. }
  52833. return nil, &googleapi.Error{
  52834. Code: res.StatusCode,
  52835. Header: res.Header,
  52836. }
  52837. }
  52838. if err != nil {
  52839. return nil, err
  52840. }
  52841. defer googleapi.CloseBody(res)
  52842. if err := googleapi.CheckResponse(res); err != nil {
  52843. return nil, err
  52844. }
  52845. ret := &Operation{
  52846. ServerResponse: googleapi.ServerResponse{
  52847. Header: res.Header,
  52848. HTTPStatusCode: res.StatusCode,
  52849. },
  52850. }
  52851. target := &ret
  52852. if err := gensupport.DecodeResponse(target, res); err != nil {
  52853. return nil, err
  52854. }
  52855. return ret, nil
  52856. // {
  52857. // "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.",
  52858. // "httpMethod": "POST",
  52859. // "id": "compute.projects.enableXpnResource",
  52860. // "parameterOrder": [
  52861. // "project"
  52862. // ],
  52863. // "parameters": {
  52864. // "project": {
  52865. // "description": "Project ID for this request.",
  52866. // "location": "path",
  52867. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52868. // "required": true,
  52869. // "type": "string"
  52870. // },
  52871. // "requestId": {
  52872. // "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).",
  52873. // "location": "query",
  52874. // "type": "string"
  52875. // }
  52876. // },
  52877. // "path": "{project}/enableXpnResource",
  52878. // "request": {
  52879. // "$ref": "ProjectsEnableXpnResourceRequest"
  52880. // },
  52881. // "response": {
  52882. // "$ref": "Operation"
  52883. // },
  52884. // "scopes": [
  52885. // "https://www.googleapis.com/auth/cloud-platform",
  52886. // "https://www.googleapis.com/auth/compute"
  52887. // ]
  52888. // }
  52889. }
  52890. // method id "compute.projects.get":
  52891. type ProjectsGetCall struct {
  52892. s *Service
  52893. project string
  52894. urlParams_ gensupport.URLParams
  52895. ifNoneMatch_ string
  52896. ctx_ context.Context
  52897. header_ http.Header
  52898. }
  52899. // Get: Returns the specified Project resource.
  52900. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  52901. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  52902. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52903. c.project = project
  52904. return c
  52905. }
  52906. // Fields allows partial responses to be retrieved. See
  52907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52908. // for more information.
  52909. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  52910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52911. return c
  52912. }
  52913. // IfNoneMatch sets the optional parameter which makes the operation
  52914. // fail if the object's ETag matches the given value. This is useful for
  52915. // getting updates only after the object has changed since the last
  52916. // request. Use googleapi.IsNotModified to check whether the response
  52917. // error from Do is the result of In-None-Match.
  52918. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  52919. c.ifNoneMatch_ = entityTag
  52920. return c
  52921. }
  52922. // Context sets the context to be used in this call's Do method. Any
  52923. // pending HTTP request will be aborted if the provided context is
  52924. // canceled.
  52925. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  52926. c.ctx_ = ctx
  52927. return c
  52928. }
  52929. // Header returns an http.Header that can be modified by the caller to
  52930. // add HTTP headers to the request.
  52931. func (c *ProjectsGetCall) Header() http.Header {
  52932. if c.header_ == nil {
  52933. c.header_ = make(http.Header)
  52934. }
  52935. return c.header_
  52936. }
  52937. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  52938. reqHeaders := make(http.Header)
  52939. for k, v := range c.header_ {
  52940. reqHeaders[k] = v
  52941. }
  52942. reqHeaders.Set("User-Agent", c.s.userAgent())
  52943. if c.ifNoneMatch_ != "" {
  52944. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52945. }
  52946. var body io.Reader = nil
  52947. c.urlParams_.Set("alt", alt)
  52948. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  52949. urls += "?" + c.urlParams_.Encode()
  52950. req, _ := http.NewRequest("GET", urls, body)
  52951. req.Header = reqHeaders
  52952. googleapi.Expand(req.URL, map[string]string{
  52953. "project": c.project,
  52954. })
  52955. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52956. }
  52957. // Do executes the "compute.projects.get" call.
  52958. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  52959. // code is an error. Response headers are in either
  52960. // *Project.ServerResponse.Header or (if a response was returned at all)
  52961. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  52962. // check whether the returned error was because http.StatusNotModified
  52963. // was returned.
  52964. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  52965. gensupport.SetOptions(c.urlParams_, opts...)
  52966. res, err := c.doRequest("json")
  52967. if res != nil && res.StatusCode == http.StatusNotModified {
  52968. if res.Body != nil {
  52969. res.Body.Close()
  52970. }
  52971. return nil, &googleapi.Error{
  52972. Code: res.StatusCode,
  52973. Header: res.Header,
  52974. }
  52975. }
  52976. if err != nil {
  52977. return nil, err
  52978. }
  52979. defer googleapi.CloseBody(res)
  52980. if err := googleapi.CheckResponse(res); err != nil {
  52981. return nil, err
  52982. }
  52983. ret := &Project{
  52984. ServerResponse: googleapi.ServerResponse{
  52985. Header: res.Header,
  52986. HTTPStatusCode: res.StatusCode,
  52987. },
  52988. }
  52989. target := &ret
  52990. if err := gensupport.DecodeResponse(target, res); err != nil {
  52991. return nil, err
  52992. }
  52993. return ret, nil
  52994. // {
  52995. // "description": "Returns the specified Project resource.",
  52996. // "httpMethod": "GET",
  52997. // "id": "compute.projects.get",
  52998. // "parameterOrder": [
  52999. // "project"
  53000. // ],
  53001. // "parameters": {
  53002. // "project": {
  53003. // "description": "Project ID for this request.",
  53004. // "location": "path",
  53005. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53006. // "required": true,
  53007. // "type": "string"
  53008. // }
  53009. // },
  53010. // "path": "{project}",
  53011. // "response": {
  53012. // "$ref": "Project"
  53013. // },
  53014. // "scopes": [
  53015. // "https://www.googleapis.com/auth/cloud-platform",
  53016. // "https://www.googleapis.com/auth/compute",
  53017. // "https://www.googleapis.com/auth/compute.readonly"
  53018. // ]
  53019. // }
  53020. }
  53021. // method id "compute.projects.getXpnHost":
  53022. type ProjectsGetXpnHostCall struct {
  53023. s *Service
  53024. project string
  53025. urlParams_ gensupport.URLParams
  53026. ifNoneMatch_ string
  53027. ctx_ context.Context
  53028. header_ http.Header
  53029. }
  53030. // GetXpnHost: Gets the shared VPC host project that this project links
  53031. // to. May be empty if no link exists.
  53032. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  53033. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53034. c.project = project
  53035. return c
  53036. }
  53037. // Fields allows partial responses to be retrieved. See
  53038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53039. // for more information.
  53040. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  53041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53042. return c
  53043. }
  53044. // IfNoneMatch sets the optional parameter which makes the operation
  53045. // fail if the object's ETag matches the given value. This is useful for
  53046. // getting updates only after the object has changed since the last
  53047. // request. Use googleapi.IsNotModified to check whether the response
  53048. // error from Do is the result of In-None-Match.
  53049. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  53050. c.ifNoneMatch_ = entityTag
  53051. return c
  53052. }
  53053. // Context sets the context to be used in this call's Do method. Any
  53054. // pending HTTP request will be aborted if the provided context is
  53055. // canceled.
  53056. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  53057. c.ctx_ = ctx
  53058. return c
  53059. }
  53060. // Header returns an http.Header that can be modified by the caller to
  53061. // add HTTP headers to the request.
  53062. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  53063. if c.header_ == nil {
  53064. c.header_ = make(http.Header)
  53065. }
  53066. return c.header_
  53067. }
  53068. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  53069. reqHeaders := make(http.Header)
  53070. for k, v := range c.header_ {
  53071. reqHeaders[k] = v
  53072. }
  53073. reqHeaders.Set("User-Agent", c.s.userAgent())
  53074. if c.ifNoneMatch_ != "" {
  53075. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53076. }
  53077. var body io.Reader = nil
  53078. c.urlParams_.Set("alt", alt)
  53079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  53080. urls += "?" + c.urlParams_.Encode()
  53081. req, _ := http.NewRequest("GET", urls, body)
  53082. req.Header = reqHeaders
  53083. googleapi.Expand(req.URL, map[string]string{
  53084. "project": c.project,
  53085. })
  53086. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53087. }
  53088. // Do executes the "compute.projects.getXpnHost" call.
  53089. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  53090. // code is an error. Response headers are in either
  53091. // *Project.ServerResponse.Header or (if a response was returned at all)
  53092. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  53093. // check whether the returned error was because http.StatusNotModified
  53094. // was returned.
  53095. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  53096. gensupport.SetOptions(c.urlParams_, opts...)
  53097. res, err := c.doRequest("json")
  53098. if res != nil && res.StatusCode == http.StatusNotModified {
  53099. if res.Body != nil {
  53100. res.Body.Close()
  53101. }
  53102. return nil, &googleapi.Error{
  53103. Code: res.StatusCode,
  53104. Header: res.Header,
  53105. }
  53106. }
  53107. if err != nil {
  53108. return nil, err
  53109. }
  53110. defer googleapi.CloseBody(res)
  53111. if err := googleapi.CheckResponse(res); err != nil {
  53112. return nil, err
  53113. }
  53114. ret := &Project{
  53115. ServerResponse: googleapi.ServerResponse{
  53116. Header: res.Header,
  53117. HTTPStatusCode: res.StatusCode,
  53118. },
  53119. }
  53120. target := &ret
  53121. if err := gensupport.DecodeResponse(target, res); err != nil {
  53122. return nil, err
  53123. }
  53124. return ret, nil
  53125. // {
  53126. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  53127. // "httpMethod": "GET",
  53128. // "id": "compute.projects.getXpnHost",
  53129. // "parameterOrder": [
  53130. // "project"
  53131. // ],
  53132. // "parameters": {
  53133. // "project": {
  53134. // "description": "Project ID for this request.",
  53135. // "location": "path",
  53136. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53137. // "required": true,
  53138. // "type": "string"
  53139. // }
  53140. // },
  53141. // "path": "{project}/getXpnHost",
  53142. // "response": {
  53143. // "$ref": "Project"
  53144. // },
  53145. // "scopes": [
  53146. // "https://www.googleapis.com/auth/cloud-platform",
  53147. // "https://www.googleapis.com/auth/compute"
  53148. // ]
  53149. // }
  53150. }
  53151. // method id "compute.projects.getXpnResources":
  53152. type ProjectsGetXpnResourcesCall struct {
  53153. s *Service
  53154. project string
  53155. urlParams_ gensupport.URLParams
  53156. ifNoneMatch_ string
  53157. ctx_ context.Context
  53158. header_ http.Header
  53159. }
  53160. // GetXpnResources: Gets service resources (a.k.a service project)
  53161. // associated with this host project.
  53162. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  53163. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53164. c.project = project
  53165. return c
  53166. }
  53167. // Filter sets the optional parameter "filter":
  53168. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  53169. c.urlParams_.Set("filter", filter)
  53170. return c
  53171. }
  53172. // MaxResults sets the optional parameter "maxResults":
  53173. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  53174. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53175. return c
  53176. }
  53177. // OrderBy sets the optional parameter "order_by":
  53178. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  53179. c.urlParams_.Set("order_by", orderBy)
  53180. return c
  53181. }
  53182. // PageToken sets the optional parameter "pageToken":
  53183. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  53184. c.urlParams_.Set("pageToken", pageToken)
  53185. return c
  53186. }
  53187. // Fields allows partial responses to be retrieved. See
  53188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53189. // for more information.
  53190. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  53191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53192. return c
  53193. }
  53194. // IfNoneMatch sets the optional parameter which makes the operation
  53195. // fail if the object's ETag matches the given value. This is useful for
  53196. // getting updates only after the object has changed since the last
  53197. // request. Use googleapi.IsNotModified to check whether the response
  53198. // error from Do is the result of In-None-Match.
  53199. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  53200. c.ifNoneMatch_ = entityTag
  53201. return c
  53202. }
  53203. // Context sets the context to be used in this call's Do method. Any
  53204. // pending HTTP request will be aborted if the provided context is
  53205. // canceled.
  53206. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  53207. c.ctx_ = ctx
  53208. return c
  53209. }
  53210. // Header returns an http.Header that can be modified by the caller to
  53211. // add HTTP headers to the request.
  53212. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  53213. if c.header_ == nil {
  53214. c.header_ = make(http.Header)
  53215. }
  53216. return c.header_
  53217. }
  53218. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  53219. reqHeaders := make(http.Header)
  53220. for k, v := range c.header_ {
  53221. reqHeaders[k] = v
  53222. }
  53223. reqHeaders.Set("User-Agent", c.s.userAgent())
  53224. if c.ifNoneMatch_ != "" {
  53225. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53226. }
  53227. var body io.Reader = nil
  53228. c.urlParams_.Set("alt", alt)
  53229. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  53230. urls += "?" + c.urlParams_.Encode()
  53231. req, _ := http.NewRequest("GET", urls, body)
  53232. req.Header = reqHeaders
  53233. googleapi.Expand(req.URL, map[string]string{
  53234. "project": c.project,
  53235. })
  53236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53237. }
  53238. // Do executes the "compute.projects.getXpnResources" call.
  53239. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  53240. // non-2xx status code is an error. Response headers are in either
  53241. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  53242. // returned at all) in error.(*googleapi.Error).Header. Use
  53243. // googleapi.IsNotModified to check whether the returned error was
  53244. // because http.StatusNotModified was returned.
  53245. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  53246. gensupport.SetOptions(c.urlParams_, opts...)
  53247. res, err := c.doRequest("json")
  53248. if res != nil && res.StatusCode == http.StatusNotModified {
  53249. if res.Body != nil {
  53250. res.Body.Close()
  53251. }
  53252. return nil, &googleapi.Error{
  53253. Code: res.StatusCode,
  53254. Header: res.Header,
  53255. }
  53256. }
  53257. if err != nil {
  53258. return nil, err
  53259. }
  53260. defer googleapi.CloseBody(res)
  53261. if err := googleapi.CheckResponse(res); err != nil {
  53262. return nil, err
  53263. }
  53264. ret := &ProjectsGetXpnResources{
  53265. ServerResponse: googleapi.ServerResponse{
  53266. Header: res.Header,
  53267. HTTPStatusCode: res.StatusCode,
  53268. },
  53269. }
  53270. target := &ret
  53271. if err := gensupport.DecodeResponse(target, res); err != nil {
  53272. return nil, err
  53273. }
  53274. return ret, nil
  53275. // {
  53276. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  53277. // "httpMethod": "GET",
  53278. // "id": "compute.projects.getXpnResources",
  53279. // "parameterOrder": [
  53280. // "project"
  53281. // ],
  53282. // "parameters": {
  53283. // "filter": {
  53284. // "location": "query",
  53285. // "type": "string"
  53286. // },
  53287. // "maxResults": {
  53288. // "default": "500",
  53289. // "format": "uint32",
  53290. // "location": "query",
  53291. // "minimum": "0",
  53292. // "type": "integer"
  53293. // },
  53294. // "order_by": {
  53295. // "location": "query",
  53296. // "type": "string"
  53297. // },
  53298. // "pageToken": {
  53299. // "location": "query",
  53300. // "type": "string"
  53301. // },
  53302. // "project": {
  53303. // "description": "Project ID for this request.",
  53304. // "location": "path",
  53305. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53306. // "required": true,
  53307. // "type": "string"
  53308. // }
  53309. // },
  53310. // "path": "{project}/getXpnResources",
  53311. // "response": {
  53312. // "$ref": "ProjectsGetXpnResources"
  53313. // },
  53314. // "scopes": [
  53315. // "https://www.googleapis.com/auth/cloud-platform",
  53316. // "https://www.googleapis.com/auth/compute"
  53317. // ]
  53318. // }
  53319. }
  53320. // Pages invokes f for each page of results.
  53321. // A non-nil error returned from f will halt the iteration.
  53322. // The provided context supersedes any context provided to the Context method.
  53323. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  53324. c.ctx_ = ctx
  53325. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53326. for {
  53327. x, err := c.Do()
  53328. if err != nil {
  53329. return err
  53330. }
  53331. if err := f(x); err != nil {
  53332. return err
  53333. }
  53334. if x.NextPageToken == "" {
  53335. return nil
  53336. }
  53337. c.PageToken(x.NextPageToken)
  53338. }
  53339. }
  53340. // method id "compute.projects.listXpnHosts":
  53341. type ProjectsListXpnHostsCall struct {
  53342. s *Service
  53343. project string
  53344. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  53345. urlParams_ gensupport.URLParams
  53346. ctx_ context.Context
  53347. header_ http.Header
  53348. }
  53349. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  53350. // in an organization.
  53351. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  53352. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53353. c.project = project
  53354. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  53355. return c
  53356. }
  53357. // Filter sets the optional parameter "filter":
  53358. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  53359. c.urlParams_.Set("filter", filter)
  53360. return c
  53361. }
  53362. // MaxResults sets the optional parameter "maxResults":
  53363. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  53364. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53365. return c
  53366. }
  53367. // OrderBy sets the optional parameter "order_by":
  53368. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  53369. c.urlParams_.Set("order_by", orderBy)
  53370. return c
  53371. }
  53372. // PageToken sets the optional parameter "pageToken":
  53373. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  53374. c.urlParams_.Set("pageToken", pageToken)
  53375. return c
  53376. }
  53377. // Fields allows partial responses to be retrieved. See
  53378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53379. // for more information.
  53380. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  53381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53382. return c
  53383. }
  53384. // Context sets the context to be used in this call's Do method. Any
  53385. // pending HTTP request will be aborted if the provided context is
  53386. // canceled.
  53387. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  53388. c.ctx_ = ctx
  53389. return c
  53390. }
  53391. // Header returns an http.Header that can be modified by the caller to
  53392. // add HTTP headers to the request.
  53393. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  53394. if c.header_ == nil {
  53395. c.header_ = make(http.Header)
  53396. }
  53397. return c.header_
  53398. }
  53399. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  53400. reqHeaders := make(http.Header)
  53401. for k, v := range c.header_ {
  53402. reqHeaders[k] = v
  53403. }
  53404. reqHeaders.Set("User-Agent", c.s.userAgent())
  53405. var body io.Reader = nil
  53406. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  53407. if err != nil {
  53408. return nil, err
  53409. }
  53410. reqHeaders.Set("Content-Type", "application/json")
  53411. c.urlParams_.Set("alt", alt)
  53412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  53413. urls += "?" + c.urlParams_.Encode()
  53414. req, _ := http.NewRequest("POST", urls, body)
  53415. req.Header = reqHeaders
  53416. googleapi.Expand(req.URL, map[string]string{
  53417. "project": c.project,
  53418. })
  53419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53420. }
  53421. // Do executes the "compute.projects.listXpnHosts" call.
  53422. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  53423. // status code is an error. Response headers are in either
  53424. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  53425. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53426. // to check whether the returned error was because
  53427. // http.StatusNotModified was returned.
  53428. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  53429. gensupport.SetOptions(c.urlParams_, opts...)
  53430. res, err := c.doRequest("json")
  53431. if res != nil && res.StatusCode == http.StatusNotModified {
  53432. if res.Body != nil {
  53433. res.Body.Close()
  53434. }
  53435. return nil, &googleapi.Error{
  53436. Code: res.StatusCode,
  53437. Header: res.Header,
  53438. }
  53439. }
  53440. if err != nil {
  53441. return nil, err
  53442. }
  53443. defer googleapi.CloseBody(res)
  53444. if err := googleapi.CheckResponse(res); err != nil {
  53445. return nil, err
  53446. }
  53447. ret := &XpnHostList{
  53448. ServerResponse: googleapi.ServerResponse{
  53449. Header: res.Header,
  53450. HTTPStatusCode: res.StatusCode,
  53451. },
  53452. }
  53453. target := &ret
  53454. if err := gensupport.DecodeResponse(target, res); err != nil {
  53455. return nil, err
  53456. }
  53457. return ret, nil
  53458. // {
  53459. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  53460. // "httpMethod": "POST",
  53461. // "id": "compute.projects.listXpnHosts",
  53462. // "parameterOrder": [
  53463. // "project"
  53464. // ],
  53465. // "parameters": {
  53466. // "filter": {
  53467. // "location": "query",
  53468. // "type": "string"
  53469. // },
  53470. // "maxResults": {
  53471. // "default": "500",
  53472. // "format": "uint32",
  53473. // "location": "query",
  53474. // "minimum": "0",
  53475. // "type": "integer"
  53476. // },
  53477. // "order_by": {
  53478. // "location": "query",
  53479. // "type": "string"
  53480. // },
  53481. // "pageToken": {
  53482. // "location": "query",
  53483. // "type": "string"
  53484. // },
  53485. // "project": {
  53486. // "description": "Project ID for this request.",
  53487. // "location": "path",
  53488. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53489. // "required": true,
  53490. // "type": "string"
  53491. // }
  53492. // },
  53493. // "path": "{project}/listXpnHosts",
  53494. // "request": {
  53495. // "$ref": "ProjectsListXpnHostsRequest"
  53496. // },
  53497. // "response": {
  53498. // "$ref": "XpnHostList"
  53499. // },
  53500. // "scopes": [
  53501. // "https://www.googleapis.com/auth/cloud-platform",
  53502. // "https://www.googleapis.com/auth/compute"
  53503. // ]
  53504. // }
  53505. }
  53506. // Pages invokes f for each page of results.
  53507. // A non-nil error returned from f will halt the iteration.
  53508. // The provided context supersedes any context provided to the Context method.
  53509. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  53510. c.ctx_ = ctx
  53511. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53512. for {
  53513. x, err := c.Do()
  53514. if err != nil {
  53515. return err
  53516. }
  53517. if err := f(x); err != nil {
  53518. return err
  53519. }
  53520. if x.NextPageToken == "" {
  53521. return nil
  53522. }
  53523. c.PageToken(x.NextPageToken)
  53524. }
  53525. }
  53526. // method id "compute.projects.moveDisk":
  53527. type ProjectsMoveDiskCall struct {
  53528. s *Service
  53529. project string
  53530. diskmoverequest *DiskMoveRequest
  53531. urlParams_ gensupport.URLParams
  53532. ctx_ context.Context
  53533. header_ http.Header
  53534. }
  53535. // MoveDisk: Moves a persistent disk from one zone to another.
  53536. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  53537. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53538. c.project = project
  53539. c.diskmoverequest = diskmoverequest
  53540. return c
  53541. }
  53542. // RequestId sets the optional parameter "requestId": An optional
  53543. // request ID to identify requests. Specify a unique request ID so that
  53544. // if you must retry your request, the server will know to ignore the
  53545. // request if it has already been completed.
  53546. //
  53547. // For example, consider a situation where you make an initial request
  53548. // and the request times out. If you make the request again with the
  53549. // same request ID, the server can check if original operation with the
  53550. // same request ID was received, and if so, will ignore the second
  53551. // request. This prevents clients from accidentally creating duplicate
  53552. // commitments.
  53553. //
  53554. // The request ID must be a valid UUID with the exception that zero UUID
  53555. // is not supported (00000000-0000-0000-0000-000000000000).
  53556. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  53557. c.urlParams_.Set("requestId", requestId)
  53558. return c
  53559. }
  53560. // Fields allows partial responses to be retrieved. See
  53561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53562. // for more information.
  53563. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  53564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53565. return c
  53566. }
  53567. // Context sets the context to be used in this call's Do method. Any
  53568. // pending HTTP request will be aborted if the provided context is
  53569. // canceled.
  53570. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  53571. c.ctx_ = ctx
  53572. return c
  53573. }
  53574. // Header returns an http.Header that can be modified by the caller to
  53575. // add HTTP headers to the request.
  53576. func (c *ProjectsMoveDiskCall) Header() http.Header {
  53577. if c.header_ == nil {
  53578. c.header_ = make(http.Header)
  53579. }
  53580. return c.header_
  53581. }
  53582. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  53583. reqHeaders := make(http.Header)
  53584. for k, v := range c.header_ {
  53585. reqHeaders[k] = v
  53586. }
  53587. reqHeaders.Set("User-Agent", c.s.userAgent())
  53588. var body io.Reader = nil
  53589. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  53590. if err != nil {
  53591. return nil, err
  53592. }
  53593. reqHeaders.Set("Content-Type", "application/json")
  53594. c.urlParams_.Set("alt", alt)
  53595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  53596. urls += "?" + c.urlParams_.Encode()
  53597. req, _ := http.NewRequest("POST", urls, body)
  53598. req.Header = reqHeaders
  53599. googleapi.Expand(req.URL, map[string]string{
  53600. "project": c.project,
  53601. })
  53602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53603. }
  53604. // Do executes the "compute.projects.moveDisk" call.
  53605. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53606. // status code is an error. Response headers are in either
  53607. // *Operation.ServerResponse.Header or (if a response was returned at
  53608. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53609. // to check whether the returned error was because
  53610. // http.StatusNotModified was returned.
  53611. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53612. gensupport.SetOptions(c.urlParams_, opts...)
  53613. res, err := c.doRequest("json")
  53614. if res != nil && res.StatusCode == http.StatusNotModified {
  53615. if res.Body != nil {
  53616. res.Body.Close()
  53617. }
  53618. return nil, &googleapi.Error{
  53619. Code: res.StatusCode,
  53620. Header: res.Header,
  53621. }
  53622. }
  53623. if err != nil {
  53624. return nil, err
  53625. }
  53626. defer googleapi.CloseBody(res)
  53627. if err := googleapi.CheckResponse(res); err != nil {
  53628. return nil, err
  53629. }
  53630. ret := &Operation{
  53631. ServerResponse: googleapi.ServerResponse{
  53632. Header: res.Header,
  53633. HTTPStatusCode: res.StatusCode,
  53634. },
  53635. }
  53636. target := &ret
  53637. if err := gensupport.DecodeResponse(target, res); err != nil {
  53638. return nil, err
  53639. }
  53640. return ret, nil
  53641. // {
  53642. // "description": "Moves a persistent disk from one zone to another.",
  53643. // "httpMethod": "POST",
  53644. // "id": "compute.projects.moveDisk",
  53645. // "parameterOrder": [
  53646. // "project"
  53647. // ],
  53648. // "parameters": {
  53649. // "project": {
  53650. // "description": "Project ID for this request.",
  53651. // "location": "path",
  53652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53653. // "required": true,
  53654. // "type": "string"
  53655. // },
  53656. // "requestId": {
  53657. // "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).",
  53658. // "location": "query",
  53659. // "type": "string"
  53660. // }
  53661. // },
  53662. // "path": "{project}/moveDisk",
  53663. // "request": {
  53664. // "$ref": "DiskMoveRequest"
  53665. // },
  53666. // "response": {
  53667. // "$ref": "Operation"
  53668. // },
  53669. // "scopes": [
  53670. // "https://www.googleapis.com/auth/cloud-platform",
  53671. // "https://www.googleapis.com/auth/compute"
  53672. // ]
  53673. // }
  53674. }
  53675. // method id "compute.projects.moveInstance":
  53676. type ProjectsMoveInstanceCall struct {
  53677. s *Service
  53678. project string
  53679. instancemoverequest *InstanceMoveRequest
  53680. urlParams_ gensupport.URLParams
  53681. ctx_ context.Context
  53682. header_ http.Header
  53683. }
  53684. // MoveInstance: Moves an instance and its attached persistent disks
  53685. // from one zone to another.
  53686. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  53687. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53688. c.project = project
  53689. c.instancemoverequest = instancemoverequest
  53690. return c
  53691. }
  53692. // RequestId sets the optional parameter "requestId": An optional
  53693. // request ID to identify requests. Specify a unique request ID so that
  53694. // if you must retry your request, the server will know to ignore the
  53695. // request if it has already been completed.
  53696. //
  53697. // For example, consider a situation where you make an initial request
  53698. // and the request times out. If you make the request again with the
  53699. // same request ID, the server can check if original operation with the
  53700. // same request ID was received, and if so, will ignore the second
  53701. // request. This prevents clients from accidentally creating duplicate
  53702. // commitments.
  53703. //
  53704. // The request ID must be a valid UUID with the exception that zero UUID
  53705. // is not supported (00000000-0000-0000-0000-000000000000).
  53706. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  53707. c.urlParams_.Set("requestId", requestId)
  53708. return c
  53709. }
  53710. // Fields allows partial responses to be retrieved. See
  53711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53712. // for more information.
  53713. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  53714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53715. return c
  53716. }
  53717. // Context sets the context to be used in this call's Do method. Any
  53718. // pending HTTP request will be aborted if the provided context is
  53719. // canceled.
  53720. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  53721. c.ctx_ = ctx
  53722. return c
  53723. }
  53724. // Header returns an http.Header that can be modified by the caller to
  53725. // add HTTP headers to the request.
  53726. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  53727. if c.header_ == nil {
  53728. c.header_ = make(http.Header)
  53729. }
  53730. return c.header_
  53731. }
  53732. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  53733. reqHeaders := make(http.Header)
  53734. for k, v := range c.header_ {
  53735. reqHeaders[k] = v
  53736. }
  53737. reqHeaders.Set("User-Agent", c.s.userAgent())
  53738. var body io.Reader = nil
  53739. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  53740. if err != nil {
  53741. return nil, err
  53742. }
  53743. reqHeaders.Set("Content-Type", "application/json")
  53744. c.urlParams_.Set("alt", alt)
  53745. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  53746. urls += "?" + c.urlParams_.Encode()
  53747. req, _ := http.NewRequest("POST", urls, body)
  53748. req.Header = reqHeaders
  53749. googleapi.Expand(req.URL, map[string]string{
  53750. "project": c.project,
  53751. })
  53752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53753. }
  53754. // Do executes the "compute.projects.moveInstance" call.
  53755. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53756. // status code is an error. Response headers are in either
  53757. // *Operation.ServerResponse.Header or (if a response was returned at
  53758. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53759. // to check whether the returned error was because
  53760. // http.StatusNotModified was returned.
  53761. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53762. gensupport.SetOptions(c.urlParams_, opts...)
  53763. res, err := c.doRequest("json")
  53764. if res != nil && res.StatusCode == http.StatusNotModified {
  53765. if res.Body != nil {
  53766. res.Body.Close()
  53767. }
  53768. return nil, &googleapi.Error{
  53769. Code: res.StatusCode,
  53770. Header: res.Header,
  53771. }
  53772. }
  53773. if err != nil {
  53774. return nil, err
  53775. }
  53776. defer googleapi.CloseBody(res)
  53777. if err := googleapi.CheckResponse(res); err != nil {
  53778. return nil, err
  53779. }
  53780. ret := &Operation{
  53781. ServerResponse: googleapi.ServerResponse{
  53782. Header: res.Header,
  53783. HTTPStatusCode: res.StatusCode,
  53784. },
  53785. }
  53786. target := &ret
  53787. if err := gensupport.DecodeResponse(target, res); err != nil {
  53788. return nil, err
  53789. }
  53790. return ret, nil
  53791. // {
  53792. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  53793. // "httpMethod": "POST",
  53794. // "id": "compute.projects.moveInstance",
  53795. // "parameterOrder": [
  53796. // "project"
  53797. // ],
  53798. // "parameters": {
  53799. // "project": {
  53800. // "description": "Project ID for this request.",
  53801. // "location": "path",
  53802. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53803. // "required": true,
  53804. // "type": "string"
  53805. // },
  53806. // "requestId": {
  53807. // "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).",
  53808. // "location": "query",
  53809. // "type": "string"
  53810. // }
  53811. // },
  53812. // "path": "{project}/moveInstance",
  53813. // "request": {
  53814. // "$ref": "InstanceMoveRequest"
  53815. // },
  53816. // "response": {
  53817. // "$ref": "Operation"
  53818. // },
  53819. // "scopes": [
  53820. // "https://www.googleapis.com/auth/cloud-platform",
  53821. // "https://www.googleapis.com/auth/compute"
  53822. // ]
  53823. // }
  53824. }
  53825. // method id "compute.projects.setCommonInstanceMetadata":
  53826. type ProjectsSetCommonInstanceMetadataCall struct {
  53827. s *Service
  53828. project string
  53829. metadata *Metadata
  53830. urlParams_ gensupport.URLParams
  53831. ctx_ context.Context
  53832. header_ http.Header
  53833. }
  53834. // SetCommonInstanceMetadata: Sets metadata common to all instances
  53835. // within the specified project using the data included in the request.
  53836. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  53837. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  53838. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53839. c.project = project
  53840. c.metadata = metadata
  53841. return c
  53842. }
  53843. // RequestId sets the optional parameter "requestId": An optional
  53844. // request ID to identify requests. Specify a unique request ID so that
  53845. // if you must retry your request, the server will know to ignore the
  53846. // request if it has already been completed.
  53847. //
  53848. // For example, consider a situation where you make an initial request
  53849. // and the request times out. If you make the request again with the
  53850. // same request ID, the server can check if original operation with the
  53851. // same request ID was received, and if so, will ignore the second
  53852. // request. This prevents clients from accidentally creating duplicate
  53853. // commitments.
  53854. //
  53855. // The request ID must be a valid UUID with the exception that zero UUID
  53856. // is not supported (00000000-0000-0000-0000-000000000000).
  53857. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  53858. c.urlParams_.Set("requestId", requestId)
  53859. return c
  53860. }
  53861. // Fields allows partial responses to be retrieved. See
  53862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53863. // for more information.
  53864. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  53865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53866. return c
  53867. }
  53868. // Context sets the context to be used in this call's Do method. Any
  53869. // pending HTTP request will be aborted if the provided context is
  53870. // canceled.
  53871. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  53872. c.ctx_ = ctx
  53873. return c
  53874. }
  53875. // Header returns an http.Header that can be modified by the caller to
  53876. // add HTTP headers to the request.
  53877. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  53878. if c.header_ == nil {
  53879. c.header_ = make(http.Header)
  53880. }
  53881. return c.header_
  53882. }
  53883. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  53884. reqHeaders := make(http.Header)
  53885. for k, v := range c.header_ {
  53886. reqHeaders[k] = v
  53887. }
  53888. reqHeaders.Set("User-Agent", c.s.userAgent())
  53889. var body io.Reader = nil
  53890. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  53891. if err != nil {
  53892. return nil, err
  53893. }
  53894. reqHeaders.Set("Content-Type", "application/json")
  53895. c.urlParams_.Set("alt", alt)
  53896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  53897. urls += "?" + c.urlParams_.Encode()
  53898. req, _ := http.NewRequest("POST", urls, body)
  53899. req.Header = reqHeaders
  53900. googleapi.Expand(req.URL, map[string]string{
  53901. "project": c.project,
  53902. })
  53903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53904. }
  53905. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  53906. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53907. // status code is an error. Response headers are in either
  53908. // *Operation.ServerResponse.Header or (if a response was returned at
  53909. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53910. // to check whether the returned error was because
  53911. // http.StatusNotModified was returned.
  53912. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53913. gensupport.SetOptions(c.urlParams_, opts...)
  53914. res, err := c.doRequest("json")
  53915. if res != nil && res.StatusCode == http.StatusNotModified {
  53916. if res.Body != nil {
  53917. res.Body.Close()
  53918. }
  53919. return nil, &googleapi.Error{
  53920. Code: res.StatusCode,
  53921. Header: res.Header,
  53922. }
  53923. }
  53924. if err != nil {
  53925. return nil, err
  53926. }
  53927. defer googleapi.CloseBody(res)
  53928. if err := googleapi.CheckResponse(res); err != nil {
  53929. return nil, err
  53930. }
  53931. ret := &Operation{
  53932. ServerResponse: googleapi.ServerResponse{
  53933. Header: res.Header,
  53934. HTTPStatusCode: res.StatusCode,
  53935. },
  53936. }
  53937. target := &ret
  53938. if err := gensupport.DecodeResponse(target, res); err != nil {
  53939. return nil, err
  53940. }
  53941. return ret, nil
  53942. // {
  53943. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  53944. // "httpMethod": "POST",
  53945. // "id": "compute.projects.setCommonInstanceMetadata",
  53946. // "parameterOrder": [
  53947. // "project"
  53948. // ],
  53949. // "parameters": {
  53950. // "project": {
  53951. // "description": "Project ID for this request.",
  53952. // "location": "path",
  53953. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53954. // "required": true,
  53955. // "type": "string"
  53956. // },
  53957. // "requestId": {
  53958. // "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).",
  53959. // "location": "query",
  53960. // "type": "string"
  53961. // }
  53962. // },
  53963. // "path": "{project}/setCommonInstanceMetadata",
  53964. // "request": {
  53965. // "$ref": "Metadata"
  53966. // },
  53967. // "response": {
  53968. // "$ref": "Operation"
  53969. // },
  53970. // "scopes": [
  53971. // "https://www.googleapis.com/auth/cloud-platform",
  53972. // "https://www.googleapis.com/auth/compute"
  53973. // ]
  53974. // }
  53975. }
  53976. // method id "compute.projects.setUsageExportBucket":
  53977. type ProjectsSetUsageExportBucketCall struct {
  53978. s *Service
  53979. project string
  53980. usageexportlocation *UsageExportLocation
  53981. urlParams_ gensupport.URLParams
  53982. ctx_ context.Context
  53983. header_ http.Header
  53984. }
  53985. // SetUsageExportBucket: Enables the usage export feature and sets the
  53986. // usage export bucket where reports are stored. If you provide an empty
  53987. // request body using this method, the usage export feature will be
  53988. // disabled.
  53989. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  53990. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  53991. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53992. c.project = project
  53993. c.usageexportlocation = usageexportlocation
  53994. return c
  53995. }
  53996. // RequestId sets the optional parameter "requestId": An optional
  53997. // request ID to identify requests. Specify a unique request ID so that
  53998. // if you must retry your request, the server will know to ignore the
  53999. // request if it has already been completed.
  54000. //
  54001. // For example, consider a situation where you make an initial request
  54002. // and the request times out. If you make the request again with the
  54003. // same request ID, the server can check if original operation with the
  54004. // same request ID was received, and if so, will ignore the second
  54005. // request. This prevents clients from accidentally creating duplicate
  54006. // commitments.
  54007. //
  54008. // The request ID must be a valid UUID with the exception that zero UUID
  54009. // is not supported (00000000-0000-0000-0000-000000000000).
  54010. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  54011. c.urlParams_.Set("requestId", requestId)
  54012. return c
  54013. }
  54014. // Fields allows partial responses to be retrieved. See
  54015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54016. // for more information.
  54017. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  54018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54019. return c
  54020. }
  54021. // Context sets the context to be used in this call's Do method. Any
  54022. // pending HTTP request will be aborted if the provided context is
  54023. // canceled.
  54024. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  54025. c.ctx_ = ctx
  54026. return c
  54027. }
  54028. // Header returns an http.Header that can be modified by the caller to
  54029. // add HTTP headers to the request.
  54030. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  54031. if c.header_ == nil {
  54032. c.header_ = make(http.Header)
  54033. }
  54034. return c.header_
  54035. }
  54036. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  54037. reqHeaders := make(http.Header)
  54038. for k, v := range c.header_ {
  54039. reqHeaders[k] = v
  54040. }
  54041. reqHeaders.Set("User-Agent", c.s.userAgent())
  54042. var body io.Reader = nil
  54043. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  54044. if err != nil {
  54045. return nil, err
  54046. }
  54047. reqHeaders.Set("Content-Type", "application/json")
  54048. c.urlParams_.Set("alt", alt)
  54049. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  54050. urls += "?" + c.urlParams_.Encode()
  54051. req, _ := http.NewRequest("POST", urls, body)
  54052. req.Header = reqHeaders
  54053. googleapi.Expand(req.URL, map[string]string{
  54054. "project": c.project,
  54055. })
  54056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54057. }
  54058. // Do executes the "compute.projects.setUsageExportBucket" call.
  54059. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54060. // status code is an error. Response headers are in either
  54061. // *Operation.ServerResponse.Header or (if a response was returned at
  54062. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54063. // to check whether the returned error was because
  54064. // http.StatusNotModified was returned.
  54065. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54066. gensupport.SetOptions(c.urlParams_, opts...)
  54067. res, err := c.doRequest("json")
  54068. if res != nil && res.StatusCode == http.StatusNotModified {
  54069. if res.Body != nil {
  54070. res.Body.Close()
  54071. }
  54072. return nil, &googleapi.Error{
  54073. Code: res.StatusCode,
  54074. Header: res.Header,
  54075. }
  54076. }
  54077. if err != nil {
  54078. return nil, err
  54079. }
  54080. defer googleapi.CloseBody(res)
  54081. if err := googleapi.CheckResponse(res); err != nil {
  54082. return nil, err
  54083. }
  54084. ret := &Operation{
  54085. ServerResponse: googleapi.ServerResponse{
  54086. Header: res.Header,
  54087. HTTPStatusCode: res.StatusCode,
  54088. },
  54089. }
  54090. target := &ret
  54091. if err := gensupport.DecodeResponse(target, res); err != nil {
  54092. return nil, err
  54093. }
  54094. return ret, nil
  54095. // {
  54096. // "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.",
  54097. // "httpMethod": "POST",
  54098. // "id": "compute.projects.setUsageExportBucket",
  54099. // "parameterOrder": [
  54100. // "project"
  54101. // ],
  54102. // "parameters": {
  54103. // "project": {
  54104. // "description": "Project ID for this request.",
  54105. // "location": "path",
  54106. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54107. // "required": true,
  54108. // "type": "string"
  54109. // },
  54110. // "requestId": {
  54111. // "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).",
  54112. // "location": "query",
  54113. // "type": "string"
  54114. // }
  54115. // },
  54116. // "path": "{project}/setUsageExportBucket",
  54117. // "request": {
  54118. // "$ref": "UsageExportLocation"
  54119. // },
  54120. // "response": {
  54121. // "$ref": "Operation"
  54122. // },
  54123. // "scopes": [
  54124. // "https://www.googleapis.com/auth/cloud-platform",
  54125. // "https://www.googleapis.com/auth/compute",
  54126. // "https://www.googleapis.com/auth/devstorage.full_control",
  54127. // "https://www.googleapis.com/auth/devstorage.read_only",
  54128. // "https://www.googleapis.com/auth/devstorage.read_write"
  54129. // ]
  54130. // }
  54131. }
  54132. // method id "compute.regionAutoscalers.delete":
  54133. type RegionAutoscalersDeleteCall struct {
  54134. s *Service
  54135. project string
  54136. region string
  54137. autoscaler string
  54138. urlParams_ gensupport.URLParams
  54139. ctx_ context.Context
  54140. header_ http.Header
  54141. }
  54142. // Delete: Deletes the specified autoscaler.
  54143. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  54144. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54145. c.project = project
  54146. c.region = region
  54147. c.autoscaler = autoscaler
  54148. return c
  54149. }
  54150. // RequestId sets the optional parameter "requestId": An optional
  54151. // request ID to identify requests. Specify a unique request ID so that
  54152. // if you must retry your request, the server will know to ignore the
  54153. // request if it has already been completed.
  54154. //
  54155. // For example, consider a situation where you make an initial request
  54156. // and the request times out. If you make the request again with the
  54157. // same request ID, the server can check if original operation with the
  54158. // same request ID was received, and if so, will ignore the second
  54159. // request. This prevents clients from accidentally creating duplicate
  54160. // commitments.
  54161. //
  54162. // The request ID must be a valid UUID with the exception that zero UUID
  54163. // is not supported (00000000-0000-0000-0000-000000000000).
  54164. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  54165. c.urlParams_.Set("requestId", requestId)
  54166. return c
  54167. }
  54168. // Fields allows partial responses to be retrieved. See
  54169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54170. // for more information.
  54171. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  54172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54173. return c
  54174. }
  54175. // Context sets the context to be used in this call's Do method. Any
  54176. // pending HTTP request will be aborted if the provided context is
  54177. // canceled.
  54178. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  54179. c.ctx_ = ctx
  54180. return c
  54181. }
  54182. // Header returns an http.Header that can be modified by the caller to
  54183. // add HTTP headers to the request.
  54184. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  54185. if c.header_ == nil {
  54186. c.header_ = make(http.Header)
  54187. }
  54188. return c.header_
  54189. }
  54190. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  54191. reqHeaders := make(http.Header)
  54192. for k, v := range c.header_ {
  54193. reqHeaders[k] = v
  54194. }
  54195. reqHeaders.Set("User-Agent", c.s.userAgent())
  54196. var body io.Reader = nil
  54197. c.urlParams_.Set("alt", alt)
  54198. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  54199. urls += "?" + c.urlParams_.Encode()
  54200. req, _ := http.NewRequest("DELETE", urls, body)
  54201. req.Header = reqHeaders
  54202. googleapi.Expand(req.URL, map[string]string{
  54203. "project": c.project,
  54204. "region": c.region,
  54205. "autoscaler": c.autoscaler,
  54206. })
  54207. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54208. }
  54209. // Do executes the "compute.regionAutoscalers.delete" call.
  54210. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54211. // status code is an error. Response headers are in either
  54212. // *Operation.ServerResponse.Header or (if a response was returned at
  54213. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54214. // to check whether the returned error was because
  54215. // http.StatusNotModified was returned.
  54216. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54217. gensupport.SetOptions(c.urlParams_, opts...)
  54218. res, err := c.doRequest("json")
  54219. if res != nil && res.StatusCode == http.StatusNotModified {
  54220. if res.Body != nil {
  54221. res.Body.Close()
  54222. }
  54223. return nil, &googleapi.Error{
  54224. Code: res.StatusCode,
  54225. Header: res.Header,
  54226. }
  54227. }
  54228. if err != nil {
  54229. return nil, err
  54230. }
  54231. defer googleapi.CloseBody(res)
  54232. if err := googleapi.CheckResponse(res); err != nil {
  54233. return nil, err
  54234. }
  54235. ret := &Operation{
  54236. ServerResponse: googleapi.ServerResponse{
  54237. Header: res.Header,
  54238. HTTPStatusCode: res.StatusCode,
  54239. },
  54240. }
  54241. target := &ret
  54242. if err := gensupport.DecodeResponse(target, res); err != nil {
  54243. return nil, err
  54244. }
  54245. return ret, nil
  54246. // {
  54247. // "description": "Deletes the specified autoscaler.",
  54248. // "httpMethod": "DELETE",
  54249. // "id": "compute.regionAutoscalers.delete",
  54250. // "parameterOrder": [
  54251. // "project",
  54252. // "region",
  54253. // "autoscaler"
  54254. // ],
  54255. // "parameters": {
  54256. // "autoscaler": {
  54257. // "description": "Name of the autoscaler to delete.",
  54258. // "location": "path",
  54259. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54260. // "required": true,
  54261. // "type": "string"
  54262. // },
  54263. // "project": {
  54264. // "description": "Project ID for this request.",
  54265. // "location": "path",
  54266. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54267. // "required": true,
  54268. // "type": "string"
  54269. // },
  54270. // "region": {
  54271. // "description": "Name of the region scoping this request.",
  54272. // "location": "path",
  54273. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54274. // "required": true,
  54275. // "type": "string"
  54276. // },
  54277. // "requestId": {
  54278. // "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).",
  54279. // "location": "query",
  54280. // "type": "string"
  54281. // }
  54282. // },
  54283. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  54284. // "response": {
  54285. // "$ref": "Operation"
  54286. // },
  54287. // "scopes": [
  54288. // "https://www.googleapis.com/auth/cloud-platform",
  54289. // "https://www.googleapis.com/auth/compute"
  54290. // ]
  54291. // }
  54292. }
  54293. // method id "compute.regionAutoscalers.get":
  54294. type RegionAutoscalersGetCall struct {
  54295. s *Service
  54296. project string
  54297. region string
  54298. autoscaler string
  54299. urlParams_ gensupport.URLParams
  54300. ifNoneMatch_ string
  54301. ctx_ context.Context
  54302. header_ http.Header
  54303. }
  54304. // Get: Returns the specified autoscaler.
  54305. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  54306. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54307. c.project = project
  54308. c.region = region
  54309. c.autoscaler = autoscaler
  54310. return c
  54311. }
  54312. // Fields allows partial responses to be retrieved. See
  54313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54314. // for more information.
  54315. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  54316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54317. return c
  54318. }
  54319. // IfNoneMatch sets the optional parameter which makes the operation
  54320. // fail if the object's ETag matches the given value. This is useful for
  54321. // getting updates only after the object has changed since the last
  54322. // request. Use googleapi.IsNotModified to check whether the response
  54323. // error from Do is the result of In-None-Match.
  54324. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  54325. c.ifNoneMatch_ = entityTag
  54326. return c
  54327. }
  54328. // Context sets the context to be used in this call's Do method. Any
  54329. // pending HTTP request will be aborted if the provided context is
  54330. // canceled.
  54331. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  54332. c.ctx_ = ctx
  54333. return c
  54334. }
  54335. // Header returns an http.Header that can be modified by the caller to
  54336. // add HTTP headers to the request.
  54337. func (c *RegionAutoscalersGetCall) Header() http.Header {
  54338. if c.header_ == nil {
  54339. c.header_ = make(http.Header)
  54340. }
  54341. return c.header_
  54342. }
  54343. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  54344. reqHeaders := make(http.Header)
  54345. for k, v := range c.header_ {
  54346. reqHeaders[k] = v
  54347. }
  54348. reqHeaders.Set("User-Agent", c.s.userAgent())
  54349. if c.ifNoneMatch_ != "" {
  54350. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54351. }
  54352. var body io.Reader = nil
  54353. c.urlParams_.Set("alt", alt)
  54354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  54355. urls += "?" + c.urlParams_.Encode()
  54356. req, _ := http.NewRequest("GET", urls, body)
  54357. req.Header = reqHeaders
  54358. googleapi.Expand(req.URL, map[string]string{
  54359. "project": c.project,
  54360. "region": c.region,
  54361. "autoscaler": c.autoscaler,
  54362. })
  54363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54364. }
  54365. // Do executes the "compute.regionAutoscalers.get" call.
  54366. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  54367. // status code is an error. Response headers are in either
  54368. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  54369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54370. // to check whether the returned error was because
  54371. // http.StatusNotModified was returned.
  54372. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  54373. gensupport.SetOptions(c.urlParams_, opts...)
  54374. res, err := c.doRequest("json")
  54375. if res != nil && res.StatusCode == http.StatusNotModified {
  54376. if res.Body != nil {
  54377. res.Body.Close()
  54378. }
  54379. return nil, &googleapi.Error{
  54380. Code: res.StatusCode,
  54381. Header: res.Header,
  54382. }
  54383. }
  54384. if err != nil {
  54385. return nil, err
  54386. }
  54387. defer googleapi.CloseBody(res)
  54388. if err := googleapi.CheckResponse(res); err != nil {
  54389. return nil, err
  54390. }
  54391. ret := &Autoscaler{
  54392. ServerResponse: googleapi.ServerResponse{
  54393. Header: res.Header,
  54394. HTTPStatusCode: res.StatusCode,
  54395. },
  54396. }
  54397. target := &ret
  54398. if err := gensupport.DecodeResponse(target, res); err != nil {
  54399. return nil, err
  54400. }
  54401. return ret, nil
  54402. // {
  54403. // "description": "Returns the specified autoscaler.",
  54404. // "httpMethod": "GET",
  54405. // "id": "compute.regionAutoscalers.get",
  54406. // "parameterOrder": [
  54407. // "project",
  54408. // "region",
  54409. // "autoscaler"
  54410. // ],
  54411. // "parameters": {
  54412. // "autoscaler": {
  54413. // "description": "Name of the autoscaler to return.",
  54414. // "location": "path",
  54415. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54416. // "required": true,
  54417. // "type": "string"
  54418. // },
  54419. // "project": {
  54420. // "description": "Project ID for this request.",
  54421. // "location": "path",
  54422. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54423. // "required": true,
  54424. // "type": "string"
  54425. // },
  54426. // "region": {
  54427. // "description": "Name of the region scoping this request.",
  54428. // "location": "path",
  54429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54430. // "required": true,
  54431. // "type": "string"
  54432. // }
  54433. // },
  54434. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  54435. // "response": {
  54436. // "$ref": "Autoscaler"
  54437. // },
  54438. // "scopes": [
  54439. // "https://www.googleapis.com/auth/cloud-platform",
  54440. // "https://www.googleapis.com/auth/compute",
  54441. // "https://www.googleapis.com/auth/compute.readonly"
  54442. // ]
  54443. // }
  54444. }
  54445. // method id "compute.regionAutoscalers.insert":
  54446. type RegionAutoscalersInsertCall struct {
  54447. s *Service
  54448. project string
  54449. region string
  54450. autoscaler *Autoscaler
  54451. urlParams_ gensupport.URLParams
  54452. ctx_ context.Context
  54453. header_ http.Header
  54454. }
  54455. // Insert: Creates an autoscaler in the specified project using the data
  54456. // included in the request.
  54457. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  54458. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54459. c.project = project
  54460. c.region = region
  54461. c.autoscaler = autoscaler
  54462. return c
  54463. }
  54464. // RequestId sets the optional parameter "requestId": An optional
  54465. // request ID to identify requests. Specify a unique request ID so that
  54466. // if you must retry your request, the server will know to ignore the
  54467. // request if it has already been completed.
  54468. //
  54469. // For example, consider a situation where you make an initial request
  54470. // and the request times out. If you make the request again with the
  54471. // same request ID, the server can check if original operation with the
  54472. // same request ID was received, and if so, will ignore the second
  54473. // request. This prevents clients from accidentally creating duplicate
  54474. // commitments.
  54475. //
  54476. // The request ID must be a valid UUID with the exception that zero UUID
  54477. // is not supported (00000000-0000-0000-0000-000000000000).
  54478. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  54479. c.urlParams_.Set("requestId", requestId)
  54480. return c
  54481. }
  54482. // Fields allows partial responses to be retrieved. See
  54483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54484. // for more information.
  54485. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  54486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54487. return c
  54488. }
  54489. // Context sets the context to be used in this call's Do method. Any
  54490. // pending HTTP request will be aborted if the provided context is
  54491. // canceled.
  54492. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  54493. c.ctx_ = ctx
  54494. return c
  54495. }
  54496. // Header returns an http.Header that can be modified by the caller to
  54497. // add HTTP headers to the request.
  54498. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  54499. if c.header_ == nil {
  54500. c.header_ = make(http.Header)
  54501. }
  54502. return c.header_
  54503. }
  54504. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  54505. reqHeaders := make(http.Header)
  54506. for k, v := range c.header_ {
  54507. reqHeaders[k] = v
  54508. }
  54509. reqHeaders.Set("User-Agent", c.s.userAgent())
  54510. var body io.Reader = nil
  54511. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  54512. if err != nil {
  54513. return nil, err
  54514. }
  54515. reqHeaders.Set("Content-Type", "application/json")
  54516. c.urlParams_.Set("alt", alt)
  54517. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  54518. urls += "?" + c.urlParams_.Encode()
  54519. req, _ := http.NewRequest("POST", urls, body)
  54520. req.Header = reqHeaders
  54521. googleapi.Expand(req.URL, map[string]string{
  54522. "project": c.project,
  54523. "region": c.region,
  54524. })
  54525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54526. }
  54527. // Do executes the "compute.regionAutoscalers.insert" call.
  54528. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54529. // status code is an error. Response headers are in either
  54530. // *Operation.ServerResponse.Header or (if a response was returned at
  54531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54532. // to check whether the returned error was because
  54533. // http.StatusNotModified was returned.
  54534. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54535. gensupport.SetOptions(c.urlParams_, opts...)
  54536. res, err := c.doRequest("json")
  54537. if res != nil && res.StatusCode == http.StatusNotModified {
  54538. if res.Body != nil {
  54539. res.Body.Close()
  54540. }
  54541. return nil, &googleapi.Error{
  54542. Code: res.StatusCode,
  54543. Header: res.Header,
  54544. }
  54545. }
  54546. if err != nil {
  54547. return nil, err
  54548. }
  54549. defer googleapi.CloseBody(res)
  54550. if err := googleapi.CheckResponse(res); err != nil {
  54551. return nil, err
  54552. }
  54553. ret := &Operation{
  54554. ServerResponse: googleapi.ServerResponse{
  54555. Header: res.Header,
  54556. HTTPStatusCode: res.StatusCode,
  54557. },
  54558. }
  54559. target := &ret
  54560. if err := gensupport.DecodeResponse(target, res); err != nil {
  54561. return nil, err
  54562. }
  54563. return ret, nil
  54564. // {
  54565. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  54566. // "httpMethod": "POST",
  54567. // "id": "compute.regionAutoscalers.insert",
  54568. // "parameterOrder": [
  54569. // "project",
  54570. // "region"
  54571. // ],
  54572. // "parameters": {
  54573. // "project": {
  54574. // "description": "Project ID for this request.",
  54575. // "location": "path",
  54576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54577. // "required": true,
  54578. // "type": "string"
  54579. // },
  54580. // "region": {
  54581. // "description": "Name of the region scoping this request.",
  54582. // "location": "path",
  54583. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54584. // "required": true,
  54585. // "type": "string"
  54586. // },
  54587. // "requestId": {
  54588. // "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).",
  54589. // "location": "query",
  54590. // "type": "string"
  54591. // }
  54592. // },
  54593. // "path": "{project}/regions/{region}/autoscalers",
  54594. // "request": {
  54595. // "$ref": "Autoscaler"
  54596. // },
  54597. // "response": {
  54598. // "$ref": "Operation"
  54599. // },
  54600. // "scopes": [
  54601. // "https://www.googleapis.com/auth/cloud-platform",
  54602. // "https://www.googleapis.com/auth/compute"
  54603. // ]
  54604. // }
  54605. }
  54606. // method id "compute.regionAutoscalers.list":
  54607. type RegionAutoscalersListCall struct {
  54608. s *Service
  54609. project string
  54610. region string
  54611. urlParams_ gensupport.URLParams
  54612. ifNoneMatch_ string
  54613. ctx_ context.Context
  54614. header_ http.Header
  54615. }
  54616. // List: Retrieves a list of autoscalers contained within the specified
  54617. // region.
  54618. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  54619. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54620. c.project = project
  54621. c.region = region
  54622. return c
  54623. }
  54624. // Filter sets the optional parameter "filter": A filter expression that
  54625. // filters resources listed in the response. The expression must specify
  54626. // the field name, a comparison operator, and the value that you want to
  54627. // use for filtering. The value must be a string, a number, or a
  54628. // boolean. The comparison operator must be either =, !=, >, or <.
  54629. //
  54630. // For example, if you are filtering Compute Engine instances, you can
  54631. // exclude instances named example-instance by specifying name !=
  54632. // example-instance.
  54633. //
  54634. // You can also filter nested fields. For example, you could specify
  54635. // scheduling.automaticRestart = false to include instances only if they
  54636. // are not scheduled for automatic restarts. You can use filtering on
  54637. // nested fields to filter based on resource labels.
  54638. //
  54639. // To filter on multiple expressions, provide each separate expression
  54640. // within parentheses. For example, (scheduling.automaticRestart = true)
  54641. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54642. // AND expression. However, you can include AND and OR expressions
  54643. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54644. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54645. // true).
  54646. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  54647. c.urlParams_.Set("filter", filter)
  54648. return c
  54649. }
  54650. // MaxResults sets the optional parameter "maxResults": The maximum
  54651. // number of results per page that should be returned. If the number of
  54652. // available results is larger than maxResults, Compute Engine returns a
  54653. // nextPageToken that can be used to get the next page of results in
  54654. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54655. // (Default: 500)
  54656. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  54657. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54658. return c
  54659. }
  54660. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54661. // a certain order. By default, results are returned in alphanumerical
  54662. // order based on the resource name.
  54663. //
  54664. // You can also sort results in descending order based on the creation
  54665. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54666. // based on the creationTimestamp field in reverse chronological order
  54667. // (newest result first). Use this to sort resources like operations so
  54668. // that the newest operation is returned first.
  54669. //
  54670. // Currently, only sorting by name or creationTimestamp desc is
  54671. // supported.
  54672. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  54673. c.urlParams_.Set("orderBy", orderBy)
  54674. return c
  54675. }
  54676. // PageToken sets the optional parameter "pageToken": Specifies a page
  54677. // token to use. Set pageToken to the nextPageToken returned by a
  54678. // previous list request to get the next page of results.
  54679. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  54680. c.urlParams_.Set("pageToken", pageToken)
  54681. return c
  54682. }
  54683. // Fields allows partial responses to be retrieved. See
  54684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54685. // for more information.
  54686. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  54687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54688. return c
  54689. }
  54690. // IfNoneMatch sets the optional parameter which makes the operation
  54691. // fail if the object's ETag matches the given value. This is useful for
  54692. // getting updates only after the object has changed since the last
  54693. // request. Use googleapi.IsNotModified to check whether the response
  54694. // error from Do is the result of In-None-Match.
  54695. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  54696. c.ifNoneMatch_ = entityTag
  54697. return c
  54698. }
  54699. // Context sets the context to be used in this call's Do method. Any
  54700. // pending HTTP request will be aborted if the provided context is
  54701. // canceled.
  54702. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  54703. c.ctx_ = ctx
  54704. return c
  54705. }
  54706. // Header returns an http.Header that can be modified by the caller to
  54707. // add HTTP headers to the request.
  54708. func (c *RegionAutoscalersListCall) Header() http.Header {
  54709. if c.header_ == nil {
  54710. c.header_ = make(http.Header)
  54711. }
  54712. return c.header_
  54713. }
  54714. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  54715. reqHeaders := make(http.Header)
  54716. for k, v := range c.header_ {
  54717. reqHeaders[k] = v
  54718. }
  54719. reqHeaders.Set("User-Agent", c.s.userAgent())
  54720. if c.ifNoneMatch_ != "" {
  54721. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54722. }
  54723. var body io.Reader = nil
  54724. c.urlParams_.Set("alt", alt)
  54725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  54726. urls += "?" + c.urlParams_.Encode()
  54727. req, _ := http.NewRequest("GET", urls, body)
  54728. req.Header = reqHeaders
  54729. googleapi.Expand(req.URL, map[string]string{
  54730. "project": c.project,
  54731. "region": c.region,
  54732. })
  54733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54734. }
  54735. // Do executes the "compute.regionAutoscalers.list" call.
  54736. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  54737. // non-2xx status code is an error. Response headers are in either
  54738. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  54739. // returned at all) in error.(*googleapi.Error).Header. Use
  54740. // googleapi.IsNotModified to check whether the returned error was
  54741. // because http.StatusNotModified was returned.
  54742. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  54743. gensupport.SetOptions(c.urlParams_, opts...)
  54744. res, err := c.doRequest("json")
  54745. if res != nil && res.StatusCode == http.StatusNotModified {
  54746. if res.Body != nil {
  54747. res.Body.Close()
  54748. }
  54749. return nil, &googleapi.Error{
  54750. Code: res.StatusCode,
  54751. Header: res.Header,
  54752. }
  54753. }
  54754. if err != nil {
  54755. return nil, err
  54756. }
  54757. defer googleapi.CloseBody(res)
  54758. if err := googleapi.CheckResponse(res); err != nil {
  54759. return nil, err
  54760. }
  54761. ret := &RegionAutoscalerList{
  54762. ServerResponse: googleapi.ServerResponse{
  54763. Header: res.Header,
  54764. HTTPStatusCode: res.StatusCode,
  54765. },
  54766. }
  54767. target := &ret
  54768. if err := gensupport.DecodeResponse(target, res); err != nil {
  54769. return nil, err
  54770. }
  54771. return ret, nil
  54772. // {
  54773. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  54774. // "httpMethod": "GET",
  54775. // "id": "compute.regionAutoscalers.list",
  54776. // "parameterOrder": [
  54777. // "project",
  54778. // "region"
  54779. // ],
  54780. // "parameters": {
  54781. // "filter": {
  54782. // "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).",
  54783. // "location": "query",
  54784. // "type": "string"
  54785. // },
  54786. // "maxResults": {
  54787. // "default": "500",
  54788. // "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)",
  54789. // "format": "uint32",
  54790. // "location": "query",
  54791. // "minimum": "0",
  54792. // "type": "integer"
  54793. // },
  54794. // "orderBy": {
  54795. // "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.",
  54796. // "location": "query",
  54797. // "type": "string"
  54798. // },
  54799. // "pageToken": {
  54800. // "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.",
  54801. // "location": "query",
  54802. // "type": "string"
  54803. // },
  54804. // "project": {
  54805. // "description": "Project ID for this request.",
  54806. // "location": "path",
  54807. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54808. // "required": true,
  54809. // "type": "string"
  54810. // },
  54811. // "region": {
  54812. // "description": "Name of the region scoping this request.",
  54813. // "location": "path",
  54814. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54815. // "required": true,
  54816. // "type": "string"
  54817. // }
  54818. // },
  54819. // "path": "{project}/regions/{region}/autoscalers",
  54820. // "response": {
  54821. // "$ref": "RegionAutoscalerList"
  54822. // },
  54823. // "scopes": [
  54824. // "https://www.googleapis.com/auth/cloud-platform",
  54825. // "https://www.googleapis.com/auth/compute",
  54826. // "https://www.googleapis.com/auth/compute.readonly"
  54827. // ]
  54828. // }
  54829. }
  54830. // Pages invokes f for each page of results.
  54831. // A non-nil error returned from f will halt the iteration.
  54832. // The provided context supersedes any context provided to the Context method.
  54833. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  54834. c.ctx_ = ctx
  54835. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54836. for {
  54837. x, err := c.Do()
  54838. if err != nil {
  54839. return err
  54840. }
  54841. if err := f(x); err != nil {
  54842. return err
  54843. }
  54844. if x.NextPageToken == "" {
  54845. return nil
  54846. }
  54847. c.PageToken(x.NextPageToken)
  54848. }
  54849. }
  54850. // method id "compute.regionAutoscalers.patch":
  54851. type RegionAutoscalersPatchCall struct {
  54852. s *Service
  54853. project string
  54854. region string
  54855. autoscaler *Autoscaler
  54856. urlParams_ gensupport.URLParams
  54857. ctx_ context.Context
  54858. header_ http.Header
  54859. }
  54860. // Patch: Updates an autoscaler in the specified project using the data
  54861. // included in the request. This method supports PATCH semantics and
  54862. // uses the JSON merge patch format and processing rules.
  54863. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  54864. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54865. c.project = project
  54866. c.region = region
  54867. c.autoscaler = autoscaler
  54868. return c
  54869. }
  54870. // Autoscaler sets the optional parameter "autoscaler": Name of the
  54871. // autoscaler to patch.
  54872. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  54873. c.urlParams_.Set("autoscaler", autoscaler)
  54874. return c
  54875. }
  54876. // RequestId sets the optional parameter "requestId": An optional
  54877. // request ID to identify requests. Specify a unique request ID so that
  54878. // if you must retry your request, the server will know to ignore the
  54879. // request if it has already been completed.
  54880. //
  54881. // For example, consider a situation where you make an initial request
  54882. // and the request times out. If you make the request again with the
  54883. // same request ID, the server can check if original operation with the
  54884. // same request ID was received, and if so, will ignore the second
  54885. // request. This prevents clients from accidentally creating duplicate
  54886. // commitments.
  54887. //
  54888. // The request ID must be a valid UUID with the exception that zero UUID
  54889. // is not supported (00000000-0000-0000-0000-000000000000).
  54890. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  54891. c.urlParams_.Set("requestId", requestId)
  54892. return c
  54893. }
  54894. // Fields allows partial responses to be retrieved. See
  54895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54896. // for more information.
  54897. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  54898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54899. return c
  54900. }
  54901. // Context sets the context to be used in this call's Do method. Any
  54902. // pending HTTP request will be aborted if the provided context is
  54903. // canceled.
  54904. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  54905. c.ctx_ = ctx
  54906. return c
  54907. }
  54908. // Header returns an http.Header that can be modified by the caller to
  54909. // add HTTP headers to the request.
  54910. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  54911. if c.header_ == nil {
  54912. c.header_ = make(http.Header)
  54913. }
  54914. return c.header_
  54915. }
  54916. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  54917. reqHeaders := make(http.Header)
  54918. for k, v := range c.header_ {
  54919. reqHeaders[k] = v
  54920. }
  54921. reqHeaders.Set("User-Agent", c.s.userAgent())
  54922. var body io.Reader = nil
  54923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  54924. if err != nil {
  54925. return nil, err
  54926. }
  54927. reqHeaders.Set("Content-Type", "application/json")
  54928. c.urlParams_.Set("alt", alt)
  54929. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  54930. urls += "?" + c.urlParams_.Encode()
  54931. req, _ := http.NewRequest("PATCH", urls, body)
  54932. req.Header = reqHeaders
  54933. googleapi.Expand(req.URL, map[string]string{
  54934. "project": c.project,
  54935. "region": c.region,
  54936. })
  54937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54938. }
  54939. // Do executes the "compute.regionAutoscalers.patch" call.
  54940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54941. // status code is an error. Response headers are in either
  54942. // *Operation.ServerResponse.Header or (if a response was returned at
  54943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54944. // to check whether the returned error was because
  54945. // http.StatusNotModified was returned.
  54946. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54947. gensupport.SetOptions(c.urlParams_, opts...)
  54948. res, err := c.doRequest("json")
  54949. if res != nil && res.StatusCode == http.StatusNotModified {
  54950. if res.Body != nil {
  54951. res.Body.Close()
  54952. }
  54953. return nil, &googleapi.Error{
  54954. Code: res.StatusCode,
  54955. Header: res.Header,
  54956. }
  54957. }
  54958. if err != nil {
  54959. return nil, err
  54960. }
  54961. defer googleapi.CloseBody(res)
  54962. if err := googleapi.CheckResponse(res); err != nil {
  54963. return nil, err
  54964. }
  54965. ret := &Operation{
  54966. ServerResponse: googleapi.ServerResponse{
  54967. Header: res.Header,
  54968. HTTPStatusCode: res.StatusCode,
  54969. },
  54970. }
  54971. target := &ret
  54972. if err := gensupport.DecodeResponse(target, res); err != nil {
  54973. return nil, err
  54974. }
  54975. return ret, nil
  54976. // {
  54977. // "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.",
  54978. // "httpMethod": "PATCH",
  54979. // "id": "compute.regionAutoscalers.patch",
  54980. // "parameterOrder": [
  54981. // "project",
  54982. // "region"
  54983. // ],
  54984. // "parameters": {
  54985. // "autoscaler": {
  54986. // "description": "Name of the autoscaler to patch.",
  54987. // "location": "query",
  54988. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54989. // "type": "string"
  54990. // },
  54991. // "project": {
  54992. // "description": "Project ID for this request.",
  54993. // "location": "path",
  54994. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54995. // "required": true,
  54996. // "type": "string"
  54997. // },
  54998. // "region": {
  54999. // "description": "Name of the region scoping this request.",
  55000. // "location": "path",
  55001. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55002. // "required": true,
  55003. // "type": "string"
  55004. // },
  55005. // "requestId": {
  55006. // "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).",
  55007. // "location": "query",
  55008. // "type": "string"
  55009. // }
  55010. // },
  55011. // "path": "{project}/regions/{region}/autoscalers",
  55012. // "request": {
  55013. // "$ref": "Autoscaler"
  55014. // },
  55015. // "response": {
  55016. // "$ref": "Operation"
  55017. // },
  55018. // "scopes": [
  55019. // "https://www.googleapis.com/auth/cloud-platform",
  55020. // "https://www.googleapis.com/auth/compute"
  55021. // ]
  55022. // }
  55023. }
  55024. // method id "compute.regionAutoscalers.update":
  55025. type RegionAutoscalersUpdateCall struct {
  55026. s *Service
  55027. project string
  55028. region string
  55029. autoscaler *Autoscaler
  55030. urlParams_ gensupport.URLParams
  55031. ctx_ context.Context
  55032. header_ http.Header
  55033. }
  55034. // Update: Updates an autoscaler in the specified project using the data
  55035. // included in the request.
  55036. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  55037. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55038. c.project = project
  55039. c.region = region
  55040. c.autoscaler = autoscaler
  55041. return c
  55042. }
  55043. // Autoscaler sets the optional parameter "autoscaler": Name of the
  55044. // autoscaler to update.
  55045. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  55046. c.urlParams_.Set("autoscaler", autoscaler)
  55047. return c
  55048. }
  55049. // RequestId sets the optional parameter "requestId": An optional
  55050. // request ID to identify requests. Specify a unique request ID so that
  55051. // if you must retry your request, the server will know to ignore the
  55052. // request if it has already been completed.
  55053. //
  55054. // For example, consider a situation where you make an initial request
  55055. // and the request times out. If you make the request again with the
  55056. // same request ID, the server can check if original operation with the
  55057. // same request ID was received, and if so, will ignore the second
  55058. // request. This prevents clients from accidentally creating duplicate
  55059. // commitments.
  55060. //
  55061. // The request ID must be a valid UUID with the exception that zero UUID
  55062. // is not supported (00000000-0000-0000-0000-000000000000).
  55063. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  55064. c.urlParams_.Set("requestId", requestId)
  55065. return c
  55066. }
  55067. // Fields allows partial responses to be retrieved. See
  55068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55069. // for more information.
  55070. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  55071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55072. return c
  55073. }
  55074. // Context sets the context to be used in this call's Do method. Any
  55075. // pending HTTP request will be aborted if the provided context is
  55076. // canceled.
  55077. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  55078. c.ctx_ = ctx
  55079. return c
  55080. }
  55081. // Header returns an http.Header that can be modified by the caller to
  55082. // add HTTP headers to the request.
  55083. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  55084. if c.header_ == nil {
  55085. c.header_ = make(http.Header)
  55086. }
  55087. return c.header_
  55088. }
  55089. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  55090. reqHeaders := make(http.Header)
  55091. for k, v := range c.header_ {
  55092. reqHeaders[k] = v
  55093. }
  55094. reqHeaders.Set("User-Agent", c.s.userAgent())
  55095. var body io.Reader = nil
  55096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  55097. if err != nil {
  55098. return nil, err
  55099. }
  55100. reqHeaders.Set("Content-Type", "application/json")
  55101. c.urlParams_.Set("alt", alt)
  55102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  55103. urls += "?" + c.urlParams_.Encode()
  55104. req, _ := http.NewRequest("PUT", urls, body)
  55105. req.Header = reqHeaders
  55106. googleapi.Expand(req.URL, map[string]string{
  55107. "project": c.project,
  55108. "region": c.region,
  55109. })
  55110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55111. }
  55112. // Do executes the "compute.regionAutoscalers.update" call.
  55113. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55114. // status code is an error. Response headers are in either
  55115. // *Operation.ServerResponse.Header or (if a response was returned at
  55116. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55117. // to check whether the returned error was because
  55118. // http.StatusNotModified was returned.
  55119. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55120. gensupport.SetOptions(c.urlParams_, opts...)
  55121. res, err := c.doRequest("json")
  55122. if res != nil && res.StatusCode == http.StatusNotModified {
  55123. if res.Body != nil {
  55124. res.Body.Close()
  55125. }
  55126. return nil, &googleapi.Error{
  55127. Code: res.StatusCode,
  55128. Header: res.Header,
  55129. }
  55130. }
  55131. if err != nil {
  55132. return nil, err
  55133. }
  55134. defer googleapi.CloseBody(res)
  55135. if err := googleapi.CheckResponse(res); err != nil {
  55136. return nil, err
  55137. }
  55138. ret := &Operation{
  55139. ServerResponse: googleapi.ServerResponse{
  55140. Header: res.Header,
  55141. HTTPStatusCode: res.StatusCode,
  55142. },
  55143. }
  55144. target := &ret
  55145. if err := gensupport.DecodeResponse(target, res); err != nil {
  55146. return nil, err
  55147. }
  55148. return ret, nil
  55149. // {
  55150. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  55151. // "httpMethod": "PUT",
  55152. // "id": "compute.regionAutoscalers.update",
  55153. // "parameterOrder": [
  55154. // "project",
  55155. // "region"
  55156. // ],
  55157. // "parameters": {
  55158. // "autoscaler": {
  55159. // "description": "Name of the autoscaler to update.",
  55160. // "location": "query",
  55161. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  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 scoping 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}/autoscalers",
  55185. // "request": {
  55186. // "$ref": "Autoscaler"
  55187. // },
  55188. // "response": {
  55189. // "$ref": "Operation"
  55190. // },
  55191. // "scopes": [
  55192. // "https://www.googleapis.com/auth/cloud-platform",
  55193. // "https://www.googleapis.com/auth/compute"
  55194. // ]
  55195. // }
  55196. }
  55197. // method id "compute.regionBackendServices.delete":
  55198. type RegionBackendServicesDeleteCall struct {
  55199. s *Service
  55200. project string
  55201. region string
  55202. backendService string
  55203. urlParams_ gensupport.URLParams
  55204. ctx_ context.Context
  55205. header_ http.Header
  55206. }
  55207. // Delete: Deletes the specified regional BackendService resource.
  55208. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  55209. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55210. c.project = project
  55211. c.region = region
  55212. c.backendService = backendService
  55213. return c
  55214. }
  55215. // RequestId sets the optional parameter "requestId": An optional
  55216. // request ID to identify requests. Specify a unique request ID so that
  55217. // if you must retry your request, the server will know to ignore the
  55218. // request if it has already been completed.
  55219. //
  55220. // For example, consider a situation where you make an initial request
  55221. // and the request times out. If you make the request again with the
  55222. // same request ID, the server can check if original operation with the
  55223. // same request ID was received, and if so, will ignore the second
  55224. // request. This prevents clients from accidentally creating duplicate
  55225. // commitments.
  55226. //
  55227. // The request ID must be a valid UUID with the exception that zero UUID
  55228. // is not supported (00000000-0000-0000-0000-000000000000).
  55229. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  55230. c.urlParams_.Set("requestId", requestId)
  55231. return c
  55232. }
  55233. // Fields allows partial responses to be retrieved. See
  55234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55235. // for more information.
  55236. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  55237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55238. return c
  55239. }
  55240. // Context sets the context to be used in this call's Do method. Any
  55241. // pending HTTP request will be aborted if the provided context is
  55242. // canceled.
  55243. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  55244. c.ctx_ = ctx
  55245. return c
  55246. }
  55247. // Header returns an http.Header that can be modified by the caller to
  55248. // add HTTP headers to the request.
  55249. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  55250. if c.header_ == nil {
  55251. c.header_ = make(http.Header)
  55252. }
  55253. return c.header_
  55254. }
  55255. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  55256. reqHeaders := make(http.Header)
  55257. for k, v := range c.header_ {
  55258. reqHeaders[k] = v
  55259. }
  55260. reqHeaders.Set("User-Agent", c.s.userAgent())
  55261. var body io.Reader = nil
  55262. c.urlParams_.Set("alt", alt)
  55263. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  55264. urls += "?" + c.urlParams_.Encode()
  55265. req, _ := http.NewRequest("DELETE", urls, body)
  55266. req.Header = reqHeaders
  55267. googleapi.Expand(req.URL, map[string]string{
  55268. "project": c.project,
  55269. "region": c.region,
  55270. "backendService": c.backendService,
  55271. })
  55272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55273. }
  55274. // Do executes the "compute.regionBackendServices.delete" call.
  55275. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55276. // status code is an error. Response headers are in either
  55277. // *Operation.ServerResponse.Header or (if a response was returned at
  55278. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55279. // to check whether the returned error was because
  55280. // http.StatusNotModified was returned.
  55281. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55282. gensupport.SetOptions(c.urlParams_, opts...)
  55283. res, err := c.doRequest("json")
  55284. if res != nil && res.StatusCode == http.StatusNotModified {
  55285. if res.Body != nil {
  55286. res.Body.Close()
  55287. }
  55288. return nil, &googleapi.Error{
  55289. Code: res.StatusCode,
  55290. Header: res.Header,
  55291. }
  55292. }
  55293. if err != nil {
  55294. return nil, err
  55295. }
  55296. defer googleapi.CloseBody(res)
  55297. if err := googleapi.CheckResponse(res); err != nil {
  55298. return nil, err
  55299. }
  55300. ret := &Operation{
  55301. ServerResponse: googleapi.ServerResponse{
  55302. Header: res.Header,
  55303. HTTPStatusCode: res.StatusCode,
  55304. },
  55305. }
  55306. target := &ret
  55307. if err := gensupport.DecodeResponse(target, res); err != nil {
  55308. return nil, err
  55309. }
  55310. return ret, nil
  55311. // {
  55312. // "description": "Deletes the specified regional BackendService resource.",
  55313. // "httpMethod": "DELETE",
  55314. // "id": "compute.regionBackendServices.delete",
  55315. // "parameterOrder": [
  55316. // "project",
  55317. // "region",
  55318. // "backendService"
  55319. // ],
  55320. // "parameters": {
  55321. // "backendService": {
  55322. // "description": "Name of the BackendService resource to delete.",
  55323. // "location": "path",
  55324. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55325. // "required": true,
  55326. // "type": "string"
  55327. // },
  55328. // "project": {
  55329. // "description": "Project ID for this request.",
  55330. // "location": "path",
  55331. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55332. // "required": true,
  55333. // "type": "string"
  55334. // },
  55335. // "region": {
  55336. // "description": "Name of the region scoping this request.",
  55337. // "location": "path",
  55338. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55339. // "required": true,
  55340. // "type": "string"
  55341. // },
  55342. // "requestId": {
  55343. // "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).",
  55344. // "location": "query",
  55345. // "type": "string"
  55346. // }
  55347. // },
  55348. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  55349. // "response": {
  55350. // "$ref": "Operation"
  55351. // },
  55352. // "scopes": [
  55353. // "https://www.googleapis.com/auth/cloud-platform",
  55354. // "https://www.googleapis.com/auth/compute"
  55355. // ]
  55356. // }
  55357. }
  55358. // method id "compute.regionBackendServices.get":
  55359. type RegionBackendServicesGetCall struct {
  55360. s *Service
  55361. project string
  55362. region string
  55363. backendService string
  55364. urlParams_ gensupport.URLParams
  55365. ifNoneMatch_ string
  55366. ctx_ context.Context
  55367. header_ http.Header
  55368. }
  55369. // Get: Returns the specified regional BackendService resource.
  55370. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  55371. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55372. c.project = project
  55373. c.region = region
  55374. c.backendService = backendService
  55375. return c
  55376. }
  55377. // Fields allows partial responses to be retrieved. See
  55378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55379. // for more information.
  55380. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  55381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55382. return c
  55383. }
  55384. // IfNoneMatch sets the optional parameter which makes the operation
  55385. // fail if the object's ETag matches the given value. This is useful for
  55386. // getting updates only after the object has changed since the last
  55387. // request. Use googleapi.IsNotModified to check whether the response
  55388. // error from Do is the result of In-None-Match.
  55389. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  55390. c.ifNoneMatch_ = entityTag
  55391. return c
  55392. }
  55393. // Context sets the context to be used in this call's Do method. Any
  55394. // pending HTTP request will be aborted if the provided context is
  55395. // canceled.
  55396. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  55397. c.ctx_ = ctx
  55398. return c
  55399. }
  55400. // Header returns an http.Header that can be modified by the caller to
  55401. // add HTTP headers to the request.
  55402. func (c *RegionBackendServicesGetCall) Header() http.Header {
  55403. if c.header_ == nil {
  55404. c.header_ = make(http.Header)
  55405. }
  55406. return c.header_
  55407. }
  55408. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  55409. reqHeaders := make(http.Header)
  55410. for k, v := range c.header_ {
  55411. reqHeaders[k] = v
  55412. }
  55413. reqHeaders.Set("User-Agent", c.s.userAgent())
  55414. if c.ifNoneMatch_ != "" {
  55415. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55416. }
  55417. var body io.Reader = nil
  55418. c.urlParams_.Set("alt", alt)
  55419. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  55420. urls += "?" + c.urlParams_.Encode()
  55421. req, _ := http.NewRequest("GET", urls, body)
  55422. req.Header = reqHeaders
  55423. googleapi.Expand(req.URL, map[string]string{
  55424. "project": c.project,
  55425. "region": c.region,
  55426. "backendService": c.backendService,
  55427. })
  55428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55429. }
  55430. // Do executes the "compute.regionBackendServices.get" call.
  55431. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  55432. // status code is an error. Response headers are in either
  55433. // *BackendService.ServerResponse.Header or (if a response was returned
  55434. // at all) in error.(*googleapi.Error).Header. Use
  55435. // googleapi.IsNotModified to check whether the returned error was
  55436. // because http.StatusNotModified was returned.
  55437. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  55438. gensupport.SetOptions(c.urlParams_, opts...)
  55439. res, err := c.doRequest("json")
  55440. if res != nil && res.StatusCode == http.StatusNotModified {
  55441. if res.Body != nil {
  55442. res.Body.Close()
  55443. }
  55444. return nil, &googleapi.Error{
  55445. Code: res.StatusCode,
  55446. Header: res.Header,
  55447. }
  55448. }
  55449. if err != nil {
  55450. return nil, err
  55451. }
  55452. defer googleapi.CloseBody(res)
  55453. if err := googleapi.CheckResponse(res); err != nil {
  55454. return nil, err
  55455. }
  55456. ret := &BackendService{
  55457. ServerResponse: googleapi.ServerResponse{
  55458. Header: res.Header,
  55459. HTTPStatusCode: res.StatusCode,
  55460. },
  55461. }
  55462. target := &ret
  55463. if err := gensupport.DecodeResponse(target, res); err != nil {
  55464. return nil, err
  55465. }
  55466. return ret, nil
  55467. // {
  55468. // "description": "Returns the specified regional BackendService resource.",
  55469. // "httpMethod": "GET",
  55470. // "id": "compute.regionBackendServices.get",
  55471. // "parameterOrder": [
  55472. // "project",
  55473. // "region",
  55474. // "backendService"
  55475. // ],
  55476. // "parameters": {
  55477. // "backendService": {
  55478. // "description": "Name of the BackendService resource to return.",
  55479. // "location": "path",
  55480. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55481. // "required": true,
  55482. // "type": "string"
  55483. // },
  55484. // "project": {
  55485. // "description": "Project ID for this request.",
  55486. // "location": "path",
  55487. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55488. // "required": true,
  55489. // "type": "string"
  55490. // },
  55491. // "region": {
  55492. // "description": "Name of the region scoping this request.",
  55493. // "location": "path",
  55494. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55495. // "required": true,
  55496. // "type": "string"
  55497. // }
  55498. // },
  55499. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  55500. // "response": {
  55501. // "$ref": "BackendService"
  55502. // },
  55503. // "scopes": [
  55504. // "https://www.googleapis.com/auth/cloud-platform",
  55505. // "https://www.googleapis.com/auth/compute",
  55506. // "https://www.googleapis.com/auth/compute.readonly"
  55507. // ]
  55508. // }
  55509. }
  55510. // method id "compute.regionBackendServices.getHealth":
  55511. type RegionBackendServicesGetHealthCall struct {
  55512. s *Service
  55513. project string
  55514. region string
  55515. backendService string
  55516. resourcegroupreference *ResourceGroupReference
  55517. urlParams_ gensupport.URLParams
  55518. ctx_ context.Context
  55519. header_ http.Header
  55520. }
  55521. // GetHealth: Gets the most recent health check results for this
  55522. // regional BackendService.
  55523. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  55524. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55525. c.project = project
  55526. c.region = region
  55527. c.backendService = backendService
  55528. c.resourcegroupreference = resourcegroupreference
  55529. return c
  55530. }
  55531. // Fields allows partial responses to be retrieved. See
  55532. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55533. // for more information.
  55534. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  55535. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55536. return c
  55537. }
  55538. // Context sets the context to be used in this call's Do method. Any
  55539. // pending HTTP request will be aborted if the provided context is
  55540. // canceled.
  55541. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  55542. c.ctx_ = ctx
  55543. return c
  55544. }
  55545. // Header returns an http.Header that can be modified by the caller to
  55546. // add HTTP headers to the request.
  55547. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  55548. if c.header_ == nil {
  55549. c.header_ = make(http.Header)
  55550. }
  55551. return c.header_
  55552. }
  55553. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  55554. reqHeaders := make(http.Header)
  55555. for k, v := range c.header_ {
  55556. reqHeaders[k] = v
  55557. }
  55558. reqHeaders.Set("User-Agent", c.s.userAgent())
  55559. var body io.Reader = nil
  55560. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  55561. if err != nil {
  55562. return nil, err
  55563. }
  55564. reqHeaders.Set("Content-Type", "application/json")
  55565. c.urlParams_.Set("alt", alt)
  55566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  55567. urls += "?" + c.urlParams_.Encode()
  55568. req, _ := http.NewRequest("POST", urls, body)
  55569. req.Header = reqHeaders
  55570. googleapi.Expand(req.URL, map[string]string{
  55571. "project": c.project,
  55572. "region": c.region,
  55573. "backendService": c.backendService,
  55574. })
  55575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55576. }
  55577. // Do executes the "compute.regionBackendServices.getHealth" call.
  55578. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  55579. // Any non-2xx status code is an error. Response headers are in either
  55580. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  55581. // was returned at all) in error.(*googleapi.Error).Header. Use
  55582. // googleapi.IsNotModified to check whether the returned error was
  55583. // because http.StatusNotModified was returned.
  55584. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  55585. gensupport.SetOptions(c.urlParams_, opts...)
  55586. res, err := c.doRequest("json")
  55587. if res != nil && res.StatusCode == http.StatusNotModified {
  55588. if res.Body != nil {
  55589. res.Body.Close()
  55590. }
  55591. return nil, &googleapi.Error{
  55592. Code: res.StatusCode,
  55593. Header: res.Header,
  55594. }
  55595. }
  55596. if err != nil {
  55597. return nil, err
  55598. }
  55599. defer googleapi.CloseBody(res)
  55600. if err := googleapi.CheckResponse(res); err != nil {
  55601. return nil, err
  55602. }
  55603. ret := &BackendServiceGroupHealth{
  55604. ServerResponse: googleapi.ServerResponse{
  55605. Header: res.Header,
  55606. HTTPStatusCode: res.StatusCode,
  55607. },
  55608. }
  55609. target := &ret
  55610. if err := gensupport.DecodeResponse(target, res); err != nil {
  55611. return nil, err
  55612. }
  55613. return ret, nil
  55614. // {
  55615. // "description": "Gets the most recent health check results for this regional BackendService.",
  55616. // "httpMethod": "POST",
  55617. // "id": "compute.regionBackendServices.getHealth",
  55618. // "parameterOrder": [
  55619. // "project",
  55620. // "region",
  55621. // "backendService"
  55622. // ],
  55623. // "parameters": {
  55624. // "backendService": {
  55625. // "description": "Name of the BackendService resource for which to get health.",
  55626. // "location": "path",
  55627. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55628. // "required": true,
  55629. // "type": "string"
  55630. // },
  55631. // "project": {
  55632. // "location": "path",
  55633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55634. // "required": true,
  55635. // "type": "string"
  55636. // },
  55637. // "region": {
  55638. // "description": "Name of the region scoping this request.",
  55639. // "location": "path",
  55640. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55641. // "required": true,
  55642. // "type": "string"
  55643. // }
  55644. // },
  55645. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  55646. // "request": {
  55647. // "$ref": "ResourceGroupReference"
  55648. // },
  55649. // "response": {
  55650. // "$ref": "BackendServiceGroupHealth"
  55651. // },
  55652. // "scopes": [
  55653. // "https://www.googleapis.com/auth/cloud-platform",
  55654. // "https://www.googleapis.com/auth/compute",
  55655. // "https://www.googleapis.com/auth/compute.readonly"
  55656. // ]
  55657. // }
  55658. }
  55659. // method id "compute.regionBackendServices.insert":
  55660. type RegionBackendServicesInsertCall struct {
  55661. s *Service
  55662. project string
  55663. region string
  55664. backendservice *BackendService
  55665. urlParams_ gensupport.URLParams
  55666. ctx_ context.Context
  55667. header_ http.Header
  55668. }
  55669. // Insert: Creates a regional BackendService resource in the specified
  55670. // project using the data included in the request. There are several
  55671. // restrictions and guidelines to keep in mind when creating a regional
  55672. // backend service. Read Restrictions and Guidelines for more
  55673. // information.
  55674. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  55675. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55676. c.project = project
  55677. c.region = region
  55678. c.backendservice = backendservice
  55679. return c
  55680. }
  55681. // RequestId sets the optional parameter "requestId": An optional
  55682. // request ID to identify requests. Specify a unique request ID so that
  55683. // if you must retry your request, the server will know to ignore the
  55684. // request if it has already been completed.
  55685. //
  55686. // For example, consider a situation where you make an initial request
  55687. // and the request times out. If you make the request again with the
  55688. // same request ID, the server can check if original operation with the
  55689. // same request ID was received, and if so, will ignore the second
  55690. // request. This prevents clients from accidentally creating duplicate
  55691. // commitments.
  55692. //
  55693. // The request ID must be a valid UUID with the exception that zero UUID
  55694. // is not supported (00000000-0000-0000-0000-000000000000).
  55695. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  55696. c.urlParams_.Set("requestId", requestId)
  55697. return c
  55698. }
  55699. // Fields allows partial responses to be retrieved. See
  55700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55701. // for more information.
  55702. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  55703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55704. return c
  55705. }
  55706. // Context sets the context to be used in this call's Do method. Any
  55707. // pending HTTP request will be aborted if the provided context is
  55708. // canceled.
  55709. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  55710. c.ctx_ = ctx
  55711. return c
  55712. }
  55713. // Header returns an http.Header that can be modified by the caller to
  55714. // add HTTP headers to the request.
  55715. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  55716. if c.header_ == nil {
  55717. c.header_ = make(http.Header)
  55718. }
  55719. return c.header_
  55720. }
  55721. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  55722. reqHeaders := make(http.Header)
  55723. for k, v := range c.header_ {
  55724. reqHeaders[k] = v
  55725. }
  55726. reqHeaders.Set("User-Agent", c.s.userAgent())
  55727. var body io.Reader = nil
  55728. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  55729. if err != nil {
  55730. return nil, err
  55731. }
  55732. reqHeaders.Set("Content-Type", "application/json")
  55733. c.urlParams_.Set("alt", alt)
  55734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  55735. urls += "?" + c.urlParams_.Encode()
  55736. req, _ := http.NewRequest("POST", urls, body)
  55737. req.Header = reqHeaders
  55738. googleapi.Expand(req.URL, map[string]string{
  55739. "project": c.project,
  55740. "region": c.region,
  55741. })
  55742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55743. }
  55744. // Do executes the "compute.regionBackendServices.insert" call.
  55745. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55746. // status code is an error. Response headers are in either
  55747. // *Operation.ServerResponse.Header or (if a response was returned at
  55748. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55749. // to check whether the returned error was because
  55750. // http.StatusNotModified was returned.
  55751. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55752. gensupport.SetOptions(c.urlParams_, opts...)
  55753. res, err := c.doRequest("json")
  55754. if res != nil && res.StatusCode == http.StatusNotModified {
  55755. if res.Body != nil {
  55756. res.Body.Close()
  55757. }
  55758. return nil, &googleapi.Error{
  55759. Code: res.StatusCode,
  55760. Header: res.Header,
  55761. }
  55762. }
  55763. if err != nil {
  55764. return nil, err
  55765. }
  55766. defer googleapi.CloseBody(res)
  55767. if err := googleapi.CheckResponse(res); err != nil {
  55768. return nil, err
  55769. }
  55770. ret := &Operation{
  55771. ServerResponse: googleapi.ServerResponse{
  55772. Header: res.Header,
  55773. HTTPStatusCode: res.StatusCode,
  55774. },
  55775. }
  55776. target := &ret
  55777. if err := gensupport.DecodeResponse(target, res); err != nil {
  55778. return nil, err
  55779. }
  55780. return ret, nil
  55781. // {
  55782. // "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.",
  55783. // "httpMethod": "POST",
  55784. // "id": "compute.regionBackendServices.insert",
  55785. // "parameterOrder": [
  55786. // "project",
  55787. // "region"
  55788. // ],
  55789. // "parameters": {
  55790. // "project": {
  55791. // "description": "Project ID for this request.",
  55792. // "location": "path",
  55793. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55794. // "required": true,
  55795. // "type": "string"
  55796. // },
  55797. // "region": {
  55798. // "description": "Name of the region scoping this request.",
  55799. // "location": "path",
  55800. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55801. // "required": true,
  55802. // "type": "string"
  55803. // },
  55804. // "requestId": {
  55805. // "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).",
  55806. // "location": "query",
  55807. // "type": "string"
  55808. // }
  55809. // },
  55810. // "path": "{project}/regions/{region}/backendServices",
  55811. // "request": {
  55812. // "$ref": "BackendService"
  55813. // },
  55814. // "response": {
  55815. // "$ref": "Operation"
  55816. // },
  55817. // "scopes": [
  55818. // "https://www.googleapis.com/auth/cloud-platform",
  55819. // "https://www.googleapis.com/auth/compute"
  55820. // ]
  55821. // }
  55822. }
  55823. // method id "compute.regionBackendServices.list":
  55824. type RegionBackendServicesListCall struct {
  55825. s *Service
  55826. project string
  55827. region string
  55828. urlParams_ gensupport.URLParams
  55829. ifNoneMatch_ string
  55830. ctx_ context.Context
  55831. header_ http.Header
  55832. }
  55833. // List: Retrieves the list of regional BackendService resources
  55834. // available to the specified project in the given region.
  55835. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  55836. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55837. c.project = project
  55838. c.region = region
  55839. return c
  55840. }
  55841. // Filter sets the optional parameter "filter": A filter expression that
  55842. // filters resources listed in the response. The expression must specify
  55843. // the field name, a comparison operator, and the value that you want to
  55844. // use for filtering. The value must be a string, a number, or a
  55845. // boolean. The comparison operator must be either =, !=, >, or <.
  55846. //
  55847. // For example, if you are filtering Compute Engine instances, you can
  55848. // exclude instances named example-instance by specifying name !=
  55849. // example-instance.
  55850. //
  55851. // You can also filter nested fields. For example, you could specify
  55852. // scheduling.automaticRestart = false to include instances only if they
  55853. // are not scheduled for automatic restarts. You can use filtering on
  55854. // nested fields to filter based on resource labels.
  55855. //
  55856. // To filter on multiple expressions, provide each separate expression
  55857. // within parentheses. For example, (scheduling.automaticRestart = true)
  55858. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55859. // AND expression. However, you can include AND and OR expressions
  55860. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55861. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55862. // true).
  55863. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  55864. c.urlParams_.Set("filter", filter)
  55865. return c
  55866. }
  55867. // MaxResults sets the optional parameter "maxResults": The maximum
  55868. // number of results per page that should be returned. If the number of
  55869. // available results is larger than maxResults, Compute Engine returns a
  55870. // nextPageToken that can be used to get the next page of results in
  55871. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55872. // (Default: 500)
  55873. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  55874. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55875. return c
  55876. }
  55877. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55878. // a certain order. By default, results are returned in alphanumerical
  55879. // order based on the resource name.
  55880. //
  55881. // You can also sort results in descending order based on the creation
  55882. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55883. // based on the creationTimestamp field in reverse chronological order
  55884. // (newest result first). Use this to sort resources like operations so
  55885. // that the newest operation is returned first.
  55886. //
  55887. // Currently, only sorting by name or creationTimestamp desc is
  55888. // supported.
  55889. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  55890. c.urlParams_.Set("orderBy", orderBy)
  55891. return c
  55892. }
  55893. // PageToken sets the optional parameter "pageToken": Specifies a page
  55894. // token to use. Set pageToken to the nextPageToken returned by a
  55895. // previous list request to get the next page of results.
  55896. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  55897. c.urlParams_.Set("pageToken", pageToken)
  55898. return c
  55899. }
  55900. // Fields allows partial responses to be retrieved. See
  55901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55902. // for more information.
  55903. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  55904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55905. return c
  55906. }
  55907. // IfNoneMatch sets the optional parameter which makes the operation
  55908. // fail if the object's ETag matches the given value. This is useful for
  55909. // getting updates only after the object has changed since the last
  55910. // request. Use googleapi.IsNotModified to check whether the response
  55911. // error from Do is the result of In-None-Match.
  55912. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  55913. c.ifNoneMatch_ = entityTag
  55914. return c
  55915. }
  55916. // Context sets the context to be used in this call's Do method. Any
  55917. // pending HTTP request will be aborted if the provided context is
  55918. // canceled.
  55919. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  55920. c.ctx_ = ctx
  55921. return c
  55922. }
  55923. // Header returns an http.Header that can be modified by the caller to
  55924. // add HTTP headers to the request.
  55925. func (c *RegionBackendServicesListCall) Header() http.Header {
  55926. if c.header_ == nil {
  55927. c.header_ = make(http.Header)
  55928. }
  55929. return c.header_
  55930. }
  55931. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  55932. reqHeaders := make(http.Header)
  55933. for k, v := range c.header_ {
  55934. reqHeaders[k] = v
  55935. }
  55936. reqHeaders.Set("User-Agent", c.s.userAgent())
  55937. if c.ifNoneMatch_ != "" {
  55938. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55939. }
  55940. var body io.Reader = nil
  55941. c.urlParams_.Set("alt", alt)
  55942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  55943. urls += "?" + c.urlParams_.Encode()
  55944. req, _ := http.NewRequest("GET", urls, body)
  55945. req.Header = reqHeaders
  55946. googleapi.Expand(req.URL, map[string]string{
  55947. "project": c.project,
  55948. "region": c.region,
  55949. })
  55950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55951. }
  55952. // Do executes the "compute.regionBackendServices.list" call.
  55953. // Exactly one of *BackendServiceList or error will be non-nil. Any
  55954. // non-2xx status code is an error. Response headers are in either
  55955. // *BackendServiceList.ServerResponse.Header or (if a response was
  55956. // returned at all) in error.(*googleapi.Error).Header. Use
  55957. // googleapi.IsNotModified to check whether the returned error was
  55958. // because http.StatusNotModified was returned.
  55959. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  55960. gensupport.SetOptions(c.urlParams_, opts...)
  55961. res, err := c.doRequest("json")
  55962. if res != nil && res.StatusCode == http.StatusNotModified {
  55963. if res.Body != nil {
  55964. res.Body.Close()
  55965. }
  55966. return nil, &googleapi.Error{
  55967. Code: res.StatusCode,
  55968. Header: res.Header,
  55969. }
  55970. }
  55971. if err != nil {
  55972. return nil, err
  55973. }
  55974. defer googleapi.CloseBody(res)
  55975. if err := googleapi.CheckResponse(res); err != nil {
  55976. return nil, err
  55977. }
  55978. ret := &BackendServiceList{
  55979. ServerResponse: googleapi.ServerResponse{
  55980. Header: res.Header,
  55981. HTTPStatusCode: res.StatusCode,
  55982. },
  55983. }
  55984. target := &ret
  55985. if err := gensupport.DecodeResponse(target, res); err != nil {
  55986. return nil, err
  55987. }
  55988. return ret, nil
  55989. // {
  55990. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  55991. // "httpMethod": "GET",
  55992. // "id": "compute.regionBackendServices.list",
  55993. // "parameterOrder": [
  55994. // "project",
  55995. // "region"
  55996. // ],
  55997. // "parameters": {
  55998. // "filter": {
  55999. // "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).",
  56000. // "location": "query",
  56001. // "type": "string"
  56002. // },
  56003. // "maxResults": {
  56004. // "default": "500",
  56005. // "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)",
  56006. // "format": "uint32",
  56007. // "location": "query",
  56008. // "minimum": "0",
  56009. // "type": "integer"
  56010. // },
  56011. // "orderBy": {
  56012. // "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.",
  56013. // "location": "query",
  56014. // "type": "string"
  56015. // },
  56016. // "pageToken": {
  56017. // "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.",
  56018. // "location": "query",
  56019. // "type": "string"
  56020. // },
  56021. // "project": {
  56022. // "description": "Project ID for this request.",
  56023. // "location": "path",
  56024. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56025. // "required": true,
  56026. // "type": "string"
  56027. // },
  56028. // "region": {
  56029. // "description": "Name of the region scoping this request.",
  56030. // "location": "path",
  56031. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56032. // "required": true,
  56033. // "type": "string"
  56034. // }
  56035. // },
  56036. // "path": "{project}/regions/{region}/backendServices",
  56037. // "response": {
  56038. // "$ref": "BackendServiceList"
  56039. // },
  56040. // "scopes": [
  56041. // "https://www.googleapis.com/auth/cloud-platform",
  56042. // "https://www.googleapis.com/auth/compute",
  56043. // "https://www.googleapis.com/auth/compute.readonly"
  56044. // ]
  56045. // }
  56046. }
  56047. // Pages invokes f for each page of results.
  56048. // A non-nil error returned from f will halt the iteration.
  56049. // The provided context supersedes any context provided to the Context method.
  56050. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  56051. c.ctx_ = ctx
  56052. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56053. for {
  56054. x, err := c.Do()
  56055. if err != nil {
  56056. return err
  56057. }
  56058. if err := f(x); err != nil {
  56059. return err
  56060. }
  56061. if x.NextPageToken == "" {
  56062. return nil
  56063. }
  56064. c.PageToken(x.NextPageToken)
  56065. }
  56066. }
  56067. // method id "compute.regionBackendServices.patch":
  56068. type RegionBackendServicesPatchCall struct {
  56069. s *Service
  56070. project string
  56071. region string
  56072. backendService string
  56073. backendservice *BackendService
  56074. urlParams_ gensupport.URLParams
  56075. ctx_ context.Context
  56076. header_ http.Header
  56077. }
  56078. // Patch: Updates the specified regional BackendService resource with
  56079. // the data included in the request. There are several restrictions and
  56080. // guidelines to keep in mind when updating a backend service. Read
  56081. // Restrictions and Guidelines for more information. This method
  56082. // supports PATCH semantics and uses the JSON merge patch format and
  56083. // processing rules.
  56084. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  56085. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56086. c.project = project
  56087. c.region = region
  56088. c.backendService = backendService
  56089. c.backendservice = backendservice
  56090. return c
  56091. }
  56092. // RequestId sets the optional parameter "requestId": An optional
  56093. // request ID to identify requests. Specify a unique request ID so that
  56094. // if you must retry your request, the server will know to ignore the
  56095. // request if it has already been completed.
  56096. //
  56097. // For example, consider a situation where you make an initial request
  56098. // and the request times out. If you make the request again with the
  56099. // same request ID, the server can check if original operation with the
  56100. // same request ID was received, and if so, will ignore the second
  56101. // request. This prevents clients from accidentally creating duplicate
  56102. // commitments.
  56103. //
  56104. // The request ID must be a valid UUID with the exception that zero UUID
  56105. // is not supported (00000000-0000-0000-0000-000000000000).
  56106. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  56107. c.urlParams_.Set("requestId", requestId)
  56108. return c
  56109. }
  56110. // Fields allows partial responses to be retrieved. See
  56111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56112. // for more information.
  56113. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  56114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56115. return c
  56116. }
  56117. // Context sets the context to be used in this call's Do method. Any
  56118. // pending HTTP request will be aborted if the provided context is
  56119. // canceled.
  56120. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  56121. c.ctx_ = ctx
  56122. return c
  56123. }
  56124. // Header returns an http.Header that can be modified by the caller to
  56125. // add HTTP headers to the request.
  56126. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  56127. if c.header_ == nil {
  56128. c.header_ = make(http.Header)
  56129. }
  56130. return c.header_
  56131. }
  56132. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  56133. reqHeaders := make(http.Header)
  56134. for k, v := range c.header_ {
  56135. reqHeaders[k] = v
  56136. }
  56137. reqHeaders.Set("User-Agent", c.s.userAgent())
  56138. var body io.Reader = nil
  56139. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  56140. if err != nil {
  56141. return nil, err
  56142. }
  56143. reqHeaders.Set("Content-Type", "application/json")
  56144. c.urlParams_.Set("alt", alt)
  56145. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  56146. urls += "?" + c.urlParams_.Encode()
  56147. req, _ := http.NewRequest("PATCH", urls, body)
  56148. req.Header = reqHeaders
  56149. googleapi.Expand(req.URL, map[string]string{
  56150. "project": c.project,
  56151. "region": c.region,
  56152. "backendService": c.backendService,
  56153. })
  56154. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56155. }
  56156. // Do executes the "compute.regionBackendServices.patch" call.
  56157. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56158. // status code is an error. Response headers are in either
  56159. // *Operation.ServerResponse.Header or (if a response was returned at
  56160. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56161. // to check whether the returned error was because
  56162. // http.StatusNotModified was returned.
  56163. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56164. gensupport.SetOptions(c.urlParams_, opts...)
  56165. res, err := c.doRequest("json")
  56166. if res != nil && res.StatusCode == http.StatusNotModified {
  56167. if res.Body != nil {
  56168. res.Body.Close()
  56169. }
  56170. return nil, &googleapi.Error{
  56171. Code: res.StatusCode,
  56172. Header: res.Header,
  56173. }
  56174. }
  56175. if err != nil {
  56176. return nil, err
  56177. }
  56178. defer googleapi.CloseBody(res)
  56179. if err := googleapi.CheckResponse(res); err != nil {
  56180. return nil, err
  56181. }
  56182. ret := &Operation{
  56183. ServerResponse: googleapi.ServerResponse{
  56184. Header: res.Header,
  56185. HTTPStatusCode: res.StatusCode,
  56186. },
  56187. }
  56188. target := &ret
  56189. if err := gensupport.DecodeResponse(target, res); err != nil {
  56190. return nil, err
  56191. }
  56192. return ret, nil
  56193. // {
  56194. // "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.",
  56195. // "httpMethod": "PATCH",
  56196. // "id": "compute.regionBackendServices.patch",
  56197. // "parameterOrder": [
  56198. // "project",
  56199. // "region",
  56200. // "backendService"
  56201. // ],
  56202. // "parameters": {
  56203. // "backendService": {
  56204. // "description": "Name of the BackendService resource to patch.",
  56205. // "location": "path",
  56206. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56207. // "required": true,
  56208. // "type": "string"
  56209. // },
  56210. // "project": {
  56211. // "description": "Project ID for this request.",
  56212. // "location": "path",
  56213. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56214. // "required": true,
  56215. // "type": "string"
  56216. // },
  56217. // "region": {
  56218. // "description": "Name of the region scoping this request.",
  56219. // "location": "path",
  56220. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56221. // "required": true,
  56222. // "type": "string"
  56223. // },
  56224. // "requestId": {
  56225. // "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).",
  56226. // "location": "query",
  56227. // "type": "string"
  56228. // }
  56229. // },
  56230. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  56231. // "request": {
  56232. // "$ref": "BackendService"
  56233. // },
  56234. // "response": {
  56235. // "$ref": "Operation"
  56236. // },
  56237. // "scopes": [
  56238. // "https://www.googleapis.com/auth/cloud-platform",
  56239. // "https://www.googleapis.com/auth/compute"
  56240. // ]
  56241. // }
  56242. }
  56243. // method id "compute.regionBackendServices.update":
  56244. type RegionBackendServicesUpdateCall struct {
  56245. s *Service
  56246. project string
  56247. region string
  56248. backendService string
  56249. backendservice *BackendService
  56250. urlParams_ gensupport.URLParams
  56251. ctx_ context.Context
  56252. header_ http.Header
  56253. }
  56254. // Update: Updates the specified regional BackendService resource with
  56255. // the data included in the request. There are several restrictions and
  56256. // guidelines to keep in mind when updating a backend service. Read
  56257. // Restrictions and Guidelines for more information.
  56258. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  56259. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56260. c.project = project
  56261. c.region = region
  56262. c.backendService = backendService
  56263. c.backendservice = backendservice
  56264. return c
  56265. }
  56266. // RequestId sets the optional parameter "requestId": An optional
  56267. // request ID to identify requests. Specify a unique request ID so that
  56268. // if you must retry your request, the server will know to ignore the
  56269. // request if it has already been completed.
  56270. //
  56271. // For example, consider a situation where you make an initial request
  56272. // and the request times out. If you make the request again with the
  56273. // same request ID, the server can check if original operation with the
  56274. // same request ID was received, and if so, will ignore the second
  56275. // request. This prevents clients from accidentally creating duplicate
  56276. // commitments.
  56277. //
  56278. // The request ID must be a valid UUID with the exception that zero UUID
  56279. // is not supported (00000000-0000-0000-0000-000000000000).
  56280. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  56281. c.urlParams_.Set("requestId", requestId)
  56282. return c
  56283. }
  56284. // Fields allows partial responses to be retrieved. See
  56285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56286. // for more information.
  56287. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  56288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56289. return c
  56290. }
  56291. // Context sets the context to be used in this call's Do method. Any
  56292. // pending HTTP request will be aborted if the provided context is
  56293. // canceled.
  56294. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  56295. c.ctx_ = ctx
  56296. return c
  56297. }
  56298. // Header returns an http.Header that can be modified by the caller to
  56299. // add HTTP headers to the request.
  56300. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  56301. if c.header_ == nil {
  56302. c.header_ = make(http.Header)
  56303. }
  56304. return c.header_
  56305. }
  56306. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  56307. reqHeaders := make(http.Header)
  56308. for k, v := range c.header_ {
  56309. reqHeaders[k] = v
  56310. }
  56311. reqHeaders.Set("User-Agent", c.s.userAgent())
  56312. var body io.Reader = nil
  56313. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  56314. if err != nil {
  56315. return nil, err
  56316. }
  56317. reqHeaders.Set("Content-Type", "application/json")
  56318. c.urlParams_.Set("alt", alt)
  56319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  56320. urls += "?" + c.urlParams_.Encode()
  56321. req, _ := http.NewRequest("PUT", urls, body)
  56322. req.Header = reqHeaders
  56323. googleapi.Expand(req.URL, map[string]string{
  56324. "project": c.project,
  56325. "region": c.region,
  56326. "backendService": c.backendService,
  56327. })
  56328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56329. }
  56330. // Do executes the "compute.regionBackendServices.update" call.
  56331. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56332. // status code is an error. Response headers are in either
  56333. // *Operation.ServerResponse.Header or (if a response was returned at
  56334. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56335. // to check whether the returned error was because
  56336. // http.StatusNotModified was returned.
  56337. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56338. gensupport.SetOptions(c.urlParams_, opts...)
  56339. res, err := c.doRequest("json")
  56340. if res != nil && res.StatusCode == http.StatusNotModified {
  56341. if res.Body != nil {
  56342. res.Body.Close()
  56343. }
  56344. return nil, &googleapi.Error{
  56345. Code: res.StatusCode,
  56346. Header: res.Header,
  56347. }
  56348. }
  56349. if err != nil {
  56350. return nil, err
  56351. }
  56352. defer googleapi.CloseBody(res)
  56353. if err := googleapi.CheckResponse(res); err != nil {
  56354. return nil, err
  56355. }
  56356. ret := &Operation{
  56357. ServerResponse: googleapi.ServerResponse{
  56358. Header: res.Header,
  56359. HTTPStatusCode: res.StatusCode,
  56360. },
  56361. }
  56362. target := &ret
  56363. if err := gensupport.DecodeResponse(target, res); err != nil {
  56364. return nil, err
  56365. }
  56366. return ret, nil
  56367. // {
  56368. // "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.",
  56369. // "httpMethod": "PUT",
  56370. // "id": "compute.regionBackendServices.update",
  56371. // "parameterOrder": [
  56372. // "project",
  56373. // "region",
  56374. // "backendService"
  56375. // ],
  56376. // "parameters": {
  56377. // "backendService": {
  56378. // "description": "Name of the BackendService resource to update.",
  56379. // "location": "path",
  56380. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56381. // "required": true,
  56382. // "type": "string"
  56383. // },
  56384. // "project": {
  56385. // "description": "Project ID for this request.",
  56386. // "location": "path",
  56387. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56388. // "required": true,
  56389. // "type": "string"
  56390. // },
  56391. // "region": {
  56392. // "description": "Name of the region scoping this request.",
  56393. // "location": "path",
  56394. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56395. // "required": true,
  56396. // "type": "string"
  56397. // },
  56398. // "requestId": {
  56399. // "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).",
  56400. // "location": "query",
  56401. // "type": "string"
  56402. // }
  56403. // },
  56404. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  56405. // "request": {
  56406. // "$ref": "BackendService"
  56407. // },
  56408. // "response": {
  56409. // "$ref": "Operation"
  56410. // },
  56411. // "scopes": [
  56412. // "https://www.googleapis.com/auth/cloud-platform",
  56413. // "https://www.googleapis.com/auth/compute"
  56414. // ]
  56415. // }
  56416. }
  56417. // method id "compute.regionCommitments.aggregatedList":
  56418. type RegionCommitmentsAggregatedListCall struct {
  56419. s *Service
  56420. project string
  56421. urlParams_ gensupport.URLParams
  56422. ifNoneMatch_ string
  56423. ctx_ context.Context
  56424. header_ http.Header
  56425. }
  56426. // AggregatedList: Retrieves an aggregated list of commitments.
  56427. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  56428. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56429. c.project = project
  56430. return c
  56431. }
  56432. // Filter sets the optional parameter "filter": A filter expression that
  56433. // filters resources listed in the response. The expression must specify
  56434. // the field name, a comparison operator, and the value that you want to
  56435. // use for filtering. The value must be a string, a number, or a
  56436. // boolean. The comparison operator must be either =, !=, >, or <.
  56437. //
  56438. // For example, if you are filtering Compute Engine instances, you can
  56439. // exclude instances named example-instance by specifying name !=
  56440. // example-instance.
  56441. //
  56442. // You can also filter nested fields. For example, you could specify
  56443. // scheduling.automaticRestart = false to include instances only if they
  56444. // are not scheduled for automatic restarts. You can use filtering on
  56445. // nested fields to filter based on resource labels.
  56446. //
  56447. // To filter on multiple expressions, provide each separate expression
  56448. // within parentheses. For example, (scheduling.automaticRestart = true)
  56449. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56450. // AND expression. However, you can include AND and OR expressions
  56451. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56452. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56453. // true).
  56454. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  56455. c.urlParams_.Set("filter", filter)
  56456. return c
  56457. }
  56458. // MaxResults sets the optional parameter "maxResults": The maximum
  56459. // number of results per page that should be returned. If the number of
  56460. // available results is larger than maxResults, Compute Engine returns a
  56461. // nextPageToken that can be used to get the next page of results in
  56462. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56463. // (Default: 500)
  56464. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  56465. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56466. return c
  56467. }
  56468. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56469. // a certain order. By default, results are returned in alphanumerical
  56470. // order based on the resource name.
  56471. //
  56472. // You can also sort results in descending order based on the creation
  56473. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56474. // based on the creationTimestamp field in reverse chronological order
  56475. // (newest result first). Use this to sort resources like operations so
  56476. // that the newest operation is returned first.
  56477. //
  56478. // Currently, only sorting by name or creationTimestamp desc is
  56479. // supported.
  56480. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  56481. c.urlParams_.Set("orderBy", orderBy)
  56482. return c
  56483. }
  56484. // PageToken sets the optional parameter "pageToken": Specifies a page
  56485. // token to use. Set pageToken to the nextPageToken returned by a
  56486. // previous list request to get the next page of results.
  56487. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  56488. c.urlParams_.Set("pageToken", pageToken)
  56489. return c
  56490. }
  56491. // Fields allows partial responses to be retrieved. See
  56492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56493. // for more information.
  56494. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  56495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56496. return c
  56497. }
  56498. // IfNoneMatch sets the optional parameter which makes the operation
  56499. // fail if the object's ETag matches the given value. This is useful for
  56500. // getting updates only after the object has changed since the last
  56501. // request. Use googleapi.IsNotModified to check whether the response
  56502. // error from Do is the result of In-None-Match.
  56503. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  56504. c.ifNoneMatch_ = entityTag
  56505. return c
  56506. }
  56507. // Context sets the context to be used in this call's Do method. Any
  56508. // pending HTTP request will be aborted if the provided context is
  56509. // canceled.
  56510. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  56511. c.ctx_ = ctx
  56512. return c
  56513. }
  56514. // Header returns an http.Header that can be modified by the caller to
  56515. // add HTTP headers to the request.
  56516. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  56517. if c.header_ == nil {
  56518. c.header_ = make(http.Header)
  56519. }
  56520. return c.header_
  56521. }
  56522. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  56523. reqHeaders := make(http.Header)
  56524. for k, v := range c.header_ {
  56525. reqHeaders[k] = v
  56526. }
  56527. reqHeaders.Set("User-Agent", c.s.userAgent())
  56528. if c.ifNoneMatch_ != "" {
  56529. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56530. }
  56531. var body io.Reader = nil
  56532. c.urlParams_.Set("alt", alt)
  56533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  56534. urls += "?" + c.urlParams_.Encode()
  56535. req, _ := http.NewRequest("GET", urls, body)
  56536. req.Header = reqHeaders
  56537. googleapi.Expand(req.URL, map[string]string{
  56538. "project": c.project,
  56539. })
  56540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56541. }
  56542. // Do executes the "compute.regionCommitments.aggregatedList" call.
  56543. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  56544. // Any non-2xx status code is an error. Response headers are in either
  56545. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  56546. // returned at all) in error.(*googleapi.Error).Header. Use
  56547. // googleapi.IsNotModified to check whether the returned error was
  56548. // because http.StatusNotModified was returned.
  56549. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  56550. gensupport.SetOptions(c.urlParams_, opts...)
  56551. res, err := c.doRequest("json")
  56552. if res != nil && res.StatusCode == http.StatusNotModified {
  56553. if res.Body != nil {
  56554. res.Body.Close()
  56555. }
  56556. return nil, &googleapi.Error{
  56557. Code: res.StatusCode,
  56558. Header: res.Header,
  56559. }
  56560. }
  56561. if err != nil {
  56562. return nil, err
  56563. }
  56564. defer googleapi.CloseBody(res)
  56565. if err := googleapi.CheckResponse(res); err != nil {
  56566. return nil, err
  56567. }
  56568. ret := &CommitmentAggregatedList{
  56569. ServerResponse: googleapi.ServerResponse{
  56570. Header: res.Header,
  56571. HTTPStatusCode: res.StatusCode,
  56572. },
  56573. }
  56574. target := &ret
  56575. if err := gensupport.DecodeResponse(target, res); err != nil {
  56576. return nil, err
  56577. }
  56578. return ret, nil
  56579. // {
  56580. // "description": "Retrieves an aggregated list of commitments.",
  56581. // "httpMethod": "GET",
  56582. // "id": "compute.regionCommitments.aggregatedList",
  56583. // "parameterOrder": [
  56584. // "project"
  56585. // ],
  56586. // "parameters": {
  56587. // "filter": {
  56588. // "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).",
  56589. // "location": "query",
  56590. // "type": "string"
  56591. // },
  56592. // "maxResults": {
  56593. // "default": "500",
  56594. // "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)",
  56595. // "format": "uint32",
  56596. // "location": "query",
  56597. // "minimum": "0",
  56598. // "type": "integer"
  56599. // },
  56600. // "orderBy": {
  56601. // "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.",
  56602. // "location": "query",
  56603. // "type": "string"
  56604. // },
  56605. // "pageToken": {
  56606. // "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.",
  56607. // "location": "query",
  56608. // "type": "string"
  56609. // },
  56610. // "project": {
  56611. // "description": "Project ID for this request.",
  56612. // "location": "path",
  56613. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56614. // "required": true,
  56615. // "type": "string"
  56616. // }
  56617. // },
  56618. // "path": "{project}/aggregated/commitments",
  56619. // "response": {
  56620. // "$ref": "CommitmentAggregatedList"
  56621. // },
  56622. // "scopes": [
  56623. // "https://www.googleapis.com/auth/cloud-platform",
  56624. // "https://www.googleapis.com/auth/compute",
  56625. // "https://www.googleapis.com/auth/compute.readonly"
  56626. // ]
  56627. // }
  56628. }
  56629. // Pages invokes f for each page of results.
  56630. // A non-nil error returned from f will halt the iteration.
  56631. // The provided context supersedes any context provided to the Context method.
  56632. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  56633. c.ctx_ = ctx
  56634. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56635. for {
  56636. x, err := c.Do()
  56637. if err != nil {
  56638. return err
  56639. }
  56640. if err := f(x); err != nil {
  56641. return err
  56642. }
  56643. if x.NextPageToken == "" {
  56644. return nil
  56645. }
  56646. c.PageToken(x.NextPageToken)
  56647. }
  56648. }
  56649. // method id "compute.regionCommitments.get":
  56650. type RegionCommitmentsGetCall struct {
  56651. s *Service
  56652. project string
  56653. region string
  56654. commitment string
  56655. urlParams_ gensupport.URLParams
  56656. ifNoneMatch_ string
  56657. ctx_ context.Context
  56658. header_ http.Header
  56659. }
  56660. // Get: Returns the specified commitment resource. Gets a list of
  56661. // available commitments by making a list() request.
  56662. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  56663. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56664. c.project = project
  56665. c.region = region
  56666. c.commitment = commitment
  56667. return c
  56668. }
  56669. // Fields allows partial responses to be retrieved. See
  56670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56671. // for more information.
  56672. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  56673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56674. return c
  56675. }
  56676. // IfNoneMatch sets the optional parameter which makes the operation
  56677. // fail if the object's ETag matches the given value. This is useful for
  56678. // getting updates only after the object has changed since the last
  56679. // request. Use googleapi.IsNotModified to check whether the response
  56680. // error from Do is the result of In-None-Match.
  56681. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  56682. c.ifNoneMatch_ = entityTag
  56683. return c
  56684. }
  56685. // Context sets the context to be used in this call's Do method. Any
  56686. // pending HTTP request will be aborted if the provided context is
  56687. // canceled.
  56688. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  56689. c.ctx_ = ctx
  56690. return c
  56691. }
  56692. // Header returns an http.Header that can be modified by the caller to
  56693. // add HTTP headers to the request.
  56694. func (c *RegionCommitmentsGetCall) Header() http.Header {
  56695. if c.header_ == nil {
  56696. c.header_ = make(http.Header)
  56697. }
  56698. return c.header_
  56699. }
  56700. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  56701. reqHeaders := make(http.Header)
  56702. for k, v := range c.header_ {
  56703. reqHeaders[k] = v
  56704. }
  56705. reqHeaders.Set("User-Agent", c.s.userAgent())
  56706. if c.ifNoneMatch_ != "" {
  56707. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56708. }
  56709. var body io.Reader = nil
  56710. c.urlParams_.Set("alt", alt)
  56711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  56712. urls += "?" + c.urlParams_.Encode()
  56713. req, _ := http.NewRequest("GET", urls, body)
  56714. req.Header = reqHeaders
  56715. googleapi.Expand(req.URL, map[string]string{
  56716. "project": c.project,
  56717. "region": c.region,
  56718. "commitment": c.commitment,
  56719. })
  56720. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56721. }
  56722. // Do executes the "compute.regionCommitments.get" call.
  56723. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  56724. // status code is an error. Response headers are in either
  56725. // *Commitment.ServerResponse.Header or (if a response was returned at
  56726. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56727. // to check whether the returned error was because
  56728. // http.StatusNotModified was returned.
  56729. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  56730. gensupport.SetOptions(c.urlParams_, opts...)
  56731. res, err := c.doRequest("json")
  56732. if res != nil && res.StatusCode == http.StatusNotModified {
  56733. if res.Body != nil {
  56734. res.Body.Close()
  56735. }
  56736. return nil, &googleapi.Error{
  56737. Code: res.StatusCode,
  56738. Header: res.Header,
  56739. }
  56740. }
  56741. if err != nil {
  56742. return nil, err
  56743. }
  56744. defer googleapi.CloseBody(res)
  56745. if err := googleapi.CheckResponse(res); err != nil {
  56746. return nil, err
  56747. }
  56748. ret := &Commitment{
  56749. ServerResponse: googleapi.ServerResponse{
  56750. Header: res.Header,
  56751. HTTPStatusCode: res.StatusCode,
  56752. },
  56753. }
  56754. target := &ret
  56755. if err := gensupport.DecodeResponse(target, res); err != nil {
  56756. return nil, err
  56757. }
  56758. return ret, nil
  56759. // {
  56760. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  56761. // "httpMethod": "GET",
  56762. // "id": "compute.regionCommitments.get",
  56763. // "parameterOrder": [
  56764. // "project",
  56765. // "region",
  56766. // "commitment"
  56767. // ],
  56768. // "parameters": {
  56769. // "commitment": {
  56770. // "description": "Name of the commitment to return.",
  56771. // "location": "path",
  56772. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56773. // "required": true,
  56774. // "type": "string"
  56775. // },
  56776. // "project": {
  56777. // "description": "Project ID for this request.",
  56778. // "location": "path",
  56779. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56780. // "required": true,
  56781. // "type": "string"
  56782. // },
  56783. // "region": {
  56784. // "description": "Name of the region for this request.",
  56785. // "location": "path",
  56786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56787. // "required": true,
  56788. // "type": "string"
  56789. // }
  56790. // },
  56791. // "path": "{project}/regions/{region}/commitments/{commitment}",
  56792. // "response": {
  56793. // "$ref": "Commitment"
  56794. // },
  56795. // "scopes": [
  56796. // "https://www.googleapis.com/auth/cloud-platform",
  56797. // "https://www.googleapis.com/auth/compute",
  56798. // "https://www.googleapis.com/auth/compute.readonly"
  56799. // ]
  56800. // }
  56801. }
  56802. // method id "compute.regionCommitments.insert":
  56803. type RegionCommitmentsInsertCall struct {
  56804. s *Service
  56805. project string
  56806. region string
  56807. commitment *Commitment
  56808. urlParams_ gensupport.URLParams
  56809. ctx_ context.Context
  56810. header_ http.Header
  56811. }
  56812. // Insert: Creates a commitment in the specified project using the data
  56813. // included in the request.
  56814. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  56815. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56816. c.project = project
  56817. c.region = region
  56818. c.commitment = commitment
  56819. return c
  56820. }
  56821. // RequestId sets the optional parameter "requestId": An optional
  56822. // request ID to identify requests. Specify a unique request ID so that
  56823. // if you must retry your request, the server will know to ignore the
  56824. // request if it has already been completed.
  56825. //
  56826. // For example, consider a situation where you make an initial request
  56827. // and the request times out. If you make the request again with the
  56828. // same request ID, the server can check if original operation with the
  56829. // same request ID was received, and if so, will ignore the second
  56830. // request. This prevents clients from accidentally creating duplicate
  56831. // commitments.
  56832. //
  56833. // The request ID must be a valid UUID with the exception that zero UUID
  56834. // is not supported (00000000-0000-0000-0000-000000000000).
  56835. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  56836. c.urlParams_.Set("requestId", requestId)
  56837. return c
  56838. }
  56839. // Fields allows partial responses to be retrieved. See
  56840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56841. // for more information.
  56842. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  56843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56844. return c
  56845. }
  56846. // Context sets the context to be used in this call's Do method. Any
  56847. // pending HTTP request will be aborted if the provided context is
  56848. // canceled.
  56849. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  56850. c.ctx_ = ctx
  56851. return c
  56852. }
  56853. // Header returns an http.Header that can be modified by the caller to
  56854. // add HTTP headers to the request.
  56855. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  56856. if c.header_ == nil {
  56857. c.header_ = make(http.Header)
  56858. }
  56859. return c.header_
  56860. }
  56861. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  56862. reqHeaders := make(http.Header)
  56863. for k, v := range c.header_ {
  56864. reqHeaders[k] = v
  56865. }
  56866. reqHeaders.Set("User-Agent", c.s.userAgent())
  56867. var body io.Reader = nil
  56868. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  56869. if err != nil {
  56870. return nil, err
  56871. }
  56872. reqHeaders.Set("Content-Type", "application/json")
  56873. c.urlParams_.Set("alt", alt)
  56874. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  56875. urls += "?" + c.urlParams_.Encode()
  56876. req, _ := http.NewRequest("POST", urls, body)
  56877. req.Header = reqHeaders
  56878. googleapi.Expand(req.URL, map[string]string{
  56879. "project": c.project,
  56880. "region": c.region,
  56881. })
  56882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56883. }
  56884. // Do executes the "compute.regionCommitments.insert" call.
  56885. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56886. // status code is an error. Response headers are in either
  56887. // *Operation.ServerResponse.Header or (if a response was returned at
  56888. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56889. // to check whether the returned error was because
  56890. // http.StatusNotModified was returned.
  56891. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56892. gensupport.SetOptions(c.urlParams_, opts...)
  56893. res, err := c.doRequest("json")
  56894. if res != nil && res.StatusCode == http.StatusNotModified {
  56895. if res.Body != nil {
  56896. res.Body.Close()
  56897. }
  56898. return nil, &googleapi.Error{
  56899. Code: res.StatusCode,
  56900. Header: res.Header,
  56901. }
  56902. }
  56903. if err != nil {
  56904. return nil, err
  56905. }
  56906. defer googleapi.CloseBody(res)
  56907. if err := googleapi.CheckResponse(res); err != nil {
  56908. return nil, err
  56909. }
  56910. ret := &Operation{
  56911. ServerResponse: googleapi.ServerResponse{
  56912. Header: res.Header,
  56913. HTTPStatusCode: res.StatusCode,
  56914. },
  56915. }
  56916. target := &ret
  56917. if err := gensupport.DecodeResponse(target, res); err != nil {
  56918. return nil, err
  56919. }
  56920. return ret, nil
  56921. // {
  56922. // "description": "Creates a commitment in the specified project using the data included in the request.",
  56923. // "httpMethod": "POST",
  56924. // "id": "compute.regionCommitments.insert",
  56925. // "parameterOrder": [
  56926. // "project",
  56927. // "region"
  56928. // ],
  56929. // "parameters": {
  56930. // "project": {
  56931. // "description": "Project ID for this request.",
  56932. // "location": "path",
  56933. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56934. // "required": true,
  56935. // "type": "string"
  56936. // },
  56937. // "region": {
  56938. // "description": "Name of the region for this request.",
  56939. // "location": "path",
  56940. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56941. // "required": true,
  56942. // "type": "string"
  56943. // },
  56944. // "requestId": {
  56945. // "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).",
  56946. // "location": "query",
  56947. // "type": "string"
  56948. // }
  56949. // },
  56950. // "path": "{project}/regions/{region}/commitments",
  56951. // "request": {
  56952. // "$ref": "Commitment"
  56953. // },
  56954. // "response": {
  56955. // "$ref": "Operation"
  56956. // },
  56957. // "scopes": [
  56958. // "https://www.googleapis.com/auth/cloud-platform",
  56959. // "https://www.googleapis.com/auth/compute"
  56960. // ]
  56961. // }
  56962. }
  56963. // method id "compute.regionCommitments.list":
  56964. type RegionCommitmentsListCall struct {
  56965. s *Service
  56966. project string
  56967. region string
  56968. urlParams_ gensupport.URLParams
  56969. ifNoneMatch_ string
  56970. ctx_ context.Context
  56971. header_ http.Header
  56972. }
  56973. // List: Retrieves a list of commitments contained within the specified
  56974. // region.
  56975. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  56976. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56977. c.project = project
  56978. c.region = region
  56979. return c
  56980. }
  56981. // Filter sets the optional parameter "filter": A filter expression that
  56982. // filters resources listed in the response. The expression must specify
  56983. // the field name, a comparison operator, and the value that you want to
  56984. // use for filtering. The value must be a string, a number, or a
  56985. // boolean. The comparison operator must be either =, !=, >, or <.
  56986. //
  56987. // For example, if you are filtering Compute Engine instances, you can
  56988. // exclude instances named example-instance by specifying name !=
  56989. // example-instance.
  56990. //
  56991. // You can also filter nested fields. For example, you could specify
  56992. // scheduling.automaticRestart = false to include instances only if they
  56993. // are not scheduled for automatic restarts. You can use filtering on
  56994. // nested fields to filter based on resource labels.
  56995. //
  56996. // To filter on multiple expressions, provide each separate expression
  56997. // within parentheses. For example, (scheduling.automaticRestart = true)
  56998. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56999. // AND expression. However, you can include AND and OR expressions
  57000. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57001. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57002. // true).
  57003. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  57004. c.urlParams_.Set("filter", filter)
  57005. return c
  57006. }
  57007. // MaxResults sets the optional parameter "maxResults": The maximum
  57008. // number of results per page that should be returned. If the number of
  57009. // available results is larger than maxResults, Compute Engine returns a
  57010. // nextPageToken that can be used to get the next page of results in
  57011. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57012. // (Default: 500)
  57013. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  57014. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57015. return c
  57016. }
  57017. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57018. // a certain order. By default, results are returned in alphanumerical
  57019. // order based on the resource name.
  57020. //
  57021. // You can also sort results in descending order based on the creation
  57022. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57023. // based on the creationTimestamp field in reverse chronological order
  57024. // (newest result first). Use this to sort resources like operations so
  57025. // that the newest operation is returned first.
  57026. //
  57027. // Currently, only sorting by name or creationTimestamp desc is
  57028. // supported.
  57029. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  57030. c.urlParams_.Set("orderBy", orderBy)
  57031. return c
  57032. }
  57033. // PageToken sets the optional parameter "pageToken": Specifies a page
  57034. // token to use. Set pageToken to the nextPageToken returned by a
  57035. // previous list request to get the next page of results.
  57036. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  57037. c.urlParams_.Set("pageToken", pageToken)
  57038. return c
  57039. }
  57040. // Fields allows partial responses to be retrieved. See
  57041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57042. // for more information.
  57043. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  57044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57045. return c
  57046. }
  57047. // IfNoneMatch sets the optional parameter which makes the operation
  57048. // fail if the object's ETag matches the given value. This is useful for
  57049. // getting updates only after the object has changed since the last
  57050. // request. Use googleapi.IsNotModified to check whether the response
  57051. // error from Do is the result of In-None-Match.
  57052. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  57053. c.ifNoneMatch_ = entityTag
  57054. return c
  57055. }
  57056. // Context sets the context to be used in this call's Do method. Any
  57057. // pending HTTP request will be aborted if the provided context is
  57058. // canceled.
  57059. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  57060. c.ctx_ = ctx
  57061. return c
  57062. }
  57063. // Header returns an http.Header that can be modified by the caller to
  57064. // add HTTP headers to the request.
  57065. func (c *RegionCommitmentsListCall) Header() http.Header {
  57066. if c.header_ == nil {
  57067. c.header_ = make(http.Header)
  57068. }
  57069. return c.header_
  57070. }
  57071. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  57072. reqHeaders := make(http.Header)
  57073. for k, v := range c.header_ {
  57074. reqHeaders[k] = v
  57075. }
  57076. reqHeaders.Set("User-Agent", c.s.userAgent())
  57077. if c.ifNoneMatch_ != "" {
  57078. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57079. }
  57080. var body io.Reader = nil
  57081. c.urlParams_.Set("alt", alt)
  57082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  57083. urls += "?" + c.urlParams_.Encode()
  57084. req, _ := http.NewRequest("GET", urls, body)
  57085. req.Header = reqHeaders
  57086. googleapi.Expand(req.URL, map[string]string{
  57087. "project": c.project,
  57088. "region": c.region,
  57089. })
  57090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57091. }
  57092. // Do executes the "compute.regionCommitments.list" call.
  57093. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  57094. // status code is an error. Response headers are in either
  57095. // *CommitmentList.ServerResponse.Header or (if a response was returned
  57096. // at all) in error.(*googleapi.Error).Header. Use
  57097. // googleapi.IsNotModified to check whether the returned error was
  57098. // because http.StatusNotModified was returned.
  57099. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  57100. gensupport.SetOptions(c.urlParams_, opts...)
  57101. res, err := c.doRequest("json")
  57102. if res != nil && res.StatusCode == http.StatusNotModified {
  57103. if res.Body != nil {
  57104. res.Body.Close()
  57105. }
  57106. return nil, &googleapi.Error{
  57107. Code: res.StatusCode,
  57108. Header: res.Header,
  57109. }
  57110. }
  57111. if err != nil {
  57112. return nil, err
  57113. }
  57114. defer googleapi.CloseBody(res)
  57115. if err := googleapi.CheckResponse(res); err != nil {
  57116. return nil, err
  57117. }
  57118. ret := &CommitmentList{
  57119. ServerResponse: googleapi.ServerResponse{
  57120. Header: res.Header,
  57121. HTTPStatusCode: res.StatusCode,
  57122. },
  57123. }
  57124. target := &ret
  57125. if err := gensupport.DecodeResponse(target, res); err != nil {
  57126. return nil, err
  57127. }
  57128. return ret, nil
  57129. // {
  57130. // "description": "Retrieves a list of commitments contained within the specified region.",
  57131. // "httpMethod": "GET",
  57132. // "id": "compute.regionCommitments.list",
  57133. // "parameterOrder": [
  57134. // "project",
  57135. // "region"
  57136. // ],
  57137. // "parameters": {
  57138. // "filter": {
  57139. // "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).",
  57140. // "location": "query",
  57141. // "type": "string"
  57142. // },
  57143. // "maxResults": {
  57144. // "default": "500",
  57145. // "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)",
  57146. // "format": "uint32",
  57147. // "location": "query",
  57148. // "minimum": "0",
  57149. // "type": "integer"
  57150. // },
  57151. // "orderBy": {
  57152. // "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.",
  57153. // "location": "query",
  57154. // "type": "string"
  57155. // },
  57156. // "pageToken": {
  57157. // "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.",
  57158. // "location": "query",
  57159. // "type": "string"
  57160. // },
  57161. // "project": {
  57162. // "description": "Project ID for this request.",
  57163. // "location": "path",
  57164. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57165. // "required": true,
  57166. // "type": "string"
  57167. // },
  57168. // "region": {
  57169. // "description": "Name of the region for this request.",
  57170. // "location": "path",
  57171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57172. // "required": true,
  57173. // "type": "string"
  57174. // }
  57175. // },
  57176. // "path": "{project}/regions/{region}/commitments",
  57177. // "response": {
  57178. // "$ref": "CommitmentList"
  57179. // },
  57180. // "scopes": [
  57181. // "https://www.googleapis.com/auth/cloud-platform",
  57182. // "https://www.googleapis.com/auth/compute",
  57183. // "https://www.googleapis.com/auth/compute.readonly"
  57184. // ]
  57185. // }
  57186. }
  57187. // Pages invokes f for each page of results.
  57188. // A non-nil error returned from f will halt the iteration.
  57189. // The provided context supersedes any context provided to the Context method.
  57190. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  57191. c.ctx_ = ctx
  57192. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57193. for {
  57194. x, err := c.Do()
  57195. if err != nil {
  57196. return err
  57197. }
  57198. if err := f(x); err != nil {
  57199. return err
  57200. }
  57201. if x.NextPageToken == "" {
  57202. return nil
  57203. }
  57204. c.PageToken(x.NextPageToken)
  57205. }
  57206. }
  57207. // method id "compute.regionDiskTypes.get":
  57208. type RegionDiskTypesGetCall struct {
  57209. s *Service
  57210. project string
  57211. region string
  57212. diskType string
  57213. urlParams_ gensupport.URLParams
  57214. ifNoneMatch_ string
  57215. ctx_ context.Context
  57216. header_ http.Header
  57217. }
  57218. // Get: Returns the specified regional disk type. Gets a list of
  57219. // available disk types by making a list() request.
  57220. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  57221. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57222. c.project = project
  57223. c.region = region
  57224. c.diskType = diskType
  57225. return c
  57226. }
  57227. // Fields allows partial responses to be retrieved. See
  57228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57229. // for more information.
  57230. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  57231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57232. return c
  57233. }
  57234. // IfNoneMatch sets the optional parameter which makes the operation
  57235. // fail if the object's ETag matches the given value. This is useful for
  57236. // getting updates only after the object has changed since the last
  57237. // request. Use googleapi.IsNotModified to check whether the response
  57238. // error from Do is the result of In-None-Match.
  57239. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  57240. c.ifNoneMatch_ = entityTag
  57241. return c
  57242. }
  57243. // Context sets the context to be used in this call's Do method. Any
  57244. // pending HTTP request will be aborted if the provided context is
  57245. // canceled.
  57246. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  57247. c.ctx_ = ctx
  57248. return c
  57249. }
  57250. // Header returns an http.Header that can be modified by the caller to
  57251. // add HTTP headers to the request.
  57252. func (c *RegionDiskTypesGetCall) Header() http.Header {
  57253. if c.header_ == nil {
  57254. c.header_ = make(http.Header)
  57255. }
  57256. return c.header_
  57257. }
  57258. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  57259. reqHeaders := make(http.Header)
  57260. for k, v := range c.header_ {
  57261. reqHeaders[k] = v
  57262. }
  57263. reqHeaders.Set("User-Agent", c.s.userAgent())
  57264. if c.ifNoneMatch_ != "" {
  57265. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57266. }
  57267. var body io.Reader = nil
  57268. c.urlParams_.Set("alt", alt)
  57269. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  57270. urls += "?" + c.urlParams_.Encode()
  57271. req, _ := http.NewRequest("GET", urls, body)
  57272. req.Header = reqHeaders
  57273. googleapi.Expand(req.URL, map[string]string{
  57274. "project": c.project,
  57275. "region": c.region,
  57276. "diskType": c.diskType,
  57277. })
  57278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57279. }
  57280. // Do executes the "compute.regionDiskTypes.get" call.
  57281. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  57282. // code is an error. Response headers are in either
  57283. // *DiskType.ServerResponse.Header or (if a response was returned at
  57284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57285. // to check whether the returned error was because
  57286. // http.StatusNotModified was returned.
  57287. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  57288. gensupport.SetOptions(c.urlParams_, opts...)
  57289. res, err := c.doRequest("json")
  57290. if res != nil && res.StatusCode == http.StatusNotModified {
  57291. if res.Body != nil {
  57292. res.Body.Close()
  57293. }
  57294. return nil, &googleapi.Error{
  57295. Code: res.StatusCode,
  57296. Header: res.Header,
  57297. }
  57298. }
  57299. if err != nil {
  57300. return nil, err
  57301. }
  57302. defer googleapi.CloseBody(res)
  57303. if err := googleapi.CheckResponse(res); err != nil {
  57304. return nil, err
  57305. }
  57306. ret := &DiskType{
  57307. ServerResponse: googleapi.ServerResponse{
  57308. Header: res.Header,
  57309. HTTPStatusCode: res.StatusCode,
  57310. },
  57311. }
  57312. target := &ret
  57313. if err := gensupport.DecodeResponse(target, res); err != nil {
  57314. return nil, err
  57315. }
  57316. return ret, nil
  57317. // {
  57318. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  57319. // "httpMethod": "GET",
  57320. // "id": "compute.regionDiskTypes.get",
  57321. // "parameterOrder": [
  57322. // "project",
  57323. // "region",
  57324. // "diskType"
  57325. // ],
  57326. // "parameters": {
  57327. // "diskType": {
  57328. // "description": "Name of the disk type to return.",
  57329. // "location": "path",
  57330. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57331. // "required": true,
  57332. // "type": "string"
  57333. // },
  57334. // "project": {
  57335. // "description": "Project ID for this request.",
  57336. // "location": "path",
  57337. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57338. // "required": true,
  57339. // "type": "string"
  57340. // },
  57341. // "region": {
  57342. // "description": "The name of the region for this request.",
  57343. // "location": "path",
  57344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57345. // "required": true,
  57346. // "type": "string"
  57347. // }
  57348. // },
  57349. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  57350. // "response": {
  57351. // "$ref": "DiskType"
  57352. // },
  57353. // "scopes": [
  57354. // "https://www.googleapis.com/auth/cloud-platform",
  57355. // "https://www.googleapis.com/auth/compute",
  57356. // "https://www.googleapis.com/auth/compute.readonly"
  57357. // ]
  57358. // }
  57359. }
  57360. // method id "compute.regionDiskTypes.list":
  57361. type RegionDiskTypesListCall struct {
  57362. s *Service
  57363. project string
  57364. region string
  57365. urlParams_ gensupport.URLParams
  57366. ifNoneMatch_ string
  57367. ctx_ context.Context
  57368. header_ http.Header
  57369. }
  57370. // List: Retrieves a list of regional disk types available to the
  57371. // specified project.
  57372. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  57373. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57374. c.project = project
  57375. c.region = region
  57376. return c
  57377. }
  57378. // Filter sets the optional parameter "filter": A filter expression that
  57379. // filters resources listed in the response. The expression must specify
  57380. // the field name, a comparison operator, and the value that you want to
  57381. // use for filtering. The value must be a string, a number, or a
  57382. // boolean. The comparison operator must be either =, !=, >, or <.
  57383. //
  57384. // For example, if you are filtering Compute Engine instances, you can
  57385. // exclude instances named example-instance by specifying name !=
  57386. // example-instance.
  57387. //
  57388. // You can also filter nested fields. For example, you could specify
  57389. // scheduling.automaticRestart = false to include instances only if they
  57390. // are not scheduled for automatic restarts. You can use filtering on
  57391. // nested fields to filter based on resource labels.
  57392. //
  57393. // To filter on multiple expressions, provide each separate expression
  57394. // within parentheses. For example, (scheduling.automaticRestart = true)
  57395. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57396. // AND expression. However, you can include AND and OR expressions
  57397. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57398. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57399. // true).
  57400. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  57401. c.urlParams_.Set("filter", filter)
  57402. return c
  57403. }
  57404. // MaxResults sets the optional parameter "maxResults": The maximum
  57405. // number of results per page that should be returned. If the number of
  57406. // available results is larger than maxResults, Compute Engine returns a
  57407. // nextPageToken that can be used to get the next page of results in
  57408. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57409. // (Default: 500)
  57410. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  57411. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57412. return c
  57413. }
  57414. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57415. // a certain order. By default, results are returned in alphanumerical
  57416. // order based on the resource name.
  57417. //
  57418. // You can also sort results in descending order based on the creation
  57419. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57420. // based on the creationTimestamp field in reverse chronological order
  57421. // (newest result first). Use this to sort resources like operations so
  57422. // that the newest operation is returned first.
  57423. //
  57424. // Currently, only sorting by name or creationTimestamp desc is
  57425. // supported.
  57426. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  57427. c.urlParams_.Set("orderBy", orderBy)
  57428. return c
  57429. }
  57430. // PageToken sets the optional parameter "pageToken": Specifies a page
  57431. // token to use. Set pageToken to the nextPageToken returned by a
  57432. // previous list request to get the next page of results.
  57433. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  57434. c.urlParams_.Set("pageToken", pageToken)
  57435. return c
  57436. }
  57437. // Fields allows partial responses to be retrieved. See
  57438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57439. // for more information.
  57440. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  57441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57442. return c
  57443. }
  57444. // IfNoneMatch sets the optional parameter which makes the operation
  57445. // fail if the object's ETag matches the given value. This is useful for
  57446. // getting updates only after the object has changed since the last
  57447. // request. Use googleapi.IsNotModified to check whether the response
  57448. // error from Do is the result of In-None-Match.
  57449. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  57450. c.ifNoneMatch_ = entityTag
  57451. return c
  57452. }
  57453. // Context sets the context to be used in this call's Do method. Any
  57454. // pending HTTP request will be aborted if the provided context is
  57455. // canceled.
  57456. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  57457. c.ctx_ = ctx
  57458. return c
  57459. }
  57460. // Header returns an http.Header that can be modified by the caller to
  57461. // add HTTP headers to the request.
  57462. func (c *RegionDiskTypesListCall) Header() http.Header {
  57463. if c.header_ == nil {
  57464. c.header_ = make(http.Header)
  57465. }
  57466. return c.header_
  57467. }
  57468. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  57469. reqHeaders := make(http.Header)
  57470. for k, v := range c.header_ {
  57471. reqHeaders[k] = v
  57472. }
  57473. reqHeaders.Set("User-Agent", c.s.userAgent())
  57474. if c.ifNoneMatch_ != "" {
  57475. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57476. }
  57477. var body io.Reader = nil
  57478. c.urlParams_.Set("alt", alt)
  57479. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  57480. urls += "?" + c.urlParams_.Encode()
  57481. req, _ := http.NewRequest("GET", urls, body)
  57482. req.Header = reqHeaders
  57483. googleapi.Expand(req.URL, map[string]string{
  57484. "project": c.project,
  57485. "region": c.region,
  57486. })
  57487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57488. }
  57489. // Do executes the "compute.regionDiskTypes.list" call.
  57490. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  57491. // non-2xx status code is an error. Response headers are in either
  57492. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  57493. // returned at all) in error.(*googleapi.Error).Header. Use
  57494. // googleapi.IsNotModified to check whether the returned error was
  57495. // because http.StatusNotModified was returned.
  57496. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  57497. gensupport.SetOptions(c.urlParams_, opts...)
  57498. res, err := c.doRequest("json")
  57499. if res != nil && res.StatusCode == http.StatusNotModified {
  57500. if res.Body != nil {
  57501. res.Body.Close()
  57502. }
  57503. return nil, &googleapi.Error{
  57504. Code: res.StatusCode,
  57505. Header: res.Header,
  57506. }
  57507. }
  57508. if err != nil {
  57509. return nil, err
  57510. }
  57511. defer googleapi.CloseBody(res)
  57512. if err := googleapi.CheckResponse(res); err != nil {
  57513. return nil, err
  57514. }
  57515. ret := &RegionDiskTypeList{
  57516. ServerResponse: googleapi.ServerResponse{
  57517. Header: res.Header,
  57518. HTTPStatusCode: res.StatusCode,
  57519. },
  57520. }
  57521. target := &ret
  57522. if err := gensupport.DecodeResponse(target, res); err != nil {
  57523. return nil, err
  57524. }
  57525. return ret, nil
  57526. // {
  57527. // "description": "Retrieves a list of regional disk types available to the specified project.",
  57528. // "httpMethod": "GET",
  57529. // "id": "compute.regionDiskTypes.list",
  57530. // "parameterOrder": [
  57531. // "project",
  57532. // "region"
  57533. // ],
  57534. // "parameters": {
  57535. // "filter": {
  57536. // "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).",
  57537. // "location": "query",
  57538. // "type": "string"
  57539. // },
  57540. // "maxResults": {
  57541. // "default": "500",
  57542. // "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)",
  57543. // "format": "uint32",
  57544. // "location": "query",
  57545. // "minimum": "0",
  57546. // "type": "integer"
  57547. // },
  57548. // "orderBy": {
  57549. // "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.",
  57550. // "location": "query",
  57551. // "type": "string"
  57552. // },
  57553. // "pageToken": {
  57554. // "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.",
  57555. // "location": "query",
  57556. // "type": "string"
  57557. // },
  57558. // "project": {
  57559. // "description": "Project ID for this request.",
  57560. // "location": "path",
  57561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57562. // "required": true,
  57563. // "type": "string"
  57564. // },
  57565. // "region": {
  57566. // "description": "The name of the region for this request.",
  57567. // "location": "path",
  57568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57569. // "required": true,
  57570. // "type": "string"
  57571. // }
  57572. // },
  57573. // "path": "{project}/regions/{region}/diskTypes",
  57574. // "response": {
  57575. // "$ref": "RegionDiskTypeList"
  57576. // },
  57577. // "scopes": [
  57578. // "https://www.googleapis.com/auth/cloud-platform",
  57579. // "https://www.googleapis.com/auth/compute",
  57580. // "https://www.googleapis.com/auth/compute.readonly"
  57581. // ]
  57582. // }
  57583. }
  57584. // Pages invokes f for each page of results.
  57585. // A non-nil error returned from f will halt the iteration.
  57586. // The provided context supersedes any context provided to the Context method.
  57587. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  57588. c.ctx_ = ctx
  57589. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57590. for {
  57591. x, err := c.Do()
  57592. if err != nil {
  57593. return err
  57594. }
  57595. if err := f(x); err != nil {
  57596. return err
  57597. }
  57598. if x.NextPageToken == "" {
  57599. return nil
  57600. }
  57601. c.PageToken(x.NextPageToken)
  57602. }
  57603. }
  57604. // method id "compute.regionDisks.createSnapshot":
  57605. type RegionDisksCreateSnapshotCall struct {
  57606. s *Service
  57607. project string
  57608. region string
  57609. disk string
  57610. snapshot *Snapshot
  57611. urlParams_ gensupport.URLParams
  57612. ctx_ context.Context
  57613. header_ http.Header
  57614. }
  57615. // CreateSnapshot: Creates a snapshot of this regional disk.
  57616. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  57617. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57618. c.project = project
  57619. c.region = region
  57620. c.disk = disk
  57621. c.snapshot = snapshot
  57622. return c
  57623. }
  57624. // RequestId sets the optional parameter "requestId": An optional
  57625. // request ID to identify requests. Specify a unique request ID so that
  57626. // if you must retry your request, the server will know to ignore the
  57627. // request if it has already been completed.
  57628. //
  57629. // For example, consider a situation where you make an initial request
  57630. // and the request times out. If you make the request again with the
  57631. // same request ID, the server can check if original operation with the
  57632. // same request ID was received, and if so, will ignore the second
  57633. // request. This prevents clients from accidentally creating duplicate
  57634. // commitments.
  57635. //
  57636. // The request ID must be a valid UUID with the exception that zero UUID
  57637. // is not supported (00000000-0000-0000-0000-000000000000).
  57638. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  57639. c.urlParams_.Set("requestId", requestId)
  57640. return c
  57641. }
  57642. // Fields allows partial responses to be retrieved. See
  57643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57644. // for more information.
  57645. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  57646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57647. return c
  57648. }
  57649. // Context sets the context to be used in this call's Do method. Any
  57650. // pending HTTP request will be aborted if the provided context is
  57651. // canceled.
  57652. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  57653. c.ctx_ = ctx
  57654. return c
  57655. }
  57656. // Header returns an http.Header that can be modified by the caller to
  57657. // add HTTP headers to the request.
  57658. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  57659. if c.header_ == nil {
  57660. c.header_ = make(http.Header)
  57661. }
  57662. return c.header_
  57663. }
  57664. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  57665. reqHeaders := make(http.Header)
  57666. for k, v := range c.header_ {
  57667. reqHeaders[k] = v
  57668. }
  57669. reqHeaders.Set("User-Agent", c.s.userAgent())
  57670. var body io.Reader = nil
  57671. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  57672. if err != nil {
  57673. return nil, err
  57674. }
  57675. reqHeaders.Set("Content-Type", "application/json")
  57676. c.urlParams_.Set("alt", alt)
  57677. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  57678. urls += "?" + c.urlParams_.Encode()
  57679. req, _ := http.NewRequest("POST", urls, body)
  57680. req.Header = reqHeaders
  57681. googleapi.Expand(req.URL, map[string]string{
  57682. "project": c.project,
  57683. "region": c.region,
  57684. "disk": c.disk,
  57685. })
  57686. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57687. }
  57688. // Do executes the "compute.regionDisks.createSnapshot" call.
  57689. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57690. // status code is an error. Response headers are in either
  57691. // *Operation.ServerResponse.Header or (if a response was returned at
  57692. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57693. // to check whether the returned error was because
  57694. // http.StatusNotModified was returned.
  57695. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57696. gensupport.SetOptions(c.urlParams_, opts...)
  57697. res, err := c.doRequest("json")
  57698. if res != nil && res.StatusCode == http.StatusNotModified {
  57699. if res.Body != nil {
  57700. res.Body.Close()
  57701. }
  57702. return nil, &googleapi.Error{
  57703. Code: res.StatusCode,
  57704. Header: res.Header,
  57705. }
  57706. }
  57707. if err != nil {
  57708. return nil, err
  57709. }
  57710. defer googleapi.CloseBody(res)
  57711. if err := googleapi.CheckResponse(res); err != nil {
  57712. return nil, err
  57713. }
  57714. ret := &Operation{
  57715. ServerResponse: googleapi.ServerResponse{
  57716. Header: res.Header,
  57717. HTTPStatusCode: res.StatusCode,
  57718. },
  57719. }
  57720. target := &ret
  57721. if err := gensupport.DecodeResponse(target, res); err != nil {
  57722. return nil, err
  57723. }
  57724. return ret, nil
  57725. // {
  57726. // "description": "Creates a snapshot of this regional disk.",
  57727. // "httpMethod": "POST",
  57728. // "id": "compute.regionDisks.createSnapshot",
  57729. // "parameterOrder": [
  57730. // "project",
  57731. // "region",
  57732. // "disk"
  57733. // ],
  57734. // "parameters": {
  57735. // "disk": {
  57736. // "description": "Name of the regional persistent disk to snapshot.",
  57737. // "location": "path",
  57738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57739. // "required": true,
  57740. // "type": "string"
  57741. // },
  57742. // "project": {
  57743. // "description": "Project ID for this request.",
  57744. // "location": "path",
  57745. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57746. // "required": true,
  57747. // "type": "string"
  57748. // },
  57749. // "region": {
  57750. // "description": "Name of the region for this request.",
  57751. // "location": "path",
  57752. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57753. // "required": true,
  57754. // "type": "string"
  57755. // },
  57756. // "requestId": {
  57757. // "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).",
  57758. // "location": "query",
  57759. // "type": "string"
  57760. // }
  57761. // },
  57762. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  57763. // "request": {
  57764. // "$ref": "Snapshot"
  57765. // },
  57766. // "response": {
  57767. // "$ref": "Operation"
  57768. // },
  57769. // "scopes": [
  57770. // "https://www.googleapis.com/auth/cloud-platform",
  57771. // "https://www.googleapis.com/auth/compute"
  57772. // ]
  57773. // }
  57774. }
  57775. // method id "compute.regionDisks.delete":
  57776. type RegionDisksDeleteCall struct {
  57777. s *Service
  57778. project string
  57779. region string
  57780. disk string
  57781. urlParams_ gensupport.URLParams
  57782. ctx_ context.Context
  57783. header_ http.Header
  57784. }
  57785. // Delete: Deletes the specified regional persistent disk. Deleting a
  57786. // regional disk removes all the replicas of its data permanently and is
  57787. // irreversible. However, deleting a disk does not delete any snapshots
  57788. // previously made from the disk. You must separately delete snapshots.
  57789. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  57790. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57791. c.project = project
  57792. c.region = region
  57793. c.disk = disk
  57794. return c
  57795. }
  57796. // RequestId sets the optional parameter "requestId": An optional
  57797. // request ID to identify requests. Specify a unique request ID so that
  57798. // if you must retry your request, the server will know to ignore the
  57799. // request if it has already been completed.
  57800. //
  57801. // For example, consider a situation where you make an initial request
  57802. // and the request times out. If you make the request again with the
  57803. // same request ID, the server can check if original operation with the
  57804. // same request ID was received, and if so, will ignore the second
  57805. // request. This prevents clients from accidentally creating duplicate
  57806. // commitments.
  57807. //
  57808. // The request ID must be a valid UUID with the exception that zero UUID
  57809. // is not supported (00000000-0000-0000-0000-000000000000).
  57810. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  57811. c.urlParams_.Set("requestId", requestId)
  57812. return c
  57813. }
  57814. // Fields allows partial responses to be retrieved. See
  57815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57816. // for more information.
  57817. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  57818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57819. return c
  57820. }
  57821. // Context sets the context to be used in this call's Do method. Any
  57822. // pending HTTP request will be aborted if the provided context is
  57823. // canceled.
  57824. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  57825. c.ctx_ = ctx
  57826. return c
  57827. }
  57828. // Header returns an http.Header that can be modified by the caller to
  57829. // add HTTP headers to the request.
  57830. func (c *RegionDisksDeleteCall) Header() http.Header {
  57831. if c.header_ == nil {
  57832. c.header_ = make(http.Header)
  57833. }
  57834. return c.header_
  57835. }
  57836. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  57837. reqHeaders := make(http.Header)
  57838. for k, v := range c.header_ {
  57839. reqHeaders[k] = v
  57840. }
  57841. reqHeaders.Set("User-Agent", c.s.userAgent())
  57842. var body io.Reader = nil
  57843. c.urlParams_.Set("alt", alt)
  57844. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  57845. urls += "?" + c.urlParams_.Encode()
  57846. req, _ := http.NewRequest("DELETE", urls, body)
  57847. req.Header = reqHeaders
  57848. googleapi.Expand(req.URL, map[string]string{
  57849. "project": c.project,
  57850. "region": c.region,
  57851. "disk": c.disk,
  57852. })
  57853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57854. }
  57855. // Do executes the "compute.regionDisks.delete" call.
  57856. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57857. // status code is an error. Response headers are in either
  57858. // *Operation.ServerResponse.Header or (if a response was returned at
  57859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57860. // to check whether the returned error was because
  57861. // http.StatusNotModified was returned.
  57862. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57863. gensupport.SetOptions(c.urlParams_, opts...)
  57864. res, err := c.doRequest("json")
  57865. if res != nil && res.StatusCode == http.StatusNotModified {
  57866. if res.Body != nil {
  57867. res.Body.Close()
  57868. }
  57869. return nil, &googleapi.Error{
  57870. Code: res.StatusCode,
  57871. Header: res.Header,
  57872. }
  57873. }
  57874. if err != nil {
  57875. return nil, err
  57876. }
  57877. defer googleapi.CloseBody(res)
  57878. if err := googleapi.CheckResponse(res); err != nil {
  57879. return nil, err
  57880. }
  57881. ret := &Operation{
  57882. ServerResponse: googleapi.ServerResponse{
  57883. Header: res.Header,
  57884. HTTPStatusCode: res.StatusCode,
  57885. },
  57886. }
  57887. target := &ret
  57888. if err := gensupport.DecodeResponse(target, res); err != nil {
  57889. return nil, err
  57890. }
  57891. return ret, nil
  57892. // {
  57893. // "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.",
  57894. // "httpMethod": "DELETE",
  57895. // "id": "compute.regionDisks.delete",
  57896. // "parameterOrder": [
  57897. // "project",
  57898. // "region",
  57899. // "disk"
  57900. // ],
  57901. // "parameters": {
  57902. // "disk": {
  57903. // "description": "Name of the regional persistent disk to delete.",
  57904. // "location": "path",
  57905. // "required": true,
  57906. // "type": "string"
  57907. // },
  57908. // "project": {
  57909. // "description": "Project ID for this request.",
  57910. // "location": "path",
  57911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57912. // "required": true,
  57913. // "type": "string"
  57914. // },
  57915. // "region": {
  57916. // "description": "Name of the region for this request.",
  57917. // "location": "path",
  57918. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57919. // "required": true,
  57920. // "type": "string"
  57921. // },
  57922. // "requestId": {
  57923. // "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).",
  57924. // "location": "query",
  57925. // "type": "string"
  57926. // }
  57927. // },
  57928. // "path": "{project}/regions/{region}/disks/{disk}",
  57929. // "response": {
  57930. // "$ref": "Operation"
  57931. // },
  57932. // "scopes": [
  57933. // "https://www.googleapis.com/auth/cloud-platform",
  57934. // "https://www.googleapis.com/auth/compute"
  57935. // ]
  57936. // }
  57937. }
  57938. // method id "compute.regionDisks.get":
  57939. type RegionDisksGetCall struct {
  57940. s *Service
  57941. project string
  57942. region string
  57943. disk string
  57944. urlParams_ gensupport.URLParams
  57945. ifNoneMatch_ string
  57946. ctx_ context.Context
  57947. header_ http.Header
  57948. }
  57949. // Get: Returns a specified regional persistent disk.
  57950. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  57951. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57952. c.project = project
  57953. c.region = region
  57954. c.disk = disk
  57955. return c
  57956. }
  57957. // Fields allows partial responses to be retrieved. See
  57958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57959. // for more information.
  57960. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  57961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57962. return c
  57963. }
  57964. // IfNoneMatch sets the optional parameter which makes the operation
  57965. // fail if the object's ETag matches the given value. This is useful for
  57966. // getting updates only after the object has changed since the last
  57967. // request. Use googleapi.IsNotModified to check whether the response
  57968. // error from Do is the result of In-None-Match.
  57969. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  57970. c.ifNoneMatch_ = entityTag
  57971. return c
  57972. }
  57973. // Context sets the context to be used in this call's Do method. Any
  57974. // pending HTTP request will be aborted if the provided context is
  57975. // canceled.
  57976. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  57977. c.ctx_ = ctx
  57978. return c
  57979. }
  57980. // Header returns an http.Header that can be modified by the caller to
  57981. // add HTTP headers to the request.
  57982. func (c *RegionDisksGetCall) Header() http.Header {
  57983. if c.header_ == nil {
  57984. c.header_ = make(http.Header)
  57985. }
  57986. return c.header_
  57987. }
  57988. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  57989. reqHeaders := make(http.Header)
  57990. for k, v := range c.header_ {
  57991. reqHeaders[k] = v
  57992. }
  57993. reqHeaders.Set("User-Agent", c.s.userAgent())
  57994. if c.ifNoneMatch_ != "" {
  57995. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57996. }
  57997. var body io.Reader = nil
  57998. c.urlParams_.Set("alt", alt)
  57999. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  58000. urls += "?" + c.urlParams_.Encode()
  58001. req, _ := http.NewRequest("GET", urls, body)
  58002. req.Header = reqHeaders
  58003. googleapi.Expand(req.URL, map[string]string{
  58004. "project": c.project,
  58005. "region": c.region,
  58006. "disk": c.disk,
  58007. })
  58008. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58009. }
  58010. // Do executes the "compute.regionDisks.get" call.
  58011. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  58012. // code is an error. Response headers are in either
  58013. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  58014. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  58015. // whether the returned error was because http.StatusNotModified was
  58016. // returned.
  58017. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  58018. gensupport.SetOptions(c.urlParams_, opts...)
  58019. res, err := c.doRequest("json")
  58020. if res != nil && res.StatusCode == http.StatusNotModified {
  58021. if res.Body != nil {
  58022. res.Body.Close()
  58023. }
  58024. return nil, &googleapi.Error{
  58025. Code: res.StatusCode,
  58026. Header: res.Header,
  58027. }
  58028. }
  58029. if err != nil {
  58030. return nil, err
  58031. }
  58032. defer googleapi.CloseBody(res)
  58033. if err := googleapi.CheckResponse(res); err != nil {
  58034. return nil, err
  58035. }
  58036. ret := &Disk{
  58037. ServerResponse: googleapi.ServerResponse{
  58038. Header: res.Header,
  58039. HTTPStatusCode: res.StatusCode,
  58040. },
  58041. }
  58042. target := &ret
  58043. if err := gensupport.DecodeResponse(target, res); err != nil {
  58044. return nil, err
  58045. }
  58046. return ret, nil
  58047. // {
  58048. // "description": "Returns a specified regional persistent disk.",
  58049. // "httpMethod": "GET",
  58050. // "id": "compute.regionDisks.get",
  58051. // "parameterOrder": [
  58052. // "project",
  58053. // "region",
  58054. // "disk"
  58055. // ],
  58056. // "parameters": {
  58057. // "disk": {
  58058. // "description": "Name of the regional persistent disk to return.",
  58059. // "location": "path",
  58060. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58061. // "required": true,
  58062. // "type": "string"
  58063. // },
  58064. // "project": {
  58065. // "description": "Project ID for this request.",
  58066. // "location": "path",
  58067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58068. // "required": true,
  58069. // "type": "string"
  58070. // },
  58071. // "region": {
  58072. // "description": "Name of the region for this request.",
  58073. // "location": "path",
  58074. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58075. // "required": true,
  58076. // "type": "string"
  58077. // }
  58078. // },
  58079. // "path": "{project}/regions/{region}/disks/{disk}",
  58080. // "response": {
  58081. // "$ref": "Disk"
  58082. // },
  58083. // "scopes": [
  58084. // "https://www.googleapis.com/auth/cloud-platform",
  58085. // "https://www.googleapis.com/auth/compute",
  58086. // "https://www.googleapis.com/auth/compute.readonly"
  58087. // ]
  58088. // }
  58089. }
  58090. // method id "compute.regionDisks.insert":
  58091. type RegionDisksInsertCall struct {
  58092. s *Service
  58093. project string
  58094. region string
  58095. disk *Disk
  58096. urlParams_ gensupport.URLParams
  58097. ctx_ context.Context
  58098. header_ http.Header
  58099. }
  58100. // Insert: Creates a persistent regional disk in the specified project
  58101. // using the data included in the request.
  58102. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  58103. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58104. c.project = project
  58105. c.region = region
  58106. c.disk = disk
  58107. return c
  58108. }
  58109. // RequestId sets the optional parameter "requestId": An optional
  58110. // request ID to identify requests. Specify a unique request ID so that
  58111. // if you must retry your request, the server will know to ignore the
  58112. // request if it has already been completed.
  58113. //
  58114. // For example, consider a situation where you make an initial request
  58115. // and the request times out. If you make the request again with the
  58116. // same request ID, the server can check if original operation with the
  58117. // same request ID was received, and if so, will ignore the second
  58118. // request. This prevents clients from accidentally creating duplicate
  58119. // commitments.
  58120. //
  58121. // The request ID must be a valid UUID with the exception that zero UUID
  58122. // is not supported (00000000-0000-0000-0000-000000000000).
  58123. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  58124. c.urlParams_.Set("requestId", requestId)
  58125. return c
  58126. }
  58127. // SourceImage sets the optional parameter "sourceImage": Source image
  58128. // to restore onto a disk.
  58129. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  58130. c.urlParams_.Set("sourceImage", sourceImage)
  58131. return c
  58132. }
  58133. // Fields allows partial responses to be retrieved. See
  58134. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58135. // for more information.
  58136. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  58137. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58138. return c
  58139. }
  58140. // Context sets the context to be used in this call's Do method. Any
  58141. // pending HTTP request will be aborted if the provided context is
  58142. // canceled.
  58143. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  58144. c.ctx_ = ctx
  58145. return c
  58146. }
  58147. // Header returns an http.Header that can be modified by the caller to
  58148. // add HTTP headers to the request.
  58149. func (c *RegionDisksInsertCall) Header() http.Header {
  58150. if c.header_ == nil {
  58151. c.header_ = make(http.Header)
  58152. }
  58153. return c.header_
  58154. }
  58155. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  58156. reqHeaders := make(http.Header)
  58157. for k, v := range c.header_ {
  58158. reqHeaders[k] = v
  58159. }
  58160. reqHeaders.Set("User-Agent", c.s.userAgent())
  58161. var body io.Reader = nil
  58162. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  58163. if err != nil {
  58164. return nil, err
  58165. }
  58166. reqHeaders.Set("Content-Type", "application/json")
  58167. c.urlParams_.Set("alt", alt)
  58168. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  58169. urls += "?" + c.urlParams_.Encode()
  58170. req, _ := http.NewRequest("POST", urls, body)
  58171. req.Header = reqHeaders
  58172. googleapi.Expand(req.URL, map[string]string{
  58173. "project": c.project,
  58174. "region": c.region,
  58175. })
  58176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58177. }
  58178. // Do executes the "compute.regionDisks.insert" call.
  58179. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58180. // status code is an error. Response headers are in either
  58181. // *Operation.ServerResponse.Header or (if a response was returned at
  58182. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58183. // to check whether the returned error was because
  58184. // http.StatusNotModified was returned.
  58185. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58186. gensupport.SetOptions(c.urlParams_, opts...)
  58187. res, err := c.doRequest("json")
  58188. if res != nil && res.StatusCode == http.StatusNotModified {
  58189. if res.Body != nil {
  58190. res.Body.Close()
  58191. }
  58192. return nil, &googleapi.Error{
  58193. Code: res.StatusCode,
  58194. Header: res.Header,
  58195. }
  58196. }
  58197. if err != nil {
  58198. return nil, err
  58199. }
  58200. defer googleapi.CloseBody(res)
  58201. if err := googleapi.CheckResponse(res); err != nil {
  58202. return nil, err
  58203. }
  58204. ret := &Operation{
  58205. ServerResponse: googleapi.ServerResponse{
  58206. Header: res.Header,
  58207. HTTPStatusCode: res.StatusCode,
  58208. },
  58209. }
  58210. target := &ret
  58211. if err := gensupport.DecodeResponse(target, res); err != nil {
  58212. return nil, err
  58213. }
  58214. return ret, nil
  58215. // {
  58216. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  58217. // "httpMethod": "POST",
  58218. // "id": "compute.regionDisks.insert",
  58219. // "parameterOrder": [
  58220. // "project",
  58221. // "region"
  58222. // ],
  58223. // "parameters": {
  58224. // "project": {
  58225. // "description": "Project ID for this request.",
  58226. // "location": "path",
  58227. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58228. // "required": true,
  58229. // "type": "string"
  58230. // },
  58231. // "region": {
  58232. // "description": "Name of the region for this request.",
  58233. // "location": "path",
  58234. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58235. // "required": true,
  58236. // "type": "string"
  58237. // },
  58238. // "requestId": {
  58239. // "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).",
  58240. // "location": "query",
  58241. // "type": "string"
  58242. // },
  58243. // "sourceImage": {
  58244. // "description": "Optional. Source image to restore onto a disk.",
  58245. // "location": "query",
  58246. // "type": "string"
  58247. // }
  58248. // },
  58249. // "path": "{project}/regions/{region}/disks",
  58250. // "request": {
  58251. // "$ref": "Disk"
  58252. // },
  58253. // "response": {
  58254. // "$ref": "Operation"
  58255. // },
  58256. // "scopes": [
  58257. // "https://www.googleapis.com/auth/cloud-platform",
  58258. // "https://www.googleapis.com/auth/compute"
  58259. // ]
  58260. // }
  58261. }
  58262. // method id "compute.regionDisks.list":
  58263. type RegionDisksListCall struct {
  58264. s *Service
  58265. project string
  58266. region string
  58267. urlParams_ gensupport.URLParams
  58268. ifNoneMatch_ string
  58269. ctx_ context.Context
  58270. header_ http.Header
  58271. }
  58272. // List: Retrieves the list of persistent disks contained within the
  58273. // specified region.
  58274. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  58275. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58276. c.project = project
  58277. c.region = region
  58278. return c
  58279. }
  58280. // Filter sets the optional parameter "filter": A filter expression that
  58281. // filters resources listed in the response. The expression must specify
  58282. // the field name, a comparison operator, and the value that you want to
  58283. // use for filtering. The value must be a string, a number, or a
  58284. // boolean. The comparison operator must be either =, !=, >, or <.
  58285. //
  58286. // For example, if you are filtering Compute Engine instances, you can
  58287. // exclude instances named example-instance by specifying name !=
  58288. // example-instance.
  58289. //
  58290. // You can also filter nested fields. For example, you could specify
  58291. // scheduling.automaticRestart = false to include instances only if they
  58292. // are not scheduled for automatic restarts. You can use filtering on
  58293. // nested fields to filter based on resource labels.
  58294. //
  58295. // To filter on multiple expressions, provide each separate expression
  58296. // within parentheses. For example, (scheduling.automaticRestart = true)
  58297. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58298. // AND expression. However, you can include AND and OR expressions
  58299. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58300. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58301. // true).
  58302. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  58303. c.urlParams_.Set("filter", filter)
  58304. return c
  58305. }
  58306. // MaxResults sets the optional parameter "maxResults": The maximum
  58307. // number of results per page that should be returned. If the number of
  58308. // available results is larger than maxResults, Compute Engine returns a
  58309. // nextPageToken that can be used to get the next page of results in
  58310. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58311. // (Default: 500)
  58312. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  58313. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58314. return c
  58315. }
  58316. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58317. // a certain order. By default, results are returned in alphanumerical
  58318. // order based on the resource name.
  58319. //
  58320. // You can also sort results in descending order based on the creation
  58321. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58322. // based on the creationTimestamp field in reverse chronological order
  58323. // (newest result first). Use this to sort resources like operations so
  58324. // that the newest operation is returned first.
  58325. //
  58326. // Currently, only sorting by name or creationTimestamp desc is
  58327. // supported.
  58328. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  58329. c.urlParams_.Set("orderBy", orderBy)
  58330. return c
  58331. }
  58332. // PageToken sets the optional parameter "pageToken": Specifies a page
  58333. // token to use. Set pageToken to the nextPageToken returned by a
  58334. // previous list request to get the next page of results.
  58335. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  58336. c.urlParams_.Set("pageToken", pageToken)
  58337. return c
  58338. }
  58339. // Fields allows partial responses to be retrieved. See
  58340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58341. // for more information.
  58342. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  58343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58344. return c
  58345. }
  58346. // IfNoneMatch sets the optional parameter which makes the operation
  58347. // fail if the object's ETag matches the given value. This is useful for
  58348. // getting updates only after the object has changed since the last
  58349. // request. Use googleapi.IsNotModified to check whether the response
  58350. // error from Do is the result of In-None-Match.
  58351. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  58352. c.ifNoneMatch_ = entityTag
  58353. return c
  58354. }
  58355. // Context sets the context to be used in this call's Do method. Any
  58356. // pending HTTP request will be aborted if the provided context is
  58357. // canceled.
  58358. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  58359. c.ctx_ = ctx
  58360. return c
  58361. }
  58362. // Header returns an http.Header that can be modified by the caller to
  58363. // add HTTP headers to the request.
  58364. func (c *RegionDisksListCall) Header() http.Header {
  58365. if c.header_ == nil {
  58366. c.header_ = make(http.Header)
  58367. }
  58368. return c.header_
  58369. }
  58370. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  58371. reqHeaders := make(http.Header)
  58372. for k, v := range c.header_ {
  58373. reqHeaders[k] = v
  58374. }
  58375. reqHeaders.Set("User-Agent", c.s.userAgent())
  58376. if c.ifNoneMatch_ != "" {
  58377. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58378. }
  58379. var body io.Reader = nil
  58380. c.urlParams_.Set("alt", alt)
  58381. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  58382. urls += "?" + c.urlParams_.Encode()
  58383. req, _ := http.NewRequest("GET", urls, body)
  58384. req.Header = reqHeaders
  58385. googleapi.Expand(req.URL, map[string]string{
  58386. "project": c.project,
  58387. "region": c.region,
  58388. })
  58389. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58390. }
  58391. // Do executes the "compute.regionDisks.list" call.
  58392. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  58393. // code is an error. Response headers are in either
  58394. // *DiskList.ServerResponse.Header or (if a response was returned at
  58395. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58396. // to check whether the returned error was because
  58397. // http.StatusNotModified was returned.
  58398. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  58399. gensupport.SetOptions(c.urlParams_, opts...)
  58400. res, err := c.doRequest("json")
  58401. if res != nil && res.StatusCode == http.StatusNotModified {
  58402. if res.Body != nil {
  58403. res.Body.Close()
  58404. }
  58405. return nil, &googleapi.Error{
  58406. Code: res.StatusCode,
  58407. Header: res.Header,
  58408. }
  58409. }
  58410. if err != nil {
  58411. return nil, err
  58412. }
  58413. defer googleapi.CloseBody(res)
  58414. if err := googleapi.CheckResponse(res); err != nil {
  58415. return nil, err
  58416. }
  58417. ret := &DiskList{
  58418. ServerResponse: googleapi.ServerResponse{
  58419. Header: res.Header,
  58420. HTTPStatusCode: res.StatusCode,
  58421. },
  58422. }
  58423. target := &ret
  58424. if err := gensupport.DecodeResponse(target, res); err != nil {
  58425. return nil, err
  58426. }
  58427. return ret, nil
  58428. // {
  58429. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  58430. // "httpMethod": "GET",
  58431. // "id": "compute.regionDisks.list",
  58432. // "parameterOrder": [
  58433. // "project",
  58434. // "region"
  58435. // ],
  58436. // "parameters": {
  58437. // "filter": {
  58438. // "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).",
  58439. // "location": "query",
  58440. // "type": "string"
  58441. // },
  58442. // "maxResults": {
  58443. // "default": "500",
  58444. // "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)",
  58445. // "format": "uint32",
  58446. // "location": "query",
  58447. // "minimum": "0",
  58448. // "type": "integer"
  58449. // },
  58450. // "orderBy": {
  58451. // "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.",
  58452. // "location": "query",
  58453. // "type": "string"
  58454. // },
  58455. // "pageToken": {
  58456. // "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.",
  58457. // "location": "query",
  58458. // "type": "string"
  58459. // },
  58460. // "project": {
  58461. // "description": "Project ID for this request.",
  58462. // "location": "path",
  58463. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58464. // "required": true,
  58465. // "type": "string"
  58466. // },
  58467. // "region": {
  58468. // "description": "Name of the region for this request.",
  58469. // "location": "path",
  58470. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58471. // "required": true,
  58472. // "type": "string"
  58473. // }
  58474. // },
  58475. // "path": "{project}/regions/{region}/disks",
  58476. // "response": {
  58477. // "$ref": "DiskList"
  58478. // },
  58479. // "scopes": [
  58480. // "https://www.googleapis.com/auth/cloud-platform",
  58481. // "https://www.googleapis.com/auth/compute",
  58482. // "https://www.googleapis.com/auth/compute.readonly"
  58483. // ]
  58484. // }
  58485. }
  58486. // Pages invokes f for each page of results.
  58487. // A non-nil error returned from f will halt the iteration.
  58488. // The provided context supersedes any context provided to the Context method.
  58489. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  58490. c.ctx_ = ctx
  58491. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58492. for {
  58493. x, err := c.Do()
  58494. if err != nil {
  58495. return err
  58496. }
  58497. if err := f(x); err != nil {
  58498. return err
  58499. }
  58500. if x.NextPageToken == "" {
  58501. return nil
  58502. }
  58503. c.PageToken(x.NextPageToken)
  58504. }
  58505. }
  58506. // method id "compute.regionDisks.resize":
  58507. type RegionDisksResizeCall struct {
  58508. s *Service
  58509. project string
  58510. region string
  58511. disk string
  58512. regiondisksresizerequest *RegionDisksResizeRequest
  58513. urlParams_ gensupport.URLParams
  58514. ctx_ context.Context
  58515. header_ http.Header
  58516. }
  58517. // Resize: Resizes the specified regional persistent disk.
  58518. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  58519. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58520. c.project = project
  58521. c.region = region
  58522. c.disk = disk
  58523. c.regiondisksresizerequest = regiondisksresizerequest
  58524. return c
  58525. }
  58526. // RequestId sets the optional parameter "requestId": An optional
  58527. // request ID to identify requests. Specify a unique request ID so that
  58528. // if you must retry your request, the server will know to ignore the
  58529. // request if it has already been completed.
  58530. //
  58531. // For example, consider a situation where you make an initial request
  58532. // and the request times out. If you make the request again with the
  58533. // same request ID, the server can check if original operation with the
  58534. // same request ID was received, and if so, will ignore the second
  58535. // request. This prevents clients from accidentally creating duplicate
  58536. // commitments.
  58537. //
  58538. // The request ID must be a valid UUID with the exception that zero UUID
  58539. // is not supported (00000000-0000-0000-0000-000000000000).
  58540. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  58541. c.urlParams_.Set("requestId", requestId)
  58542. return c
  58543. }
  58544. // Fields allows partial responses to be retrieved. See
  58545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58546. // for more information.
  58547. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  58548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58549. return c
  58550. }
  58551. // Context sets the context to be used in this call's Do method. Any
  58552. // pending HTTP request will be aborted if the provided context is
  58553. // canceled.
  58554. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  58555. c.ctx_ = ctx
  58556. return c
  58557. }
  58558. // Header returns an http.Header that can be modified by the caller to
  58559. // add HTTP headers to the request.
  58560. func (c *RegionDisksResizeCall) Header() http.Header {
  58561. if c.header_ == nil {
  58562. c.header_ = make(http.Header)
  58563. }
  58564. return c.header_
  58565. }
  58566. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  58567. reqHeaders := make(http.Header)
  58568. for k, v := range c.header_ {
  58569. reqHeaders[k] = v
  58570. }
  58571. reqHeaders.Set("User-Agent", c.s.userAgent())
  58572. var body io.Reader = nil
  58573. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  58574. if err != nil {
  58575. return nil, err
  58576. }
  58577. reqHeaders.Set("Content-Type", "application/json")
  58578. c.urlParams_.Set("alt", alt)
  58579. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  58580. urls += "?" + c.urlParams_.Encode()
  58581. req, _ := http.NewRequest("POST", urls, body)
  58582. req.Header = reqHeaders
  58583. googleapi.Expand(req.URL, map[string]string{
  58584. "project": c.project,
  58585. "region": c.region,
  58586. "disk": c.disk,
  58587. })
  58588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58589. }
  58590. // Do executes the "compute.regionDisks.resize" call.
  58591. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58592. // status code is an error. Response headers are in either
  58593. // *Operation.ServerResponse.Header or (if a response was returned at
  58594. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58595. // to check whether the returned error was because
  58596. // http.StatusNotModified was returned.
  58597. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58598. gensupport.SetOptions(c.urlParams_, opts...)
  58599. res, err := c.doRequest("json")
  58600. if res != nil && res.StatusCode == http.StatusNotModified {
  58601. if res.Body != nil {
  58602. res.Body.Close()
  58603. }
  58604. return nil, &googleapi.Error{
  58605. Code: res.StatusCode,
  58606. Header: res.Header,
  58607. }
  58608. }
  58609. if err != nil {
  58610. return nil, err
  58611. }
  58612. defer googleapi.CloseBody(res)
  58613. if err := googleapi.CheckResponse(res); err != nil {
  58614. return nil, err
  58615. }
  58616. ret := &Operation{
  58617. ServerResponse: googleapi.ServerResponse{
  58618. Header: res.Header,
  58619. HTTPStatusCode: res.StatusCode,
  58620. },
  58621. }
  58622. target := &ret
  58623. if err := gensupport.DecodeResponse(target, res); err != nil {
  58624. return nil, err
  58625. }
  58626. return ret, nil
  58627. // {
  58628. // "description": "Resizes the specified regional persistent disk.",
  58629. // "httpMethod": "POST",
  58630. // "id": "compute.regionDisks.resize",
  58631. // "parameterOrder": [
  58632. // "project",
  58633. // "region",
  58634. // "disk"
  58635. // ],
  58636. // "parameters": {
  58637. // "disk": {
  58638. // "description": "Name of the regional persistent disk.",
  58639. // "location": "path",
  58640. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58641. // "required": true,
  58642. // "type": "string"
  58643. // },
  58644. // "project": {
  58645. // "description": "The project ID for this request.",
  58646. // "location": "path",
  58647. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58648. // "required": true,
  58649. // "type": "string"
  58650. // },
  58651. // "region": {
  58652. // "description": "Name of the region for this request.",
  58653. // "location": "path",
  58654. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58655. // "required": true,
  58656. // "type": "string"
  58657. // },
  58658. // "requestId": {
  58659. // "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).",
  58660. // "location": "query",
  58661. // "type": "string"
  58662. // }
  58663. // },
  58664. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  58665. // "request": {
  58666. // "$ref": "RegionDisksResizeRequest"
  58667. // },
  58668. // "response": {
  58669. // "$ref": "Operation"
  58670. // },
  58671. // "scopes": [
  58672. // "https://www.googleapis.com/auth/cloud-platform",
  58673. // "https://www.googleapis.com/auth/compute"
  58674. // ]
  58675. // }
  58676. }
  58677. // method id "compute.regionDisks.setLabels":
  58678. type RegionDisksSetLabelsCall struct {
  58679. s *Service
  58680. project string
  58681. region string
  58682. resource string
  58683. regionsetlabelsrequest *RegionSetLabelsRequest
  58684. urlParams_ gensupport.URLParams
  58685. ctx_ context.Context
  58686. header_ http.Header
  58687. }
  58688. // SetLabels: Sets the labels on the target regional disk.
  58689. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  58690. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58691. c.project = project
  58692. c.region = region
  58693. c.resource = resource
  58694. c.regionsetlabelsrequest = regionsetlabelsrequest
  58695. return c
  58696. }
  58697. // RequestId sets the optional parameter "requestId": An optional
  58698. // request ID to identify requests. Specify a unique request ID so that
  58699. // if you must retry your request, the server will know to ignore the
  58700. // request if it has already been completed.
  58701. //
  58702. // For example, consider a situation where you make an initial request
  58703. // and the request times out. If you make the request again with the
  58704. // same request ID, the server can check if original operation with the
  58705. // same request ID was received, and if so, will ignore the second
  58706. // request. This prevents clients from accidentally creating duplicate
  58707. // commitments.
  58708. //
  58709. // The request ID must be a valid UUID with the exception that zero UUID
  58710. // is not supported (00000000-0000-0000-0000-000000000000).
  58711. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  58712. c.urlParams_.Set("requestId", requestId)
  58713. return c
  58714. }
  58715. // Fields allows partial responses to be retrieved. See
  58716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58717. // for more information.
  58718. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  58719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58720. return c
  58721. }
  58722. // Context sets the context to be used in this call's Do method. Any
  58723. // pending HTTP request will be aborted if the provided context is
  58724. // canceled.
  58725. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  58726. c.ctx_ = ctx
  58727. return c
  58728. }
  58729. // Header returns an http.Header that can be modified by the caller to
  58730. // add HTTP headers to the request.
  58731. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  58732. if c.header_ == nil {
  58733. c.header_ = make(http.Header)
  58734. }
  58735. return c.header_
  58736. }
  58737. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  58738. reqHeaders := make(http.Header)
  58739. for k, v := range c.header_ {
  58740. reqHeaders[k] = v
  58741. }
  58742. reqHeaders.Set("User-Agent", c.s.userAgent())
  58743. var body io.Reader = nil
  58744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  58745. if err != nil {
  58746. return nil, err
  58747. }
  58748. reqHeaders.Set("Content-Type", "application/json")
  58749. c.urlParams_.Set("alt", alt)
  58750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  58751. urls += "?" + c.urlParams_.Encode()
  58752. req, _ := http.NewRequest("POST", urls, body)
  58753. req.Header = reqHeaders
  58754. googleapi.Expand(req.URL, map[string]string{
  58755. "project": c.project,
  58756. "region": c.region,
  58757. "resource": c.resource,
  58758. })
  58759. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58760. }
  58761. // Do executes the "compute.regionDisks.setLabels" call.
  58762. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58763. // status code is an error. Response headers are in either
  58764. // *Operation.ServerResponse.Header or (if a response was returned at
  58765. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58766. // to check whether the returned error was because
  58767. // http.StatusNotModified was returned.
  58768. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58769. gensupport.SetOptions(c.urlParams_, opts...)
  58770. res, err := c.doRequest("json")
  58771. if res != nil && res.StatusCode == http.StatusNotModified {
  58772. if res.Body != nil {
  58773. res.Body.Close()
  58774. }
  58775. return nil, &googleapi.Error{
  58776. Code: res.StatusCode,
  58777. Header: res.Header,
  58778. }
  58779. }
  58780. if err != nil {
  58781. return nil, err
  58782. }
  58783. defer googleapi.CloseBody(res)
  58784. if err := googleapi.CheckResponse(res); err != nil {
  58785. return nil, err
  58786. }
  58787. ret := &Operation{
  58788. ServerResponse: googleapi.ServerResponse{
  58789. Header: res.Header,
  58790. HTTPStatusCode: res.StatusCode,
  58791. },
  58792. }
  58793. target := &ret
  58794. if err := gensupport.DecodeResponse(target, res); err != nil {
  58795. return nil, err
  58796. }
  58797. return ret, nil
  58798. // {
  58799. // "description": "Sets the labels on the target regional disk.",
  58800. // "httpMethod": "POST",
  58801. // "id": "compute.regionDisks.setLabels",
  58802. // "parameterOrder": [
  58803. // "project",
  58804. // "region",
  58805. // "resource"
  58806. // ],
  58807. // "parameters": {
  58808. // "project": {
  58809. // "description": "Project ID for this request.",
  58810. // "location": "path",
  58811. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58812. // "required": true,
  58813. // "type": "string"
  58814. // },
  58815. // "region": {
  58816. // "description": "The region for this request.",
  58817. // "location": "path",
  58818. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58819. // "required": true,
  58820. // "type": "string"
  58821. // },
  58822. // "requestId": {
  58823. // "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).",
  58824. // "location": "query",
  58825. // "type": "string"
  58826. // },
  58827. // "resource": {
  58828. // "description": "Name of the resource for this request.",
  58829. // "location": "path",
  58830. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58831. // "required": true,
  58832. // "type": "string"
  58833. // }
  58834. // },
  58835. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  58836. // "request": {
  58837. // "$ref": "RegionSetLabelsRequest"
  58838. // },
  58839. // "response": {
  58840. // "$ref": "Operation"
  58841. // },
  58842. // "scopes": [
  58843. // "https://www.googleapis.com/auth/cloud-platform",
  58844. // "https://www.googleapis.com/auth/compute"
  58845. // ]
  58846. // }
  58847. }
  58848. // method id "compute.regionDisks.testIamPermissions":
  58849. type RegionDisksTestIamPermissionsCall struct {
  58850. s *Service
  58851. project string
  58852. region string
  58853. resource string
  58854. testpermissionsrequest *TestPermissionsRequest
  58855. urlParams_ gensupport.URLParams
  58856. ctx_ context.Context
  58857. header_ http.Header
  58858. }
  58859. // TestIamPermissions: Returns permissions that a caller has on the
  58860. // specified resource.
  58861. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  58862. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58863. c.project = project
  58864. c.region = region
  58865. c.resource = resource
  58866. c.testpermissionsrequest = testpermissionsrequest
  58867. return c
  58868. }
  58869. // Fields allows partial responses to be retrieved. See
  58870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58871. // for more information.
  58872. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  58873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58874. return c
  58875. }
  58876. // Context sets the context to be used in this call's Do method. Any
  58877. // pending HTTP request will be aborted if the provided context is
  58878. // canceled.
  58879. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  58880. c.ctx_ = ctx
  58881. return c
  58882. }
  58883. // Header returns an http.Header that can be modified by the caller to
  58884. // add HTTP headers to the request.
  58885. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  58886. if c.header_ == nil {
  58887. c.header_ = make(http.Header)
  58888. }
  58889. return c.header_
  58890. }
  58891. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  58892. reqHeaders := make(http.Header)
  58893. for k, v := range c.header_ {
  58894. reqHeaders[k] = v
  58895. }
  58896. reqHeaders.Set("User-Agent", c.s.userAgent())
  58897. var body io.Reader = nil
  58898. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  58899. if err != nil {
  58900. return nil, err
  58901. }
  58902. reqHeaders.Set("Content-Type", "application/json")
  58903. c.urlParams_.Set("alt", alt)
  58904. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  58905. urls += "?" + c.urlParams_.Encode()
  58906. req, _ := http.NewRequest("POST", urls, body)
  58907. req.Header = reqHeaders
  58908. googleapi.Expand(req.URL, map[string]string{
  58909. "project": c.project,
  58910. "region": c.region,
  58911. "resource": c.resource,
  58912. })
  58913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58914. }
  58915. // Do executes the "compute.regionDisks.testIamPermissions" call.
  58916. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  58917. // non-2xx status code is an error. Response headers are in either
  58918. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  58919. // returned at all) in error.(*googleapi.Error).Header. Use
  58920. // googleapi.IsNotModified to check whether the returned error was
  58921. // because http.StatusNotModified was returned.
  58922. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  58923. gensupport.SetOptions(c.urlParams_, opts...)
  58924. res, err := c.doRequest("json")
  58925. if res != nil && res.StatusCode == http.StatusNotModified {
  58926. if res.Body != nil {
  58927. res.Body.Close()
  58928. }
  58929. return nil, &googleapi.Error{
  58930. Code: res.StatusCode,
  58931. Header: res.Header,
  58932. }
  58933. }
  58934. if err != nil {
  58935. return nil, err
  58936. }
  58937. defer googleapi.CloseBody(res)
  58938. if err := googleapi.CheckResponse(res); err != nil {
  58939. return nil, err
  58940. }
  58941. ret := &TestPermissionsResponse{
  58942. ServerResponse: googleapi.ServerResponse{
  58943. Header: res.Header,
  58944. HTTPStatusCode: res.StatusCode,
  58945. },
  58946. }
  58947. target := &ret
  58948. if err := gensupport.DecodeResponse(target, res); err != nil {
  58949. return nil, err
  58950. }
  58951. return ret, nil
  58952. // {
  58953. // "description": "Returns permissions that a caller has on the specified resource.",
  58954. // "httpMethod": "POST",
  58955. // "id": "compute.regionDisks.testIamPermissions",
  58956. // "parameterOrder": [
  58957. // "project",
  58958. // "region",
  58959. // "resource"
  58960. // ],
  58961. // "parameters": {
  58962. // "project": {
  58963. // "description": "Project ID for this request.",
  58964. // "location": "path",
  58965. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58966. // "required": true,
  58967. // "type": "string"
  58968. // },
  58969. // "region": {
  58970. // "description": "The name of the region for this request.",
  58971. // "location": "path",
  58972. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58973. // "required": true,
  58974. // "type": "string"
  58975. // },
  58976. // "resource": {
  58977. // "description": "Name of the resource for this request.",
  58978. // "location": "path",
  58979. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58980. // "required": true,
  58981. // "type": "string"
  58982. // }
  58983. // },
  58984. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  58985. // "request": {
  58986. // "$ref": "TestPermissionsRequest"
  58987. // },
  58988. // "response": {
  58989. // "$ref": "TestPermissionsResponse"
  58990. // },
  58991. // "scopes": [
  58992. // "https://www.googleapis.com/auth/cloud-platform",
  58993. // "https://www.googleapis.com/auth/compute",
  58994. // "https://www.googleapis.com/auth/compute.readonly"
  58995. // ]
  58996. // }
  58997. }
  58998. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  58999. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  59000. s *Service
  59001. project string
  59002. region string
  59003. instanceGroupManager string
  59004. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  59005. urlParams_ gensupport.URLParams
  59006. ctx_ context.Context
  59007. header_ http.Header
  59008. }
  59009. // AbandonInstances: Schedules a group action to remove the specified
  59010. // instances from the managed instance group. Abandoning an instance
  59011. // does not delete the instance, but it does remove the instance from
  59012. // any target pools that are applied by the managed instance group. This
  59013. // method reduces the targetSize of the managed instance group by the
  59014. // number of instances that you abandon. This operation is marked as
  59015. // DONE when the action is scheduled even if the instances have not yet
  59016. // been removed from the group. You must separately verify the status of
  59017. // the abandoning action with the listmanagedinstances method.
  59018. //
  59019. // If the group is part of a backend service that has enabled connection
  59020. // draining, it can take up to 60 seconds after the connection draining
  59021. // duration has elapsed before the VM instance is removed or
  59022. // deleted.
  59023. //
  59024. // You can specify a maximum of 1000 instances with this method per
  59025. // request.
  59026. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  59027. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59028. c.project = project
  59029. c.region = region
  59030. c.instanceGroupManager = instanceGroupManager
  59031. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  59032. return c
  59033. }
  59034. // RequestId sets the optional parameter "requestId": An optional
  59035. // request ID to identify requests. Specify a unique request ID so that
  59036. // if you must retry your request, the server will know to ignore the
  59037. // request if it has already been completed.
  59038. //
  59039. // For example, consider a situation where you make an initial request
  59040. // and the request times out. If you make the request again with the
  59041. // same request ID, the server can check if original operation with the
  59042. // same request ID was received, and if so, will ignore the second
  59043. // request. This prevents clients from accidentally creating duplicate
  59044. // commitments.
  59045. //
  59046. // The request ID must be a valid UUID with the exception that zero UUID
  59047. // is not supported (00000000-0000-0000-0000-000000000000).
  59048. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  59049. c.urlParams_.Set("requestId", requestId)
  59050. return c
  59051. }
  59052. // Fields allows partial responses to be retrieved. See
  59053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59054. // for more information.
  59055. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  59056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59057. return c
  59058. }
  59059. // Context sets the context to be used in this call's Do method. Any
  59060. // pending HTTP request will be aborted if the provided context is
  59061. // canceled.
  59062. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  59063. c.ctx_ = ctx
  59064. return c
  59065. }
  59066. // Header returns an http.Header that can be modified by the caller to
  59067. // add HTTP headers to the request.
  59068. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  59069. if c.header_ == nil {
  59070. c.header_ = make(http.Header)
  59071. }
  59072. return c.header_
  59073. }
  59074. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  59075. reqHeaders := make(http.Header)
  59076. for k, v := range c.header_ {
  59077. reqHeaders[k] = v
  59078. }
  59079. reqHeaders.Set("User-Agent", c.s.userAgent())
  59080. var body io.Reader = nil
  59081. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  59082. if err != nil {
  59083. return nil, err
  59084. }
  59085. reqHeaders.Set("Content-Type", "application/json")
  59086. c.urlParams_.Set("alt", alt)
  59087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  59088. urls += "?" + c.urlParams_.Encode()
  59089. req, _ := http.NewRequest("POST", urls, body)
  59090. req.Header = reqHeaders
  59091. googleapi.Expand(req.URL, map[string]string{
  59092. "project": c.project,
  59093. "region": c.region,
  59094. "instanceGroupManager": c.instanceGroupManager,
  59095. })
  59096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59097. }
  59098. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  59099. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59100. // status code is an error. Response headers are in either
  59101. // *Operation.ServerResponse.Header or (if a response was returned at
  59102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59103. // to check whether the returned error was because
  59104. // http.StatusNotModified was returned.
  59105. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59106. gensupport.SetOptions(c.urlParams_, opts...)
  59107. res, err := c.doRequest("json")
  59108. if res != nil && res.StatusCode == http.StatusNotModified {
  59109. if res.Body != nil {
  59110. res.Body.Close()
  59111. }
  59112. return nil, &googleapi.Error{
  59113. Code: res.StatusCode,
  59114. Header: res.Header,
  59115. }
  59116. }
  59117. if err != nil {
  59118. return nil, err
  59119. }
  59120. defer googleapi.CloseBody(res)
  59121. if err := googleapi.CheckResponse(res); err != nil {
  59122. return nil, err
  59123. }
  59124. ret := &Operation{
  59125. ServerResponse: googleapi.ServerResponse{
  59126. Header: res.Header,
  59127. HTTPStatusCode: res.StatusCode,
  59128. },
  59129. }
  59130. target := &ret
  59131. if err := gensupport.DecodeResponse(target, res); err != nil {
  59132. return nil, err
  59133. }
  59134. return ret, nil
  59135. // {
  59136. // "description": "Schedules a group action to remove the specified instances 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.",
  59137. // "httpMethod": "POST",
  59138. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  59139. // "parameterOrder": [
  59140. // "project",
  59141. // "region",
  59142. // "instanceGroupManager"
  59143. // ],
  59144. // "parameters": {
  59145. // "instanceGroupManager": {
  59146. // "description": "Name of the managed instance group.",
  59147. // "location": "path",
  59148. // "required": true,
  59149. // "type": "string"
  59150. // },
  59151. // "project": {
  59152. // "description": "Project ID for this request.",
  59153. // "location": "path",
  59154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59155. // "required": true,
  59156. // "type": "string"
  59157. // },
  59158. // "region": {
  59159. // "description": "Name of the region scoping this request.",
  59160. // "location": "path",
  59161. // "required": true,
  59162. // "type": "string"
  59163. // },
  59164. // "requestId": {
  59165. // "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).",
  59166. // "location": "query",
  59167. // "type": "string"
  59168. // }
  59169. // },
  59170. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  59171. // "request": {
  59172. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  59173. // },
  59174. // "response": {
  59175. // "$ref": "Operation"
  59176. // },
  59177. // "scopes": [
  59178. // "https://www.googleapis.com/auth/cloud-platform",
  59179. // "https://www.googleapis.com/auth/compute"
  59180. // ]
  59181. // }
  59182. }
  59183. // method id "compute.regionInstanceGroupManagers.delete":
  59184. type RegionInstanceGroupManagersDeleteCall struct {
  59185. s *Service
  59186. project string
  59187. region string
  59188. instanceGroupManager string
  59189. urlParams_ gensupport.URLParams
  59190. ctx_ context.Context
  59191. header_ http.Header
  59192. }
  59193. // Delete: Deletes the specified managed instance group and all of the
  59194. // instances in that group.
  59195. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  59196. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59197. c.project = project
  59198. c.region = region
  59199. c.instanceGroupManager = instanceGroupManager
  59200. return c
  59201. }
  59202. // RequestId sets the optional parameter "requestId": An optional
  59203. // request ID to identify requests. Specify a unique request ID so that
  59204. // if you must retry your request, the server will know to ignore the
  59205. // request if it has already been completed.
  59206. //
  59207. // For example, consider a situation where you make an initial request
  59208. // and the request times out. If you make the request again with the
  59209. // same request ID, the server can check if original operation with the
  59210. // same request ID was received, and if so, will ignore the second
  59211. // request. This prevents clients from accidentally creating duplicate
  59212. // commitments.
  59213. //
  59214. // The request ID must be a valid UUID with the exception that zero UUID
  59215. // is not supported (00000000-0000-0000-0000-000000000000).
  59216. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  59217. c.urlParams_.Set("requestId", requestId)
  59218. return c
  59219. }
  59220. // Fields allows partial responses to be retrieved. See
  59221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59222. // for more information.
  59223. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  59224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59225. return c
  59226. }
  59227. // Context sets the context to be used in this call's Do method. Any
  59228. // pending HTTP request will be aborted if the provided context is
  59229. // canceled.
  59230. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  59231. c.ctx_ = ctx
  59232. return c
  59233. }
  59234. // Header returns an http.Header that can be modified by the caller to
  59235. // add HTTP headers to the request.
  59236. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  59237. if c.header_ == nil {
  59238. c.header_ = make(http.Header)
  59239. }
  59240. return c.header_
  59241. }
  59242. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  59243. reqHeaders := make(http.Header)
  59244. for k, v := range c.header_ {
  59245. reqHeaders[k] = v
  59246. }
  59247. reqHeaders.Set("User-Agent", c.s.userAgent())
  59248. var body io.Reader = nil
  59249. c.urlParams_.Set("alt", alt)
  59250. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  59251. urls += "?" + c.urlParams_.Encode()
  59252. req, _ := http.NewRequest("DELETE", urls, body)
  59253. req.Header = reqHeaders
  59254. googleapi.Expand(req.URL, map[string]string{
  59255. "project": c.project,
  59256. "region": c.region,
  59257. "instanceGroupManager": c.instanceGroupManager,
  59258. })
  59259. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59260. }
  59261. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  59262. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59263. // status code is an error. Response headers are in either
  59264. // *Operation.ServerResponse.Header or (if a response was returned at
  59265. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59266. // to check whether the returned error was because
  59267. // http.StatusNotModified was returned.
  59268. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59269. gensupport.SetOptions(c.urlParams_, opts...)
  59270. res, err := c.doRequest("json")
  59271. if res != nil && res.StatusCode == http.StatusNotModified {
  59272. if res.Body != nil {
  59273. res.Body.Close()
  59274. }
  59275. return nil, &googleapi.Error{
  59276. Code: res.StatusCode,
  59277. Header: res.Header,
  59278. }
  59279. }
  59280. if err != nil {
  59281. return nil, err
  59282. }
  59283. defer googleapi.CloseBody(res)
  59284. if err := googleapi.CheckResponse(res); err != nil {
  59285. return nil, err
  59286. }
  59287. ret := &Operation{
  59288. ServerResponse: googleapi.ServerResponse{
  59289. Header: res.Header,
  59290. HTTPStatusCode: res.StatusCode,
  59291. },
  59292. }
  59293. target := &ret
  59294. if err := gensupport.DecodeResponse(target, res); err != nil {
  59295. return nil, err
  59296. }
  59297. return ret, nil
  59298. // {
  59299. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  59300. // "httpMethod": "DELETE",
  59301. // "id": "compute.regionInstanceGroupManagers.delete",
  59302. // "parameterOrder": [
  59303. // "project",
  59304. // "region",
  59305. // "instanceGroupManager"
  59306. // ],
  59307. // "parameters": {
  59308. // "instanceGroupManager": {
  59309. // "description": "Name of the managed instance group to delete.",
  59310. // "location": "path",
  59311. // "required": true,
  59312. // "type": "string"
  59313. // },
  59314. // "project": {
  59315. // "description": "Project ID for this request.",
  59316. // "location": "path",
  59317. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59318. // "required": true,
  59319. // "type": "string"
  59320. // },
  59321. // "region": {
  59322. // "description": "Name of the region scoping this request.",
  59323. // "location": "path",
  59324. // "required": true,
  59325. // "type": "string"
  59326. // },
  59327. // "requestId": {
  59328. // "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).",
  59329. // "location": "query",
  59330. // "type": "string"
  59331. // }
  59332. // },
  59333. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  59334. // "response": {
  59335. // "$ref": "Operation"
  59336. // },
  59337. // "scopes": [
  59338. // "https://www.googleapis.com/auth/cloud-platform",
  59339. // "https://www.googleapis.com/auth/compute"
  59340. // ]
  59341. // }
  59342. }
  59343. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  59344. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  59345. s *Service
  59346. project string
  59347. region string
  59348. instanceGroupManager string
  59349. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  59350. urlParams_ gensupport.URLParams
  59351. ctx_ context.Context
  59352. header_ http.Header
  59353. }
  59354. // DeleteInstances: Schedules a group action to delete the specified
  59355. // instances in the managed instance group. The instances are also
  59356. // removed from any target pools of which they were a member. This
  59357. // method reduces the targetSize of the managed instance group by the
  59358. // number of instances that you delete. This operation is marked as DONE
  59359. // when the action is scheduled even if the instances are still being
  59360. // deleted. You must separately verify the status of the deleting action
  59361. // with the listmanagedinstances method.
  59362. //
  59363. // If the group is part of a backend service that has enabled connection
  59364. // draining, it can take up to 60 seconds after the connection draining
  59365. // duration has elapsed before the VM instance is removed or
  59366. // deleted.
  59367. //
  59368. // You can specify a maximum of 1000 instances with this method per
  59369. // request.
  59370. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  59371. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59372. c.project = project
  59373. c.region = region
  59374. c.instanceGroupManager = instanceGroupManager
  59375. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  59376. return c
  59377. }
  59378. // RequestId sets the optional parameter "requestId": An optional
  59379. // request ID to identify requests. Specify a unique request ID so that
  59380. // if you must retry your request, the server will know to ignore the
  59381. // request if it has already been completed.
  59382. //
  59383. // For example, consider a situation where you make an initial request
  59384. // and the request times out. If you make the request again with the
  59385. // same request ID, the server can check if original operation with the
  59386. // same request ID was received, and if so, will ignore the second
  59387. // request. This prevents clients from accidentally creating duplicate
  59388. // commitments.
  59389. //
  59390. // The request ID must be a valid UUID with the exception that zero UUID
  59391. // is not supported (00000000-0000-0000-0000-000000000000).
  59392. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  59393. c.urlParams_.Set("requestId", requestId)
  59394. return c
  59395. }
  59396. // Fields allows partial responses to be retrieved. See
  59397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59398. // for more information.
  59399. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  59400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59401. return c
  59402. }
  59403. // Context sets the context to be used in this call's Do method. Any
  59404. // pending HTTP request will be aborted if the provided context is
  59405. // canceled.
  59406. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  59407. c.ctx_ = ctx
  59408. return c
  59409. }
  59410. // Header returns an http.Header that can be modified by the caller to
  59411. // add HTTP headers to the request.
  59412. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  59413. if c.header_ == nil {
  59414. c.header_ = make(http.Header)
  59415. }
  59416. return c.header_
  59417. }
  59418. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  59419. reqHeaders := make(http.Header)
  59420. for k, v := range c.header_ {
  59421. reqHeaders[k] = v
  59422. }
  59423. reqHeaders.Set("User-Agent", c.s.userAgent())
  59424. var body io.Reader = nil
  59425. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  59426. if err != nil {
  59427. return nil, err
  59428. }
  59429. reqHeaders.Set("Content-Type", "application/json")
  59430. c.urlParams_.Set("alt", alt)
  59431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  59432. urls += "?" + c.urlParams_.Encode()
  59433. req, _ := http.NewRequest("POST", urls, body)
  59434. req.Header = reqHeaders
  59435. googleapi.Expand(req.URL, map[string]string{
  59436. "project": c.project,
  59437. "region": c.region,
  59438. "instanceGroupManager": c.instanceGroupManager,
  59439. })
  59440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59441. }
  59442. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  59443. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59444. // status code is an error. Response headers are in either
  59445. // *Operation.ServerResponse.Header or (if a response was returned at
  59446. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59447. // to check whether the returned error was because
  59448. // http.StatusNotModified was returned.
  59449. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59450. gensupport.SetOptions(c.urlParams_, opts...)
  59451. res, err := c.doRequest("json")
  59452. if res != nil && res.StatusCode == http.StatusNotModified {
  59453. if res.Body != nil {
  59454. res.Body.Close()
  59455. }
  59456. return nil, &googleapi.Error{
  59457. Code: res.StatusCode,
  59458. Header: res.Header,
  59459. }
  59460. }
  59461. if err != nil {
  59462. return nil, err
  59463. }
  59464. defer googleapi.CloseBody(res)
  59465. if err := googleapi.CheckResponse(res); err != nil {
  59466. return nil, err
  59467. }
  59468. ret := &Operation{
  59469. ServerResponse: googleapi.ServerResponse{
  59470. Header: res.Header,
  59471. HTTPStatusCode: res.StatusCode,
  59472. },
  59473. }
  59474. target := &ret
  59475. if err := gensupport.DecodeResponse(target, res); err != nil {
  59476. return nil, err
  59477. }
  59478. return ret, nil
  59479. // {
  59480. // "description": "Schedules a group action to delete the specified instances in the managed instance group. 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.",
  59481. // "httpMethod": "POST",
  59482. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  59483. // "parameterOrder": [
  59484. // "project",
  59485. // "region",
  59486. // "instanceGroupManager"
  59487. // ],
  59488. // "parameters": {
  59489. // "instanceGroupManager": {
  59490. // "description": "Name of the managed instance group.",
  59491. // "location": "path",
  59492. // "required": true,
  59493. // "type": "string"
  59494. // },
  59495. // "project": {
  59496. // "description": "Project ID for this request.",
  59497. // "location": "path",
  59498. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59499. // "required": true,
  59500. // "type": "string"
  59501. // },
  59502. // "region": {
  59503. // "description": "Name of the region scoping this request.",
  59504. // "location": "path",
  59505. // "required": true,
  59506. // "type": "string"
  59507. // },
  59508. // "requestId": {
  59509. // "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).",
  59510. // "location": "query",
  59511. // "type": "string"
  59512. // }
  59513. // },
  59514. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  59515. // "request": {
  59516. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  59517. // },
  59518. // "response": {
  59519. // "$ref": "Operation"
  59520. // },
  59521. // "scopes": [
  59522. // "https://www.googleapis.com/auth/cloud-platform",
  59523. // "https://www.googleapis.com/auth/compute"
  59524. // ]
  59525. // }
  59526. }
  59527. // method id "compute.regionInstanceGroupManagers.get":
  59528. type RegionInstanceGroupManagersGetCall struct {
  59529. s *Service
  59530. project string
  59531. region string
  59532. instanceGroupManager string
  59533. urlParams_ gensupport.URLParams
  59534. ifNoneMatch_ string
  59535. ctx_ context.Context
  59536. header_ http.Header
  59537. }
  59538. // Get: Returns all of the details about the specified managed instance
  59539. // group.
  59540. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  59541. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59542. c.project = project
  59543. c.region = region
  59544. c.instanceGroupManager = instanceGroupManager
  59545. return c
  59546. }
  59547. // Fields allows partial responses to be retrieved. See
  59548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59549. // for more information.
  59550. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  59551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59552. return c
  59553. }
  59554. // IfNoneMatch sets the optional parameter which makes the operation
  59555. // fail if the object's ETag matches the given value. This is useful for
  59556. // getting updates only after the object has changed since the last
  59557. // request. Use googleapi.IsNotModified to check whether the response
  59558. // error from Do is the result of In-None-Match.
  59559. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  59560. c.ifNoneMatch_ = entityTag
  59561. return c
  59562. }
  59563. // Context sets the context to be used in this call's Do method. Any
  59564. // pending HTTP request will be aborted if the provided context is
  59565. // canceled.
  59566. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  59567. c.ctx_ = ctx
  59568. return c
  59569. }
  59570. // Header returns an http.Header that can be modified by the caller to
  59571. // add HTTP headers to the request.
  59572. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  59573. if c.header_ == nil {
  59574. c.header_ = make(http.Header)
  59575. }
  59576. return c.header_
  59577. }
  59578. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  59579. reqHeaders := make(http.Header)
  59580. for k, v := range c.header_ {
  59581. reqHeaders[k] = v
  59582. }
  59583. reqHeaders.Set("User-Agent", c.s.userAgent())
  59584. if c.ifNoneMatch_ != "" {
  59585. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59586. }
  59587. var body io.Reader = nil
  59588. c.urlParams_.Set("alt", alt)
  59589. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  59590. urls += "?" + c.urlParams_.Encode()
  59591. req, _ := http.NewRequest("GET", urls, body)
  59592. req.Header = reqHeaders
  59593. googleapi.Expand(req.URL, map[string]string{
  59594. "project": c.project,
  59595. "region": c.region,
  59596. "instanceGroupManager": c.instanceGroupManager,
  59597. })
  59598. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59599. }
  59600. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  59601. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  59602. // non-2xx status code is an error. Response headers are in either
  59603. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  59604. // returned at all) in error.(*googleapi.Error).Header. Use
  59605. // googleapi.IsNotModified to check whether the returned error was
  59606. // because http.StatusNotModified was returned.
  59607. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  59608. gensupport.SetOptions(c.urlParams_, opts...)
  59609. res, err := c.doRequest("json")
  59610. if res != nil && res.StatusCode == http.StatusNotModified {
  59611. if res.Body != nil {
  59612. res.Body.Close()
  59613. }
  59614. return nil, &googleapi.Error{
  59615. Code: res.StatusCode,
  59616. Header: res.Header,
  59617. }
  59618. }
  59619. if err != nil {
  59620. return nil, err
  59621. }
  59622. defer googleapi.CloseBody(res)
  59623. if err := googleapi.CheckResponse(res); err != nil {
  59624. return nil, err
  59625. }
  59626. ret := &InstanceGroupManager{
  59627. ServerResponse: googleapi.ServerResponse{
  59628. Header: res.Header,
  59629. HTTPStatusCode: res.StatusCode,
  59630. },
  59631. }
  59632. target := &ret
  59633. if err := gensupport.DecodeResponse(target, res); err != nil {
  59634. return nil, err
  59635. }
  59636. return ret, nil
  59637. // {
  59638. // "description": "Returns all of the details about the specified managed instance group.",
  59639. // "httpMethod": "GET",
  59640. // "id": "compute.regionInstanceGroupManagers.get",
  59641. // "parameterOrder": [
  59642. // "project",
  59643. // "region",
  59644. // "instanceGroupManager"
  59645. // ],
  59646. // "parameters": {
  59647. // "instanceGroupManager": {
  59648. // "description": "Name of the managed instance group to return.",
  59649. // "location": "path",
  59650. // "required": true,
  59651. // "type": "string"
  59652. // },
  59653. // "project": {
  59654. // "description": "Project ID for this request.",
  59655. // "location": "path",
  59656. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59657. // "required": true,
  59658. // "type": "string"
  59659. // },
  59660. // "region": {
  59661. // "description": "Name of the region scoping this request.",
  59662. // "location": "path",
  59663. // "required": true,
  59664. // "type": "string"
  59665. // }
  59666. // },
  59667. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  59668. // "response": {
  59669. // "$ref": "InstanceGroupManager"
  59670. // },
  59671. // "scopes": [
  59672. // "https://www.googleapis.com/auth/cloud-platform",
  59673. // "https://www.googleapis.com/auth/compute",
  59674. // "https://www.googleapis.com/auth/compute.readonly"
  59675. // ]
  59676. // }
  59677. }
  59678. // method id "compute.regionInstanceGroupManagers.insert":
  59679. type RegionInstanceGroupManagersInsertCall struct {
  59680. s *Service
  59681. project string
  59682. region string
  59683. instancegroupmanager *InstanceGroupManager
  59684. urlParams_ gensupport.URLParams
  59685. ctx_ context.Context
  59686. header_ http.Header
  59687. }
  59688. // Insert: Creates a managed instance group using the information that
  59689. // you specify in the request. After the group is created, it schedules
  59690. // an action to create instances in the group using the specified
  59691. // instance template. This operation is marked as DONE when the group is
  59692. // created even if the instances in the group have not yet been created.
  59693. // You must separately verify the status of the individual instances
  59694. // with the listmanagedinstances method.
  59695. //
  59696. // A regional managed instance group can contain up to 2000 instances.
  59697. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  59698. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59699. c.project = project
  59700. c.region = region
  59701. c.instancegroupmanager = instancegroupmanager
  59702. return c
  59703. }
  59704. // RequestId sets the optional parameter "requestId": An optional
  59705. // request ID to identify requests. Specify a unique request ID so that
  59706. // if you must retry your request, the server will know to ignore the
  59707. // request if it has already been completed.
  59708. //
  59709. // For example, consider a situation where you make an initial request
  59710. // and the request times out. If you make the request again with the
  59711. // same request ID, the server can check if original operation with the
  59712. // same request ID was received, and if so, will ignore the second
  59713. // request. This prevents clients from accidentally creating duplicate
  59714. // commitments.
  59715. //
  59716. // The request ID must be a valid UUID with the exception that zero UUID
  59717. // is not supported (00000000-0000-0000-0000-000000000000).
  59718. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  59719. c.urlParams_.Set("requestId", requestId)
  59720. return c
  59721. }
  59722. // Fields allows partial responses to be retrieved. See
  59723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59724. // for more information.
  59725. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  59726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59727. return c
  59728. }
  59729. // Context sets the context to be used in this call's Do method. Any
  59730. // pending HTTP request will be aborted if the provided context is
  59731. // canceled.
  59732. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  59733. c.ctx_ = ctx
  59734. return c
  59735. }
  59736. // Header returns an http.Header that can be modified by the caller to
  59737. // add HTTP headers to the request.
  59738. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  59739. if c.header_ == nil {
  59740. c.header_ = make(http.Header)
  59741. }
  59742. return c.header_
  59743. }
  59744. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  59745. reqHeaders := make(http.Header)
  59746. for k, v := range c.header_ {
  59747. reqHeaders[k] = v
  59748. }
  59749. reqHeaders.Set("User-Agent", c.s.userAgent())
  59750. var body io.Reader = nil
  59751. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  59752. if err != nil {
  59753. return nil, err
  59754. }
  59755. reqHeaders.Set("Content-Type", "application/json")
  59756. c.urlParams_.Set("alt", alt)
  59757. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  59758. urls += "?" + c.urlParams_.Encode()
  59759. req, _ := http.NewRequest("POST", urls, body)
  59760. req.Header = reqHeaders
  59761. googleapi.Expand(req.URL, map[string]string{
  59762. "project": c.project,
  59763. "region": c.region,
  59764. })
  59765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59766. }
  59767. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  59768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59769. // status code is an error. Response headers are in either
  59770. // *Operation.ServerResponse.Header or (if a response was returned at
  59771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59772. // to check whether the returned error was because
  59773. // http.StatusNotModified was returned.
  59774. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59775. gensupport.SetOptions(c.urlParams_, opts...)
  59776. res, err := c.doRequest("json")
  59777. if res != nil && res.StatusCode == http.StatusNotModified {
  59778. if res.Body != nil {
  59779. res.Body.Close()
  59780. }
  59781. return nil, &googleapi.Error{
  59782. Code: res.StatusCode,
  59783. Header: res.Header,
  59784. }
  59785. }
  59786. if err != nil {
  59787. return nil, err
  59788. }
  59789. defer googleapi.CloseBody(res)
  59790. if err := googleapi.CheckResponse(res); err != nil {
  59791. return nil, err
  59792. }
  59793. ret := &Operation{
  59794. ServerResponse: googleapi.ServerResponse{
  59795. Header: res.Header,
  59796. HTTPStatusCode: res.StatusCode,
  59797. },
  59798. }
  59799. target := &ret
  59800. if err := gensupport.DecodeResponse(target, res); err != nil {
  59801. return nil, err
  59802. }
  59803. return ret, nil
  59804. // {
  59805. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.",
  59806. // "httpMethod": "POST",
  59807. // "id": "compute.regionInstanceGroupManagers.insert",
  59808. // "parameterOrder": [
  59809. // "project",
  59810. // "region"
  59811. // ],
  59812. // "parameters": {
  59813. // "project": {
  59814. // "description": "Project ID for this request.",
  59815. // "location": "path",
  59816. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59817. // "required": true,
  59818. // "type": "string"
  59819. // },
  59820. // "region": {
  59821. // "description": "Name of the region scoping this request.",
  59822. // "location": "path",
  59823. // "required": true,
  59824. // "type": "string"
  59825. // },
  59826. // "requestId": {
  59827. // "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).",
  59828. // "location": "query",
  59829. // "type": "string"
  59830. // }
  59831. // },
  59832. // "path": "{project}/regions/{region}/instanceGroupManagers",
  59833. // "request": {
  59834. // "$ref": "InstanceGroupManager"
  59835. // },
  59836. // "response": {
  59837. // "$ref": "Operation"
  59838. // },
  59839. // "scopes": [
  59840. // "https://www.googleapis.com/auth/cloud-platform",
  59841. // "https://www.googleapis.com/auth/compute"
  59842. // ]
  59843. // }
  59844. }
  59845. // method id "compute.regionInstanceGroupManagers.list":
  59846. type RegionInstanceGroupManagersListCall struct {
  59847. s *Service
  59848. project string
  59849. region string
  59850. urlParams_ gensupport.URLParams
  59851. ifNoneMatch_ string
  59852. ctx_ context.Context
  59853. header_ http.Header
  59854. }
  59855. // List: Retrieves the list of managed instance groups that are
  59856. // contained within the specified region.
  59857. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  59858. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59859. c.project = project
  59860. c.region = region
  59861. return c
  59862. }
  59863. // Filter sets the optional parameter "filter": A filter expression that
  59864. // filters resources listed in the response. The expression must specify
  59865. // the field name, a comparison operator, and the value that you want to
  59866. // use for filtering. The value must be a string, a number, or a
  59867. // boolean. The comparison operator must be either =, !=, >, or <.
  59868. //
  59869. // For example, if you are filtering Compute Engine instances, you can
  59870. // exclude instances named example-instance by specifying name !=
  59871. // example-instance.
  59872. //
  59873. // You can also filter nested fields. For example, you could specify
  59874. // scheduling.automaticRestart = false to include instances only if they
  59875. // are not scheduled for automatic restarts. You can use filtering on
  59876. // nested fields to filter based on resource labels.
  59877. //
  59878. // To filter on multiple expressions, provide each separate expression
  59879. // within parentheses. For example, (scheduling.automaticRestart = true)
  59880. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59881. // AND expression. However, you can include AND and OR expressions
  59882. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59883. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59884. // true).
  59885. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  59886. c.urlParams_.Set("filter", filter)
  59887. return c
  59888. }
  59889. // MaxResults sets the optional parameter "maxResults": The maximum
  59890. // number of results per page that should be returned. If the number of
  59891. // available results is larger than maxResults, Compute Engine returns a
  59892. // nextPageToken that can be used to get the next page of results in
  59893. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59894. // (Default: 500)
  59895. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  59896. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59897. return c
  59898. }
  59899. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59900. // a certain order. By default, results are returned in alphanumerical
  59901. // order based on the resource name.
  59902. //
  59903. // You can also sort results in descending order based on the creation
  59904. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59905. // based on the creationTimestamp field in reverse chronological order
  59906. // (newest result first). Use this to sort resources like operations so
  59907. // that the newest operation is returned first.
  59908. //
  59909. // Currently, only sorting by name or creationTimestamp desc is
  59910. // supported.
  59911. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  59912. c.urlParams_.Set("orderBy", orderBy)
  59913. return c
  59914. }
  59915. // PageToken sets the optional parameter "pageToken": Specifies a page
  59916. // token to use. Set pageToken to the nextPageToken returned by a
  59917. // previous list request to get the next page of results.
  59918. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  59919. c.urlParams_.Set("pageToken", pageToken)
  59920. return c
  59921. }
  59922. // Fields allows partial responses to be retrieved. See
  59923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59924. // for more information.
  59925. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  59926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59927. return c
  59928. }
  59929. // IfNoneMatch sets the optional parameter which makes the operation
  59930. // fail if the object's ETag matches the given value. This is useful for
  59931. // getting updates only after the object has changed since the last
  59932. // request. Use googleapi.IsNotModified to check whether the response
  59933. // error from Do is the result of In-None-Match.
  59934. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  59935. c.ifNoneMatch_ = entityTag
  59936. return c
  59937. }
  59938. // Context sets the context to be used in this call's Do method. Any
  59939. // pending HTTP request will be aborted if the provided context is
  59940. // canceled.
  59941. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  59942. c.ctx_ = ctx
  59943. return c
  59944. }
  59945. // Header returns an http.Header that can be modified by the caller to
  59946. // add HTTP headers to the request.
  59947. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  59948. if c.header_ == nil {
  59949. c.header_ = make(http.Header)
  59950. }
  59951. return c.header_
  59952. }
  59953. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  59954. reqHeaders := make(http.Header)
  59955. for k, v := range c.header_ {
  59956. reqHeaders[k] = v
  59957. }
  59958. reqHeaders.Set("User-Agent", c.s.userAgent())
  59959. if c.ifNoneMatch_ != "" {
  59960. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59961. }
  59962. var body io.Reader = nil
  59963. c.urlParams_.Set("alt", alt)
  59964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  59965. urls += "?" + c.urlParams_.Encode()
  59966. req, _ := http.NewRequest("GET", urls, body)
  59967. req.Header = reqHeaders
  59968. googleapi.Expand(req.URL, map[string]string{
  59969. "project": c.project,
  59970. "region": c.region,
  59971. })
  59972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59973. }
  59974. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  59975. // Exactly one of *RegionInstanceGroupManagerList or error will be
  59976. // non-nil. Any non-2xx status code is an error. Response headers are in
  59977. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  59978. // response was returned at all) in error.(*googleapi.Error).Header. Use
  59979. // googleapi.IsNotModified to check whether the returned error was
  59980. // because http.StatusNotModified was returned.
  59981. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  59982. gensupport.SetOptions(c.urlParams_, opts...)
  59983. res, err := c.doRequest("json")
  59984. if res != nil && res.StatusCode == http.StatusNotModified {
  59985. if res.Body != nil {
  59986. res.Body.Close()
  59987. }
  59988. return nil, &googleapi.Error{
  59989. Code: res.StatusCode,
  59990. Header: res.Header,
  59991. }
  59992. }
  59993. if err != nil {
  59994. return nil, err
  59995. }
  59996. defer googleapi.CloseBody(res)
  59997. if err := googleapi.CheckResponse(res); err != nil {
  59998. return nil, err
  59999. }
  60000. ret := &RegionInstanceGroupManagerList{
  60001. ServerResponse: googleapi.ServerResponse{
  60002. Header: res.Header,
  60003. HTTPStatusCode: res.StatusCode,
  60004. },
  60005. }
  60006. target := &ret
  60007. if err := gensupport.DecodeResponse(target, res); err != nil {
  60008. return nil, err
  60009. }
  60010. return ret, nil
  60011. // {
  60012. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  60013. // "httpMethod": "GET",
  60014. // "id": "compute.regionInstanceGroupManagers.list",
  60015. // "parameterOrder": [
  60016. // "project",
  60017. // "region"
  60018. // ],
  60019. // "parameters": {
  60020. // "filter": {
  60021. // "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).",
  60022. // "location": "query",
  60023. // "type": "string"
  60024. // },
  60025. // "maxResults": {
  60026. // "default": "500",
  60027. // "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)",
  60028. // "format": "uint32",
  60029. // "location": "query",
  60030. // "minimum": "0",
  60031. // "type": "integer"
  60032. // },
  60033. // "orderBy": {
  60034. // "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.",
  60035. // "location": "query",
  60036. // "type": "string"
  60037. // },
  60038. // "pageToken": {
  60039. // "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.",
  60040. // "location": "query",
  60041. // "type": "string"
  60042. // },
  60043. // "project": {
  60044. // "description": "Project ID for this request.",
  60045. // "location": "path",
  60046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60047. // "required": true,
  60048. // "type": "string"
  60049. // },
  60050. // "region": {
  60051. // "description": "Name of the region scoping this request.",
  60052. // "location": "path",
  60053. // "required": true,
  60054. // "type": "string"
  60055. // }
  60056. // },
  60057. // "path": "{project}/regions/{region}/instanceGroupManagers",
  60058. // "response": {
  60059. // "$ref": "RegionInstanceGroupManagerList"
  60060. // },
  60061. // "scopes": [
  60062. // "https://www.googleapis.com/auth/cloud-platform",
  60063. // "https://www.googleapis.com/auth/compute",
  60064. // "https://www.googleapis.com/auth/compute.readonly"
  60065. // ]
  60066. // }
  60067. }
  60068. // Pages invokes f for each page of results.
  60069. // A non-nil error returned from f will halt the iteration.
  60070. // The provided context supersedes any context provided to the Context method.
  60071. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  60072. c.ctx_ = ctx
  60073. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60074. for {
  60075. x, err := c.Do()
  60076. if err != nil {
  60077. return err
  60078. }
  60079. if err := f(x); err != nil {
  60080. return err
  60081. }
  60082. if x.NextPageToken == "" {
  60083. return nil
  60084. }
  60085. c.PageToken(x.NextPageToken)
  60086. }
  60087. }
  60088. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  60089. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  60090. s *Service
  60091. project string
  60092. region string
  60093. instanceGroupManager string
  60094. urlParams_ gensupport.URLParams
  60095. ctx_ context.Context
  60096. header_ http.Header
  60097. }
  60098. // ListManagedInstances: Lists the instances in the managed instance
  60099. // group and instances that are scheduled to be created. The list
  60100. // includes any current actions that the group has scheduled for its
  60101. // instances.
  60102. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  60103. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60104. c.project = project
  60105. c.region = region
  60106. c.instanceGroupManager = instanceGroupManager
  60107. return c
  60108. }
  60109. // Filter sets the optional parameter "filter":
  60110. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  60111. c.urlParams_.Set("filter", filter)
  60112. return c
  60113. }
  60114. // MaxResults sets the optional parameter "maxResults":
  60115. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  60116. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60117. return c
  60118. }
  60119. // OrderBy sets the optional parameter "order_by":
  60120. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  60121. c.urlParams_.Set("order_by", orderBy)
  60122. return c
  60123. }
  60124. // PageToken sets the optional parameter "pageToken":
  60125. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  60126. c.urlParams_.Set("pageToken", pageToken)
  60127. return c
  60128. }
  60129. // Fields allows partial responses to be retrieved. See
  60130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60131. // for more information.
  60132. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  60133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60134. return c
  60135. }
  60136. // Context sets the context to be used in this call's Do method. Any
  60137. // pending HTTP request will be aborted if the provided context is
  60138. // canceled.
  60139. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  60140. c.ctx_ = ctx
  60141. return c
  60142. }
  60143. // Header returns an http.Header that can be modified by the caller to
  60144. // add HTTP headers to the request.
  60145. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  60146. if c.header_ == nil {
  60147. c.header_ = make(http.Header)
  60148. }
  60149. return c.header_
  60150. }
  60151. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  60152. reqHeaders := make(http.Header)
  60153. for k, v := range c.header_ {
  60154. reqHeaders[k] = v
  60155. }
  60156. reqHeaders.Set("User-Agent", c.s.userAgent())
  60157. var body io.Reader = nil
  60158. c.urlParams_.Set("alt", alt)
  60159. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  60160. urls += "?" + c.urlParams_.Encode()
  60161. req, _ := http.NewRequest("POST", urls, body)
  60162. req.Header = reqHeaders
  60163. googleapi.Expand(req.URL, map[string]string{
  60164. "project": c.project,
  60165. "region": c.region,
  60166. "instanceGroupManager": c.instanceGroupManager,
  60167. })
  60168. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60169. }
  60170. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  60171. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  60172. // error will be non-nil. Any non-2xx status code is an error. Response
  60173. // headers are in either
  60174. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  60175. // r or (if a response was returned at all) in
  60176. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  60177. // whether the returned error was because http.StatusNotModified was
  60178. // returned.
  60179. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  60180. gensupport.SetOptions(c.urlParams_, opts...)
  60181. res, err := c.doRequest("json")
  60182. if res != nil && res.StatusCode == http.StatusNotModified {
  60183. if res.Body != nil {
  60184. res.Body.Close()
  60185. }
  60186. return nil, &googleapi.Error{
  60187. Code: res.StatusCode,
  60188. Header: res.Header,
  60189. }
  60190. }
  60191. if err != nil {
  60192. return nil, err
  60193. }
  60194. defer googleapi.CloseBody(res)
  60195. if err := googleapi.CheckResponse(res); err != nil {
  60196. return nil, err
  60197. }
  60198. ret := &RegionInstanceGroupManagersListInstancesResponse{
  60199. ServerResponse: googleapi.ServerResponse{
  60200. Header: res.Header,
  60201. HTTPStatusCode: res.StatusCode,
  60202. },
  60203. }
  60204. target := &ret
  60205. if err := gensupport.DecodeResponse(target, res); err != nil {
  60206. return nil, err
  60207. }
  60208. return ret, nil
  60209. // {
  60210. // "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.",
  60211. // "httpMethod": "POST",
  60212. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  60213. // "parameterOrder": [
  60214. // "project",
  60215. // "region",
  60216. // "instanceGroupManager"
  60217. // ],
  60218. // "parameters": {
  60219. // "filter": {
  60220. // "location": "query",
  60221. // "type": "string"
  60222. // },
  60223. // "instanceGroupManager": {
  60224. // "description": "The name of the managed instance group.",
  60225. // "location": "path",
  60226. // "required": true,
  60227. // "type": "string"
  60228. // },
  60229. // "maxResults": {
  60230. // "default": "500",
  60231. // "format": "uint32",
  60232. // "location": "query",
  60233. // "minimum": "0",
  60234. // "type": "integer"
  60235. // },
  60236. // "order_by": {
  60237. // "location": "query",
  60238. // "type": "string"
  60239. // },
  60240. // "pageToken": {
  60241. // "location": "query",
  60242. // "type": "string"
  60243. // },
  60244. // "project": {
  60245. // "description": "Project ID for this request.",
  60246. // "location": "path",
  60247. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60248. // "required": true,
  60249. // "type": "string"
  60250. // },
  60251. // "region": {
  60252. // "description": "Name of the region scoping this request.",
  60253. // "location": "path",
  60254. // "required": true,
  60255. // "type": "string"
  60256. // }
  60257. // },
  60258. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  60259. // "response": {
  60260. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  60261. // },
  60262. // "scopes": [
  60263. // "https://www.googleapis.com/auth/cloud-platform",
  60264. // "https://www.googleapis.com/auth/compute",
  60265. // "https://www.googleapis.com/auth/compute.readonly"
  60266. // ]
  60267. // }
  60268. }
  60269. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  60270. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  60271. s *Service
  60272. project string
  60273. region string
  60274. instanceGroupManager string
  60275. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  60276. urlParams_ gensupport.URLParams
  60277. ctx_ context.Context
  60278. header_ http.Header
  60279. }
  60280. // RecreateInstances: Schedules a group action to recreate the specified
  60281. // instances in the managed instance group. The instances are deleted
  60282. // and recreated using the current instance template for the managed
  60283. // instance group. This operation is marked as DONE when the action is
  60284. // scheduled even if the instances have not yet been recreated. You must
  60285. // separately verify the status of the recreating action with the
  60286. // listmanagedinstances method.
  60287. //
  60288. // If the group is part of a backend service that has enabled connection
  60289. // draining, it can take up to 60 seconds after the connection draining
  60290. // duration has elapsed before the VM instance is removed or
  60291. // deleted.
  60292. //
  60293. // You can specify a maximum of 1000 instances with this method per
  60294. // request.
  60295. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  60296. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60297. c.project = project
  60298. c.region = region
  60299. c.instanceGroupManager = instanceGroupManager
  60300. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  60301. return c
  60302. }
  60303. // RequestId sets the optional parameter "requestId": An optional
  60304. // request ID to identify requests. Specify a unique request ID so that
  60305. // if you must retry your request, the server will know to ignore the
  60306. // request if it has already been completed.
  60307. //
  60308. // For example, consider a situation where you make an initial request
  60309. // and the request times out. If you make the request again with the
  60310. // same request ID, the server can check if original operation with the
  60311. // same request ID was received, and if so, will ignore the second
  60312. // request. This prevents clients from accidentally creating duplicate
  60313. // commitments.
  60314. //
  60315. // The request ID must be a valid UUID with the exception that zero UUID
  60316. // is not supported (00000000-0000-0000-0000-000000000000).
  60317. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  60318. c.urlParams_.Set("requestId", requestId)
  60319. return c
  60320. }
  60321. // Fields allows partial responses to be retrieved. See
  60322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60323. // for more information.
  60324. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  60325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60326. return c
  60327. }
  60328. // Context sets the context to be used in this call's Do method. Any
  60329. // pending HTTP request will be aborted if the provided context is
  60330. // canceled.
  60331. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  60332. c.ctx_ = ctx
  60333. return c
  60334. }
  60335. // Header returns an http.Header that can be modified by the caller to
  60336. // add HTTP headers to the request.
  60337. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  60338. if c.header_ == nil {
  60339. c.header_ = make(http.Header)
  60340. }
  60341. return c.header_
  60342. }
  60343. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  60344. reqHeaders := make(http.Header)
  60345. for k, v := range c.header_ {
  60346. reqHeaders[k] = v
  60347. }
  60348. reqHeaders.Set("User-Agent", c.s.userAgent())
  60349. var body io.Reader = nil
  60350. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  60351. if err != nil {
  60352. return nil, err
  60353. }
  60354. reqHeaders.Set("Content-Type", "application/json")
  60355. c.urlParams_.Set("alt", alt)
  60356. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  60357. urls += "?" + c.urlParams_.Encode()
  60358. req, _ := http.NewRequest("POST", urls, body)
  60359. req.Header = reqHeaders
  60360. googleapi.Expand(req.URL, map[string]string{
  60361. "project": c.project,
  60362. "region": c.region,
  60363. "instanceGroupManager": c.instanceGroupManager,
  60364. })
  60365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60366. }
  60367. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  60368. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60369. // status code is an error. Response headers are in either
  60370. // *Operation.ServerResponse.Header or (if a response was returned at
  60371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60372. // to check whether the returned error was because
  60373. // http.StatusNotModified was returned.
  60374. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60375. gensupport.SetOptions(c.urlParams_, opts...)
  60376. res, err := c.doRequest("json")
  60377. if res != nil && res.StatusCode == http.StatusNotModified {
  60378. if res.Body != nil {
  60379. res.Body.Close()
  60380. }
  60381. return nil, &googleapi.Error{
  60382. Code: res.StatusCode,
  60383. Header: res.Header,
  60384. }
  60385. }
  60386. if err != nil {
  60387. return nil, err
  60388. }
  60389. defer googleapi.CloseBody(res)
  60390. if err := googleapi.CheckResponse(res); err != nil {
  60391. return nil, err
  60392. }
  60393. ret := &Operation{
  60394. ServerResponse: googleapi.ServerResponse{
  60395. Header: res.Header,
  60396. HTTPStatusCode: res.StatusCode,
  60397. },
  60398. }
  60399. target := &ret
  60400. if err := gensupport.DecodeResponse(target, res); err != nil {
  60401. return nil, err
  60402. }
  60403. return ret, nil
  60404. // {
  60405. // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled 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.",
  60406. // "httpMethod": "POST",
  60407. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  60408. // "parameterOrder": [
  60409. // "project",
  60410. // "region",
  60411. // "instanceGroupManager"
  60412. // ],
  60413. // "parameters": {
  60414. // "instanceGroupManager": {
  60415. // "description": "Name of the managed instance group.",
  60416. // "location": "path",
  60417. // "required": true,
  60418. // "type": "string"
  60419. // },
  60420. // "project": {
  60421. // "description": "Project ID for this request.",
  60422. // "location": "path",
  60423. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60424. // "required": true,
  60425. // "type": "string"
  60426. // },
  60427. // "region": {
  60428. // "description": "Name of the region scoping this request.",
  60429. // "location": "path",
  60430. // "required": true,
  60431. // "type": "string"
  60432. // },
  60433. // "requestId": {
  60434. // "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).",
  60435. // "location": "query",
  60436. // "type": "string"
  60437. // }
  60438. // },
  60439. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  60440. // "request": {
  60441. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  60442. // },
  60443. // "response": {
  60444. // "$ref": "Operation"
  60445. // },
  60446. // "scopes": [
  60447. // "https://www.googleapis.com/auth/cloud-platform",
  60448. // "https://www.googleapis.com/auth/compute"
  60449. // ]
  60450. // }
  60451. }
  60452. // method id "compute.regionInstanceGroupManagers.resize":
  60453. type RegionInstanceGroupManagersResizeCall struct {
  60454. s *Service
  60455. project string
  60456. region string
  60457. instanceGroupManager string
  60458. urlParams_ gensupport.URLParams
  60459. ctx_ context.Context
  60460. header_ http.Header
  60461. }
  60462. // Resize: Changes the intended size for the managed instance group. If
  60463. // you increase the size, the group schedules actions to create new
  60464. // instances using the current instance template. If you decrease the
  60465. // size, the group schedules delete actions on one or more instances.
  60466. // The resize operation is marked DONE when the resize actions are
  60467. // scheduled even if the group has not yet added or deleted any
  60468. // instances. You must separately verify the status of the creating or
  60469. // deleting actions with the listmanagedinstances method.
  60470. //
  60471. // If the group is part of a backend service that has enabled connection
  60472. // draining, it can take up to 60 seconds after the connection draining
  60473. // duration has elapsed before the VM instance is removed or deleted.
  60474. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  60475. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60476. c.project = project
  60477. c.region = region
  60478. c.instanceGroupManager = instanceGroupManager
  60479. c.urlParams_.Set("size", fmt.Sprint(size))
  60480. return c
  60481. }
  60482. // RequestId sets the optional parameter "requestId": An optional
  60483. // request ID to identify requests. Specify a unique request ID so that
  60484. // if you must retry your request, the server will know to ignore the
  60485. // request if it has already been completed.
  60486. //
  60487. // For example, consider a situation where you make an initial request
  60488. // and the request times out. If you make the request again with the
  60489. // same request ID, the server can check if original operation with the
  60490. // same request ID was received, and if so, will ignore the second
  60491. // request. This prevents clients from accidentally creating duplicate
  60492. // commitments.
  60493. //
  60494. // The request ID must be a valid UUID with the exception that zero UUID
  60495. // is not supported (00000000-0000-0000-0000-000000000000).
  60496. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  60497. c.urlParams_.Set("requestId", requestId)
  60498. return c
  60499. }
  60500. // Fields allows partial responses to be retrieved. See
  60501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60502. // for more information.
  60503. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  60504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60505. return c
  60506. }
  60507. // Context sets the context to be used in this call's Do method. Any
  60508. // pending HTTP request will be aborted if the provided context is
  60509. // canceled.
  60510. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  60511. c.ctx_ = ctx
  60512. return c
  60513. }
  60514. // Header returns an http.Header that can be modified by the caller to
  60515. // add HTTP headers to the request.
  60516. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  60517. if c.header_ == nil {
  60518. c.header_ = make(http.Header)
  60519. }
  60520. return c.header_
  60521. }
  60522. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  60523. reqHeaders := make(http.Header)
  60524. for k, v := range c.header_ {
  60525. reqHeaders[k] = v
  60526. }
  60527. reqHeaders.Set("User-Agent", c.s.userAgent())
  60528. var body io.Reader = nil
  60529. c.urlParams_.Set("alt", alt)
  60530. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  60531. urls += "?" + c.urlParams_.Encode()
  60532. req, _ := http.NewRequest("POST", urls, body)
  60533. req.Header = reqHeaders
  60534. googleapi.Expand(req.URL, map[string]string{
  60535. "project": c.project,
  60536. "region": c.region,
  60537. "instanceGroupManager": c.instanceGroupManager,
  60538. })
  60539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60540. }
  60541. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  60542. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60543. // status code is an error. Response headers are in either
  60544. // *Operation.ServerResponse.Header or (if a response was returned at
  60545. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60546. // to check whether the returned error was because
  60547. // http.StatusNotModified was returned.
  60548. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60549. gensupport.SetOptions(c.urlParams_, opts...)
  60550. res, err := c.doRequest("json")
  60551. if res != nil && res.StatusCode == http.StatusNotModified {
  60552. if res.Body != nil {
  60553. res.Body.Close()
  60554. }
  60555. return nil, &googleapi.Error{
  60556. Code: res.StatusCode,
  60557. Header: res.Header,
  60558. }
  60559. }
  60560. if err != nil {
  60561. return nil, err
  60562. }
  60563. defer googleapi.CloseBody(res)
  60564. if err := googleapi.CheckResponse(res); err != nil {
  60565. return nil, err
  60566. }
  60567. ret := &Operation{
  60568. ServerResponse: googleapi.ServerResponse{
  60569. Header: res.Header,
  60570. HTTPStatusCode: res.StatusCode,
  60571. },
  60572. }
  60573. target := &ret
  60574. if err := gensupport.DecodeResponse(target, res); err != nil {
  60575. return nil, err
  60576. }
  60577. return ret, nil
  60578. // {
  60579. // "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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\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.",
  60580. // "httpMethod": "POST",
  60581. // "id": "compute.regionInstanceGroupManagers.resize",
  60582. // "parameterOrder": [
  60583. // "project",
  60584. // "region",
  60585. // "instanceGroupManager",
  60586. // "size"
  60587. // ],
  60588. // "parameters": {
  60589. // "instanceGroupManager": {
  60590. // "description": "Name of the managed instance group.",
  60591. // "location": "path",
  60592. // "required": true,
  60593. // "type": "string"
  60594. // },
  60595. // "project": {
  60596. // "description": "Project ID for this request.",
  60597. // "location": "path",
  60598. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60599. // "required": true,
  60600. // "type": "string"
  60601. // },
  60602. // "region": {
  60603. // "description": "Name of the region scoping this request.",
  60604. // "location": "path",
  60605. // "required": true,
  60606. // "type": "string"
  60607. // },
  60608. // "requestId": {
  60609. // "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).",
  60610. // "location": "query",
  60611. // "type": "string"
  60612. // },
  60613. // "size": {
  60614. // "description": "Number of instances that should exist in this instance group manager.",
  60615. // "format": "int32",
  60616. // "location": "query",
  60617. // "minimum": "0",
  60618. // "required": true,
  60619. // "type": "integer"
  60620. // }
  60621. // },
  60622. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  60623. // "response": {
  60624. // "$ref": "Operation"
  60625. // },
  60626. // "scopes": [
  60627. // "https://www.googleapis.com/auth/cloud-platform",
  60628. // "https://www.googleapis.com/auth/compute"
  60629. // ]
  60630. // }
  60631. }
  60632. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  60633. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  60634. s *Service
  60635. project string
  60636. region string
  60637. instanceGroupManager string
  60638. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  60639. urlParams_ gensupport.URLParams
  60640. ctx_ context.Context
  60641. header_ http.Header
  60642. }
  60643. // SetInstanceTemplate: Sets the instance template to use when creating
  60644. // new instances or recreating instances in this group. Existing
  60645. // instances are not affected.
  60646. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  60647. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60648. c.project = project
  60649. c.region = region
  60650. c.instanceGroupManager = instanceGroupManager
  60651. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  60652. return c
  60653. }
  60654. // RequestId sets the optional parameter "requestId": An optional
  60655. // request ID to identify requests. Specify a unique request ID so that
  60656. // if you must retry your request, the server will know to ignore the
  60657. // request if it has already been completed.
  60658. //
  60659. // For example, consider a situation where you make an initial request
  60660. // and the request times out. If you make the request again with the
  60661. // same request ID, the server can check if original operation with the
  60662. // same request ID was received, and if so, will ignore the second
  60663. // request. This prevents clients from accidentally creating duplicate
  60664. // commitments.
  60665. //
  60666. // The request ID must be a valid UUID with the exception that zero UUID
  60667. // is not supported (00000000-0000-0000-0000-000000000000).
  60668. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  60669. c.urlParams_.Set("requestId", requestId)
  60670. return c
  60671. }
  60672. // Fields allows partial responses to be retrieved. See
  60673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60674. // for more information.
  60675. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  60676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60677. return c
  60678. }
  60679. // Context sets the context to be used in this call's Do method. Any
  60680. // pending HTTP request will be aborted if the provided context is
  60681. // canceled.
  60682. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  60683. c.ctx_ = ctx
  60684. return c
  60685. }
  60686. // Header returns an http.Header that can be modified by the caller to
  60687. // add HTTP headers to the request.
  60688. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  60689. if c.header_ == nil {
  60690. c.header_ = make(http.Header)
  60691. }
  60692. return c.header_
  60693. }
  60694. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  60695. reqHeaders := make(http.Header)
  60696. for k, v := range c.header_ {
  60697. reqHeaders[k] = v
  60698. }
  60699. reqHeaders.Set("User-Agent", c.s.userAgent())
  60700. var body io.Reader = nil
  60701. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  60702. if err != nil {
  60703. return nil, err
  60704. }
  60705. reqHeaders.Set("Content-Type", "application/json")
  60706. c.urlParams_.Set("alt", alt)
  60707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  60708. urls += "?" + c.urlParams_.Encode()
  60709. req, _ := http.NewRequest("POST", urls, body)
  60710. req.Header = reqHeaders
  60711. googleapi.Expand(req.URL, map[string]string{
  60712. "project": c.project,
  60713. "region": c.region,
  60714. "instanceGroupManager": c.instanceGroupManager,
  60715. })
  60716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60717. }
  60718. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  60719. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60720. // status code is an error. Response headers are in either
  60721. // *Operation.ServerResponse.Header or (if a response was returned at
  60722. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60723. // to check whether the returned error was because
  60724. // http.StatusNotModified was returned.
  60725. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60726. gensupport.SetOptions(c.urlParams_, opts...)
  60727. res, err := c.doRequest("json")
  60728. if res != nil && res.StatusCode == http.StatusNotModified {
  60729. if res.Body != nil {
  60730. res.Body.Close()
  60731. }
  60732. return nil, &googleapi.Error{
  60733. Code: res.StatusCode,
  60734. Header: res.Header,
  60735. }
  60736. }
  60737. if err != nil {
  60738. return nil, err
  60739. }
  60740. defer googleapi.CloseBody(res)
  60741. if err := googleapi.CheckResponse(res); err != nil {
  60742. return nil, err
  60743. }
  60744. ret := &Operation{
  60745. ServerResponse: googleapi.ServerResponse{
  60746. Header: res.Header,
  60747. HTTPStatusCode: res.StatusCode,
  60748. },
  60749. }
  60750. target := &ret
  60751. if err := gensupport.DecodeResponse(target, res); err != nil {
  60752. return nil, err
  60753. }
  60754. return ret, nil
  60755. // {
  60756. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  60757. // "httpMethod": "POST",
  60758. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  60759. // "parameterOrder": [
  60760. // "project",
  60761. // "region",
  60762. // "instanceGroupManager"
  60763. // ],
  60764. // "parameters": {
  60765. // "instanceGroupManager": {
  60766. // "description": "The name of the managed instance group.",
  60767. // "location": "path",
  60768. // "required": true,
  60769. // "type": "string"
  60770. // },
  60771. // "project": {
  60772. // "description": "Project ID for this request.",
  60773. // "location": "path",
  60774. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60775. // "required": true,
  60776. // "type": "string"
  60777. // },
  60778. // "region": {
  60779. // "description": "Name of the region scoping this request.",
  60780. // "location": "path",
  60781. // "required": true,
  60782. // "type": "string"
  60783. // },
  60784. // "requestId": {
  60785. // "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).",
  60786. // "location": "query",
  60787. // "type": "string"
  60788. // }
  60789. // },
  60790. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  60791. // "request": {
  60792. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  60793. // },
  60794. // "response": {
  60795. // "$ref": "Operation"
  60796. // },
  60797. // "scopes": [
  60798. // "https://www.googleapis.com/auth/cloud-platform",
  60799. // "https://www.googleapis.com/auth/compute"
  60800. // ]
  60801. // }
  60802. }
  60803. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  60804. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  60805. s *Service
  60806. project string
  60807. region string
  60808. instanceGroupManager string
  60809. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  60810. urlParams_ gensupport.URLParams
  60811. ctx_ context.Context
  60812. header_ http.Header
  60813. }
  60814. // SetTargetPools: Modifies the target pools to which all new instances
  60815. // in this group are assigned. Existing instances in the group are not
  60816. // affected.
  60817. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  60818. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60819. c.project = project
  60820. c.region = region
  60821. c.instanceGroupManager = instanceGroupManager
  60822. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  60823. return c
  60824. }
  60825. // RequestId sets the optional parameter "requestId": An optional
  60826. // request ID to identify requests. Specify a unique request ID so that
  60827. // if you must retry your request, the server will know to ignore the
  60828. // request if it has already been completed.
  60829. //
  60830. // For example, consider a situation where you make an initial request
  60831. // and the request times out. If you make the request again with the
  60832. // same request ID, the server can check if original operation with the
  60833. // same request ID was received, and if so, will ignore the second
  60834. // request. This prevents clients from accidentally creating duplicate
  60835. // commitments.
  60836. //
  60837. // The request ID must be a valid UUID with the exception that zero UUID
  60838. // is not supported (00000000-0000-0000-0000-000000000000).
  60839. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  60840. c.urlParams_.Set("requestId", requestId)
  60841. return c
  60842. }
  60843. // Fields allows partial responses to be retrieved. See
  60844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60845. // for more information.
  60846. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  60847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60848. return c
  60849. }
  60850. // Context sets the context to be used in this call's Do method. Any
  60851. // pending HTTP request will be aborted if the provided context is
  60852. // canceled.
  60853. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  60854. c.ctx_ = ctx
  60855. return c
  60856. }
  60857. // Header returns an http.Header that can be modified by the caller to
  60858. // add HTTP headers to the request.
  60859. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  60860. if c.header_ == nil {
  60861. c.header_ = make(http.Header)
  60862. }
  60863. return c.header_
  60864. }
  60865. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  60866. reqHeaders := make(http.Header)
  60867. for k, v := range c.header_ {
  60868. reqHeaders[k] = v
  60869. }
  60870. reqHeaders.Set("User-Agent", c.s.userAgent())
  60871. var body io.Reader = nil
  60872. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  60873. if err != nil {
  60874. return nil, err
  60875. }
  60876. reqHeaders.Set("Content-Type", "application/json")
  60877. c.urlParams_.Set("alt", alt)
  60878. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  60879. urls += "?" + c.urlParams_.Encode()
  60880. req, _ := http.NewRequest("POST", urls, body)
  60881. req.Header = reqHeaders
  60882. googleapi.Expand(req.URL, map[string]string{
  60883. "project": c.project,
  60884. "region": c.region,
  60885. "instanceGroupManager": c.instanceGroupManager,
  60886. })
  60887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60888. }
  60889. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  60890. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60891. // status code is an error. Response headers are in either
  60892. // *Operation.ServerResponse.Header or (if a response was returned at
  60893. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60894. // to check whether the returned error was because
  60895. // http.StatusNotModified was returned.
  60896. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60897. gensupport.SetOptions(c.urlParams_, opts...)
  60898. res, err := c.doRequest("json")
  60899. if res != nil && res.StatusCode == http.StatusNotModified {
  60900. if res.Body != nil {
  60901. res.Body.Close()
  60902. }
  60903. return nil, &googleapi.Error{
  60904. Code: res.StatusCode,
  60905. Header: res.Header,
  60906. }
  60907. }
  60908. if err != nil {
  60909. return nil, err
  60910. }
  60911. defer googleapi.CloseBody(res)
  60912. if err := googleapi.CheckResponse(res); err != nil {
  60913. return nil, err
  60914. }
  60915. ret := &Operation{
  60916. ServerResponse: googleapi.ServerResponse{
  60917. Header: res.Header,
  60918. HTTPStatusCode: res.StatusCode,
  60919. },
  60920. }
  60921. target := &ret
  60922. if err := gensupport.DecodeResponse(target, res); err != nil {
  60923. return nil, err
  60924. }
  60925. return ret, nil
  60926. // {
  60927. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  60928. // "httpMethod": "POST",
  60929. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  60930. // "parameterOrder": [
  60931. // "project",
  60932. // "region",
  60933. // "instanceGroupManager"
  60934. // ],
  60935. // "parameters": {
  60936. // "instanceGroupManager": {
  60937. // "description": "Name of the managed instance group.",
  60938. // "location": "path",
  60939. // "required": true,
  60940. // "type": "string"
  60941. // },
  60942. // "project": {
  60943. // "description": "Project ID for this request.",
  60944. // "location": "path",
  60945. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60946. // "required": true,
  60947. // "type": "string"
  60948. // },
  60949. // "region": {
  60950. // "description": "Name of the region scoping this request.",
  60951. // "location": "path",
  60952. // "required": true,
  60953. // "type": "string"
  60954. // },
  60955. // "requestId": {
  60956. // "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).",
  60957. // "location": "query",
  60958. // "type": "string"
  60959. // }
  60960. // },
  60961. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  60962. // "request": {
  60963. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  60964. // },
  60965. // "response": {
  60966. // "$ref": "Operation"
  60967. // },
  60968. // "scopes": [
  60969. // "https://www.googleapis.com/auth/cloud-platform",
  60970. // "https://www.googleapis.com/auth/compute"
  60971. // ]
  60972. // }
  60973. }
  60974. // method id "compute.regionInstanceGroups.get":
  60975. type RegionInstanceGroupsGetCall struct {
  60976. s *Service
  60977. project string
  60978. region string
  60979. instanceGroup string
  60980. urlParams_ gensupport.URLParams
  60981. ifNoneMatch_ string
  60982. ctx_ context.Context
  60983. header_ http.Header
  60984. }
  60985. // Get: Returns the specified instance group resource.
  60986. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  60987. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60988. c.project = project
  60989. c.region = region
  60990. c.instanceGroup = instanceGroup
  60991. return c
  60992. }
  60993. // Fields allows partial responses to be retrieved. See
  60994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60995. // for more information.
  60996. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  60997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60998. return c
  60999. }
  61000. // IfNoneMatch sets the optional parameter which makes the operation
  61001. // fail if the object's ETag matches the given value. This is useful for
  61002. // getting updates only after the object has changed since the last
  61003. // request. Use googleapi.IsNotModified to check whether the response
  61004. // error from Do is the result of In-None-Match.
  61005. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  61006. c.ifNoneMatch_ = entityTag
  61007. return c
  61008. }
  61009. // Context sets the context to be used in this call's Do method. Any
  61010. // pending HTTP request will be aborted if the provided context is
  61011. // canceled.
  61012. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  61013. c.ctx_ = ctx
  61014. return c
  61015. }
  61016. // Header returns an http.Header that can be modified by the caller to
  61017. // add HTTP headers to the request.
  61018. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  61019. if c.header_ == nil {
  61020. c.header_ = make(http.Header)
  61021. }
  61022. return c.header_
  61023. }
  61024. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  61025. reqHeaders := make(http.Header)
  61026. for k, v := range c.header_ {
  61027. reqHeaders[k] = v
  61028. }
  61029. reqHeaders.Set("User-Agent", c.s.userAgent())
  61030. if c.ifNoneMatch_ != "" {
  61031. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61032. }
  61033. var body io.Reader = nil
  61034. c.urlParams_.Set("alt", alt)
  61035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  61036. urls += "?" + c.urlParams_.Encode()
  61037. req, _ := http.NewRequest("GET", urls, body)
  61038. req.Header = reqHeaders
  61039. googleapi.Expand(req.URL, map[string]string{
  61040. "project": c.project,
  61041. "region": c.region,
  61042. "instanceGroup": c.instanceGroup,
  61043. })
  61044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61045. }
  61046. // Do executes the "compute.regionInstanceGroups.get" call.
  61047. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  61048. // status code is an error. Response headers are in either
  61049. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  61050. // at all) in error.(*googleapi.Error).Header. Use
  61051. // googleapi.IsNotModified to check whether the returned error was
  61052. // because http.StatusNotModified was returned.
  61053. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  61054. gensupport.SetOptions(c.urlParams_, opts...)
  61055. res, err := c.doRequest("json")
  61056. if res != nil && res.StatusCode == http.StatusNotModified {
  61057. if res.Body != nil {
  61058. res.Body.Close()
  61059. }
  61060. return nil, &googleapi.Error{
  61061. Code: res.StatusCode,
  61062. Header: res.Header,
  61063. }
  61064. }
  61065. if err != nil {
  61066. return nil, err
  61067. }
  61068. defer googleapi.CloseBody(res)
  61069. if err := googleapi.CheckResponse(res); err != nil {
  61070. return nil, err
  61071. }
  61072. ret := &InstanceGroup{
  61073. ServerResponse: googleapi.ServerResponse{
  61074. Header: res.Header,
  61075. HTTPStatusCode: res.StatusCode,
  61076. },
  61077. }
  61078. target := &ret
  61079. if err := gensupport.DecodeResponse(target, res); err != nil {
  61080. return nil, err
  61081. }
  61082. return ret, nil
  61083. // {
  61084. // "description": "Returns the specified instance group resource.",
  61085. // "httpMethod": "GET",
  61086. // "id": "compute.regionInstanceGroups.get",
  61087. // "parameterOrder": [
  61088. // "project",
  61089. // "region",
  61090. // "instanceGroup"
  61091. // ],
  61092. // "parameters": {
  61093. // "instanceGroup": {
  61094. // "description": "Name of the instance group resource to return.",
  61095. // "location": "path",
  61096. // "required": true,
  61097. // "type": "string"
  61098. // },
  61099. // "project": {
  61100. // "description": "Project ID for this request.",
  61101. // "location": "path",
  61102. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61103. // "required": true,
  61104. // "type": "string"
  61105. // },
  61106. // "region": {
  61107. // "description": "Name of the region scoping this request.",
  61108. // "location": "path",
  61109. // "required": true,
  61110. // "type": "string"
  61111. // }
  61112. // },
  61113. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  61114. // "response": {
  61115. // "$ref": "InstanceGroup"
  61116. // },
  61117. // "scopes": [
  61118. // "https://www.googleapis.com/auth/cloud-platform",
  61119. // "https://www.googleapis.com/auth/compute",
  61120. // "https://www.googleapis.com/auth/compute.readonly"
  61121. // ]
  61122. // }
  61123. }
  61124. // method id "compute.regionInstanceGroups.list":
  61125. type RegionInstanceGroupsListCall struct {
  61126. s *Service
  61127. project string
  61128. region string
  61129. urlParams_ gensupport.URLParams
  61130. ifNoneMatch_ string
  61131. ctx_ context.Context
  61132. header_ http.Header
  61133. }
  61134. // List: Retrieves the list of instance group resources contained within
  61135. // the specified region.
  61136. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  61137. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61138. c.project = project
  61139. c.region = region
  61140. return c
  61141. }
  61142. // Filter sets the optional parameter "filter": A filter expression that
  61143. // filters resources listed in the response. The expression must specify
  61144. // the field name, a comparison operator, and the value that you want to
  61145. // use for filtering. The value must be a string, a number, or a
  61146. // boolean. The comparison operator must be either =, !=, >, or <.
  61147. //
  61148. // For example, if you are filtering Compute Engine instances, you can
  61149. // exclude instances named example-instance by specifying name !=
  61150. // example-instance.
  61151. //
  61152. // You can also filter nested fields. For example, you could specify
  61153. // scheduling.automaticRestart = false to include instances only if they
  61154. // are not scheduled for automatic restarts. You can use filtering on
  61155. // nested fields to filter based on resource labels.
  61156. //
  61157. // To filter on multiple expressions, provide each separate expression
  61158. // within parentheses. For example, (scheduling.automaticRestart = true)
  61159. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  61160. // AND expression. However, you can include AND and OR expressions
  61161. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  61162. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  61163. // true).
  61164. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  61165. c.urlParams_.Set("filter", filter)
  61166. return c
  61167. }
  61168. // MaxResults sets the optional parameter "maxResults": The maximum
  61169. // number of results per page that should be returned. If the number of
  61170. // available results is larger than maxResults, Compute Engine returns a
  61171. // nextPageToken that can be used to get the next page of results in
  61172. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  61173. // (Default: 500)
  61174. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  61175. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  61176. return c
  61177. }
  61178. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  61179. // a certain order. By default, results are returned in alphanumerical
  61180. // order based on the resource name.
  61181. //
  61182. // You can also sort results in descending order based on the creation
  61183. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61184. // based on the creationTimestamp field in reverse chronological order
  61185. // (newest result first). Use this to sort resources like operations so
  61186. // that the newest operation is returned first.
  61187. //
  61188. // Currently, only sorting by name or creationTimestamp desc is
  61189. // supported.
  61190. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  61191. c.urlParams_.Set("orderBy", orderBy)
  61192. return c
  61193. }
  61194. // PageToken sets the optional parameter "pageToken": Specifies a page
  61195. // token to use. Set pageToken to the nextPageToken returned by a
  61196. // previous list request to get the next page of results.
  61197. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  61198. c.urlParams_.Set("pageToken", pageToken)
  61199. return c
  61200. }
  61201. // Fields allows partial responses to be retrieved. See
  61202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61203. // for more information.
  61204. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  61205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61206. return c
  61207. }
  61208. // IfNoneMatch sets the optional parameter which makes the operation
  61209. // fail if the object's ETag matches the given value. This is useful for
  61210. // getting updates only after the object has changed since the last
  61211. // request. Use googleapi.IsNotModified to check whether the response
  61212. // error from Do is the result of In-None-Match.
  61213. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  61214. c.ifNoneMatch_ = entityTag
  61215. return c
  61216. }
  61217. // Context sets the context to be used in this call's Do method. Any
  61218. // pending HTTP request will be aborted if the provided context is
  61219. // canceled.
  61220. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  61221. c.ctx_ = ctx
  61222. return c
  61223. }
  61224. // Header returns an http.Header that can be modified by the caller to
  61225. // add HTTP headers to the request.
  61226. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  61227. if c.header_ == nil {
  61228. c.header_ = make(http.Header)
  61229. }
  61230. return c.header_
  61231. }
  61232. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  61233. reqHeaders := make(http.Header)
  61234. for k, v := range c.header_ {
  61235. reqHeaders[k] = v
  61236. }
  61237. reqHeaders.Set("User-Agent", c.s.userAgent())
  61238. if c.ifNoneMatch_ != "" {
  61239. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61240. }
  61241. var body io.Reader = nil
  61242. c.urlParams_.Set("alt", alt)
  61243. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  61244. urls += "?" + c.urlParams_.Encode()
  61245. req, _ := http.NewRequest("GET", urls, body)
  61246. req.Header = reqHeaders
  61247. googleapi.Expand(req.URL, map[string]string{
  61248. "project": c.project,
  61249. "region": c.region,
  61250. })
  61251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61252. }
  61253. // Do executes the "compute.regionInstanceGroups.list" call.
  61254. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  61255. // non-2xx status code is an error. Response headers are in either
  61256. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  61257. // returned at all) in error.(*googleapi.Error).Header. Use
  61258. // googleapi.IsNotModified to check whether the returned error was
  61259. // because http.StatusNotModified was returned.
  61260. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  61261. gensupport.SetOptions(c.urlParams_, opts...)
  61262. res, err := c.doRequest("json")
  61263. if res != nil && res.StatusCode == http.StatusNotModified {
  61264. if res.Body != nil {
  61265. res.Body.Close()
  61266. }
  61267. return nil, &googleapi.Error{
  61268. Code: res.StatusCode,
  61269. Header: res.Header,
  61270. }
  61271. }
  61272. if err != nil {
  61273. return nil, err
  61274. }
  61275. defer googleapi.CloseBody(res)
  61276. if err := googleapi.CheckResponse(res); err != nil {
  61277. return nil, err
  61278. }
  61279. ret := &RegionInstanceGroupList{
  61280. ServerResponse: googleapi.ServerResponse{
  61281. Header: res.Header,
  61282. HTTPStatusCode: res.StatusCode,
  61283. },
  61284. }
  61285. target := &ret
  61286. if err := gensupport.DecodeResponse(target, res); err != nil {
  61287. return nil, err
  61288. }
  61289. return ret, nil
  61290. // {
  61291. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  61292. // "httpMethod": "GET",
  61293. // "id": "compute.regionInstanceGroups.list",
  61294. // "parameterOrder": [
  61295. // "project",
  61296. // "region"
  61297. // ],
  61298. // "parameters": {
  61299. // "filter": {
  61300. // "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).",
  61301. // "location": "query",
  61302. // "type": "string"
  61303. // },
  61304. // "maxResults": {
  61305. // "default": "500",
  61306. // "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)",
  61307. // "format": "uint32",
  61308. // "location": "query",
  61309. // "minimum": "0",
  61310. // "type": "integer"
  61311. // },
  61312. // "orderBy": {
  61313. // "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.",
  61314. // "location": "query",
  61315. // "type": "string"
  61316. // },
  61317. // "pageToken": {
  61318. // "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.",
  61319. // "location": "query",
  61320. // "type": "string"
  61321. // },
  61322. // "project": {
  61323. // "description": "Project ID for this request.",
  61324. // "location": "path",
  61325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61326. // "required": true,
  61327. // "type": "string"
  61328. // },
  61329. // "region": {
  61330. // "description": "Name of the region scoping this request.",
  61331. // "location": "path",
  61332. // "required": true,
  61333. // "type": "string"
  61334. // }
  61335. // },
  61336. // "path": "{project}/regions/{region}/instanceGroups",
  61337. // "response": {
  61338. // "$ref": "RegionInstanceGroupList"
  61339. // },
  61340. // "scopes": [
  61341. // "https://www.googleapis.com/auth/cloud-platform",
  61342. // "https://www.googleapis.com/auth/compute",
  61343. // "https://www.googleapis.com/auth/compute.readonly"
  61344. // ]
  61345. // }
  61346. }
  61347. // Pages invokes f for each page of results.
  61348. // A non-nil error returned from f will halt the iteration.
  61349. // The provided context supersedes any context provided to the Context method.
  61350. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  61351. c.ctx_ = ctx
  61352. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61353. for {
  61354. x, err := c.Do()
  61355. if err != nil {
  61356. return err
  61357. }
  61358. if err := f(x); err != nil {
  61359. return err
  61360. }
  61361. if x.NextPageToken == "" {
  61362. return nil
  61363. }
  61364. c.PageToken(x.NextPageToken)
  61365. }
  61366. }
  61367. // method id "compute.regionInstanceGroups.listInstances":
  61368. type RegionInstanceGroupsListInstancesCall struct {
  61369. s *Service
  61370. project string
  61371. region string
  61372. instanceGroup string
  61373. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  61374. urlParams_ gensupport.URLParams
  61375. ctx_ context.Context
  61376. header_ http.Header
  61377. }
  61378. // ListInstances: Lists the instances in the specified instance group
  61379. // and displays information about the named ports. Depending on the
  61380. // specified options, this method can list all instances or only the
  61381. // instances that are running.
  61382. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  61383. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61384. c.project = project
  61385. c.region = region
  61386. c.instanceGroup = instanceGroup
  61387. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  61388. return c
  61389. }
  61390. // Filter sets the optional parameter "filter": A filter expression that
  61391. // filters resources listed in the response. The expression must specify
  61392. // the field name, a comparison operator, and the value that you want to
  61393. // use for filtering. The value must be a string, a number, or a
  61394. // boolean. The comparison operator must be either =, !=, >, or <.
  61395. //
  61396. // For example, if you are filtering Compute Engine instances, you can
  61397. // exclude instances named example-instance by specifying name !=
  61398. // example-instance.
  61399. //
  61400. // You can also filter nested fields. For example, you could specify
  61401. // scheduling.automaticRestart = false to include instances only if they
  61402. // are not scheduled for automatic restarts. You can use filtering on
  61403. // nested fields to filter based on resource labels.
  61404. //
  61405. // To filter on multiple expressions, provide each separate expression
  61406. // within parentheses. For example, (scheduling.automaticRestart = true)
  61407. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  61408. // AND expression. However, you can include AND and OR expressions
  61409. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  61410. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  61411. // true).
  61412. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  61413. c.urlParams_.Set("filter", filter)
  61414. return c
  61415. }
  61416. // MaxResults sets the optional parameter "maxResults": The maximum
  61417. // number of results per page that should be returned. If the number of
  61418. // available results is larger than maxResults, Compute Engine returns a
  61419. // nextPageToken that can be used to get the next page of results in
  61420. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  61421. // (Default: 500)
  61422. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  61423. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  61424. return c
  61425. }
  61426. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  61427. // a certain order. By default, results are returned in alphanumerical
  61428. // order based on the resource name.
  61429. //
  61430. // You can also sort results in descending order based on the creation
  61431. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61432. // based on the creationTimestamp field in reverse chronological order
  61433. // (newest result first). Use this to sort resources like operations so
  61434. // that the newest operation is returned first.
  61435. //
  61436. // Currently, only sorting by name or creationTimestamp desc is
  61437. // supported.
  61438. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  61439. c.urlParams_.Set("orderBy", orderBy)
  61440. return c
  61441. }
  61442. // PageToken sets the optional parameter "pageToken": Specifies a page
  61443. // token to use. Set pageToken to the nextPageToken returned by a
  61444. // previous list request to get the next page of results.
  61445. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  61446. c.urlParams_.Set("pageToken", pageToken)
  61447. return c
  61448. }
  61449. // Fields allows partial responses to be retrieved. See
  61450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61451. // for more information.
  61452. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  61453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61454. return c
  61455. }
  61456. // Context sets the context to be used in this call's Do method. Any
  61457. // pending HTTP request will be aborted if the provided context is
  61458. // canceled.
  61459. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  61460. c.ctx_ = ctx
  61461. return c
  61462. }
  61463. // Header returns an http.Header that can be modified by the caller to
  61464. // add HTTP headers to the request.
  61465. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  61466. if c.header_ == nil {
  61467. c.header_ = make(http.Header)
  61468. }
  61469. return c.header_
  61470. }
  61471. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  61472. reqHeaders := make(http.Header)
  61473. for k, v := range c.header_ {
  61474. reqHeaders[k] = v
  61475. }
  61476. reqHeaders.Set("User-Agent", c.s.userAgent())
  61477. var body io.Reader = nil
  61478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  61479. if err != nil {
  61480. return nil, err
  61481. }
  61482. reqHeaders.Set("Content-Type", "application/json")
  61483. c.urlParams_.Set("alt", alt)
  61484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  61485. urls += "?" + c.urlParams_.Encode()
  61486. req, _ := http.NewRequest("POST", urls, body)
  61487. req.Header = reqHeaders
  61488. googleapi.Expand(req.URL, map[string]string{
  61489. "project": c.project,
  61490. "region": c.region,
  61491. "instanceGroup": c.instanceGroup,
  61492. })
  61493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61494. }
  61495. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  61496. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  61497. // non-nil. Any non-2xx status code is an error. Response headers are in
  61498. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  61499. // (if a response was returned at all) in
  61500. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  61501. // whether the returned error was because http.StatusNotModified was
  61502. // returned.
  61503. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  61504. gensupport.SetOptions(c.urlParams_, opts...)
  61505. res, err := c.doRequest("json")
  61506. if res != nil && res.StatusCode == http.StatusNotModified {
  61507. if res.Body != nil {
  61508. res.Body.Close()
  61509. }
  61510. return nil, &googleapi.Error{
  61511. Code: res.StatusCode,
  61512. Header: res.Header,
  61513. }
  61514. }
  61515. if err != nil {
  61516. return nil, err
  61517. }
  61518. defer googleapi.CloseBody(res)
  61519. if err := googleapi.CheckResponse(res); err != nil {
  61520. return nil, err
  61521. }
  61522. ret := &RegionInstanceGroupsListInstances{
  61523. ServerResponse: googleapi.ServerResponse{
  61524. Header: res.Header,
  61525. HTTPStatusCode: res.StatusCode,
  61526. },
  61527. }
  61528. target := &ret
  61529. if err := gensupport.DecodeResponse(target, res); err != nil {
  61530. return nil, err
  61531. }
  61532. return ret, nil
  61533. // {
  61534. // "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.",
  61535. // "httpMethod": "POST",
  61536. // "id": "compute.regionInstanceGroups.listInstances",
  61537. // "parameterOrder": [
  61538. // "project",
  61539. // "region",
  61540. // "instanceGroup"
  61541. // ],
  61542. // "parameters": {
  61543. // "filter": {
  61544. // "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).",
  61545. // "location": "query",
  61546. // "type": "string"
  61547. // },
  61548. // "instanceGroup": {
  61549. // "description": "Name of the regional instance group for which we want to list the instances.",
  61550. // "location": "path",
  61551. // "required": true,
  61552. // "type": "string"
  61553. // },
  61554. // "maxResults": {
  61555. // "default": "500",
  61556. // "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)",
  61557. // "format": "uint32",
  61558. // "location": "query",
  61559. // "minimum": "0",
  61560. // "type": "integer"
  61561. // },
  61562. // "orderBy": {
  61563. // "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.",
  61564. // "location": "query",
  61565. // "type": "string"
  61566. // },
  61567. // "pageToken": {
  61568. // "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.",
  61569. // "location": "query",
  61570. // "type": "string"
  61571. // },
  61572. // "project": {
  61573. // "description": "Project ID for this request.",
  61574. // "location": "path",
  61575. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61576. // "required": true,
  61577. // "type": "string"
  61578. // },
  61579. // "region": {
  61580. // "description": "Name of the region scoping this request.",
  61581. // "location": "path",
  61582. // "required": true,
  61583. // "type": "string"
  61584. // }
  61585. // },
  61586. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  61587. // "request": {
  61588. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  61589. // },
  61590. // "response": {
  61591. // "$ref": "RegionInstanceGroupsListInstances"
  61592. // },
  61593. // "scopes": [
  61594. // "https://www.googleapis.com/auth/cloud-platform",
  61595. // "https://www.googleapis.com/auth/compute",
  61596. // "https://www.googleapis.com/auth/compute.readonly"
  61597. // ]
  61598. // }
  61599. }
  61600. // Pages invokes f for each page of results.
  61601. // A non-nil error returned from f will halt the iteration.
  61602. // The provided context supersedes any context provided to the Context method.
  61603. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  61604. c.ctx_ = ctx
  61605. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61606. for {
  61607. x, err := c.Do()
  61608. if err != nil {
  61609. return err
  61610. }
  61611. if err := f(x); err != nil {
  61612. return err
  61613. }
  61614. if x.NextPageToken == "" {
  61615. return nil
  61616. }
  61617. c.PageToken(x.NextPageToken)
  61618. }
  61619. }
  61620. // method id "compute.regionInstanceGroups.setNamedPorts":
  61621. type RegionInstanceGroupsSetNamedPortsCall struct {
  61622. s *Service
  61623. project string
  61624. region string
  61625. instanceGroup string
  61626. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  61627. urlParams_ gensupport.URLParams
  61628. ctx_ context.Context
  61629. header_ http.Header
  61630. }
  61631. // SetNamedPorts: Sets the named ports for the specified regional
  61632. // instance group.
  61633. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  61634. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61635. c.project = project
  61636. c.region = region
  61637. c.instanceGroup = instanceGroup
  61638. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  61639. return c
  61640. }
  61641. // RequestId sets the optional parameter "requestId": An optional
  61642. // request ID to identify requests. Specify a unique request ID so that
  61643. // if you must retry your request, the server will know to ignore the
  61644. // request if it has already been completed.
  61645. //
  61646. // For example, consider a situation where you make an initial request
  61647. // and the request times out. If you make the request again with the
  61648. // same request ID, the server can check if original operation with the
  61649. // same request ID was received, and if so, will ignore the second
  61650. // request. This prevents clients from accidentally creating duplicate
  61651. // commitments.
  61652. //
  61653. // The request ID must be a valid UUID with the exception that zero UUID
  61654. // is not supported (00000000-0000-0000-0000-000000000000).
  61655. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  61656. c.urlParams_.Set("requestId", requestId)
  61657. return c
  61658. }
  61659. // Fields allows partial responses to be retrieved. See
  61660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61661. // for more information.
  61662. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  61663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61664. return c
  61665. }
  61666. // Context sets the context to be used in this call's Do method. Any
  61667. // pending HTTP request will be aborted if the provided context is
  61668. // canceled.
  61669. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  61670. c.ctx_ = ctx
  61671. return c
  61672. }
  61673. // Header returns an http.Header that can be modified by the caller to
  61674. // add HTTP headers to the request.
  61675. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  61676. if c.header_ == nil {
  61677. c.header_ = make(http.Header)
  61678. }
  61679. return c.header_
  61680. }
  61681. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  61682. reqHeaders := make(http.Header)
  61683. for k, v := range c.header_ {
  61684. reqHeaders[k] = v
  61685. }
  61686. reqHeaders.Set("User-Agent", c.s.userAgent())
  61687. var body io.Reader = nil
  61688. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  61689. if err != nil {
  61690. return nil, err
  61691. }
  61692. reqHeaders.Set("Content-Type", "application/json")
  61693. c.urlParams_.Set("alt", alt)
  61694. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  61695. urls += "?" + c.urlParams_.Encode()
  61696. req, _ := http.NewRequest("POST", urls, body)
  61697. req.Header = reqHeaders
  61698. googleapi.Expand(req.URL, map[string]string{
  61699. "project": c.project,
  61700. "region": c.region,
  61701. "instanceGroup": c.instanceGroup,
  61702. })
  61703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61704. }
  61705. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  61706. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61707. // status code is an error. Response headers are in either
  61708. // *Operation.ServerResponse.Header or (if a response was returned at
  61709. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61710. // to check whether the returned error was because
  61711. // http.StatusNotModified was returned.
  61712. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61713. gensupport.SetOptions(c.urlParams_, opts...)
  61714. res, err := c.doRequest("json")
  61715. if res != nil && res.StatusCode == http.StatusNotModified {
  61716. if res.Body != nil {
  61717. res.Body.Close()
  61718. }
  61719. return nil, &googleapi.Error{
  61720. Code: res.StatusCode,
  61721. Header: res.Header,
  61722. }
  61723. }
  61724. if err != nil {
  61725. return nil, err
  61726. }
  61727. defer googleapi.CloseBody(res)
  61728. if err := googleapi.CheckResponse(res); err != nil {
  61729. return nil, err
  61730. }
  61731. ret := &Operation{
  61732. ServerResponse: googleapi.ServerResponse{
  61733. Header: res.Header,
  61734. HTTPStatusCode: res.StatusCode,
  61735. },
  61736. }
  61737. target := &ret
  61738. if err := gensupport.DecodeResponse(target, res); err != nil {
  61739. return nil, err
  61740. }
  61741. return ret, nil
  61742. // {
  61743. // "description": "Sets the named ports for the specified regional instance group.",
  61744. // "httpMethod": "POST",
  61745. // "id": "compute.regionInstanceGroups.setNamedPorts",
  61746. // "parameterOrder": [
  61747. // "project",
  61748. // "region",
  61749. // "instanceGroup"
  61750. // ],
  61751. // "parameters": {
  61752. // "instanceGroup": {
  61753. // "description": "The name of the regional instance group where the named ports are updated.",
  61754. // "location": "path",
  61755. // "required": true,
  61756. // "type": "string"
  61757. // },
  61758. // "project": {
  61759. // "description": "Project ID for this request.",
  61760. // "location": "path",
  61761. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61762. // "required": true,
  61763. // "type": "string"
  61764. // },
  61765. // "region": {
  61766. // "description": "Name of the region scoping this request.",
  61767. // "location": "path",
  61768. // "required": true,
  61769. // "type": "string"
  61770. // },
  61771. // "requestId": {
  61772. // "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).",
  61773. // "location": "query",
  61774. // "type": "string"
  61775. // }
  61776. // },
  61777. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  61778. // "request": {
  61779. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  61780. // },
  61781. // "response": {
  61782. // "$ref": "Operation"
  61783. // },
  61784. // "scopes": [
  61785. // "https://www.googleapis.com/auth/cloud-platform",
  61786. // "https://www.googleapis.com/auth/compute"
  61787. // ]
  61788. // }
  61789. }
  61790. // method id "compute.regionOperations.delete":
  61791. type RegionOperationsDeleteCall struct {
  61792. s *Service
  61793. project string
  61794. region string
  61795. operation string
  61796. urlParams_ gensupport.URLParams
  61797. ctx_ context.Context
  61798. header_ http.Header
  61799. }
  61800. // Delete: Deletes the specified region-specific Operations resource.
  61801. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  61802. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  61803. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61804. c.project = project
  61805. c.region = region
  61806. c.operation = operation
  61807. return c
  61808. }
  61809. // Fields allows partial responses to be retrieved. See
  61810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61811. // for more information.
  61812. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  61813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61814. return c
  61815. }
  61816. // Context sets the context to be used in this call's Do method. Any
  61817. // pending HTTP request will be aborted if the provided context is
  61818. // canceled.
  61819. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  61820. c.ctx_ = ctx
  61821. return c
  61822. }
  61823. // Header returns an http.Header that can be modified by the caller to
  61824. // add HTTP headers to the request.
  61825. func (c *RegionOperationsDeleteCall) Header() http.Header {
  61826. if c.header_ == nil {
  61827. c.header_ = make(http.Header)
  61828. }
  61829. return c.header_
  61830. }
  61831. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  61832. reqHeaders := make(http.Header)
  61833. for k, v := range c.header_ {
  61834. reqHeaders[k] = v
  61835. }
  61836. reqHeaders.Set("User-Agent", c.s.userAgent())
  61837. var body io.Reader = nil
  61838. c.urlParams_.Set("alt", alt)
  61839. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  61840. urls += "?" + c.urlParams_.Encode()
  61841. req, _ := http.NewRequest("DELETE", urls, body)
  61842. req.Header = reqHeaders
  61843. googleapi.Expand(req.URL, map[string]string{
  61844. "project": c.project,
  61845. "region": c.region,
  61846. "operation": c.operation,
  61847. })
  61848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61849. }
  61850. // Do executes the "compute.regionOperations.delete" call.
  61851. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  61852. gensupport.SetOptions(c.urlParams_, opts...)
  61853. res, err := c.doRequest("json")
  61854. if err != nil {
  61855. return err
  61856. }
  61857. defer googleapi.CloseBody(res)
  61858. if err := googleapi.CheckResponse(res); err != nil {
  61859. return err
  61860. }
  61861. return nil
  61862. // {
  61863. // "description": "Deletes the specified region-specific Operations resource.",
  61864. // "httpMethod": "DELETE",
  61865. // "id": "compute.regionOperations.delete",
  61866. // "parameterOrder": [
  61867. // "project",
  61868. // "region",
  61869. // "operation"
  61870. // ],
  61871. // "parameters": {
  61872. // "operation": {
  61873. // "description": "Name of the Operations resource to delete.",
  61874. // "location": "path",
  61875. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61876. // "required": true,
  61877. // "type": "string"
  61878. // },
  61879. // "project": {
  61880. // "description": "Project ID for this request.",
  61881. // "location": "path",
  61882. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61883. // "required": true,
  61884. // "type": "string"
  61885. // },
  61886. // "region": {
  61887. // "description": "Name of the region for this request.",
  61888. // "location": "path",
  61889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61890. // "required": true,
  61891. // "type": "string"
  61892. // }
  61893. // },
  61894. // "path": "{project}/regions/{region}/operations/{operation}",
  61895. // "scopes": [
  61896. // "https://www.googleapis.com/auth/cloud-platform",
  61897. // "https://www.googleapis.com/auth/compute"
  61898. // ]
  61899. // }
  61900. }
  61901. // method id "compute.regionOperations.get":
  61902. type RegionOperationsGetCall struct {
  61903. s *Service
  61904. project string
  61905. region string
  61906. operation string
  61907. urlParams_ gensupport.URLParams
  61908. ifNoneMatch_ string
  61909. ctx_ context.Context
  61910. header_ http.Header
  61911. }
  61912. // Get: Retrieves the specified region-specific Operations resource.
  61913. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  61914. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  61915. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61916. c.project = project
  61917. c.region = region
  61918. c.operation = operation
  61919. return c
  61920. }
  61921. // Fields allows partial responses to be retrieved. See
  61922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61923. // for more information.
  61924. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  61925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61926. return c
  61927. }
  61928. // IfNoneMatch sets the optional parameter which makes the operation
  61929. // fail if the object's ETag matches the given value. This is useful for
  61930. // getting updates only after the object has changed since the last
  61931. // request. Use googleapi.IsNotModified to check whether the response
  61932. // error from Do is the result of In-None-Match.
  61933. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  61934. c.ifNoneMatch_ = entityTag
  61935. return c
  61936. }
  61937. // Context sets the context to be used in this call's Do method. Any
  61938. // pending HTTP request will be aborted if the provided context is
  61939. // canceled.
  61940. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  61941. c.ctx_ = ctx
  61942. return c
  61943. }
  61944. // Header returns an http.Header that can be modified by the caller to
  61945. // add HTTP headers to the request.
  61946. func (c *RegionOperationsGetCall) Header() http.Header {
  61947. if c.header_ == nil {
  61948. c.header_ = make(http.Header)
  61949. }
  61950. return c.header_
  61951. }
  61952. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  61953. reqHeaders := make(http.Header)
  61954. for k, v := range c.header_ {
  61955. reqHeaders[k] = v
  61956. }
  61957. reqHeaders.Set("User-Agent", c.s.userAgent())
  61958. if c.ifNoneMatch_ != "" {
  61959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61960. }
  61961. var body io.Reader = nil
  61962. c.urlParams_.Set("alt", alt)
  61963. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  61964. urls += "?" + c.urlParams_.Encode()
  61965. req, _ := http.NewRequest("GET", urls, body)
  61966. req.Header = reqHeaders
  61967. googleapi.Expand(req.URL, map[string]string{
  61968. "project": c.project,
  61969. "region": c.region,
  61970. "operation": c.operation,
  61971. })
  61972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61973. }
  61974. // Do executes the "compute.regionOperations.get" call.
  61975. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61976. // status code is an error. Response headers are in either
  61977. // *Operation.ServerResponse.Header or (if a response was returned at
  61978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61979. // to check whether the returned error was because
  61980. // http.StatusNotModified was returned.
  61981. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61982. gensupport.SetOptions(c.urlParams_, opts...)
  61983. res, err := c.doRequest("json")
  61984. if res != nil && res.StatusCode == http.StatusNotModified {
  61985. if res.Body != nil {
  61986. res.Body.Close()
  61987. }
  61988. return nil, &googleapi.Error{
  61989. Code: res.StatusCode,
  61990. Header: res.Header,
  61991. }
  61992. }
  61993. if err != nil {
  61994. return nil, err
  61995. }
  61996. defer googleapi.CloseBody(res)
  61997. if err := googleapi.CheckResponse(res); err != nil {
  61998. return nil, err
  61999. }
  62000. ret := &Operation{
  62001. ServerResponse: googleapi.ServerResponse{
  62002. Header: res.Header,
  62003. HTTPStatusCode: res.StatusCode,
  62004. },
  62005. }
  62006. target := &ret
  62007. if err := gensupport.DecodeResponse(target, res); err != nil {
  62008. return nil, err
  62009. }
  62010. return ret, nil
  62011. // {
  62012. // "description": "Retrieves the specified region-specific Operations resource.",
  62013. // "httpMethod": "GET",
  62014. // "id": "compute.regionOperations.get",
  62015. // "parameterOrder": [
  62016. // "project",
  62017. // "region",
  62018. // "operation"
  62019. // ],
  62020. // "parameters": {
  62021. // "operation": {
  62022. // "description": "Name of the Operations resource to return.",
  62023. // "location": "path",
  62024. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62025. // "required": true,
  62026. // "type": "string"
  62027. // },
  62028. // "project": {
  62029. // "description": "Project ID for this request.",
  62030. // "location": "path",
  62031. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62032. // "required": true,
  62033. // "type": "string"
  62034. // },
  62035. // "region": {
  62036. // "description": "Name of the region for this request.",
  62037. // "location": "path",
  62038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62039. // "required": true,
  62040. // "type": "string"
  62041. // }
  62042. // },
  62043. // "path": "{project}/regions/{region}/operations/{operation}",
  62044. // "response": {
  62045. // "$ref": "Operation"
  62046. // },
  62047. // "scopes": [
  62048. // "https://www.googleapis.com/auth/cloud-platform",
  62049. // "https://www.googleapis.com/auth/compute",
  62050. // "https://www.googleapis.com/auth/compute.readonly"
  62051. // ]
  62052. // }
  62053. }
  62054. // method id "compute.regionOperations.list":
  62055. type RegionOperationsListCall struct {
  62056. s *Service
  62057. project string
  62058. region string
  62059. urlParams_ gensupport.URLParams
  62060. ifNoneMatch_ string
  62061. ctx_ context.Context
  62062. header_ http.Header
  62063. }
  62064. // List: Retrieves a list of Operation resources contained within the
  62065. // specified region.
  62066. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  62067. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  62068. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62069. c.project = project
  62070. c.region = region
  62071. return c
  62072. }
  62073. // Filter sets the optional parameter "filter": A filter expression that
  62074. // filters resources listed in the response. The expression must specify
  62075. // the field name, a comparison operator, and the value that you want to
  62076. // use for filtering. The value must be a string, a number, or a
  62077. // boolean. The comparison operator must be either =, !=, >, or <.
  62078. //
  62079. // For example, if you are filtering Compute Engine instances, you can
  62080. // exclude instances named example-instance by specifying name !=
  62081. // example-instance.
  62082. //
  62083. // You can also filter nested fields. For example, you could specify
  62084. // scheduling.automaticRestart = false to include instances only if they
  62085. // are not scheduled for automatic restarts. You can use filtering on
  62086. // nested fields to filter based on resource labels.
  62087. //
  62088. // To filter on multiple expressions, provide each separate expression
  62089. // within parentheses. For example, (scheduling.automaticRestart = true)
  62090. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62091. // AND expression. However, you can include AND and OR expressions
  62092. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62093. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62094. // true).
  62095. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  62096. c.urlParams_.Set("filter", filter)
  62097. return c
  62098. }
  62099. // MaxResults sets the optional parameter "maxResults": The maximum
  62100. // number of results per page that should be returned. If the number of
  62101. // available results is larger than maxResults, Compute Engine returns a
  62102. // nextPageToken that can be used to get the next page of results in
  62103. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62104. // (Default: 500)
  62105. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  62106. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62107. return c
  62108. }
  62109. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62110. // a certain order. By default, results are returned in alphanumerical
  62111. // order based on the resource name.
  62112. //
  62113. // You can also sort results in descending order based on the creation
  62114. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62115. // based on the creationTimestamp field in reverse chronological order
  62116. // (newest result first). Use this to sort resources like operations so
  62117. // that the newest operation is returned first.
  62118. //
  62119. // Currently, only sorting by name or creationTimestamp desc is
  62120. // supported.
  62121. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  62122. c.urlParams_.Set("orderBy", orderBy)
  62123. return c
  62124. }
  62125. // PageToken sets the optional parameter "pageToken": Specifies a page
  62126. // token to use. Set pageToken to the nextPageToken returned by a
  62127. // previous list request to get the next page of results.
  62128. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  62129. c.urlParams_.Set("pageToken", pageToken)
  62130. return c
  62131. }
  62132. // Fields allows partial responses to be retrieved. See
  62133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62134. // for more information.
  62135. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  62136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62137. return c
  62138. }
  62139. // IfNoneMatch sets the optional parameter which makes the operation
  62140. // fail if the object's ETag matches the given value. This is useful for
  62141. // getting updates only after the object has changed since the last
  62142. // request. Use googleapi.IsNotModified to check whether the response
  62143. // error from Do is the result of In-None-Match.
  62144. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  62145. c.ifNoneMatch_ = entityTag
  62146. return c
  62147. }
  62148. // Context sets the context to be used in this call's Do method. Any
  62149. // pending HTTP request will be aborted if the provided context is
  62150. // canceled.
  62151. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  62152. c.ctx_ = ctx
  62153. return c
  62154. }
  62155. // Header returns an http.Header that can be modified by the caller to
  62156. // add HTTP headers to the request.
  62157. func (c *RegionOperationsListCall) Header() http.Header {
  62158. if c.header_ == nil {
  62159. c.header_ = make(http.Header)
  62160. }
  62161. return c.header_
  62162. }
  62163. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  62164. reqHeaders := make(http.Header)
  62165. for k, v := range c.header_ {
  62166. reqHeaders[k] = v
  62167. }
  62168. reqHeaders.Set("User-Agent", c.s.userAgent())
  62169. if c.ifNoneMatch_ != "" {
  62170. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62171. }
  62172. var body io.Reader = nil
  62173. c.urlParams_.Set("alt", alt)
  62174. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  62175. urls += "?" + c.urlParams_.Encode()
  62176. req, _ := http.NewRequest("GET", urls, body)
  62177. req.Header = reqHeaders
  62178. googleapi.Expand(req.URL, map[string]string{
  62179. "project": c.project,
  62180. "region": c.region,
  62181. })
  62182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62183. }
  62184. // Do executes the "compute.regionOperations.list" call.
  62185. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  62186. // status code is an error. Response headers are in either
  62187. // *OperationList.ServerResponse.Header or (if a response was returned
  62188. // at all) in error.(*googleapi.Error).Header. Use
  62189. // googleapi.IsNotModified to check whether the returned error was
  62190. // because http.StatusNotModified was returned.
  62191. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  62192. gensupport.SetOptions(c.urlParams_, opts...)
  62193. res, err := c.doRequest("json")
  62194. if res != nil && res.StatusCode == http.StatusNotModified {
  62195. if res.Body != nil {
  62196. res.Body.Close()
  62197. }
  62198. return nil, &googleapi.Error{
  62199. Code: res.StatusCode,
  62200. Header: res.Header,
  62201. }
  62202. }
  62203. if err != nil {
  62204. return nil, err
  62205. }
  62206. defer googleapi.CloseBody(res)
  62207. if err := googleapi.CheckResponse(res); err != nil {
  62208. return nil, err
  62209. }
  62210. ret := &OperationList{
  62211. ServerResponse: googleapi.ServerResponse{
  62212. Header: res.Header,
  62213. HTTPStatusCode: res.StatusCode,
  62214. },
  62215. }
  62216. target := &ret
  62217. if err := gensupport.DecodeResponse(target, res); err != nil {
  62218. return nil, err
  62219. }
  62220. return ret, nil
  62221. // {
  62222. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  62223. // "httpMethod": "GET",
  62224. // "id": "compute.regionOperations.list",
  62225. // "parameterOrder": [
  62226. // "project",
  62227. // "region"
  62228. // ],
  62229. // "parameters": {
  62230. // "filter": {
  62231. // "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).",
  62232. // "location": "query",
  62233. // "type": "string"
  62234. // },
  62235. // "maxResults": {
  62236. // "default": "500",
  62237. // "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)",
  62238. // "format": "uint32",
  62239. // "location": "query",
  62240. // "minimum": "0",
  62241. // "type": "integer"
  62242. // },
  62243. // "orderBy": {
  62244. // "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.",
  62245. // "location": "query",
  62246. // "type": "string"
  62247. // },
  62248. // "pageToken": {
  62249. // "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.",
  62250. // "location": "query",
  62251. // "type": "string"
  62252. // },
  62253. // "project": {
  62254. // "description": "Project ID for this request.",
  62255. // "location": "path",
  62256. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62257. // "required": true,
  62258. // "type": "string"
  62259. // },
  62260. // "region": {
  62261. // "description": "Name of the region for this request.",
  62262. // "location": "path",
  62263. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62264. // "required": true,
  62265. // "type": "string"
  62266. // }
  62267. // },
  62268. // "path": "{project}/regions/{region}/operations",
  62269. // "response": {
  62270. // "$ref": "OperationList"
  62271. // },
  62272. // "scopes": [
  62273. // "https://www.googleapis.com/auth/cloud-platform",
  62274. // "https://www.googleapis.com/auth/compute",
  62275. // "https://www.googleapis.com/auth/compute.readonly"
  62276. // ]
  62277. // }
  62278. }
  62279. // Pages invokes f for each page of results.
  62280. // A non-nil error returned from f will halt the iteration.
  62281. // The provided context supersedes any context provided to the Context method.
  62282. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  62283. c.ctx_ = ctx
  62284. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62285. for {
  62286. x, err := c.Do()
  62287. if err != nil {
  62288. return err
  62289. }
  62290. if err := f(x); err != nil {
  62291. return err
  62292. }
  62293. if x.NextPageToken == "" {
  62294. return nil
  62295. }
  62296. c.PageToken(x.NextPageToken)
  62297. }
  62298. }
  62299. // method id "compute.regions.get":
  62300. type RegionsGetCall struct {
  62301. s *Service
  62302. project string
  62303. region string
  62304. urlParams_ gensupport.URLParams
  62305. ifNoneMatch_ string
  62306. ctx_ context.Context
  62307. header_ http.Header
  62308. }
  62309. // Get: Returns the specified Region resource. Gets a list of available
  62310. // regions by making a list() request.
  62311. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  62312. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  62313. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62314. c.project = project
  62315. c.region = region
  62316. return c
  62317. }
  62318. // Fields allows partial responses to be retrieved. See
  62319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62320. // for more information.
  62321. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  62322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62323. return c
  62324. }
  62325. // IfNoneMatch sets the optional parameter which makes the operation
  62326. // fail if the object's ETag matches the given value. This is useful for
  62327. // getting updates only after the object has changed since the last
  62328. // request. Use googleapi.IsNotModified to check whether the response
  62329. // error from Do is the result of In-None-Match.
  62330. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  62331. c.ifNoneMatch_ = entityTag
  62332. return c
  62333. }
  62334. // Context sets the context to be used in this call's Do method. Any
  62335. // pending HTTP request will be aborted if the provided context is
  62336. // canceled.
  62337. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  62338. c.ctx_ = ctx
  62339. return c
  62340. }
  62341. // Header returns an http.Header that can be modified by the caller to
  62342. // add HTTP headers to the request.
  62343. func (c *RegionsGetCall) Header() http.Header {
  62344. if c.header_ == nil {
  62345. c.header_ = make(http.Header)
  62346. }
  62347. return c.header_
  62348. }
  62349. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  62350. reqHeaders := make(http.Header)
  62351. for k, v := range c.header_ {
  62352. reqHeaders[k] = v
  62353. }
  62354. reqHeaders.Set("User-Agent", c.s.userAgent())
  62355. if c.ifNoneMatch_ != "" {
  62356. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62357. }
  62358. var body io.Reader = nil
  62359. c.urlParams_.Set("alt", alt)
  62360. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  62361. urls += "?" + c.urlParams_.Encode()
  62362. req, _ := http.NewRequest("GET", urls, body)
  62363. req.Header = reqHeaders
  62364. googleapi.Expand(req.URL, map[string]string{
  62365. "project": c.project,
  62366. "region": c.region,
  62367. })
  62368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62369. }
  62370. // Do executes the "compute.regions.get" call.
  62371. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  62372. // code is an error. Response headers are in either
  62373. // *Region.ServerResponse.Header or (if a response was returned at all)
  62374. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  62375. // check whether the returned error was because http.StatusNotModified
  62376. // was returned.
  62377. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  62378. gensupport.SetOptions(c.urlParams_, opts...)
  62379. res, err := c.doRequest("json")
  62380. if res != nil && res.StatusCode == http.StatusNotModified {
  62381. if res.Body != nil {
  62382. res.Body.Close()
  62383. }
  62384. return nil, &googleapi.Error{
  62385. Code: res.StatusCode,
  62386. Header: res.Header,
  62387. }
  62388. }
  62389. if err != nil {
  62390. return nil, err
  62391. }
  62392. defer googleapi.CloseBody(res)
  62393. if err := googleapi.CheckResponse(res); err != nil {
  62394. return nil, err
  62395. }
  62396. ret := &Region{
  62397. ServerResponse: googleapi.ServerResponse{
  62398. Header: res.Header,
  62399. HTTPStatusCode: res.StatusCode,
  62400. },
  62401. }
  62402. target := &ret
  62403. if err := gensupport.DecodeResponse(target, res); err != nil {
  62404. return nil, err
  62405. }
  62406. return ret, nil
  62407. // {
  62408. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  62409. // "httpMethod": "GET",
  62410. // "id": "compute.regions.get",
  62411. // "parameterOrder": [
  62412. // "project",
  62413. // "region"
  62414. // ],
  62415. // "parameters": {
  62416. // "project": {
  62417. // "description": "Project ID for this request.",
  62418. // "location": "path",
  62419. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62420. // "required": true,
  62421. // "type": "string"
  62422. // },
  62423. // "region": {
  62424. // "description": "Name of the region resource to return.",
  62425. // "location": "path",
  62426. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62427. // "required": true,
  62428. // "type": "string"
  62429. // }
  62430. // },
  62431. // "path": "{project}/regions/{region}",
  62432. // "response": {
  62433. // "$ref": "Region"
  62434. // },
  62435. // "scopes": [
  62436. // "https://www.googleapis.com/auth/cloud-platform",
  62437. // "https://www.googleapis.com/auth/compute",
  62438. // "https://www.googleapis.com/auth/compute.readonly"
  62439. // ]
  62440. // }
  62441. }
  62442. // method id "compute.regions.list":
  62443. type RegionsListCall struct {
  62444. s *Service
  62445. project string
  62446. urlParams_ gensupport.URLParams
  62447. ifNoneMatch_ string
  62448. ctx_ context.Context
  62449. header_ http.Header
  62450. }
  62451. // List: Retrieves the list of region resources available to the
  62452. // specified project.
  62453. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  62454. func (r *RegionsService) List(project string) *RegionsListCall {
  62455. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62456. c.project = project
  62457. return c
  62458. }
  62459. // Filter sets the optional parameter "filter": A filter expression that
  62460. // filters resources listed in the response. The expression must specify
  62461. // the field name, a comparison operator, and the value that you want to
  62462. // use for filtering. The value must be a string, a number, or a
  62463. // boolean. The comparison operator must be either =, !=, >, or <.
  62464. //
  62465. // For example, if you are filtering Compute Engine instances, you can
  62466. // exclude instances named example-instance by specifying name !=
  62467. // example-instance.
  62468. //
  62469. // You can also filter nested fields. For example, you could specify
  62470. // scheduling.automaticRestart = false to include instances only if they
  62471. // are not scheduled for automatic restarts. You can use filtering on
  62472. // nested fields to filter based on resource labels.
  62473. //
  62474. // To filter on multiple expressions, provide each separate expression
  62475. // within parentheses. For example, (scheduling.automaticRestart = true)
  62476. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62477. // AND expression. However, you can include AND and OR expressions
  62478. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62479. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62480. // true).
  62481. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  62482. c.urlParams_.Set("filter", filter)
  62483. return c
  62484. }
  62485. // MaxResults sets the optional parameter "maxResults": The maximum
  62486. // number of results per page that should be returned. If the number of
  62487. // available results is larger than maxResults, Compute Engine returns a
  62488. // nextPageToken that can be used to get the next page of results in
  62489. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62490. // (Default: 500)
  62491. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  62492. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62493. return c
  62494. }
  62495. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62496. // a certain order. By default, results are returned in alphanumerical
  62497. // order based on the resource name.
  62498. //
  62499. // You can also sort results in descending order based on the creation
  62500. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62501. // based on the creationTimestamp field in reverse chronological order
  62502. // (newest result first). Use this to sort resources like operations so
  62503. // that the newest operation is returned first.
  62504. //
  62505. // Currently, only sorting by name or creationTimestamp desc is
  62506. // supported.
  62507. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  62508. c.urlParams_.Set("orderBy", orderBy)
  62509. return c
  62510. }
  62511. // PageToken sets the optional parameter "pageToken": Specifies a page
  62512. // token to use. Set pageToken to the nextPageToken returned by a
  62513. // previous list request to get the next page of results.
  62514. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  62515. c.urlParams_.Set("pageToken", pageToken)
  62516. return c
  62517. }
  62518. // Fields allows partial responses to be retrieved. See
  62519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62520. // for more information.
  62521. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  62522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62523. return c
  62524. }
  62525. // IfNoneMatch sets the optional parameter which makes the operation
  62526. // fail if the object's ETag matches the given value. This is useful for
  62527. // getting updates only after the object has changed since the last
  62528. // request. Use googleapi.IsNotModified to check whether the response
  62529. // error from Do is the result of In-None-Match.
  62530. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  62531. c.ifNoneMatch_ = entityTag
  62532. return c
  62533. }
  62534. // Context sets the context to be used in this call's Do method. Any
  62535. // pending HTTP request will be aborted if the provided context is
  62536. // canceled.
  62537. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  62538. c.ctx_ = ctx
  62539. return c
  62540. }
  62541. // Header returns an http.Header that can be modified by the caller to
  62542. // add HTTP headers to the request.
  62543. func (c *RegionsListCall) Header() http.Header {
  62544. if c.header_ == nil {
  62545. c.header_ = make(http.Header)
  62546. }
  62547. return c.header_
  62548. }
  62549. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  62550. reqHeaders := make(http.Header)
  62551. for k, v := range c.header_ {
  62552. reqHeaders[k] = v
  62553. }
  62554. reqHeaders.Set("User-Agent", c.s.userAgent())
  62555. if c.ifNoneMatch_ != "" {
  62556. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62557. }
  62558. var body io.Reader = nil
  62559. c.urlParams_.Set("alt", alt)
  62560. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  62561. urls += "?" + c.urlParams_.Encode()
  62562. req, _ := http.NewRequest("GET", urls, body)
  62563. req.Header = reqHeaders
  62564. googleapi.Expand(req.URL, map[string]string{
  62565. "project": c.project,
  62566. })
  62567. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62568. }
  62569. // Do executes the "compute.regions.list" call.
  62570. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  62571. // status code is an error. Response headers are in either
  62572. // *RegionList.ServerResponse.Header or (if a response was returned at
  62573. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62574. // to check whether the returned error was because
  62575. // http.StatusNotModified was returned.
  62576. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  62577. gensupport.SetOptions(c.urlParams_, opts...)
  62578. res, err := c.doRequest("json")
  62579. if res != nil && res.StatusCode == http.StatusNotModified {
  62580. if res.Body != nil {
  62581. res.Body.Close()
  62582. }
  62583. return nil, &googleapi.Error{
  62584. Code: res.StatusCode,
  62585. Header: res.Header,
  62586. }
  62587. }
  62588. if err != nil {
  62589. return nil, err
  62590. }
  62591. defer googleapi.CloseBody(res)
  62592. if err := googleapi.CheckResponse(res); err != nil {
  62593. return nil, err
  62594. }
  62595. ret := &RegionList{
  62596. ServerResponse: googleapi.ServerResponse{
  62597. Header: res.Header,
  62598. HTTPStatusCode: res.StatusCode,
  62599. },
  62600. }
  62601. target := &ret
  62602. if err := gensupport.DecodeResponse(target, res); err != nil {
  62603. return nil, err
  62604. }
  62605. return ret, nil
  62606. // {
  62607. // "description": "Retrieves the list of region resources available to the specified project.",
  62608. // "httpMethod": "GET",
  62609. // "id": "compute.regions.list",
  62610. // "parameterOrder": [
  62611. // "project"
  62612. // ],
  62613. // "parameters": {
  62614. // "filter": {
  62615. // "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).",
  62616. // "location": "query",
  62617. // "type": "string"
  62618. // },
  62619. // "maxResults": {
  62620. // "default": "500",
  62621. // "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)",
  62622. // "format": "uint32",
  62623. // "location": "query",
  62624. // "minimum": "0",
  62625. // "type": "integer"
  62626. // },
  62627. // "orderBy": {
  62628. // "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.",
  62629. // "location": "query",
  62630. // "type": "string"
  62631. // },
  62632. // "pageToken": {
  62633. // "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.",
  62634. // "location": "query",
  62635. // "type": "string"
  62636. // },
  62637. // "project": {
  62638. // "description": "Project ID for this request.",
  62639. // "location": "path",
  62640. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62641. // "required": true,
  62642. // "type": "string"
  62643. // }
  62644. // },
  62645. // "path": "{project}/regions",
  62646. // "response": {
  62647. // "$ref": "RegionList"
  62648. // },
  62649. // "scopes": [
  62650. // "https://www.googleapis.com/auth/cloud-platform",
  62651. // "https://www.googleapis.com/auth/compute",
  62652. // "https://www.googleapis.com/auth/compute.readonly"
  62653. // ]
  62654. // }
  62655. }
  62656. // Pages invokes f for each page of results.
  62657. // A non-nil error returned from f will halt the iteration.
  62658. // The provided context supersedes any context provided to the Context method.
  62659. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  62660. c.ctx_ = ctx
  62661. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62662. for {
  62663. x, err := c.Do()
  62664. if err != nil {
  62665. return err
  62666. }
  62667. if err := f(x); err != nil {
  62668. return err
  62669. }
  62670. if x.NextPageToken == "" {
  62671. return nil
  62672. }
  62673. c.PageToken(x.NextPageToken)
  62674. }
  62675. }
  62676. // method id "compute.routers.aggregatedList":
  62677. type RoutersAggregatedListCall struct {
  62678. s *Service
  62679. project string
  62680. urlParams_ gensupport.URLParams
  62681. ifNoneMatch_ string
  62682. ctx_ context.Context
  62683. header_ http.Header
  62684. }
  62685. // AggregatedList: Retrieves an aggregated list of routers.
  62686. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  62687. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62688. c.project = project
  62689. return c
  62690. }
  62691. // Filter sets the optional parameter "filter": A filter expression that
  62692. // filters resources listed in the response. The expression must specify
  62693. // the field name, a comparison operator, and the value that you want to
  62694. // use for filtering. The value must be a string, a number, or a
  62695. // boolean. The comparison operator must be either =, !=, >, or <.
  62696. //
  62697. // For example, if you are filtering Compute Engine instances, you can
  62698. // exclude instances named example-instance by specifying name !=
  62699. // example-instance.
  62700. //
  62701. // You can also filter nested fields. For example, you could specify
  62702. // scheduling.automaticRestart = false to include instances only if they
  62703. // are not scheduled for automatic restarts. You can use filtering on
  62704. // nested fields to filter based on resource labels.
  62705. //
  62706. // To filter on multiple expressions, provide each separate expression
  62707. // within parentheses. For example, (scheduling.automaticRestart = true)
  62708. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62709. // AND expression. However, you can include AND and OR expressions
  62710. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62711. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62712. // true).
  62713. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  62714. c.urlParams_.Set("filter", filter)
  62715. return c
  62716. }
  62717. // MaxResults sets the optional parameter "maxResults": The maximum
  62718. // number of results per page that should be returned. If the number of
  62719. // available results is larger than maxResults, Compute Engine returns a
  62720. // nextPageToken that can be used to get the next page of results in
  62721. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62722. // (Default: 500)
  62723. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  62724. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62725. return c
  62726. }
  62727. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62728. // a certain order. By default, results are returned in alphanumerical
  62729. // order based on the resource name.
  62730. //
  62731. // You can also sort results in descending order based on the creation
  62732. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62733. // based on the creationTimestamp field in reverse chronological order
  62734. // (newest result first). Use this to sort resources like operations so
  62735. // that the newest operation is returned first.
  62736. //
  62737. // Currently, only sorting by name or creationTimestamp desc is
  62738. // supported.
  62739. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  62740. c.urlParams_.Set("orderBy", orderBy)
  62741. return c
  62742. }
  62743. // PageToken sets the optional parameter "pageToken": Specifies a page
  62744. // token to use. Set pageToken to the nextPageToken returned by a
  62745. // previous list request to get the next page of results.
  62746. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  62747. c.urlParams_.Set("pageToken", pageToken)
  62748. return c
  62749. }
  62750. // Fields allows partial responses to be retrieved. See
  62751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62752. // for more information.
  62753. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  62754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62755. return c
  62756. }
  62757. // IfNoneMatch sets the optional parameter which makes the operation
  62758. // fail if the object's ETag matches the given value. This is useful for
  62759. // getting updates only after the object has changed since the last
  62760. // request. Use googleapi.IsNotModified to check whether the response
  62761. // error from Do is the result of In-None-Match.
  62762. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  62763. c.ifNoneMatch_ = entityTag
  62764. return c
  62765. }
  62766. // Context sets the context to be used in this call's Do method. Any
  62767. // pending HTTP request will be aborted if the provided context is
  62768. // canceled.
  62769. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  62770. c.ctx_ = ctx
  62771. return c
  62772. }
  62773. // Header returns an http.Header that can be modified by the caller to
  62774. // add HTTP headers to the request.
  62775. func (c *RoutersAggregatedListCall) Header() http.Header {
  62776. if c.header_ == nil {
  62777. c.header_ = make(http.Header)
  62778. }
  62779. return c.header_
  62780. }
  62781. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  62782. reqHeaders := make(http.Header)
  62783. for k, v := range c.header_ {
  62784. reqHeaders[k] = v
  62785. }
  62786. reqHeaders.Set("User-Agent", c.s.userAgent())
  62787. if c.ifNoneMatch_ != "" {
  62788. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62789. }
  62790. var body io.Reader = nil
  62791. c.urlParams_.Set("alt", alt)
  62792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  62793. urls += "?" + c.urlParams_.Encode()
  62794. req, _ := http.NewRequest("GET", urls, body)
  62795. req.Header = reqHeaders
  62796. googleapi.Expand(req.URL, map[string]string{
  62797. "project": c.project,
  62798. })
  62799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62800. }
  62801. // Do executes the "compute.routers.aggregatedList" call.
  62802. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  62803. // non-2xx status code is an error. Response headers are in either
  62804. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  62805. // returned at all) in error.(*googleapi.Error).Header. Use
  62806. // googleapi.IsNotModified to check whether the returned error was
  62807. // because http.StatusNotModified was returned.
  62808. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  62809. gensupport.SetOptions(c.urlParams_, opts...)
  62810. res, err := c.doRequest("json")
  62811. if res != nil && res.StatusCode == http.StatusNotModified {
  62812. if res.Body != nil {
  62813. res.Body.Close()
  62814. }
  62815. return nil, &googleapi.Error{
  62816. Code: res.StatusCode,
  62817. Header: res.Header,
  62818. }
  62819. }
  62820. if err != nil {
  62821. return nil, err
  62822. }
  62823. defer googleapi.CloseBody(res)
  62824. if err := googleapi.CheckResponse(res); err != nil {
  62825. return nil, err
  62826. }
  62827. ret := &RouterAggregatedList{
  62828. ServerResponse: googleapi.ServerResponse{
  62829. Header: res.Header,
  62830. HTTPStatusCode: res.StatusCode,
  62831. },
  62832. }
  62833. target := &ret
  62834. if err := gensupport.DecodeResponse(target, res); err != nil {
  62835. return nil, err
  62836. }
  62837. return ret, nil
  62838. // {
  62839. // "description": "Retrieves an aggregated list of routers.",
  62840. // "httpMethod": "GET",
  62841. // "id": "compute.routers.aggregatedList",
  62842. // "parameterOrder": [
  62843. // "project"
  62844. // ],
  62845. // "parameters": {
  62846. // "filter": {
  62847. // "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).",
  62848. // "location": "query",
  62849. // "type": "string"
  62850. // },
  62851. // "maxResults": {
  62852. // "default": "500",
  62853. // "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)",
  62854. // "format": "uint32",
  62855. // "location": "query",
  62856. // "minimum": "0",
  62857. // "type": "integer"
  62858. // },
  62859. // "orderBy": {
  62860. // "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.",
  62861. // "location": "query",
  62862. // "type": "string"
  62863. // },
  62864. // "pageToken": {
  62865. // "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.",
  62866. // "location": "query",
  62867. // "type": "string"
  62868. // },
  62869. // "project": {
  62870. // "description": "Project ID for this request.",
  62871. // "location": "path",
  62872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62873. // "required": true,
  62874. // "type": "string"
  62875. // }
  62876. // },
  62877. // "path": "{project}/aggregated/routers",
  62878. // "response": {
  62879. // "$ref": "RouterAggregatedList"
  62880. // },
  62881. // "scopes": [
  62882. // "https://www.googleapis.com/auth/cloud-platform",
  62883. // "https://www.googleapis.com/auth/compute",
  62884. // "https://www.googleapis.com/auth/compute.readonly"
  62885. // ]
  62886. // }
  62887. }
  62888. // Pages invokes f for each page of results.
  62889. // A non-nil error returned from f will halt the iteration.
  62890. // The provided context supersedes any context provided to the Context method.
  62891. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  62892. c.ctx_ = ctx
  62893. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62894. for {
  62895. x, err := c.Do()
  62896. if err != nil {
  62897. return err
  62898. }
  62899. if err := f(x); err != nil {
  62900. return err
  62901. }
  62902. if x.NextPageToken == "" {
  62903. return nil
  62904. }
  62905. c.PageToken(x.NextPageToken)
  62906. }
  62907. }
  62908. // method id "compute.routers.delete":
  62909. type RoutersDeleteCall struct {
  62910. s *Service
  62911. project string
  62912. region string
  62913. router string
  62914. urlParams_ gensupport.URLParams
  62915. ctx_ context.Context
  62916. header_ http.Header
  62917. }
  62918. // Delete: Deletes the specified Router resource.
  62919. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  62920. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62921. c.project = project
  62922. c.region = region
  62923. c.router = router
  62924. return c
  62925. }
  62926. // RequestId sets the optional parameter "requestId": An optional
  62927. // request ID to identify requests. Specify a unique request ID so that
  62928. // if you must retry your request, the server will know to ignore the
  62929. // request if it has already been completed.
  62930. //
  62931. // For example, consider a situation where you make an initial request
  62932. // and the request times out. If you make the request again with the
  62933. // same request ID, the server can check if original operation with the
  62934. // same request ID was received, and if so, will ignore the second
  62935. // request. This prevents clients from accidentally creating duplicate
  62936. // commitments.
  62937. //
  62938. // The request ID must be a valid UUID with the exception that zero UUID
  62939. // is not supported (00000000-0000-0000-0000-000000000000).
  62940. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  62941. c.urlParams_.Set("requestId", requestId)
  62942. return c
  62943. }
  62944. // Fields allows partial responses to be retrieved. See
  62945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62946. // for more information.
  62947. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  62948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62949. return c
  62950. }
  62951. // Context sets the context to be used in this call's Do method. Any
  62952. // pending HTTP request will be aborted if the provided context is
  62953. // canceled.
  62954. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  62955. c.ctx_ = ctx
  62956. return c
  62957. }
  62958. // Header returns an http.Header that can be modified by the caller to
  62959. // add HTTP headers to the request.
  62960. func (c *RoutersDeleteCall) Header() http.Header {
  62961. if c.header_ == nil {
  62962. c.header_ = make(http.Header)
  62963. }
  62964. return c.header_
  62965. }
  62966. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  62967. reqHeaders := make(http.Header)
  62968. for k, v := range c.header_ {
  62969. reqHeaders[k] = v
  62970. }
  62971. reqHeaders.Set("User-Agent", c.s.userAgent())
  62972. var body io.Reader = nil
  62973. c.urlParams_.Set("alt", alt)
  62974. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  62975. urls += "?" + c.urlParams_.Encode()
  62976. req, _ := http.NewRequest("DELETE", urls, body)
  62977. req.Header = reqHeaders
  62978. googleapi.Expand(req.URL, map[string]string{
  62979. "project": c.project,
  62980. "region": c.region,
  62981. "router": c.router,
  62982. })
  62983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62984. }
  62985. // Do executes the "compute.routers.delete" call.
  62986. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62987. // status code is an error. Response headers are in either
  62988. // *Operation.ServerResponse.Header or (if a response was returned at
  62989. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62990. // to check whether the returned error was because
  62991. // http.StatusNotModified was returned.
  62992. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62993. gensupport.SetOptions(c.urlParams_, opts...)
  62994. res, err := c.doRequest("json")
  62995. if res != nil && res.StatusCode == http.StatusNotModified {
  62996. if res.Body != nil {
  62997. res.Body.Close()
  62998. }
  62999. return nil, &googleapi.Error{
  63000. Code: res.StatusCode,
  63001. Header: res.Header,
  63002. }
  63003. }
  63004. if err != nil {
  63005. return nil, err
  63006. }
  63007. defer googleapi.CloseBody(res)
  63008. if err := googleapi.CheckResponse(res); err != nil {
  63009. return nil, err
  63010. }
  63011. ret := &Operation{
  63012. ServerResponse: googleapi.ServerResponse{
  63013. Header: res.Header,
  63014. HTTPStatusCode: res.StatusCode,
  63015. },
  63016. }
  63017. target := &ret
  63018. if err := gensupport.DecodeResponse(target, res); err != nil {
  63019. return nil, err
  63020. }
  63021. return ret, nil
  63022. // {
  63023. // "description": "Deletes the specified Router resource.",
  63024. // "httpMethod": "DELETE",
  63025. // "id": "compute.routers.delete",
  63026. // "parameterOrder": [
  63027. // "project",
  63028. // "region",
  63029. // "router"
  63030. // ],
  63031. // "parameters": {
  63032. // "project": {
  63033. // "description": "Project ID for this request.",
  63034. // "location": "path",
  63035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63036. // "required": true,
  63037. // "type": "string"
  63038. // },
  63039. // "region": {
  63040. // "description": "Name of the region for this request.",
  63041. // "location": "path",
  63042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63043. // "required": true,
  63044. // "type": "string"
  63045. // },
  63046. // "requestId": {
  63047. // "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).",
  63048. // "location": "query",
  63049. // "type": "string"
  63050. // },
  63051. // "router": {
  63052. // "description": "Name of the Router resource to delete.",
  63053. // "location": "path",
  63054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63055. // "required": true,
  63056. // "type": "string"
  63057. // }
  63058. // },
  63059. // "path": "{project}/regions/{region}/routers/{router}",
  63060. // "response": {
  63061. // "$ref": "Operation"
  63062. // },
  63063. // "scopes": [
  63064. // "https://www.googleapis.com/auth/cloud-platform",
  63065. // "https://www.googleapis.com/auth/compute"
  63066. // ]
  63067. // }
  63068. }
  63069. // method id "compute.routers.get":
  63070. type RoutersGetCall struct {
  63071. s *Service
  63072. project string
  63073. region string
  63074. router string
  63075. urlParams_ gensupport.URLParams
  63076. ifNoneMatch_ string
  63077. ctx_ context.Context
  63078. header_ http.Header
  63079. }
  63080. // Get: Returns the specified Router resource. Gets a list of available
  63081. // routers by making a list() request.
  63082. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  63083. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63084. c.project = project
  63085. c.region = region
  63086. c.router = router
  63087. return c
  63088. }
  63089. // Fields allows partial responses to be retrieved. See
  63090. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63091. // for more information.
  63092. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  63093. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63094. return c
  63095. }
  63096. // IfNoneMatch sets the optional parameter which makes the operation
  63097. // fail if the object's ETag matches the given value. This is useful for
  63098. // getting updates only after the object has changed since the last
  63099. // request. Use googleapi.IsNotModified to check whether the response
  63100. // error from Do is the result of In-None-Match.
  63101. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  63102. c.ifNoneMatch_ = entityTag
  63103. return c
  63104. }
  63105. // Context sets the context to be used in this call's Do method. Any
  63106. // pending HTTP request will be aborted if the provided context is
  63107. // canceled.
  63108. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  63109. c.ctx_ = ctx
  63110. return c
  63111. }
  63112. // Header returns an http.Header that can be modified by the caller to
  63113. // add HTTP headers to the request.
  63114. func (c *RoutersGetCall) Header() http.Header {
  63115. if c.header_ == nil {
  63116. c.header_ = make(http.Header)
  63117. }
  63118. return c.header_
  63119. }
  63120. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  63121. reqHeaders := make(http.Header)
  63122. for k, v := range c.header_ {
  63123. reqHeaders[k] = v
  63124. }
  63125. reqHeaders.Set("User-Agent", c.s.userAgent())
  63126. if c.ifNoneMatch_ != "" {
  63127. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63128. }
  63129. var body io.Reader = nil
  63130. c.urlParams_.Set("alt", alt)
  63131. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  63132. urls += "?" + c.urlParams_.Encode()
  63133. req, _ := http.NewRequest("GET", urls, body)
  63134. req.Header = reqHeaders
  63135. googleapi.Expand(req.URL, map[string]string{
  63136. "project": c.project,
  63137. "region": c.region,
  63138. "router": c.router,
  63139. })
  63140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63141. }
  63142. // Do executes the "compute.routers.get" call.
  63143. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  63144. // code is an error. Response headers are in either
  63145. // *Router.ServerResponse.Header or (if a response was returned at all)
  63146. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  63147. // check whether the returned error was because http.StatusNotModified
  63148. // was returned.
  63149. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  63150. gensupport.SetOptions(c.urlParams_, opts...)
  63151. res, err := c.doRequest("json")
  63152. if res != nil && res.StatusCode == http.StatusNotModified {
  63153. if res.Body != nil {
  63154. res.Body.Close()
  63155. }
  63156. return nil, &googleapi.Error{
  63157. Code: res.StatusCode,
  63158. Header: res.Header,
  63159. }
  63160. }
  63161. if err != nil {
  63162. return nil, err
  63163. }
  63164. defer googleapi.CloseBody(res)
  63165. if err := googleapi.CheckResponse(res); err != nil {
  63166. return nil, err
  63167. }
  63168. ret := &Router{
  63169. ServerResponse: googleapi.ServerResponse{
  63170. Header: res.Header,
  63171. HTTPStatusCode: res.StatusCode,
  63172. },
  63173. }
  63174. target := &ret
  63175. if err := gensupport.DecodeResponse(target, res); err != nil {
  63176. return nil, err
  63177. }
  63178. return ret, nil
  63179. // {
  63180. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  63181. // "httpMethod": "GET",
  63182. // "id": "compute.routers.get",
  63183. // "parameterOrder": [
  63184. // "project",
  63185. // "region",
  63186. // "router"
  63187. // ],
  63188. // "parameters": {
  63189. // "project": {
  63190. // "description": "Project ID for this request.",
  63191. // "location": "path",
  63192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63193. // "required": true,
  63194. // "type": "string"
  63195. // },
  63196. // "region": {
  63197. // "description": "Name of the region for this request.",
  63198. // "location": "path",
  63199. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63200. // "required": true,
  63201. // "type": "string"
  63202. // },
  63203. // "router": {
  63204. // "description": "Name of the Router resource to return.",
  63205. // "location": "path",
  63206. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63207. // "required": true,
  63208. // "type": "string"
  63209. // }
  63210. // },
  63211. // "path": "{project}/regions/{region}/routers/{router}",
  63212. // "response": {
  63213. // "$ref": "Router"
  63214. // },
  63215. // "scopes": [
  63216. // "https://www.googleapis.com/auth/cloud-platform",
  63217. // "https://www.googleapis.com/auth/compute",
  63218. // "https://www.googleapis.com/auth/compute.readonly"
  63219. // ]
  63220. // }
  63221. }
  63222. // method id "compute.routers.getRouterStatus":
  63223. type RoutersGetRouterStatusCall struct {
  63224. s *Service
  63225. project string
  63226. region string
  63227. router string
  63228. urlParams_ gensupport.URLParams
  63229. ifNoneMatch_ string
  63230. ctx_ context.Context
  63231. header_ http.Header
  63232. }
  63233. // GetRouterStatus: Retrieves runtime information of the specified
  63234. // router.
  63235. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  63236. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63237. c.project = project
  63238. c.region = region
  63239. c.router = router
  63240. return c
  63241. }
  63242. // Fields allows partial responses to be retrieved. See
  63243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63244. // for more information.
  63245. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  63246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63247. return c
  63248. }
  63249. // IfNoneMatch sets the optional parameter which makes the operation
  63250. // fail if the object's ETag matches the given value. This is useful for
  63251. // getting updates only after the object has changed since the last
  63252. // request. Use googleapi.IsNotModified to check whether the response
  63253. // error from Do is the result of In-None-Match.
  63254. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  63255. c.ifNoneMatch_ = entityTag
  63256. return c
  63257. }
  63258. // Context sets the context to be used in this call's Do method. Any
  63259. // pending HTTP request will be aborted if the provided context is
  63260. // canceled.
  63261. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  63262. c.ctx_ = ctx
  63263. return c
  63264. }
  63265. // Header returns an http.Header that can be modified by the caller to
  63266. // add HTTP headers to the request.
  63267. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  63268. if c.header_ == nil {
  63269. c.header_ = make(http.Header)
  63270. }
  63271. return c.header_
  63272. }
  63273. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  63274. reqHeaders := make(http.Header)
  63275. for k, v := range c.header_ {
  63276. reqHeaders[k] = v
  63277. }
  63278. reqHeaders.Set("User-Agent", c.s.userAgent())
  63279. if c.ifNoneMatch_ != "" {
  63280. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63281. }
  63282. var body io.Reader = nil
  63283. c.urlParams_.Set("alt", alt)
  63284. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  63285. urls += "?" + c.urlParams_.Encode()
  63286. req, _ := http.NewRequest("GET", urls, body)
  63287. req.Header = reqHeaders
  63288. googleapi.Expand(req.URL, map[string]string{
  63289. "project": c.project,
  63290. "region": c.region,
  63291. "router": c.router,
  63292. })
  63293. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63294. }
  63295. // Do executes the "compute.routers.getRouterStatus" call.
  63296. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  63297. // non-2xx status code is an error. Response headers are in either
  63298. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  63299. // returned at all) in error.(*googleapi.Error).Header. Use
  63300. // googleapi.IsNotModified to check whether the returned error was
  63301. // because http.StatusNotModified was returned.
  63302. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  63303. gensupport.SetOptions(c.urlParams_, opts...)
  63304. res, err := c.doRequest("json")
  63305. if res != nil && res.StatusCode == http.StatusNotModified {
  63306. if res.Body != nil {
  63307. res.Body.Close()
  63308. }
  63309. return nil, &googleapi.Error{
  63310. Code: res.StatusCode,
  63311. Header: res.Header,
  63312. }
  63313. }
  63314. if err != nil {
  63315. return nil, err
  63316. }
  63317. defer googleapi.CloseBody(res)
  63318. if err := googleapi.CheckResponse(res); err != nil {
  63319. return nil, err
  63320. }
  63321. ret := &RouterStatusResponse{
  63322. ServerResponse: googleapi.ServerResponse{
  63323. Header: res.Header,
  63324. HTTPStatusCode: res.StatusCode,
  63325. },
  63326. }
  63327. target := &ret
  63328. if err := gensupport.DecodeResponse(target, res); err != nil {
  63329. return nil, err
  63330. }
  63331. return ret, nil
  63332. // {
  63333. // "description": "Retrieves runtime information of the specified router.",
  63334. // "httpMethod": "GET",
  63335. // "id": "compute.routers.getRouterStatus",
  63336. // "parameterOrder": [
  63337. // "project",
  63338. // "region",
  63339. // "router"
  63340. // ],
  63341. // "parameters": {
  63342. // "project": {
  63343. // "description": "Project ID for this request.",
  63344. // "location": "path",
  63345. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63346. // "required": true,
  63347. // "type": "string"
  63348. // },
  63349. // "region": {
  63350. // "description": "Name of the region for this request.",
  63351. // "location": "path",
  63352. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63353. // "required": true,
  63354. // "type": "string"
  63355. // },
  63356. // "router": {
  63357. // "description": "Name of the Router resource to query.",
  63358. // "location": "path",
  63359. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63360. // "required": true,
  63361. // "type": "string"
  63362. // }
  63363. // },
  63364. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  63365. // "response": {
  63366. // "$ref": "RouterStatusResponse"
  63367. // },
  63368. // "scopes": [
  63369. // "https://www.googleapis.com/auth/cloud-platform",
  63370. // "https://www.googleapis.com/auth/compute",
  63371. // "https://www.googleapis.com/auth/compute.readonly"
  63372. // ]
  63373. // }
  63374. }
  63375. // method id "compute.routers.insert":
  63376. type RoutersInsertCall struct {
  63377. s *Service
  63378. project string
  63379. region string
  63380. router *Router
  63381. urlParams_ gensupport.URLParams
  63382. ctx_ context.Context
  63383. header_ http.Header
  63384. }
  63385. // Insert: Creates a Router resource in the specified project and region
  63386. // using the data included in the request.
  63387. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  63388. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63389. c.project = project
  63390. c.region = region
  63391. c.router = router
  63392. return c
  63393. }
  63394. // RequestId sets the optional parameter "requestId": An optional
  63395. // request ID to identify requests. Specify a unique request ID so that
  63396. // if you must retry your request, the server will know to ignore the
  63397. // request if it has already been completed.
  63398. //
  63399. // For example, consider a situation where you make an initial request
  63400. // and the request times out. If you make the request again with the
  63401. // same request ID, the server can check if original operation with the
  63402. // same request ID was received, and if so, will ignore the second
  63403. // request. This prevents clients from accidentally creating duplicate
  63404. // commitments.
  63405. //
  63406. // The request ID must be a valid UUID with the exception that zero UUID
  63407. // is not supported (00000000-0000-0000-0000-000000000000).
  63408. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  63409. c.urlParams_.Set("requestId", requestId)
  63410. return c
  63411. }
  63412. // Fields allows partial responses to be retrieved. See
  63413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63414. // for more information.
  63415. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  63416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63417. return c
  63418. }
  63419. // Context sets the context to be used in this call's Do method. Any
  63420. // pending HTTP request will be aborted if the provided context is
  63421. // canceled.
  63422. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  63423. c.ctx_ = ctx
  63424. return c
  63425. }
  63426. // Header returns an http.Header that can be modified by the caller to
  63427. // add HTTP headers to the request.
  63428. func (c *RoutersInsertCall) Header() http.Header {
  63429. if c.header_ == nil {
  63430. c.header_ = make(http.Header)
  63431. }
  63432. return c.header_
  63433. }
  63434. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  63435. reqHeaders := make(http.Header)
  63436. for k, v := range c.header_ {
  63437. reqHeaders[k] = v
  63438. }
  63439. reqHeaders.Set("User-Agent", c.s.userAgent())
  63440. var body io.Reader = nil
  63441. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  63442. if err != nil {
  63443. return nil, err
  63444. }
  63445. reqHeaders.Set("Content-Type", "application/json")
  63446. c.urlParams_.Set("alt", alt)
  63447. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  63448. urls += "?" + c.urlParams_.Encode()
  63449. req, _ := http.NewRequest("POST", urls, body)
  63450. req.Header = reqHeaders
  63451. googleapi.Expand(req.URL, map[string]string{
  63452. "project": c.project,
  63453. "region": c.region,
  63454. })
  63455. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63456. }
  63457. // Do executes the "compute.routers.insert" call.
  63458. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63459. // status code is an error. Response headers are in either
  63460. // *Operation.ServerResponse.Header or (if a response was returned at
  63461. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63462. // to check whether the returned error was because
  63463. // http.StatusNotModified was returned.
  63464. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63465. gensupport.SetOptions(c.urlParams_, opts...)
  63466. res, err := c.doRequest("json")
  63467. if res != nil && res.StatusCode == http.StatusNotModified {
  63468. if res.Body != nil {
  63469. res.Body.Close()
  63470. }
  63471. return nil, &googleapi.Error{
  63472. Code: res.StatusCode,
  63473. Header: res.Header,
  63474. }
  63475. }
  63476. if err != nil {
  63477. return nil, err
  63478. }
  63479. defer googleapi.CloseBody(res)
  63480. if err := googleapi.CheckResponse(res); err != nil {
  63481. return nil, err
  63482. }
  63483. ret := &Operation{
  63484. ServerResponse: googleapi.ServerResponse{
  63485. Header: res.Header,
  63486. HTTPStatusCode: res.StatusCode,
  63487. },
  63488. }
  63489. target := &ret
  63490. if err := gensupport.DecodeResponse(target, res); err != nil {
  63491. return nil, err
  63492. }
  63493. return ret, nil
  63494. // {
  63495. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  63496. // "httpMethod": "POST",
  63497. // "id": "compute.routers.insert",
  63498. // "parameterOrder": [
  63499. // "project",
  63500. // "region"
  63501. // ],
  63502. // "parameters": {
  63503. // "project": {
  63504. // "description": "Project ID for this request.",
  63505. // "location": "path",
  63506. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63507. // "required": true,
  63508. // "type": "string"
  63509. // },
  63510. // "region": {
  63511. // "description": "Name of the region for this request.",
  63512. // "location": "path",
  63513. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63514. // "required": true,
  63515. // "type": "string"
  63516. // },
  63517. // "requestId": {
  63518. // "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).",
  63519. // "location": "query",
  63520. // "type": "string"
  63521. // }
  63522. // },
  63523. // "path": "{project}/regions/{region}/routers",
  63524. // "request": {
  63525. // "$ref": "Router"
  63526. // },
  63527. // "response": {
  63528. // "$ref": "Operation"
  63529. // },
  63530. // "scopes": [
  63531. // "https://www.googleapis.com/auth/cloud-platform",
  63532. // "https://www.googleapis.com/auth/compute"
  63533. // ]
  63534. // }
  63535. }
  63536. // method id "compute.routers.list":
  63537. type RoutersListCall struct {
  63538. s *Service
  63539. project string
  63540. region string
  63541. urlParams_ gensupport.URLParams
  63542. ifNoneMatch_ string
  63543. ctx_ context.Context
  63544. header_ http.Header
  63545. }
  63546. // List: Retrieves a list of Router resources available to the specified
  63547. // project.
  63548. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  63549. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63550. c.project = project
  63551. c.region = region
  63552. return c
  63553. }
  63554. // Filter sets the optional parameter "filter": A filter expression that
  63555. // filters resources listed in the response. The expression must specify
  63556. // the field name, a comparison operator, and the value that you want to
  63557. // use for filtering. The value must be a string, a number, or a
  63558. // boolean. The comparison operator must be either =, !=, >, or <.
  63559. //
  63560. // For example, if you are filtering Compute Engine instances, you can
  63561. // exclude instances named example-instance by specifying name !=
  63562. // example-instance.
  63563. //
  63564. // You can also filter nested fields. For example, you could specify
  63565. // scheduling.automaticRestart = false to include instances only if they
  63566. // are not scheduled for automatic restarts. You can use filtering on
  63567. // nested fields to filter based on resource labels.
  63568. //
  63569. // To filter on multiple expressions, provide each separate expression
  63570. // within parentheses. For example, (scheduling.automaticRestart = true)
  63571. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  63572. // AND expression. However, you can include AND and OR expressions
  63573. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  63574. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  63575. // true).
  63576. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  63577. c.urlParams_.Set("filter", filter)
  63578. return c
  63579. }
  63580. // MaxResults sets the optional parameter "maxResults": The maximum
  63581. // number of results per page that should be returned. If the number of
  63582. // available results is larger than maxResults, Compute Engine returns a
  63583. // nextPageToken that can be used to get the next page of results in
  63584. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  63585. // (Default: 500)
  63586. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  63587. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  63588. return c
  63589. }
  63590. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  63591. // a certain order. By default, results are returned in alphanumerical
  63592. // order based on the resource name.
  63593. //
  63594. // You can also sort results in descending order based on the creation
  63595. // timestamp using orderBy="creationTimestamp desc". This sorts results
  63596. // based on the creationTimestamp field in reverse chronological order
  63597. // (newest result first). Use this to sort resources like operations so
  63598. // that the newest operation is returned first.
  63599. //
  63600. // Currently, only sorting by name or creationTimestamp desc is
  63601. // supported.
  63602. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  63603. c.urlParams_.Set("orderBy", orderBy)
  63604. return c
  63605. }
  63606. // PageToken sets the optional parameter "pageToken": Specifies a page
  63607. // token to use. Set pageToken to the nextPageToken returned by a
  63608. // previous list request to get the next page of results.
  63609. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  63610. c.urlParams_.Set("pageToken", pageToken)
  63611. return c
  63612. }
  63613. // Fields allows partial responses to be retrieved. See
  63614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63615. // for more information.
  63616. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  63617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63618. return c
  63619. }
  63620. // IfNoneMatch sets the optional parameter which makes the operation
  63621. // fail if the object's ETag matches the given value. This is useful for
  63622. // getting updates only after the object has changed since the last
  63623. // request. Use googleapi.IsNotModified to check whether the response
  63624. // error from Do is the result of In-None-Match.
  63625. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  63626. c.ifNoneMatch_ = entityTag
  63627. return c
  63628. }
  63629. // Context sets the context to be used in this call's Do method. Any
  63630. // pending HTTP request will be aborted if the provided context is
  63631. // canceled.
  63632. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  63633. c.ctx_ = ctx
  63634. return c
  63635. }
  63636. // Header returns an http.Header that can be modified by the caller to
  63637. // add HTTP headers to the request.
  63638. func (c *RoutersListCall) Header() http.Header {
  63639. if c.header_ == nil {
  63640. c.header_ = make(http.Header)
  63641. }
  63642. return c.header_
  63643. }
  63644. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  63645. reqHeaders := make(http.Header)
  63646. for k, v := range c.header_ {
  63647. reqHeaders[k] = v
  63648. }
  63649. reqHeaders.Set("User-Agent", c.s.userAgent())
  63650. if c.ifNoneMatch_ != "" {
  63651. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63652. }
  63653. var body io.Reader = nil
  63654. c.urlParams_.Set("alt", alt)
  63655. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  63656. urls += "?" + c.urlParams_.Encode()
  63657. req, _ := http.NewRequest("GET", urls, body)
  63658. req.Header = reqHeaders
  63659. googleapi.Expand(req.URL, map[string]string{
  63660. "project": c.project,
  63661. "region": c.region,
  63662. })
  63663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63664. }
  63665. // Do executes the "compute.routers.list" call.
  63666. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  63667. // status code is an error. Response headers are in either
  63668. // *RouterList.ServerResponse.Header or (if a response was returned at
  63669. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63670. // to check whether the returned error was because
  63671. // http.StatusNotModified was returned.
  63672. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  63673. gensupport.SetOptions(c.urlParams_, opts...)
  63674. res, err := c.doRequest("json")
  63675. if res != nil && res.StatusCode == http.StatusNotModified {
  63676. if res.Body != nil {
  63677. res.Body.Close()
  63678. }
  63679. return nil, &googleapi.Error{
  63680. Code: res.StatusCode,
  63681. Header: res.Header,
  63682. }
  63683. }
  63684. if err != nil {
  63685. return nil, err
  63686. }
  63687. defer googleapi.CloseBody(res)
  63688. if err := googleapi.CheckResponse(res); err != nil {
  63689. return nil, err
  63690. }
  63691. ret := &RouterList{
  63692. ServerResponse: googleapi.ServerResponse{
  63693. Header: res.Header,
  63694. HTTPStatusCode: res.StatusCode,
  63695. },
  63696. }
  63697. target := &ret
  63698. if err := gensupport.DecodeResponse(target, res); err != nil {
  63699. return nil, err
  63700. }
  63701. return ret, nil
  63702. // {
  63703. // "description": "Retrieves a list of Router resources available to the specified project.",
  63704. // "httpMethod": "GET",
  63705. // "id": "compute.routers.list",
  63706. // "parameterOrder": [
  63707. // "project",
  63708. // "region"
  63709. // ],
  63710. // "parameters": {
  63711. // "filter": {
  63712. // "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).",
  63713. // "location": "query",
  63714. // "type": "string"
  63715. // },
  63716. // "maxResults": {
  63717. // "default": "500",
  63718. // "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)",
  63719. // "format": "uint32",
  63720. // "location": "query",
  63721. // "minimum": "0",
  63722. // "type": "integer"
  63723. // },
  63724. // "orderBy": {
  63725. // "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.",
  63726. // "location": "query",
  63727. // "type": "string"
  63728. // },
  63729. // "pageToken": {
  63730. // "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.",
  63731. // "location": "query",
  63732. // "type": "string"
  63733. // },
  63734. // "project": {
  63735. // "description": "Project ID for this request.",
  63736. // "location": "path",
  63737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63738. // "required": true,
  63739. // "type": "string"
  63740. // },
  63741. // "region": {
  63742. // "description": "Name of the region for this request.",
  63743. // "location": "path",
  63744. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63745. // "required": true,
  63746. // "type": "string"
  63747. // }
  63748. // },
  63749. // "path": "{project}/regions/{region}/routers",
  63750. // "response": {
  63751. // "$ref": "RouterList"
  63752. // },
  63753. // "scopes": [
  63754. // "https://www.googleapis.com/auth/cloud-platform",
  63755. // "https://www.googleapis.com/auth/compute",
  63756. // "https://www.googleapis.com/auth/compute.readonly"
  63757. // ]
  63758. // }
  63759. }
  63760. // Pages invokes f for each page of results.
  63761. // A non-nil error returned from f will halt the iteration.
  63762. // The provided context supersedes any context provided to the Context method.
  63763. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  63764. c.ctx_ = ctx
  63765. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  63766. for {
  63767. x, err := c.Do()
  63768. if err != nil {
  63769. return err
  63770. }
  63771. if err := f(x); err != nil {
  63772. return err
  63773. }
  63774. if x.NextPageToken == "" {
  63775. return nil
  63776. }
  63777. c.PageToken(x.NextPageToken)
  63778. }
  63779. }
  63780. // method id "compute.routers.patch":
  63781. type RoutersPatchCall struct {
  63782. s *Service
  63783. project string
  63784. region string
  63785. router string
  63786. router2 *Router
  63787. urlParams_ gensupport.URLParams
  63788. ctx_ context.Context
  63789. header_ http.Header
  63790. }
  63791. // Patch: Patches the specified Router resource with the data included
  63792. // in the request. This method supports PATCH semantics and uses JSON
  63793. // merge patch format and processing rules.
  63794. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  63795. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63796. c.project = project
  63797. c.region = region
  63798. c.router = router
  63799. c.router2 = router2
  63800. return c
  63801. }
  63802. // RequestId sets the optional parameter "requestId": An optional
  63803. // request ID to identify requests. Specify a unique request ID so that
  63804. // if you must retry your request, the server will know to ignore the
  63805. // request if it has already been completed.
  63806. //
  63807. // For example, consider a situation where you make an initial request
  63808. // and the request times out. If you make the request again with the
  63809. // same request ID, the server can check if original operation with the
  63810. // same request ID was received, and if so, will ignore the second
  63811. // request. This prevents clients from accidentally creating duplicate
  63812. // commitments.
  63813. //
  63814. // The request ID must be a valid UUID with the exception that zero UUID
  63815. // is not supported (00000000-0000-0000-0000-000000000000).
  63816. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  63817. c.urlParams_.Set("requestId", requestId)
  63818. return c
  63819. }
  63820. // Fields allows partial responses to be retrieved. See
  63821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63822. // for more information.
  63823. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  63824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63825. return c
  63826. }
  63827. // Context sets the context to be used in this call's Do method. Any
  63828. // pending HTTP request will be aborted if the provided context is
  63829. // canceled.
  63830. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  63831. c.ctx_ = ctx
  63832. return c
  63833. }
  63834. // Header returns an http.Header that can be modified by the caller to
  63835. // add HTTP headers to the request.
  63836. func (c *RoutersPatchCall) Header() http.Header {
  63837. if c.header_ == nil {
  63838. c.header_ = make(http.Header)
  63839. }
  63840. return c.header_
  63841. }
  63842. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  63843. reqHeaders := make(http.Header)
  63844. for k, v := range c.header_ {
  63845. reqHeaders[k] = v
  63846. }
  63847. reqHeaders.Set("User-Agent", c.s.userAgent())
  63848. var body io.Reader = nil
  63849. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  63850. if err != nil {
  63851. return nil, err
  63852. }
  63853. reqHeaders.Set("Content-Type", "application/json")
  63854. c.urlParams_.Set("alt", alt)
  63855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  63856. urls += "?" + c.urlParams_.Encode()
  63857. req, _ := http.NewRequest("PATCH", urls, body)
  63858. req.Header = reqHeaders
  63859. googleapi.Expand(req.URL, map[string]string{
  63860. "project": c.project,
  63861. "region": c.region,
  63862. "router": c.router,
  63863. })
  63864. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63865. }
  63866. // Do executes the "compute.routers.patch" call.
  63867. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63868. // status code is an error. Response headers are in either
  63869. // *Operation.ServerResponse.Header or (if a response was returned at
  63870. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63871. // to check whether the returned error was because
  63872. // http.StatusNotModified was returned.
  63873. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63874. gensupport.SetOptions(c.urlParams_, opts...)
  63875. res, err := c.doRequest("json")
  63876. if res != nil && res.StatusCode == http.StatusNotModified {
  63877. if res.Body != nil {
  63878. res.Body.Close()
  63879. }
  63880. return nil, &googleapi.Error{
  63881. Code: res.StatusCode,
  63882. Header: res.Header,
  63883. }
  63884. }
  63885. if err != nil {
  63886. return nil, err
  63887. }
  63888. defer googleapi.CloseBody(res)
  63889. if err := googleapi.CheckResponse(res); err != nil {
  63890. return nil, err
  63891. }
  63892. ret := &Operation{
  63893. ServerResponse: googleapi.ServerResponse{
  63894. Header: res.Header,
  63895. HTTPStatusCode: res.StatusCode,
  63896. },
  63897. }
  63898. target := &ret
  63899. if err := gensupport.DecodeResponse(target, res); err != nil {
  63900. return nil, err
  63901. }
  63902. return ret, nil
  63903. // {
  63904. // "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.",
  63905. // "httpMethod": "PATCH",
  63906. // "id": "compute.routers.patch",
  63907. // "parameterOrder": [
  63908. // "project",
  63909. // "region",
  63910. // "router"
  63911. // ],
  63912. // "parameters": {
  63913. // "project": {
  63914. // "description": "Project ID for this request.",
  63915. // "location": "path",
  63916. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63917. // "required": true,
  63918. // "type": "string"
  63919. // },
  63920. // "region": {
  63921. // "description": "Name of the region for this request.",
  63922. // "location": "path",
  63923. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63924. // "required": true,
  63925. // "type": "string"
  63926. // },
  63927. // "requestId": {
  63928. // "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).",
  63929. // "location": "query",
  63930. // "type": "string"
  63931. // },
  63932. // "router": {
  63933. // "description": "Name of the Router resource to patch.",
  63934. // "location": "path",
  63935. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63936. // "required": true,
  63937. // "type": "string"
  63938. // }
  63939. // },
  63940. // "path": "{project}/regions/{region}/routers/{router}",
  63941. // "request": {
  63942. // "$ref": "Router"
  63943. // },
  63944. // "response": {
  63945. // "$ref": "Operation"
  63946. // },
  63947. // "scopes": [
  63948. // "https://www.googleapis.com/auth/cloud-platform",
  63949. // "https://www.googleapis.com/auth/compute"
  63950. // ]
  63951. // }
  63952. }
  63953. // method id "compute.routers.preview":
  63954. type RoutersPreviewCall struct {
  63955. s *Service
  63956. project string
  63957. region string
  63958. router string
  63959. router2 *Router
  63960. urlParams_ gensupport.URLParams
  63961. ctx_ context.Context
  63962. header_ http.Header
  63963. }
  63964. // Preview: Preview fields auto-generated during router create and
  63965. // update operations. Calling this method does NOT create or update the
  63966. // router.
  63967. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  63968. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63969. c.project = project
  63970. c.region = region
  63971. c.router = router
  63972. c.router2 = router2
  63973. return c
  63974. }
  63975. // Fields allows partial responses to be retrieved. See
  63976. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63977. // for more information.
  63978. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  63979. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63980. return c
  63981. }
  63982. // Context sets the context to be used in this call's Do method. Any
  63983. // pending HTTP request will be aborted if the provided context is
  63984. // canceled.
  63985. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  63986. c.ctx_ = ctx
  63987. return c
  63988. }
  63989. // Header returns an http.Header that can be modified by the caller to
  63990. // add HTTP headers to the request.
  63991. func (c *RoutersPreviewCall) Header() http.Header {
  63992. if c.header_ == nil {
  63993. c.header_ = make(http.Header)
  63994. }
  63995. return c.header_
  63996. }
  63997. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  63998. reqHeaders := make(http.Header)
  63999. for k, v := range c.header_ {
  64000. reqHeaders[k] = v
  64001. }
  64002. reqHeaders.Set("User-Agent", c.s.userAgent())
  64003. var body io.Reader = nil
  64004. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  64005. if err != nil {
  64006. return nil, err
  64007. }
  64008. reqHeaders.Set("Content-Type", "application/json")
  64009. c.urlParams_.Set("alt", alt)
  64010. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  64011. urls += "?" + c.urlParams_.Encode()
  64012. req, _ := http.NewRequest("POST", urls, body)
  64013. req.Header = reqHeaders
  64014. googleapi.Expand(req.URL, map[string]string{
  64015. "project": c.project,
  64016. "region": c.region,
  64017. "router": c.router,
  64018. })
  64019. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64020. }
  64021. // Do executes the "compute.routers.preview" call.
  64022. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  64023. // non-2xx status code is an error. Response headers are in either
  64024. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  64025. // returned at all) in error.(*googleapi.Error).Header. Use
  64026. // googleapi.IsNotModified to check whether the returned error was
  64027. // because http.StatusNotModified was returned.
  64028. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  64029. gensupport.SetOptions(c.urlParams_, opts...)
  64030. res, err := c.doRequest("json")
  64031. if res != nil && res.StatusCode == http.StatusNotModified {
  64032. if res.Body != nil {
  64033. res.Body.Close()
  64034. }
  64035. return nil, &googleapi.Error{
  64036. Code: res.StatusCode,
  64037. Header: res.Header,
  64038. }
  64039. }
  64040. if err != nil {
  64041. return nil, err
  64042. }
  64043. defer googleapi.CloseBody(res)
  64044. if err := googleapi.CheckResponse(res); err != nil {
  64045. return nil, err
  64046. }
  64047. ret := &RoutersPreviewResponse{
  64048. ServerResponse: googleapi.ServerResponse{
  64049. Header: res.Header,
  64050. HTTPStatusCode: res.StatusCode,
  64051. },
  64052. }
  64053. target := &ret
  64054. if err := gensupport.DecodeResponse(target, res); err != nil {
  64055. return nil, err
  64056. }
  64057. return ret, nil
  64058. // {
  64059. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  64060. // "httpMethod": "POST",
  64061. // "id": "compute.routers.preview",
  64062. // "parameterOrder": [
  64063. // "project",
  64064. // "region",
  64065. // "router"
  64066. // ],
  64067. // "parameters": {
  64068. // "project": {
  64069. // "description": "Project ID for this request.",
  64070. // "location": "path",
  64071. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64072. // "required": true,
  64073. // "type": "string"
  64074. // },
  64075. // "region": {
  64076. // "description": "Name of the region for this request.",
  64077. // "location": "path",
  64078. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64079. // "required": true,
  64080. // "type": "string"
  64081. // },
  64082. // "router": {
  64083. // "description": "Name of the Router resource to query.",
  64084. // "location": "path",
  64085. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64086. // "required": true,
  64087. // "type": "string"
  64088. // }
  64089. // },
  64090. // "path": "{project}/regions/{region}/routers/{router}/preview",
  64091. // "request": {
  64092. // "$ref": "Router"
  64093. // },
  64094. // "response": {
  64095. // "$ref": "RoutersPreviewResponse"
  64096. // },
  64097. // "scopes": [
  64098. // "https://www.googleapis.com/auth/cloud-platform",
  64099. // "https://www.googleapis.com/auth/compute",
  64100. // "https://www.googleapis.com/auth/compute.readonly"
  64101. // ]
  64102. // }
  64103. }
  64104. // method id "compute.routers.update":
  64105. type RoutersUpdateCall struct {
  64106. s *Service
  64107. project string
  64108. region string
  64109. router string
  64110. router2 *Router
  64111. urlParams_ gensupport.URLParams
  64112. ctx_ context.Context
  64113. header_ http.Header
  64114. }
  64115. // Update: Updates the specified Router resource with the data included
  64116. // in the request.
  64117. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  64118. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64119. c.project = project
  64120. c.region = region
  64121. c.router = router
  64122. c.router2 = router2
  64123. return c
  64124. }
  64125. // RequestId sets the optional parameter "requestId": An optional
  64126. // request ID to identify requests. Specify a unique request ID so that
  64127. // if you must retry your request, the server will know to ignore the
  64128. // request if it has already been completed.
  64129. //
  64130. // For example, consider a situation where you make an initial request
  64131. // and the request times out. If you make the request again with the
  64132. // same request ID, the server can check if original operation with the
  64133. // same request ID was received, and if so, will ignore the second
  64134. // request. This prevents clients from accidentally creating duplicate
  64135. // commitments.
  64136. //
  64137. // The request ID must be a valid UUID with the exception that zero UUID
  64138. // is not supported (00000000-0000-0000-0000-000000000000).
  64139. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  64140. c.urlParams_.Set("requestId", requestId)
  64141. return c
  64142. }
  64143. // Fields allows partial responses to be retrieved. See
  64144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64145. // for more information.
  64146. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  64147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64148. return c
  64149. }
  64150. // Context sets the context to be used in this call's Do method. Any
  64151. // pending HTTP request will be aborted if the provided context is
  64152. // canceled.
  64153. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  64154. c.ctx_ = ctx
  64155. return c
  64156. }
  64157. // Header returns an http.Header that can be modified by the caller to
  64158. // add HTTP headers to the request.
  64159. func (c *RoutersUpdateCall) Header() http.Header {
  64160. if c.header_ == nil {
  64161. c.header_ = make(http.Header)
  64162. }
  64163. return c.header_
  64164. }
  64165. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  64166. reqHeaders := make(http.Header)
  64167. for k, v := range c.header_ {
  64168. reqHeaders[k] = v
  64169. }
  64170. reqHeaders.Set("User-Agent", c.s.userAgent())
  64171. var body io.Reader = nil
  64172. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  64173. if err != nil {
  64174. return nil, err
  64175. }
  64176. reqHeaders.Set("Content-Type", "application/json")
  64177. c.urlParams_.Set("alt", alt)
  64178. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  64179. urls += "?" + c.urlParams_.Encode()
  64180. req, _ := http.NewRequest("PUT", urls, body)
  64181. req.Header = reqHeaders
  64182. googleapi.Expand(req.URL, map[string]string{
  64183. "project": c.project,
  64184. "region": c.region,
  64185. "router": c.router,
  64186. })
  64187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64188. }
  64189. // Do executes the "compute.routers.update" call.
  64190. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64191. // status code is an error. Response headers are in either
  64192. // *Operation.ServerResponse.Header or (if a response was returned at
  64193. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64194. // to check whether the returned error was because
  64195. // http.StatusNotModified was returned.
  64196. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64197. gensupport.SetOptions(c.urlParams_, opts...)
  64198. res, err := c.doRequest("json")
  64199. if res != nil && res.StatusCode == http.StatusNotModified {
  64200. if res.Body != nil {
  64201. res.Body.Close()
  64202. }
  64203. return nil, &googleapi.Error{
  64204. Code: res.StatusCode,
  64205. Header: res.Header,
  64206. }
  64207. }
  64208. if err != nil {
  64209. return nil, err
  64210. }
  64211. defer googleapi.CloseBody(res)
  64212. if err := googleapi.CheckResponse(res); err != nil {
  64213. return nil, err
  64214. }
  64215. ret := &Operation{
  64216. ServerResponse: googleapi.ServerResponse{
  64217. Header: res.Header,
  64218. HTTPStatusCode: res.StatusCode,
  64219. },
  64220. }
  64221. target := &ret
  64222. if err := gensupport.DecodeResponse(target, res); err != nil {
  64223. return nil, err
  64224. }
  64225. return ret, nil
  64226. // {
  64227. // "description": "Updates the specified Router resource with the data included in the request.",
  64228. // "httpMethod": "PUT",
  64229. // "id": "compute.routers.update",
  64230. // "parameterOrder": [
  64231. // "project",
  64232. // "region",
  64233. // "router"
  64234. // ],
  64235. // "parameters": {
  64236. // "project": {
  64237. // "description": "Project ID for this request.",
  64238. // "location": "path",
  64239. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64240. // "required": true,
  64241. // "type": "string"
  64242. // },
  64243. // "region": {
  64244. // "description": "Name of the region for this request.",
  64245. // "location": "path",
  64246. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64247. // "required": true,
  64248. // "type": "string"
  64249. // },
  64250. // "requestId": {
  64251. // "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).",
  64252. // "location": "query",
  64253. // "type": "string"
  64254. // },
  64255. // "router": {
  64256. // "description": "Name of the Router resource to update.",
  64257. // "location": "path",
  64258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64259. // "required": true,
  64260. // "type": "string"
  64261. // }
  64262. // },
  64263. // "path": "{project}/regions/{region}/routers/{router}",
  64264. // "request": {
  64265. // "$ref": "Router"
  64266. // },
  64267. // "response": {
  64268. // "$ref": "Operation"
  64269. // },
  64270. // "scopes": [
  64271. // "https://www.googleapis.com/auth/cloud-platform",
  64272. // "https://www.googleapis.com/auth/compute"
  64273. // ]
  64274. // }
  64275. }
  64276. // method id "compute.routes.delete":
  64277. type RoutesDeleteCall struct {
  64278. s *Service
  64279. project string
  64280. route string
  64281. urlParams_ gensupport.URLParams
  64282. ctx_ context.Context
  64283. header_ http.Header
  64284. }
  64285. // Delete: Deletes the specified Route resource.
  64286. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  64287. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  64288. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64289. c.project = project
  64290. c.route = route
  64291. return c
  64292. }
  64293. // RequestId sets the optional parameter "requestId": An optional
  64294. // request ID to identify requests. Specify a unique request ID so that
  64295. // if you must retry your request, the server will know to ignore the
  64296. // request if it has already been completed.
  64297. //
  64298. // For example, consider a situation where you make an initial request
  64299. // and the request times out. If you make the request again with the
  64300. // same request ID, the server can check if original operation with the
  64301. // same request ID was received, and if so, will ignore the second
  64302. // request. This prevents clients from accidentally creating duplicate
  64303. // commitments.
  64304. //
  64305. // The request ID must be a valid UUID with the exception that zero UUID
  64306. // is not supported (00000000-0000-0000-0000-000000000000).
  64307. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  64308. c.urlParams_.Set("requestId", requestId)
  64309. return c
  64310. }
  64311. // Fields allows partial responses to be retrieved. See
  64312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64313. // for more information.
  64314. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  64315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64316. return c
  64317. }
  64318. // Context sets the context to be used in this call's Do method. Any
  64319. // pending HTTP request will be aborted if the provided context is
  64320. // canceled.
  64321. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  64322. c.ctx_ = ctx
  64323. return c
  64324. }
  64325. // Header returns an http.Header that can be modified by the caller to
  64326. // add HTTP headers to the request.
  64327. func (c *RoutesDeleteCall) Header() http.Header {
  64328. if c.header_ == nil {
  64329. c.header_ = make(http.Header)
  64330. }
  64331. return c.header_
  64332. }
  64333. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  64334. reqHeaders := make(http.Header)
  64335. for k, v := range c.header_ {
  64336. reqHeaders[k] = v
  64337. }
  64338. reqHeaders.Set("User-Agent", c.s.userAgent())
  64339. var body io.Reader = nil
  64340. c.urlParams_.Set("alt", alt)
  64341. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  64342. urls += "?" + c.urlParams_.Encode()
  64343. req, _ := http.NewRequest("DELETE", urls, body)
  64344. req.Header = reqHeaders
  64345. googleapi.Expand(req.URL, map[string]string{
  64346. "project": c.project,
  64347. "route": c.route,
  64348. })
  64349. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64350. }
  64351. // Do executes the "compute.routes.delete" call.
  64352. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64353. // status code is an error. Response headers are in either
  64354. // *Operation.ServerResponse.Header or (if a response was returned at
  64355. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64356. // to check whether the returned error was because
  64357. // http.StatusNotModified was returned.
  64358. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64359. gensupport.SetOptions(c.urlParams_, opts...)
  64360. res, err := c.doRequest("json")
  64361. if res != nil && res.StatusCode == http.StatusNotModified {
  64362. if res.Body != nil {
  64363. res.Body.Close()
  64364. }
  64365. return nil, &googleapi.Error{
  64366. Code: res.StatusCode,
  64367. Header: res.Header,
  64368. }
  64369. }
  64370. if err != nil {
  64371. return nil, err
  64372. }
  64373. defer googleapi.CloseBody(res)
  64374. if err := googleapi.CheckResponse(res); err != nil {
  64375. return nil, err
  64376. }
  64377. ret := &Operation{
  64378. ServerResponse: googleapi.ServerResponse{
  64379. Header: res.Header,
  64380. HTTPStatusCode: res.StatusCode,
  64381. },
  64382. }
  64383. target := &ret
  64384. if err := gensupport.DecodeResponse(target, res); err != nil {
  64385. return nil, err
  64386. }
  64387. return ret, nil
  64388. // {
  64389. // "description": "Deletes the specified Route resource.",
  64390. // "httpMethod": "DELETE",
  64391. // "id": "compute.routes.delete",
  64392. // "parameterOrder": [
  64393. // "project",
  64394. // "route"
  64395. // ],
  64396. // "parameters": {
  64397. // "project": {
  64398. // "description": "Project ID for this request.",
  64399. // "location": "path",
  64400. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64401. // "required": true,
  64402. // "type": "string"
  64403. // },
  64404. // "requestId": {
  64405. // "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).",
  64406. // "location": "query",
  64407. // "type": "string"
  64408. // },
  64409. // "route": {
  64410. // "description": "Name of the Route resource to delete.",
  64411. // "location": "path",
  64412. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64413. // "required": true,
  64414. // "type": "string"
  64415. // }
  64416. // },
  64417. // "path": "{project}/global/routes/{route}",
  64418. // "response": {
  64419. // "$ref": "Operation"
  64420. // },
  64421. // "scopes": [
  64422. // "https://www.googleapis.com/auth/cloud-platform",
  64423. // "https://www.googleapis.com/auth/compute"
  64424. // ]
  64425. // }
  64426. }
  64427. // method id "compute.routes.get":
  64428. type RoutesGetCall struct {
  64429. s *Service
  64430. project string
  64431. route string
  64432. urlParams_ gensupport.URLParams
  64433. ifNoneMatch_ string
  64434. ctx_ context.Context
  64435. header_ http.Header
  64436. }
  64437. // Get: Returns the specified Route resource. Gets a list of available
  64438. // routes by making a list() request.
  64439. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  64440. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  64441. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64442. c.project = project
  64443. c.route = route
  64444. return c
  64445. }
  64446. // Fields allows partial responses to be retrieved. See
  64447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64448. // for more information.
  64449. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  64450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64451. return c
  64452. }
  64453. // IfNoneMatch sets the optional parameter which makes the operation
  64454. // fail if the object's ETag matches the given value. This is useful for
  64455. // getting updates only after the object has changed since the last
  64456. // request. Use googleapi.IsNotModified to check whether the response
  64457. // error from Do is the result of In-None-Match.
  64458. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  64459. c.ifNoneMatch_ = entityTag
  64460. return c
  64461. }
  64462. // Context sets the context to be used in this call's Do method. Any
  64463. // pending HTTP request will be aborted if the provided context is
  64464. // canceled.
  64465. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  64466. c.ctx_ = ctx
  64467. return c
  64468. }
  64469. // Header returns an http.Header that can be modified by the caller to
  64470. // add HTTP headers to the request.
  64471. func (c *RoutesGetCall) Header() http.Header {
  64472. if c.header_ == nil {
  64473. c.header_ = make(http.Header)
  64474. }
  64475. return c.header_
  64476. }
  64477. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  64478. reqHeaders := make(http.Header)
  64479. for k, v := range c.header_ {
  64480. reqHeaders[k] = v
  64481. }
  64482. reqHeaders.Set("User-Agent", c.s.userAgent())
  64483. if c.ifNoneMatch_ != "" {
  64484. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64485. }
  64486. var body io.Reader = nil
  64487. c.urlParams_.Set("alt", alt)
  64488. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  64489. urls += "?" + c.urlParams_.Encode()
  64490. req, _ := http.NewRequest("GET", urls, body)
  64491. req.Header = reqHeaders
  64492. googleapi.Expand(req.URL, map[string]string{
  64493. "project": c.project,
  64494. "route": c.route,
  64495. })
  64496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64497. }
  64498. // Do executes the "compute.routes.get" call.
  64499. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  64500. // code is an error. Response headers are in either
  64501. // *Route.ServerResponse.Header or (if a response was returned at all)
  64502. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  64503. // check whether the returned error was because http.StatusNotModified
  64504. // was returned.
  64505. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  64506. gensupport.SetOptions(c.urlParams_, opts...)
  64507. res, err := c.doRequest("json")
  64508. if res != nil && res.StatusCode == http.StatusNotModified {
  64509. if res.Body != nil {
  64510. res.Body.Close()
  64511. }
  64512. return nil, &googleapi.Error{
  64513. Code: res.StatusCode,
  64514. Header: res.Header,
  64515. }
  64516. }
  64517. if err != nil {
  64518. return nil, err
  64519. }
  64520. defer googleapi.CloseBody(res)
  64521. if err := googleapi.CheckResponse(res); err != nil {
  64522. return nil, err
  64523. }
  64524. ret := &Route{
  64525. ServerResponse: googleapi.ServerResponse{
  64526. Header: res.Header,
  64527. HTTPStatusCode: res.StatusCode,
  64528. },
  64529. }
  64530. target := &ret
  64531. if err := gensupport.DecodeResponse(target, res); err != nil {
  64532. return nil, err
  64533. }
  64534. return ret, nil
  64535. // {
  64536. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  64537. // "httpMethod": "GET",
  64538. // "id": "compute.routes.get",
  64539. // "parameterOrder": [
  64540. // "project",
  64541. // "route"
  64542. // ],
  64543. // "parameters": {
  64544. // "project": {
  64545. // "description": "Project ID for this request.",
  64546. // "location": "path",
  64547. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64548. // "required": true,
  64549. // "type": "string"
  64550. // },
  64551. // "route": {
  64552. // "description": "Name of the Route resource to return.",
  64553. // "location": "path",
  64554. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64555. // "required": true,
  64556. // "type": "string"
  64557. // }
  64558. // },
  64559. // "path": "{project}/global/routes/{route}",
  64560. // "response": {
  64561. // "$ref": "Route"
  64562. // },
  64563. // "scopes": [
  64564. // "https://www.googleapis.com/auth/cloud-platform",
  64565. // "https://www.googleapis.com/auth/compute",
  64566. // "https://www.googleapis.com/auth/compute.readonly"
  64567. // ]
  64568. // }
  64569. }
  64570. // method id "compute.routes.insert":
  64571. type RoutesInsertCall struct {
  64572. s *Service
  64573. project string
  64574. route *Route
  64575. urlParams_ gensupport.URLParams
  64576. ctx_ context.Context
  64577. header_ http.Header
  64578. }
  64579. // Insert: Creates a Route resource in the specified project using the
  64580. // data included in the request.
  64581. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  64582. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  64583. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64584. c.project = project
  64585. c.route = route
  64586. return c
  64587. }
  64588. // RequestId sets the optional parameter "requestId": An optional
  64589. // request ID to identify requests. Specify a unique request ID so that
  64590. // if you must retry your request, the server will know to ignore the
  64591. // request if it has already been completed.
  64592. //
  64593. // For example, consider a situation where you make an initial request
  64594. // and the request times out. If you make the request again with the
  64595. // same request ID, the server can check if original operation with the
  64596. // same request ID was received, and if so, will ignore the second
  64597. // request. This prevents clients from accidentally creating duplicate
  64598. // commitments.
  64599. //
  64600. // The request ID must be a valid UUID with the exception that zero UUID
  64601. // is not supported (00000000-0000-0000-0000-000000000000).
  64602. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  64603. c.urlParams_.Set("requestId", requestId)
  64604. return c
  64605. }
  64606. // Fields allows partial responses to be retrieved. See
  64607. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64608. // for more information.
  64609. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  64610. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64611. return c
  64612. }
  64613. // Context sets the context to be used in this call's Do method. Any
  64614. // pending HTTP request will be aborted if the provided context is
  64615. // canceled.
  64616. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  64617. c.ctx_ = ctx
  64618. return c
  64619. }
  64620. // Header returns an http.Header that can be modified by the caller to
  64621. // add HTTP headers to the request.
  64622. func (c *RoutesInsertCall) Header() http.Header {
  64623. if c.header_ == nil {
  64624. c.header_ = make(http.Header)
  64625. }
  64626. return c.header_
  64627. }
  64628. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  64629. reqHeaders := make(http.Header)
  64630. for k, v := range c.header_ {
  64631. reqHeaders[k] = v
  64632. }
  64633. reqHeaders.Set("User-Agent", c.s.userAgent())
  64634. var body io.Reader = nil
  64635. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  64636. if err != nil {
  64637. return nil, err
  64638. }
  64639. reqHeaders.Set("Content-Type", "application/json")
  64640. c.urlParams_.Set("alt", alt)
  64641. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  64642. urls += "?" + c.urlParams_.Encode()
  64643. req, _ := http.NewRequest("POST", urls, body)
  64644. req.Header = reqHeaders
  64645. googleapi.Expand(req.URL, map[string]string{
  64646. "project": c.project,
  64647. })
  64648. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64649. }
  64650. // Do executes the "compute.routes.insert" call.
  64651. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64652. // status code is an error. Response headers are in either
  64653. // *Operation.ServerResponse.Header or (if a response was returned at
  64654. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64655. // to check whether the returned error was because
  64656. // http.StatusNotModified was returned.
  64657. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64658. gensupport.SetOptions(c.urlParams_, opts...)
  64659. res, err := c.doRequest("json")
  64660. if res != nil && res.StatusCode == http.StatusNotModified {
  64661. if res.Body != nil {
  64662. res.Body.Close()
  64663. }
  64664. return nil, &googleapi.Error{
  64665. Code: res.StatusCode,
  64666. Header: res.Header,
  64667. }
  64668. }
  64669. if err != nil {
  64670. return nil, err
  64671. }
  64672. defer googleapi.CloseBody(res)
  64673. if err := googleapi.CheckResponse(res); err != nil {
  64674. return nil, err
  64675. }
  64676. ret := &Operation{
  64677. ServerResponse: googleapi.ServerResponse{
  64678. Header: res.Header,
  64679. HTTPStatusCode: res.StatusCode,
  64680. },
  64681. }
  64682. target := &ret
  64683. if err := gensupport.DecodeResponse(target, res); err != nil {
  64684. return nil, err
  64685. }
  64686. return ret, nil
  64687. // {
  64688. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  64689. // "httpMethod": "POST",
  64690. // "id": "compute.routes.insert",
  64691. // "parameterOrder": [
  64692. // "project"
  64693. // ],
  64694. // "parameters": {
  64695. // "project": {
  64696. // "description": "Project ID for this request.",
  64697. // "location": "path",
  64698. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64699. // "required": true,
  64700. // "type": "string"
  64701. // },
  64702. // "requestId": {
  64703. // "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).",
  64704. // "location": "query",
  64705. // "type": "string"
  64706. // }
  64707. // },
  64708. // "path": "{project}/global/routes",
  64709. // "request": {
  64710. // "$ref": "Route"
  64711. // },
  64712. // "response": {
  64713. // "$ref": "Operation"
  64714. // },
  64715. // "scopes": [
  64716. // "https://www.googleapis.com/auth/cloud-platform",
  64717. // "https://www.googleapis.com/auth/compute"
  64718. // ]
  64719. // }
  64720. }
  64721. // method id "compute.routes.list":
  64722. type RoutesListCall struct {
  64723. s *Service
  64724. project string
  64725. urlParams_ gensupport.URLParams
  64726. ifNoneMatch_ string
  64727. ctx_ context.Context
  64728. header_ http.Header
  64729. }
  64730. // List: Retrieves the list of Route resources available to the
  64731. // specified project.
  64732. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  64733. func (r *RoutesService) List(project string) *RoutesListCall {
  64734. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64735. c.project = project
  64736. return c
  64737. }
  64738. // Filter sets the optional parameter "filter": A filter expression that
  64739. // filters resources listed in the response. The expression must specify
  64740. // the field name, a comparison operator, and the value that you want to
  64741. // use for filtering. The value must be a string, a number, or a
  64742. // boolean. The comparison operator must be either =, !=, >, or <.
  64743. //
  64744. // For example, if you are filtering Compute Engine instances, you can
  64745. // exclude instances named example-instance by specifying name !=
  64746. // example-instance.
  64747. //
  64748. // You can also filter nested fields. For example, you could specify
  64749. // scheduling.automaticRestart = false to include instances only if they
  64750. // are not scheduled for automatic restarts. You can use filtering on
  64751. // nested fields to filter based on resource labels.
  64752. //
  64753. // To filter on multiple expressions, provide each separate expression
  64754. // within parentheses. For example, (scheduling.automaticRestart = true)
  64755. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64756. // AND expression. However, you can include AND and OR expressions
  64757. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64758. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64759. // true).
  64760. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  64761. c.urlParams_.Set("filter", filter)
  64762. return c
  64763. }
  64764. // MaxResults sets the optional parameter "maxResults": The maximum
  64765. // number of results per page that should be returned. If the number of
  64766. // available results is larger than maxResults, Compute Engine returns a
  64767. // nextPageToken that can be used to get the next page of results in
  64768. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64769. // (Default: 500)
  64770. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  64771. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64772. return c
  64773. }
  64774. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64775. // a certain order. By default, results are returned in alphanumerical
  64776. // order based on the resource name.
  64777. //
  64778. // You can also sort results in descending order based on the creation
  64779. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64780. // based on the creationTimestamp field in reverse chronological order
  64781. // (newest result first). Use this to sort resources like operations so
  64782. // that the newest operation is returned first.
  64783. //
  64784. // Currently, only sorting by name or creationTimestamp desc is
  64785. // supported.
  64786. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  64787. c.urlParams_.Set("orderBy", orderBy)
  64788. return c
  64789. }
  64790. // PageToken sets the optional parameter "pageToken": Specifies a page
  64791. // token to use. Set pageToken to the nextPageToken returned by a
  64792. // previous list request to get the next page of results.
  64793. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  64794. c.urlParams_.Set("pageToken", pageToken)
  64795. return c
  64796. }
  64797. // Fields allows partial responses to be retrieved. See
  64798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64799. // for more information.
  64800. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  64801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64802. return c
  64803. }
  64804. // IfNoneMatch sets the optional parameter which makes the operation
  64805. // fail if the object's ETag matches the given value. This is useful for
  64806. // getting updates only after the object has changed since the last
  64807. // request. Use googleapi.IsNotModified to check whether the response
  64808. // error from Do is the result of In-None-Match.
  64809. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  64810. c.ifNoneMatch_ = entityTag
  64811. return c
  64812. }
  64813. // Context sets the context to be used in this call's Do method. Any
  64814. // pending HTTP request will be aborted if the provided context is
  64815. // canceled.
  64816. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  64817. c.ctx_ = ctx
  64818. return c
  64819. }
  64820. // Header returns an http.Header that can be modified by the caller to
  64821. // add HTTP headers to the request.
  64822. func (c *RoutesListCall) Header() http.Header {
  64823. if c.header_ == nil {
  64824. c.header_ = make(http.Header)
  64825. }
  64826. return c.header_
  64827. }
  64828. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  64829. reqHeaders := make(http.Header)
  64830. for k, v := range c.header_ {
  64831. reqHeaders[k] = v
  64832. }
  64833. reqHeaders.Set("User-Agent", c.s.userAgent())
  64834. if c.ifNoneMatch_ != "" {
  64835. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64836. }
  64837. var body io.Reader = nil
  64838. c.urlParams_.Set("alt", alt)
  64839. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  64840. urls += "?" + c.urlParams_.Encode()
  64841. req, _ := http.NewRequest("GET", urls, body)
  64842. req.Header = reqHeaders
  64843. googleapi.Expand(req.URL, map[string]string{
  64844. "project": c.project,
  64845. })
  64846. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64847. }
  64848. // Do executes the "compute.routes.list" call.
  64849. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  64850. // status code is an error. Response headers are in either
  64851. // *RouteList.ServerResponse.Header or (if a response was returned at
  64852. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64853. // to check whether the returned error was because
  64854. // http.StatusNotModified was returned.
  64855. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  64856. gensupport.SetOptions(c.urlParams_, opts...)
  64857. res, err := c.doRequest("json")
  64858. if res != nil && res.StatusCode == http.StatusNotModified {
  64859. if res.Body != nil {
  64860. res.Body.Close()
  64861. }
  64862. return nil, &googleapi.Error{
  64863. Code: res.StatusCode,
  64864. Header: res.Header,
  64865. }
  64866. }
  64867. if err != nil {
  64868. return nil, err
  64869. }
  64870. defer googleapi.CloseBody(res)
  64871. if err := googleapi.CheckResponse(res); err != nil {
  64872. return nil, err
  64873. }
  64874. ret := &RouteList{
  64875. ServerResponse: googleapi.ServerResponse{
  64876. Header: res.Header,
  64877. HTTPStatusCode: res.StatusCode,
  64878. },
  64879. }
  64880. target := &ret
  64881. if err := gensupport.DecodeResponse(target, res); err != nil {
  64882. return nil, err
  64883. }
  64884. return ret, nil
  64885. // {
  64886. // "description": "Retrieves the list of Route resources available to the specified project.",
  64887. // "httpMethod": "GET",
  64888. // "id": "compute.routes.list",
  64889. // "parameterOrder": [
  64890. // "project"
  64891. // ],
  64892. // "parameters": {
  64893. // "filter": {
  64894. // "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).",
  64895. // "location": "query",
  64896. // "type": "string"
  64897. // },
  64898. // "maxResults": {
  64899. // "default": "500",
  64900. // "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)",
  64901. // "format": "uint32",
  64902. // "location": "query",
  64903. // "minimum": "0",
  64904. // "type": "integer"
  64905. // },
  64906. // "orderBy": {
  64907. // "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.",
  64908. // "location": "query",
  64909. // "type": "string"
  64910. // },
  64911. // "pageToken": {
  64912. // "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.",
  64913. // "location": "query",
  64914. // "type": "string"
  64915. // },
  64916. // "project": {
  64917. // "description": "Project ID for this request.",
  64918. // "location": "path",
  64919. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64920. // "required": true,
  64921. // "type": "string"
  64922. // }
  64923. // },
  64924. // "path": "{project}/global/routes",
  64925. // "response": {
  64926. // "$ref": "RouteList"
  64927. // },
  64928. // "scopes": [
  64929. // "https://www.googleapis.com/auth/cloud-platform",
  64930. // "https://www.googleapis.com/auth/compute",
  64931. // "https://www.googleapis.com/auth/compute.readonly"
  64932. // ]
  64933. // }
  64934. }
  64935. // Pages invokes f for each page of results.
  64936. // A non-nil error returned from f will halt the iteration.
  64937. // The provided context supersedes any context provided to the Context method.
  64938. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  64939. c.ctx_ = ctx
  64940. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64941. for {
  64942. x, err := c.Do()
  64943. if err != nil {
  64944. return err
  64945. }
  64946. if err := f(x); err != nil {
  64947. return err
  64948. }
  64949. if x.NextPageToken == "" {
  64950. return nil
  64951. }
  64952. c.PageToken(x.NextPageToken)
  64953. }
  64954. }
  64955. // method id "compute.snapshots.delete":
  64956. type SnapshotsDeleteCall struct {
  64957. s *Service
  64958. project string
  64959. snapshot string
  64960. urlParams_ gensupport.URLParams
  64961. ctx_ context.Context
  64962. header_ http.Header
  64963. }
  64964. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  64965. // deleting a single snapshot might not necessarily delete all the data
  64966. // on that snapshot. If any data on the snapshot that is marked for
  64967. // deletion is needed for subsequent snapshots, the data will be moved
  64968. // to the next corresponding snapshot.
  64969. //
  64970. // For more information, see Deleting snaphots.
  64971. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  64972. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  64973. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64974. c.project = project
  64975. c.snapshot = snapshot
  64976. return c
  64977. }
  64978. // RequestId sets the optional parameter "requestId": An optional
  64979. // request ID to identify requests. Specify a unique request ID so that
  64980. // if you must retry your request, the server will know to ignore the
  64981. // request if it has already been completed.
  64982. //
  64983. // For example, consider a situation where you make an initial request
  64984. // and the request times out. If you make the request again with the
  64985. // same request ID, the server can check if original operation with the
  64986. // same request ID was received, and if so, will ignore the second
  64987. // request. This prevents clients from accidentally creating duplicate
  64988. // commitments.
  64989. //
  64990. // The request ID must be a valid UUID with the exception that zero UUID
  64991. // is not supported (00000000-0000-0000-0000-000000000000).
  64992. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  64993. c.urlParams_.Set("requestId", requestId)
  64994. return c
  64995. }
  64996. // Fields allows partial responses to be retrieved. See
  64997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64998. // for more information.
  64999. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  65000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65001. return c
  65002. }
  65003. // Context sets the context to be used in this call's Do method. Any
  65004. // pending HTTP request will be aborted if the provided context is
  65005. // canceled.
  65006. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  65007. c.ctx_ = ctx
  65008. return c
  65009. }
  65010. // Header returns an http.Header that can be modified by the caller to
  65011. // add HTTP headers to the request.
  65012. func (c *SnapshotsDeleteCall) Header() http.Header {
  65013. if c.header_ == nil {
  65014. c.header_ = make(http.Header)
  65015. }
  65016. return c.header_
  65017. }
  65018. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  65019. reqHeaders := make(http.Header)
  65020. for k, v := range c.header_ {
  65021. reqHeaders[k] = v
  65022. }
  65023. reqHeaders.Set("User-Agent", c.s.userAgent())
  65024. var body io.Reader = nil
  65025. c.urlParams_.Set("alt", alt)
  65026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  65027. urls += "?" + c.urlParams_.Encode()
  65028. req, _ := http.NewRequest("DELETE", urls, body)
  65029. req.Header = reqHeaders
  65030. googleapi.Expand(req.URL, map[string]string{
  65031. "project": c.project,
  65032. "snapshot": c.snapshot,
  65033. })
  65034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65035. }
  65036. // Do executes the "compute.snapshots.delete" call.
  65037. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65038. // status code is an error. Response headers are in either
  65039. // *Operation.ServerResponse.Header or (if a response was returned at
  65040. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65041. // to check whether the returned error was because
  65042. // http.StatusNotModified was returned.
  65043. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65044. gensupport.SetOptions(c.urlParams_, opts...)
  65045. res, err := c.doRequest("json")
  65046. if res != nil && res.StatusCode == http.StatusNotModified {
  65047. if res.Body != nil {
  65048. res.Body.Close()
  65049. }
  65050. return nil, &googleapi.Error{
  65051. Code: res.StatusCode,
  65052. Header: res.Header,
  65053. }
  65054. }
  65055. if err != nil {
  65056. return nil, err
  65057. }
  65058. defer googleapi.CloseBody(res)
  65059. if err := googleapi.CheckResponse(res); err != nil {
  65060. return nil, err
  65061. }
  65062. ret := &Operation{
  65063. ServerResponse: googleapi.ServerResponse{
  65064. Header: res.Header,
  65065. HTTPStatusCode: res.StatusCode,
  65066. },
  65067. }
  65068. target := &ret
  65069. if err := gensupport.DecodeResponse(target, res); err != nil {
  65070. return nil, err
  65071. }
  65072. return ret, nil
  65073. // {
  65074. // "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 snaphots.",
  65075. // "httpMethod": "DELETE",
  65076. // "id": "compute.snapshots.delete",
  65077. // "parameterOrder": [
  65078. // "project",
  65079. // "snapshot"
  65080. // ],
  65081. // "parameters": {
  65082. // "project": {
  65083. // "description": "Project ID for this request.",
  65084. // "location": "path",
  65085. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65086. // "required": true,
  65087. // "type": "string"
  65088. // },
  65089. // "requestId": {
  65090. // "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).",
  65091. // "location": "query",
  65092. // "type": "string"
  65093. // },
  65094. // "snapshot": {
  65095. // "description": "Name of the Snapshot resource to delete.",
  65096. // "location": "path",
  65097. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65098. // "required": true,
  65099. // "type": "string"
  65100. // }
  65101. // },
  65102. // "path": "{project}/global/snapshots/{snapshot}",
  65103. // "response": {
  65104. // "$ref": "Operation"
  65105. // },
  65106. // "scopes": [
  65107. // "https://www.googleapis.com/auth/cloud-platform",
  65108. // "https://www.googleapis.com/auth/compute"
  65109. // ]
  65110. // }
  65111. }
  65112. // method id "compute.snapshots.get":
  65113. type SnapshotsGetCall struct {
  65114. s *Service
  65115. project string
  65116. snapshot string
  65117. urlParams_ gensupport.URLParams
  65118. ifNoneMatch_ string
  65119. ctx_ context.Context
  65120. header_ http.Header
  65121. }
  65122. // Get: Returns the specified Snapshot resource. Gets a list of
  65123. // available snapshots by making a list() request.
  65124. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  65125. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  65126. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65127. c.project = project
  65128. c.snapshot = snapshot
  65129. return c
  65130. }
  65131. // Fields allows partial responses to be retrieved. See
  65132. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65133. // for more information.
  65134. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  65135. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65136. return c
  65137. }
  65138. // IfNoneMatch sets the optional parameter which makes the operation
  65139. // fail if the object's ETag matches the given value. This is useful for
  65140. // getting updates only after the object has changed since the last
  65141. // request. Use googleapi.IsNotModified to check whether the response
  65142. // error from Do is the result of In-None-Match.
  65143. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  65144. c.ifNoneMatch_ = entityTag
  65145. return c
  65146. }
  65147. // Context sets the context to be used in this call's Do method. Any
  65148. // pending HTTP request will be aborted if the provided context is
  65149. // canceled.
  65150. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  65151. c.ctx_ = ctx
  65152. return c
  65153. }
  65154. // Header returns an http.Header that can be modified by the caller to
  65155. // add HTTP headers to the request.
  65156. func (c *SnapshotsGetCall) Header() http.Header {
  65157. if c.header_ == nil {
  65158. c.header_ = make(http.Header)
  65159. }
  65160. return c.header_
  65161. }
  65162. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  65163. reqHeaders := make(http.Header)
  65164. for k, v := range c.header_ {
  65165. reqHeaders[k] = v
  65166. }
  65167. reqHeaders.Set("User-Agent", c.s.userAgent())
  65168. if c.ifNoneMatch_ != "" {
  65169. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65170. }
  65171. var body io.Reader = nil
  65172. c.urlParams_.Set("alt", alt)
  65173. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  65174. urls += "?" + c.urlParams_.Encode()
  65175. req, _ := http.NewRequest("GET", urls, body)
  65176. req.Header = reqHeaders
  65177. googleapi.Expand(req.URL, map[string]string{
  65178. "project": c.project,
  65179. "snapshot": c.snapshot,
  65180. })
  65181. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65182. }
  65183. // Do executes the "compute.snapshots.get" call.
  65184. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  65185. // code is an error. Response headers are in either
  65186. // *Snapshot.ServerResponse.Header or (if a response was returned at
  65187. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65188. // to check whether the returned error was because
  65189. // http.StatusNotModified was returned.
  65190. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  65191. gensupport.SetOptions(c.urlParams_, opts...)
  65192. res, err := c.doRequest("json")
  65193. if res != nil && res.StatusCode == http.StatusNotModified {
  65194. if res.Body != nil {
  65195. res.Body.Close()
  65196. }
  65197. return nil, &googleapi.Error{
  65198. Code: res.StatusCode,
  65199. Header: res.Header,
  65200. }
  65201. }
  65202. if err != nil {
  65203. return nil, err
  65204. }
  65205. defer googleapi.CloseBody(res)
  65206. if err := googleapi.CheckResponse(res); err != nil {
  65207. return nil, err
  65208. }
  65209. ret := &Snapshot{
  65210. ServerResponse: googleapi.ServerResponse{
  65211. Header: res.Header,
  65212. HTTPStatusCode: res.StatusCode,
  65213. },
  65214. }
  65215. target := &ret
  65216. if err := gensupport.DecodeResponse(target, res); err != nil {
  65217. return nil, err
  65218. }
  65219. return ret, nil
  65220. // {
  65221. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  65222. // "httpMethod": "GET",
  65223. // "id": "compute.snapshots.get",
  65224. // "parameterOrder": [
  65225. // "project",
  65226. // "snapshot"
  65227. // ],
  65228. // "parameters": {
  65229. // "project": {
  65230. // "description": "Project ID for this request.",
  65231. // "location": "path",
  65232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65233. // "required": true,
  65234. // "type": "string"
  65235. // },
  65236. // "snapshot": {
  65237. // "description": "Name of the Snapshot resource to return.",
  65238. // "location": "path",
  65239. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65240. // "required": true,
  65241. // "type": "string"
  65242. // }
  65243. // },
  65244. // "path": "{project}/global/snapshots/{snapshot}",
  65245. // "response": {
  65246. // "$ref": "Snapshot"
  65247. // },
  65248. // "scopes": [
  65249. // "https://www.googleapis.com/auth/cloud-platform",
  65250. // "https://www.googleapis.com/auth/compute",
  65251. // "https://www.googleapis.com/auth/compute.readonly"
  65252. // ]
  65253. // }
  65254. }
  65255. // method id "compute.snapshots.list":
  65256. type SnapshotsListCall struct {
  65257. s *Service
  65258. project string
  65259. urlParams_ gensupport.URLParams
  65260. ifNoneMatch_ string
  65261. ctx_ context.Context
  65262. header_ http.Header
  65263. }
  65264. // List: Retrieves the list of Snapshot resources contained within the
  65265. // specified project.
  65266. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  65267. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  65268. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65269. c.project = project
  65270. return c
  65271. }
  65272. // Filter sets the optional parameter "filter": A filter expression that
  65273. // filters resources listed in the response. The expression must specify
  65274. // the field name, a comparison operator, and the value that you want to
  65275. // use for filtering. The value must be a string, a number, or a
  65276. // boolean. The comparison operator must be either =, !=, >, or <.
  65277. //
  65278. // For example, if you are filtering Compute Engine instances, you can
  65279. // exclude instances named example-instance by specifying name !=
  65280. // example-instance.
  65281. //
  65282. // You can also filter nested fields. For example, you could specify
  65283. // scheduling.automaticRestart = false to include instances only if they
  65284. // are not scheduled for automatic restarts. You can use filtering on
  65285. // nested fields to filter based on resource labels.
  65286. //
  65287. // To filter on multiple expressions, provide each separate expression
  65288. // within parentheses. For example, (scheduling.automaticRestart = true)
  65289. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65290. // AND expression. However, you can include AND and OR expressions
  65291. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65292. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65293. // true).
  65294. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  65295. c.urlParams_.Set("filter", filter)
  65296. return c
  65297. }
  65298. // MaxResults sets the optional parameter "maxResults": The maximum
  65299. // number of results per page that should be returned. If the number of
  65300. // available results is larger than maxResults, Compute Engine returns a
  65301. // nextPageToken that can be used to get the next page of results in
  65302. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65303. // (Default: 500)
  65304. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  65305. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65306. return c
  65307. }
  65308. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  65309. // a certain order. By default, results are returned in alphanumerical
  65310. // order based on the resource name.
  65311. //
  65312. // You can also sort results in descending order based on the creation
  65313. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65314. // based on the creationTimestamp field in reverse chronological order
  65315. // (newest result first). Use this to sort resources like operations so
  65316. // that the newest operation is returned first.
  65317. //
  65318. // Currently, only sorting by name or creationTimestamp desc is
  65319. // supported.
  65320. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  65321. c.urlParams_.Set("orderBy", orderBy)
  65322. return c
  65323. }
  65324. // PageToken sets the optional parameter "pageToken": Specifies a page
  65325. // token to use. Set pageToken to the nextPageToken returned by a
  65326. // previous list request to get the next page of results.
  65327. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  65328. c.urlParams_.Set("pageToken", pageToken)
  65329. return c
  65330. }
  65331. // Fields allows partial responses to be retrieved. See
  65332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65333. // for more information.
  65334. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  65335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65336. return c
  65337. }
  65338. // IfNoneMatch sets the optional parameter which makes the operation
  65339. // fail if the object's ETag matches the given value. This is useful for
  65340. // getting updates only after the object has changed since the last
  65341. // request. Use googleapi.IsNotModified to check whether the response
  65342. // error from Do is the result of In-None-Match.
  65343. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  65344. c.ifNoneMatch_ = entityTag
  65345. return c
  65346. }
  65347. // Context sets the context to be used in this call's Do method. Any
  65348. // pending HTTP request will be aborted if the provided context is
  65349. // canceled.
  65350. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  65351. c.ctx_ = ctx
  65352. return c
  65353. }
  65354. // Header returns an http.Header that can be modified by the caller to
  65355. // add HTTP headers to the request.
  65356. func (c *SnapshotsListCall) Header() http.Header {
  65357. if c.header_ == nil {
  65358. c.header_ = make(http.Header)
  65359. }
  65360. return c.header_
  65361. }
  65362. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  65363. reqHeaders := make(http.Header)
  65364. for k, v := range c.header_ {
  65365. reqHeaders[k] = v
  65366. }
  65367. reqHeaders.Set("User-Agent", c.s.userAgent())
  65368. if c.ifNoneMatch_ != "" {
  65369. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65370. }
  65371. var body io.Reader = nil
  65372. c.urlParams_.Set("alt", alt)
  65373. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  65374. urls += "?" + c.urlParams_.Encode()
  65375. req, _ := http.NewRequest("GET", urls, body)
  65376. req.Header = reqHeaders
  65377. googleapi.Expand(req.URL, map[string]string{
  65378. "project": c.project,
  65379. })
  65380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65381. }
  65382. // Do executes the "compute.snapshots.list" call.
  65383. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  65384. // status code is an error. Response headers are in either
  65385. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  65386. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65387. // to check whether the returned error was because
  65388. // http.StatusNotModified was returned.
  65389. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  65390. gensupport.SetOptions(c.urlParams_, opts...)
  65391. res, err := c.doRequest("json")
  65392. if res != nil && res.StatusCode == http.StatusNotModified {
  65393. if res.Body != nil {
  65394. res.Body.Close()
  65395. }
  65396. return nil, &googleapi.Error{
  65397. Code: res.StatusCode,
  65398. Header: res.Header,
  65399. }
  65400. }
  65401. if err != nil {
  65402. return nil, err
  65403. }
  65404. defer googleapi.CloseBody(res)
  65405. if err := googleapi.CheckResponse(res); err != nil {
  65406. return nil, err
  65407. }
  65408. ret := &SnapshotList{
  65409. ServerResponse: googleapi.ServerResponse{
  65410. Header: res.Header,
  65411. HTTPStatusCode: res.StatusCode,
  65412. },
  65413. }
  65414. target := &ret
  65415. if err := gensupport.DecodeResponse(target, res); err != nil {
  65416. return nil, err
  65417. }
  65418. return ret, nil
  65419. // {
  65420. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  65421. // "httpMethod": "GET",
  65422. // "id": "compute.snapshots.list",
  65423. // "parameterOrder": [
  65424. // "project"
  65425. // ],
  65426. // "parameters": {
  65427. // "filter": {
  65428. // "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).",
  65429. // "location": "query",
  65430. // "type": "string"
  65431. // },
  65432. // "maxResults": {
  65433. // "default": "500",
  65434. // "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)",
  65435. // "format": "uint32",
  65436. // "location": "query",
  65437. // "minimum": "0",
  65438. // "type": "integer"
  65439. // },
  65440. // "orderBy": {
  65441. // "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.",
  65442. // "location": "query",
  65443. // "type": "string"
  65444. // },
  65445. // "pageToken": {
  65446. // "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.",
  65447. // "location": "query",
  65448. // "type": "string"
  65449. // },
  65450. // "project": {
  65451. // "description": "Project ID for this request.",
  65452. // "location": "path",
  65453. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65454. // "required": true,
  65455. // "type": "string"
  65456. // }
  65457. // },
  65458. // "path": "{project}/global/snapshots",
  65459. // "response": {
  65460. // "$ref": "SnapshotList"
  65461. // },
  65462. // "scopes": [
  65463. // "https://www.googleapis.com/auth/cloud-platform",
  65464. // "https://www.googleapis.com/auth/compute",
  65465. // "https://www.googleapis.com/auth/compute.readonly"
  65466. // ]
  65467. // }
  65468. }
  65469. // Pages invokes f for each page of results.
  65470. // A non-nil error returned from f will halt the iteration.
  65471. // The provided context supersedes any context provided to the Context method.
  65472. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  65473. c.ctx_ = ctx
  65474. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65475. for {
  65476. x, err := c.Do()
  65477. if err != nil {
  65478. return err
  65479. }
  65480. if err := f(x); err != nil {
  65481. return err
  65482. }
  65483. if x.NextPageToken == "" {
  65484. return nil
  65485. }
  65486. c.PageToken(x.NextPageToken)
  65487. }
  65488. }
  65489. // method id "compute.snapshots.setLabels":
  65490. type SnapshotsSetLabelsCall struct {
  65491. s *Service
  65492. project string
  65493. resource string
  65494. globalsetlabelsrequest *GlobalSetLabelsRequest
  65495. urlParams_ gensupport.URLParams
  65496. ctx_ context.Context
  65497. header_ http.Header
  65498. }
  65499. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  65500. // read the Labeling Resources documentation.
  65501. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  65502. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65503. c.project = project
  65504. c.resource = resource
  65505. c.globalsetlabelsrequest = globalsetlabelsrequest
  65506. return c
  65507. }
  65508. // Fields allows partial responses to be retrieved. See
  65509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65510. // for more information.
  65511. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  65512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65513. return c
  65514. }
  65515. // Context sets the context to be used in this call's Do method. Any
  65516. // pending HTTP request will be aborted if the provided context is
  65517. // canceled.
  65518. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  65519. c.ctx_ = ctx
  65520. return c
  65521. }
  65522. // Header returns an http.Header that can be modified by the caller to
  65523. // add HTTP headers to the request.
  65524. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  65525. if c.header_ == nil {
  65526. c.header_ = make(http.Header)
  65527. }
  65528. return c.header_
  65529. }
  65530. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  65531. reqHeaders := make(http.Header)
  65532. for k, v := range c.header_ {
  65533. reqHeaders[k] = v
  65534. }
  65535. reqHeaders.Set("User-Agent", c.s.userAgent())
  65536. var body io.Reader = nil
  65537. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  65538. if err != nil {
  65539. return nil, err
  65540. }
  65541. reqHeaders.Set("Content-Type", "application/json")
  65542. c.urlParams_.Set("alt", alt)
  65543. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  65544. urls += "?" + c.urlParams_.Encode()
  65545. req, _ := http.NewRequest("POST", urls, body)
  65546. req.Header = reqHeaders
  65547. googleapi.Expand(req.URL, map[string]string{
  65548. "project": c.project,
  65549. "resource": c.resource,
  65550. })
  65551. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65552. }
  65553. // Do executes the "compute.snapshots.setLabels" call.
  65554. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65555. // status code is an error. Response headers are in either
  65556. // *Operation.ServerResponse.Header or (if a response was returned at
  65557. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65558. // to check whether the returned error was because
  65559. // http.StatusNotModified was returned.
  65560. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65561. gensupport.SetOptions(c.urlParams_, opts...)
  65562. res, err := c.doRequest("json")
  65563. if res != nil && res.StatusCode == http.StatusNotModified {
  65564. if res.Body != nil {
  65565. res.Body.Close()
  65566. }
  65567. return nil, &googleapi.Error{
  65568. Code: res.StatusCode,
  65569. Header: res.Header,
  65570. }
  65571. }
  65572. if err != nil {
  65573. return nil, err
  65574. }
  65575. defer googleapi.CloseBody(res)
  65576. if err := googleapi.CheckResponse(res); err != nil {
  65577. return nil, err
  65578. }
  65579. ret := &Operation{
  65580. ServerResponse: googleapi.ServerResponse{
  65581. Header: res.Header,
  65582. HTTPStatusCode: res.StatusCode,
  65583. },
  65584. }
  65585. target := &ret
  65586. if err := gensupport.DecodeResponse(target, res); err != nil {
  65587. return nil, err
  65588. }
  65589. return ret, nil
  65590. // {
  65591. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  65592. // "httpMethod": "POST",
  65593. // "id": "compute.snapshots.setLabels",
  65594. // "parameterOrder": [
  65595. // "project",
  65596. // "resource"
  65597. // ],
  65598. // "parameters": {
  65599. // "project": {
  65600. // "description": "Project ID for this request.",
  65601. // "location": "path",
  65602. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65603. // "required": true,
  65604. // "type": "string"
  65605. // },
  65606. // "resource": {
  65607. // "description": "Name of the resource for this request.",
  65608. // "location": "path",
  65609. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  65610. // "required": true,
  65611. // "type": "string"
  65612. // }
  65613. // },
  65614. // "path": "{project}/global/snapshots/{resource}/setLabels",
  65615. // "request": {
  65616. // "$ref": "GlobalSetLabelsRequest"
  65617. // },
  65618. // "response": {
  65619. // "$ref": "Operation"
  65620. // },
  65621. // "scopes": [
  65622. // "https://www.googleapis.com/auth/cloud-platform",
  65623. // "https://www.googleapis.com/auth/compute"
  65624. // ]
  65625. // }
  65626. }
  65627. // method id "compute.sslCertificates.delete":
  65628. type SslCertificatesDeleteCall struct {
  65629. s *Service
  65630. project string
  65631. sslCertificate string
  65632. urlParams_ gensupport.URLParams
  65633. ctx_ context.Context
  65634. header_ http.Header
  65635. }
  65636. // Delete: Deletes the specified SslCertificate resource.
  65637. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  65638. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65639. c.project = project
  65640. c.sslCertificate = sslCertificate
  65641. return c
  65642. }
  65643. // RequestId sets the optional parameter "requestId": An optional
  65644. // request ID to identify requests. Specify a unique request ID so that
  65645. // if you must retry your request, the server will know to ignore the
  65646. // request if it has already been completed.
  65647. //
  65648. // For example, consider a situation where you make an initial request
  65649. // and the request times out. If you make the request again with the
  65650. // same request ID, the server can check if original operation with the
  65651. // same request ID was received, and if so, will ignore the second
  65652. // request. This prevents clients from accidentally creating duplicate
  65653. // commitments.
  65654. //
  65655. // The request ID must be a valid UUID with the exception that zero UUID
  65656. // is not supported (00000000-0000-0000-0000-000000000000).
  65657. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  65658. c.urlParams_.Set("requestId", requestId)
  65659. return c
  65660. }
  65661. // Fields allows partial responses to be retrieved. See
  65662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65663. // for more information.
  65664. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  65665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65666. return c
  65667. }
  65668. // Context sets the context to be used in this call's Do method. Any
  65669. // pending HTTP request will be aborted if the provided context is
  65670. // canceled.
  65671. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  65672. c.ctx_ = ctx
  65673. return c
  65674. }
  65675. // Header returns an http.Header that can be modified by the caller to
  65676. // add HTTP headers to the request.
  65677. func (c *SslCertificatesDeleteCall) Header() http.Header {
  65678. if c.header_ == nil {
  65679. c.header_ = make(http.Header)
  65680. }
  65681. return c.header_
  65682. }
  65683. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  65684. reqHeaders := make(http.Header)
  65685. for k, v := range c.header_ {
  65686. reqHeaders[k] = v
  65687. }
  65688. reqHeaders.Set("User-Agent", c.s.userAgent())
  65689. var body io.Reader = nil
  65690. c.urlParams_.Set("alt", alt)
  65691. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  65692. urls += "?" + c.urlParams_.Encode()
  65693. req, _ := http.NewRequest("DELETE", urls, body)
  65694. req.Header = reqHeaders
  65695. googleapi.Expand(req.URL, map[string]string{
  65696. "project": c.project,
  65697. "sslCertificate": c.sslCertificate,
  65698. })
  65699. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65700. }
  65701. // Do executes the "compute.sslCertificates.delete" call.
  65702. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65703. // status code is an error. Response headers are in either
  65704. // *Operation.ServerResponse.Header or (if a response was returned at
  65705. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65706. // to check whether the returned error was because
  65707. // http.StatusNotModified was returned.
  65708. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65709. gensupport.SetOptions(c.urlParams_, opts...)
  65710. res, err := c.doRequest("json")
  65711. if res != nil && res.StatusCode == http.StatusNotModified {
  65712. if res.Body != nil {
  65713. res.Body.Close()
  65714. }
  65715. return nil, &googleapi.Error{
  65716. Code: res.StatusCode,
  65717. Header: res.Header,
  65718. }
  65719. }
  65720. if err != nil {
  65721. return nil, err
  65722. }
  65723. defer googleapi.CloseBody(res)
  65724. if err := googleapi.CheckResponse(res); err != nil {
  65725. return nil, err
  65726. }
  65727. ret := &Operation{
  65728. ServerResponse: googleapi.ServerResponse{
  65729. Header: res.Header,
  65730. HTTPStatusCode: res.StatusCode,
  65731. },
  65732. }
  65733. target := &ret
  65734. if err := gensupport.DecodeResponse(target, res); err != nil {
  65735. return nil, err
  65736. }
  65737. return ret, nil
  65738. // {
  65739. // "description": "Deletes the specified SslCertificate resource.",
  65740. // "httpMethod": "DELETE",
  65741. // "id": "compute.sslCertificates.delete",
  65742. // "parameterOrder": [
  65743. // "project",
  65744. // "sslCertificate"
  65745. // ],
  65746. // "parameters": {
  65747. // "project": {
  65748. // "description": "Project ID for this request.",
  65749. // "location": "path",
  65750. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65751. // "required": true,
  65752. // "type": "string"
  65753. // },
  65754. // "requestId": {
  65755. // "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).",
  65756. // "location": "query",
  65757. // "type": "string"
  65758. // },
  65759. // "sslCertificate": {
  65760. // "description": "Name of the SslCertificate resource to delete.",
  65761. // "location": "path",
  65762. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65763. // "required": true,
  65764. // "type": "string"
  65765. // }
  65766. // },
  65767. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  65768. // "response": {
  65769. // "$ref": "Operation"
  65770. // },
  65771. // "scopes": [
  65772. // "https://www.googleapis.com/auth/cloud-platform",
  65773. // "https://www.googleapis.com/auth/compute"
  65774. // ]
  65775. // }
  65776. }
  65777. // method id "compute.sslCertificates.get":
  65778. type SslCertificatesGetCall struct {
  65779. s *Service
  65780. project string
  65781. sslCertificate string
  65782. urlParams_ gensupport.URLParams
  65783. ifNoneMatch_ string
  65784. ctx_ context.Context
  65785. header_ http.Header
  65786. }
  65787. // Get: Returns the specified SslCertificate resource. Gets a list of
  65788. // available SSL certificates by making a list() request.
  65789. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  65790. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65791. c.project = project
  65792. c.sslCertificate = sslCertificate
  65793. return c
  65794. }
  65795. // Fields allows partial responses to be retrieved. See
  65796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65797. // for more information.
  65798. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  65799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65800. return c
  65801. }
  65802. // IfNoneMatch sets the optional parameter which makes the operation
  65803. // fail if the object's ETag matches the given value. This is useful for
  65804. // getting updates only after the object has changed since the last
  65805. // request. Use googleapi.IsNotModified to check whether the response
  65806. // error from Do is the result of In-None-Match.
  65807. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  65808. c.ifNoneMatch_ = entityTag
  65809. return c
  65810. }
  65811. // Context sets the context to be used in this call's Do method. Any
  65812. // pending HTTP request will be aborted if the provided context is
  65813. // canceled.
  65814. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  65815. c.ctx_ = ctx
  65816. return c
  65817. }
  65818. // Header returns an http.Header that can be modified by the caller to
  65819. // add HTTP headers to the request.
  65820. func (c *SslCertificatesGetCall) Header() http.Header {
  65821. if c.header_ == nil {
  65822. c.header_ = make(http.Header)
  65823. }
  65824. return c.header_
  65825. }
  65826. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  65827. reqHeaders := make(http.Header)
  65828. for k, v := range c.header_ {
  65829. reqHeaders[k] = v
  65830. }
  65831. reqHeaders.Set("User-Agent", c.s.userAgent())
  65832. if c.ifNoneMatch_ != "" {
  65833. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65834. }
  65835. var body io.Reader = nil
  65836. c.urlParams_.Set("alt", alt)
  65837. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  65838. urls += "?" + c.urlParams_.Encode()
  65839. req, _ := http.NewRequest("GET", urls, body)
  65840. req.Header = reqHeaders
  65841. googleapi.Expand(req.URL, map[string]string{
  65842. "project": c.project,
  65843. "sslCertificate": c.sslCertificate,
  65844. })
  65845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65846. }
  65847. // Do executes the "compute.sslCertificates.get" call.
  65848. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  65849. // status code is an error. Response headers are in either
  65850. // *SslCertificate.ServerResponse.Header or (if a response was returned
  65851. // at all) in error.(*googleapi.Error).Header. Use
  65852. // googleapi.IsNotModified to check whether the returned error was
  65853. // because http.StatusNotModified was returned.
  65854. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  65855. gensupport.SetOptions(c.urlParams_, opts...)
  65856. res, err := c.doRequest("json")
  65857. if res != nil && res.StatusCode == http.StatusNotModified {
  65858. if res.Body != nil {
  65859. res.Body.Close()
  65860. }
  65861. return nil, &googleapi.Error{
  65862. Code: res.StatusCode,
  65863. Header: res.Header,
  65864. }
  65865. }
  65866. if err != nil {
  65867. return nil, err
  65868. }
  65869. defer googleapi.CloseBody(res)
  65870. if err := googleapi.CheckResponse(res); err != nil {
  65871. return nil, err
  65872. }
  65873. ret := &SslCertificate{
  65874. ServerResponse: googleapi.ServerResponse{
  65875. Header: res.Header,
  65876. HTTPStatusCode: res.StatusCode,
  65877. },
  65878. }
  65879. target := &ret
  65880. if err := gensupport.DecodeResponse(target, res); err != nil {
  65881. return nil, err
  65882. }
  65883. return ret, nil
  65884. // {
  65885. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  65886. // "httpMethod": "GET",
  65887. // "id": "compute.sslCertificates.get",
  65888. // "parameterOrder": [
  65889. // "project",
  65890. // "sslCertificate"
  65891. // ],
  65892. // "parameters": {
  65893. // "project": {
  65894. // "description": "Project ID for this request.",
  65895. // "location": "path",
  65896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65897. // "required": true,
  65898. // "type": "string"
  65899. // },
  65900. // "sslCertificate": {
  65901. // "description": "Name of the SslCertificate resource to return.",
  65902. // "location": "path",
  65903. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65904. // "required": true,
  65905. // "type": "string"
  65906. // }
  65907. // },
  65908. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  65909. // "response": {
  65910. // "$ref": "SslCertificate"
  65911. // },
  65912. // "scopes": [
  65913. // "https://www.googleapis.com/auth/cloud-platform",
  65914. // "https://www.googleapis.com/auth/compute",
  65915. // "https://www.googleapis.com/auth/compute.readonly"
  65916. // ]
  65917. // }
  65918. }
  65919. // method id "compute.sslCertificates.insert":
  65920. type SslCertificatesInsertCall struct {
  65921. s *Service
  65922. project string
  65923. sslcertificate *SslCertificate
  65924. urlParams_ gensupport.URLParams
  65925. ctx_ context.Context
  65926. header_ http.Header
  65927. }
  65928. // Insert: Creates a SslCertificate resource in the specified project
  65929. // using the data included in the request.
  65930. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  65931. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65932. c.project = project
  65933. c.sslcertificate = sslcertificate
  65934. return c
  65935. }
  65936. // RequestId sets the optional parameter "requestId": An optional
  65937. // request ID to identify requests. Specify a unique request ID so that
  65938. // if you must retry your request, the server will know to ignore the
  65939. // request if it has already been completed.
  65940. //
  65941. // For example, consider a situation where you make an initial request
  65942. // and the request times out. If you make the request again with the
  65943. // same request ID, the server can check if original operation with the
  65944. // same request ID was received, and if so, will ignore the second
  65945. // request. This prevents clients from accidentally creating duplicate
  65946. // commitments.
  65947. //
  65948. // The request ID must be a valid UUID with the exception that zero UUID
  65949. // is not supported (00000000-0000-0000-0000-000000000000).
  65950. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  65951. c.urlParams_.Set("requestId", requestId)
  65952. return c
  65953. }
  65954. // Fields allows partial responses to be retrieved. See
  65955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65956. // for more information.
  65957. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  65958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65959. return c
  65960. }
  65961. // Context sets the context to be used in this call's Do method. Any
  65962. // pending HTTP request will be aborted if the provided context is
  65963. // canceled.
  65964. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  65965. c.ctx_ = ctx
  65966. return c
  65967. }
  65968. // Header returns an http.Header that can be modified by the caller to
  65969. // add HTTP headers to the request.
  65970. func (c *SslCertificatesInsertCall) Header() http.Header {
  65971. if c.header_ == nil {
  65972. c.header_ = make(http.Header)
  65973. }
  65974. return c.header_
  65975. }
  65976. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  65977. reqHeaders := make(http.Header)
  65978. for k, v := range c.header_ {
  65979. reqHeaders[k] = v
  65980. }
  65981. reqHeaders.Set("User-Agent", c.s.userAgent())
  65982. var body io.Reader = nil
  65983. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  65984. if err != nil {
  65985. return nil, err
  65986. }
  65987. reqHeaders.Set("Content-Type", "application/json")
  65988. c.urlParams_.Set("alt", alt)
  65989. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  65990. urls += "?" + c.urlParams_.Encode()
  65991. req, _ := http.NewRequest("POST", urls, body)
  65992. req.Header = reqHeaders
  65993. googleapi.Expand(req.URL, map[string]string{
  65994. "project": c.project,
  65995. })
  65996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65997. }
  65998. // Do executes the "compute.sslCertificates.insert" call.
  65999. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66000. // status code is an error. Response headers are in either
  66001. // *Operation.ServerResponse.Header or (if a response was returned at
  66002. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66003. // to check whether the returned error was because
  66004. // http.StatusNotModified was returned.
  66005. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66006. gensupport.SetOptions(c.urlParams_, opts...)
  66007. res, err := c.doRequest("json")
  66008. if res != nil && res.StatusCode == http.StatusNotModified {
  66009. if res.Body != nil {
  66010. res.Body.Close()
  66011. }
  66012. return nil, &googleapi.Error{
  66013. Code: res.StatusCode,
  66014. Header: res.Header,
  66015. }
  66016. }
  66017. if err != nil {
  66018. return nil, err
  66019. }
  66020. defer googleapi.CloseBody(res)
  66021. if err := googleapi.CheckResponse(res); err != nil {
  66022. return nil, err
  66023. }
  66024. ret := &Operation{
  66025. ServerResponse: googleapi.ServerResponse{
  66026. Header: res.Header,
  66027. HTTPStatusCode: res.StatusCode,
  66028. },
  66029. }
  66030. target := &ret
  66031. if err := gensupport.DecodeResponse(target, res); err != nil {
  66032. return nil, err
  66033. }
  66034. return ret, nil
  66035. // {
  66036. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  66037. // "httpMethod": "POST",
  66038. // "id": "compute.sslCertificates.insert",
  66039. // "parameterOrder": [
  66040. // "project"
  66041. // ],
  66042. // "parameters": {
  66043. // "project": {
  66044. // "description": "Project ID for this request.",
  66045. // "location": "path",
  66046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66047. // "required": true,
  66048. // "type": "string"
  66049. // },
  66050. // "requestId": {
  66051. // "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).",
  66052. // "location": "query",
  66053. // "type": "string"
  66054. // }
  66055. // },
  66056. // "path": "{project}/global/sslCertificates",
  66057. // "request": {
  66058. // "$ref": "SslCertificate"
  66059. // },
  66060. // "response": {
  66061. // "$ref": "Operation"
  66062. // },
  66063. // "scopes": [
  66064. // "https://www.googleapis.com/auth/cloud-platform",
  66065. // "https://www.googleapis.com/auth/compute"
  66066. // ]
  66067. // }
  66068. }
  66069. // method id "compute.sslCertificates.list":
  66070. type SslCertificatesListCall struct {
  66071. s *Service
  66072. project string
  66073. urlParams_ gensupport.URLParams
  66074. ifNoneMatch_ string
  66075. ctx_ context.Context
  66076. header_ http.Header
  66077. }
  66078. // List: Retrieves the list of SslCertificate resources available to the
  66079. // specified project.
  66080. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  66081. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66082. c.project = project
  66083. return c
  66084. }
  66085. // Filter sets the optional parameter "filter": A filter expression that
  66086. // filters resources listed in the response. The expression must specify
  66087. // the field name, a comparison operator, and the value that you want to
  66088. // use for filtering. The value must be a string, a number, or a
  66089. // boolean. The comparison operator must be either =, !=, >, or <.
  66090. //
  66091. // For example, if you are filtering Compute Engine instances, you can
  66092. // exclude instances named example-instance by specifying name !=
  66093. // example-instance.
  66094. //
  66095. // You can also filter nested fields. For example, you could specify
  66096. // scheduling.automaticRestart = false to include instances only if they
  66097. // are not scheduled for automatic restarts. You can use filtering on
  66098. // nested fields to filter based on resource labels.
  66099. //
  66100. // To filter on multiple expressions, provide each separate expression
  66101. // within parentheses. For example, (scheduling.automaticRestart = true)
  66102. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  66103. // AND expression. However, you can include AND and OR expressions
  66104. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  66105. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  66106. // true).
  66107. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  66108. c.urlParams_.Set("filter", filter)
  66109. return c
  66110. }
  66111. // MaxResults sets the optional parameter "maxResults": The maximum
  66112. // number of results per page that should be returned. If the number of
  66113. // available results is larger than maxResults, Compute Engine returns a
  66114. // nextPageToken that can be used to get the next page of results in
  66115. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  66116. // (Default: 500)
  66117. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  66118. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  66119. return c
  66120. }
  66121. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  66122. // a certain order. By default, results are returned in alphanumerical
  66123. // order based on the resource name.
  66124. //
  66125. // You can also sort results in descending order based on the creation
  66126. // timestamp using orderBy="creationTimestamp desc". This sorts results
  66127. // based on the creationTimestamp field in reverse chronological order
  66128. // (newest result first). Use this to sort resources like operations so
  66129. // that the newest operation is returned first.
  66130. //
  66131. // Currently, only sorting by name or creationTimestamp desc is
  66132. // supported.
  66133. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  66134. c.urlParams_.Set("orderBy", orderBy)
  66135. return c
  66136. }
  66137. // PageToken sets the optional parameter "pageToken": Specifies a page
  66138. // token to use. Set pageToken to the nextPageToken returned by a
  66139. // previous list request to get the next page of results.
  66140. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  66141. c.urlParams_.Set("pageToken", pageToken)
  66142. return c
  66143. }
  66144. // Fields allows partial responses to be retrieved. See
  66145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66146. // for more information.
  66147. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  66148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66149. return c
  66150. }
  66151. // IfNoneMatch sets the optional parameter which makes the operation
  66152. // fail if the object's ETag matches the given value. This is useful for
  66153. // getting updates only after the object has changed since the last
  66154. // request. Use googleapi.IsNotModified to check whether the response
  66155. // error from Do is the result of In-None-Match.
  66156. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  66157. c.ifNoneMatch_ = entityTag
  66158. return c
  66159. }
  66160. // Context sets the context to be used in this call's Do method. Any
  66161. // pending HTTP request will be aborted if the provided context is
  66162. // canceled.
  66163. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  66164. c.ctx_ = ctx
  66165. return c
  66166. }
  66167. // Header returns an http.Header that can be modified by the caller to
  66168. // add HTTP headers to the request.
  66169. func (c *SslCertificatesListCall) Header() http.Header {
  66170. if c.header_ == nil {
  66171. c.header_ = make(http.Header)
  66172. }
  66173. return c.header_
  66174. }
  66175. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  66176. reqHeaders := make(http.Header)
  66177. for k, v := range c.header_ {
  66178. reqHeaders[k] = v
  66179. }
  66180. reqHeaders.Set("User-Agent", c.s.userAgent())
  66181. if c.ifNoneMatch_ != "" {
  66182. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66183. }
  66184. var body io.Reader = nil
  66185. c.urlParams_.Set("alt", alt)
  66186. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  66187. urls += "?" + c.urlParams_.Encode()
  66188. req, _ := http.NewRequest("GET", urls, body)
  66189. req.Header = reqHeaders
  66190. googleapi.Expand(req.URL, map[string]string{
  66191. "project": c.project,
  66192. })
  66193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66194. }
  66195. // Do executes the "compute.sslCertificates.list" call.
  66196. // Exactly one of *SslCertificateList or error will be non-nil. Any
  66197. // non-2xx status code is an error. Response headers are in either
  66198. // *SslCertificateList.ServerResponse.Header or (if a response was
  66199. // returned at all) in error.(*googleapi.Error).Header. Use
  66200. // googleapi.IsNotModified to check whether the returned error was
  66201. // because http.StatusNotModified was returned.
  66202. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  66203. gensupport.SetOptions(c.urlParams_, opts...)
  66204. res, err := c.doRequest("json")
  66205. if res != nil && res.StatusCode == http.StatusNotModified {
  66206. if res.Body != nil {
  66207. res.Body.Close()
  66208. }
  66209. return nil, &googleapi.Error{
  66210. Code: res.StatusCode,
  66211. Header: res.Header,
  66212. }
  66213. }
  66214. if err != nil {
  66215. return nil, err
  66216. }
  66217. defer googleapi.CloseBody(res)
  66218. if err := googleapi.CheckResponse(res); err != nil {
  66219. return nil, err
  66220. }
  66221. ret := &SslCertificateList{
  66222. ServerResponse: googleapi.ServerResponse{
  66223. Header: res.Header,
  66224. HTTPStatusCode: res.StatusCode,
  66225. },
  66226. }
  66227. target := &ret
  66228. if err := gensupport.DecodeResponse(target, res); err != nil {
  66229. return nil, err
  66230. }
  66231. return ret, nil
  66232. // {
  66233. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  66234. // "httpMethod": "GET",
  66235. // "id": "compute.sslCertificates.list",
  66236. // "parameterOrder": [
  66237. // "project"
  66238. // ],
  66239. // "parameters": {
  66240. // "filter": {
  66241. // "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).",
  66242. // "location": "query",
  66243. // "type": "string"
  66244. // },
  66245. // "maxResults": {
  66246. // "default": "500",
  66247. // "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)",
  66248. // "format": "uint32",
  66249. // "location": "query",
  66250. // "minimum": "0",
  66251. // "type": "integer"
  66252. // },
  66253. // "orderBy": {
  66254. // "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.",
  66255. // "location": "query",
  66256. // "type": "string"
  66257. // },
  66258. // "pageToken": {
  66259. // "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.",
  66260. // "location": "query",
  66261. // "type": "string"
  66262. // },
  66263. // "project": {
  66264. // "description": "Project ID for this request.",
  66265. // "location": "path",
  66266. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66267. // "required": true,
  66268. // "type": "string"
  66269. // }
  66270. // },
  66271. // "path": "{project}/global/sslCertificates",
  66272. // "response": {
  66273. // "$ref": "SslCertificateList"
  66274. // },
  66275. // "scopes": [
  66276. // "https://www.googleapis.com/auth/cloud-platform",
  66277. // "https://www.googleapis.com/auth/compute",
  66278. // "https://www.googleapis.com/auth/compute.readonly"
  66279. // ]
  66280. // }
  66281. }
  66282. // Pages invokes f for each page of results.
  66283. // A non-nil error returned from f will halt the iteration.
  66284. // The provided context supersedes any context provided to the Context method.
  66285. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  66286. c.ctx_ = ctx
  66287. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  66288. for {
  66289. x, err := c.Do()
  66290. if err != nil {
  66291. return err
  66292. }
  66293. if err := f(x); err != nil {
  66294. return err
  66295. }
  66296. if x.NextPageToken == "" {
  66297. return nil
  66298. }
  66299. c.PageToken(x.NextPageToken)
  66300. }
  66301. }
  66302. // method id "compute.sslPolicies.delete":
  66303. type SslPoliciesDeleteCall struct {
  66304. s *Service
  66305. project string
  66306. sslPolicy string
  66307. urlParams_ gensupport.URLParams
  66308. ctx_ context.Context
  66309. header_ http.Header
  66310. }
  66311. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  66312. // be deleted only if it is not in use by any TargetHttpsProxy or
  66313. // TargetSslProxy resources.
  66314. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  66315. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66316. c.project = project
  66317. c.sslPolicy = sslPolicy
  66318. return c
  66319. }
  66320. // RequestId sets the optional parameter "requestId": An optional
  66321. // request ID to identify requests. Specify a unique request ID so that
  66322. // if you must retry your request, the server will know to ignore the
  66323. // request if it has already been completed.
  66324. //
  66325. // For example, consider a situation where you make an initial request
  66326. // and the request times out. If you make the request again with the
  66327. // same request ID, the server can check if original operation with the
  66328. // same request ID was received, and if so, will ignore the second
  66329. // request. This prevents clients from accidentally creating duplicate
  66330. // commitments.
  66331. //
  66332. // The request ID must be a valid UUID with the exception that zero UUID
  66333. // is not supported (00000000-0000-0000-0000-000000000000).
  66334. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  66335. c.urlParams_.Set("requestId", requestId)
  66336. return c
  66337. }
  66338. // Fields allows partial responses to be retrieved. See
  66339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66340. // for more information.
  66341. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  66342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66343. return c
  66344. }
  66345. // Context sets the context to be used in this call's Do method. Any
  66346. // pending HTTP request will be aborted if the provided context is
  66347. // canceled.
  66348. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  66349. c.ctx_ = ctx
  66350. return c
  66351. }
  66352. // Header returns an http.Header that can be modified by the caller to
  66353. // add HTTP headers to the request.
  66354. func (c *SslPoliciesDeleteCall) Header() http.Header {
  66355. if c.header_ == nil {
  66356. c.header_ = make(http.Header)
  66357. }
  66358. return c.header_
  66359. }
  66360. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  66361. reqHeaders := make(http.Header)
  66362. for k, v := range c.header_ {
  66363. reqHeaders[k] = v
  66364. }
  66365. reqHeaders.Set("User-Agent", c.s.userAgent())
  66366. var body io.Reader = nil
  66367. c.urlParams_.Set("alt", alt)
  66368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  66369. urls += "?" + c.urlParams_.Encode()
  66370. req, _ := http.NewRequest("DELETE", urls, body)
  66371. req.Header = reqHeaders
  66372. googleapi.Expand(req.URL, map[string]string{
  66373. "project": c.project,
  66374. "sslPolicy": c.sslPolicy,
  66375. })
  66376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66377. }
  66378. // Do executes the "compute.sslPolicies.delete" call.
  66379. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66380. // status code is an error. Response headers are in either
  66381. // *Operation.ServerResponse.Header or (if a response was returned at
  66382. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66383. // to check whether the returned error was because
  66384. // http.StatusNotModified was returned.
  66385. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66386. gensupport.SetOptions(c.urlParams_, opts...)
  66387. res, err := c.doRequest("json")
  66388. if res != nil && res.StatusCode == http.StatusNotModified {
  66389. if res.Body != nil {
  66390. res.Body.Close()
  66391. }
  66392. return nil, &googleapi.Error{
  66393. Code: res.StatusCode,
  66394. Header: res.Header,
  66395. }
  66396. }
  66397. if err != nil {
  66398. return nil, err
  66399. }
  66400. defer googleapi.CloseBody(res)
  66401. if err := googleapi.CheckResponse(res); err != nil {
  66402. return nil, err
  66403. }
  66404. ret := &Operation{
  66405. ServerResponse: googleapi.ServerResponse{
  66406. Header: res.Header,
  66407. HTTPStatusCode: res.StatusCode,
  66408. },
  66409. }
  66410. target := &ret
  66411. if err := gensupport.DecodeResponse(target, res); err != nil {
  66412. return nil, err
  66413. }
  66414. return ret, nil
  66415. // {
  66416. // "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.",
  66417. // "httpMethod": "DELETE",
  66418. // "id": "compute.sslPolicies.delete",
  66419. // "parameterOrder": [
  66420. // "project",
  66421. // "sslPolicy"
  66422. // ],
  66423. // "parameters": {
  66424. // "project": {
  66425. // "description": "Project ID for this request.",
  66426. // "location": "path",
  66427. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66428. // "required": true,
  66429. // "type": "string"
  66430. // },
  66431. // "requestId": {
  66432. // "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).",
  66433. // "location": "query",
  66434. // "type": "string"
  66435. // },
  66436. // "sslPolicy": {
  66437. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  66438. // "location": "path",
  66439. // "required": true,
  66440. // "type": "string"
  66441. // }
  66442. // },
  66443. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  66444. // "response": {
  66445. // "$ref": "Operation"
  66446. // },
  66447. // "scopes": [
  66448. // "https://www.googleapis.com/auth/cloud-platform",
  66449. // "https://www.googleapis.com/auth/compute"
  66450. // ]
  66451. // }
  66452. }
  66453. // method id "compute.sslPolicies.get":
  66454. type SslPoliciesGetCall struct {
  66455. s *Service
  66456. project string
  66457. sslPolicy string
  66458. urlParams_ gensupport.URLParams
  66459. ifNoneMatch_ string
  66460. ctx_ context.Context
  66461. header_ http.Header
  66462. }
  66463. // Get: Lists all of the ordered rules present in a single specified
  66464. // policy.
  66465. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  66466. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66467. c.project = project
  66468. c.sslPolicy = sslPolicy
  66469. return c
  66470. }
  66471. // Fields allows partial responses to be retrieved. See
  66472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66473. // for more information.
  66474. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  66475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66476. return c
  66477. }
  66478. // IfNoneMatch sets the optional parameter which makes the operation
  66479. // fail if the object's ETag matches the given value. This is useful for
  66480. // getting updates only after the object has changed since the last
  66481. // request. Use googleapi.IsNotModified to check whether the response
  66482. // error from Do is the result of In-None-Match.
  66483. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  66484. c.ifNoneMatch_ = entityTag
  66485. return c
  66486. }
  66487. // Context sets the context to be used in this call's Do method. Any
  66488. // pending HTTP request will be aborted if the provided context is
  66489. // canceled.
  66490. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  66491. c.ctx_ = ctx
  66492. return c
  66493. }
  66494. // Header returns an http.Header that can be modified by the caller to
  66495. // add HTTP headers to the request.
  66496. func (c *SslPoliciesGetCall) Header() http.Header {
  66497. if c.header_ == nil {
  66498. c.header_ = make(http.Header)
  66499. }
  66500. return c.header_
  66501. }
  66502. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  66503. reqHeaders := make(http.Header)
  66504. for k, v := range c.header_ {
  66505. reqHeaders[k] = v
  66506. }
  66507. reqHeaders.Set("User-Agent", c.s.userAgent())
  66508. if c.ifNoneMatch_ != "" {
  66509. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66510. }
  66511. var body io.Reader = nil
  66512. c.urlParams_.Set("alt", alt)
  66513. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  66514. urls += "?" + c.urlParams_.Encode()
  66515. req, _ := http.NewRequest("GET", urls, body)
  66516. req.Header = reqHeaders
  66517. googleapi.Expand(req.URL, map[string]string{
  66518. "project": c.project,
  66519. "sslPolicy": c.sslPolicy,
  66520. })
  66521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66522. }
  66523. // Do executes the "compute.sslPolicies.get" call.
  66524. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  66525. // status code is an error. Response headers are in either
  66526. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  66527. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66528. // to check whether the returned error was because
  66529. // http.StatusNotModified was returned.
  66530. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  66531. gensupport.SetOptions(c.urlParams_, opts...)
  66532. res, err := c.doRequest("json")
  66533. if res != nil && res.StatusCode == http.StatusNotModified {
  66534. if res.Body != nil {
  66535. res.Body.Close()
  66536. }
  66537. return nil, &googleapi.Error{
  66538. Code: res.StatusCode,
  66539. Header: res.Header,
  66540. }
  66541. }
  66542. if err != nil {
  66543. return nil, err
  66544. }
  66545. defer googleapi.CloseBody(res)
  66546. if err := googleapi.CheckResponse(res); err != nil {
  66547. return nil, err
  66548. }
  66549. ret := &SslPolicy{
  66550. ServerResponse: googleapi.ServerResponse{
  66551. Header: res.Header,
  66552. HTTPStatusCode: res.StatusCode,
  66553. },
  66554. }
  66555. target := &ret
  66556. if err := gensupport.DecodeResponse(target, res); err != nil {
  66557. return nil, err
  66558. }
  66559. return ret, nil
  66560. // {
  66561. // "description": "Lists all of the ordered rules present in a single specified policy.",
  66562. // "httpMethod": "GET",
  66563. // "id": "compute.sslPolicies.get",
  66564. // "parameterOrder": [
  66565. // "project",
  66566. // "sslPolicy"
  66567. // ],
  66568. // "parameters": {
  66569. // "project": {
  66570. // "description": "Project ID for this request.",
  66571. // "location": "path",
  66572. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66573. // "required": true,
  66574. // "type": "string"
  66575. // },
  66576. // "sslPolicy": {
  66577. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  66578. // "location": "path",
  66579. // "required": true,
  66580. // "type": "string"
  66581. // }
  66582. // },
  66583. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  66584. // "response": {
  66585. // "$ref": "SslPolicy"
  66586. // },
  66587. // "scopes": [
  66588. // "https://www.googleapis.com/auth/cloud-platform",
  66589. // "https://www.googleapis.com/auth/compute",
  66590. // "https://www.googleapis.com/auth/compute.readonly"
  66591. // ]
  66592. // }
  66593. }
  66594. // method id "compute.sslPolicies.insert":
  66595. type SslPoliciesInsertCall struct {
  66596. s *Service
  66597. project string
  66598. sslpolicy *SslPolicy
  66599. urlParams_ gensupport.URLParams
  66600. ctx_ context.Context
  66601. header_ http.Header
  66602. }
  66603. // Insert: Returns the specified SSL policy resource. Gets a list of
  66604. // available SSL policies by making a list() request.
  66605. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  66606. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66607. c.project = project
  66608. c.sslpolicy = sslpolicy
  66609. return c
  66610. }
  66611. // RequestId sets the optional parameter "requestId": An optional
  66612. // request ID to identify requests. Specify a unique request ID so that
  66613. // if you must retry your request, the server will know to ignore the
  66614. // request if it has already been completed.
  66615. //
  66616. // For example, consider a situation where you make an initial request
  66617. // and the request times out. If you make the request again with the
  66618. // same request ID, the server can check if original operation with the
  66619. // same request ID was received, and if so, will ignore the second
  66620. // request. This prevents clients from accidentally creating duplicate
  66621. // commitments.
  66622. //
  66623. // The request ID must be a valid UUID with the exception that zero UUID
  66624. // is not supported (00000000-0000-0000-0000-000000000000).
  66625. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  66626. c.urlParams_.Set("requestId", requestId)
  66627. return c
  66628. }
  66629. // Fields allows partial responses to be retrieved. See
  66630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66631. // for more information.
  66632. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  66633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66634. return c
  66635. }
  66636. // Context sets the context to be used in this call's Do method. Any
  66637. // pending HTTP request will be aborted if the provided context is
  66638. // canceled.
  66639. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  66640. c.ctx_ = ctx
  66641. return c
  66642. }
  66643. // Header returns an http.Header that can be modified by the caller to
  66644. // add HTTP headers to the request.
  66645. func (c *SslPoliciesInsertCall) Header() http.Header {
  66646. if c.header_ == nil {
  66647. c.header_ = make(http.Header)
  66648. }
  66649. return c.header_
  66650. }
  66651. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  66652. reqHeaders := make(http.Header)
  66653. for k, v := range c.header_ {
  66654. reqHeaders[k] = v
  66655. }
  66656. reqHeaders.Set("User-Agent", c.s.userAgent())
  66657. var body io.Reader = nil
  66658. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  66659. if err != nil {
  66660. return nil, err
  66661. }
  66662. reqHeaders.Set("Content-Type", "application/json")
  66663. c.urlParams_.Set("alt", alt)
  66664. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  66665. urls += "?" + c.urlParams_.Encode()
  66666. req, _ := http.NewRequest("POST", urls, body)
  66667. req.Header = reqHeaders
  66668. googleapi.Expand(req.URL, map[string]string{
  66669. "project": c.project,
  66670. })
  66671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66672. }
  66673. // Do executes the "compute.sslPolicies.insert" call.
  66674. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66675. // status code is an error. Response headers are in either
  66676. // *Operation.ServerResponse.Header or (if a response was returned at
  66677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66678. // to check whether the returned error was because
  66679. // http.StatusNotModified was returned.
  66680. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66681. gensupport.SetOptions(c.urlParams_, opts...)
  66682. res, err := c.doRequest("json")
  66683. if res != nil && res.StatusCode == http.StatusNotModified {
  66684. if res.Body != nil {
  66685. res.Body.Close()
  66686. }
  66687. return nil, &googleapi.Error{
  66688. Code: res.StatusCode,
  66689. Header: res.Header,
  66690. }
  66691. }
  66692. if err != nil {
  66693. return nil, err
  66694. }
  66695. defer googleapi.CloseBody(res)
  66696. if err := googleapi.CheckResponse(res); err != nil {
  66697. return nil, err
  66698. }
  66699. ret := &Operation{
  66700. ServerResponse: googleapi.ServerResponse{
  66701. Header: res.Header,
  66702. HTTPStatusCode: res.StatusCode,
  66703. },
  66704. }
  66705. target := &ret
  66706. if err := gensupport.DecodeResponse(target, res); err != nil {
  66707. return nil, err
  66708. }
  66709. return ret, nil
  66710. // {
  66711. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  66712. // "httpMethod": "POST",
  66713. // "id": "compute.sslPolicies.insert",
  66714. // "parameterOrder": [
  66715. // "project"
  66716. // ],
  66717. // "parameters": {
  66718. // "project": {
  66719. // "description": "Project ID for this request.",
  66720. // "location": "path",
  66721. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66722. // "required": true,
  66723. // "type": "string"
  66724. // },
  66725. // "requestId": {
  66726. // "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).",
  66727. // "location": "query",
  66728. // "type": "string"
  66729. // }
  66730. // },
  66731. // "path": "{project}/global/sslPolicies",
  66732. // "request": {
  66733. // "$ref": "SslPolicy"
  66734. // },
  66735. // "response": {
  66736. // "$ref": "Operation"
  66737. // },
  66738. // "scopes": [
  66739. // "https://www.googleapis.com/auth/cloud-platform",
  66740. // "https://www.googleapis.com/auth/compute"
  66741. // ]
  66742. // }
  66743. }
  66744. // method id "compute.sslPolicies.list":
  66745. type SslPoliciesListCall struct {
  66746. s *Service
  66747. project string
  66748. urlParams_ gensupport.URLParams
  66749. ifNoneMatch_ string
  66750. ctx_ context.Context
  66751. header_ http.Header
  66752. }
  66753. // List: Lists all the SSL policies that have been configured for the
  66754. // specified project.
  66755. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  66756. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66757. c.project = project
  66758. return c
  66759. }
  66760. // Filter sets the optional parameter "filter": A filter expression that
  66761. // filters resources listed in the response. The expression must specify
  66762. // the field name, a comparison operator, and the value that you want to
  66763. // use for filtering. The value must be a string, a number, or a
  66764. // boolean. The comparison operator must be either =, !=, >, or <.
  66765. //
  66766. // For example, if you are filtering Compute Engine instances, you can
  66767. // exclude instances named example-instance by specifying name !=
  66768. // example-instance.
  66769. //
  66770. // You can also filter nested fields. For example, you could specify
  66771. // scheduling.automaticRestart = false to include instances only if they
  66772. // are not scheduled for automatic restarts. You can use filtering on
  66773. // nested fields to filter based on resource labels.
  66774. //
  66775. // To filter on multiple expressions, provide each separate expression
  66776. // within parentheses. For example, (scheduling.automaticRestart = true)
  66777. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  66778. // AND expression. However, you can include AND and OR expressions
  66779. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  66780. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  66781. // true).
  66782. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  66783. c.urlParams_.Set("filter", filter)
  66784. return c
  66785. }
  66786. // MaxResults sets the optional parameter "maxResults": The maximum
  66787. // number of results per page that should be returned. If the number of
  66788. // available results is larger than maxResults, Compute Engine returns a
  66789. // nextPageToken that can be used to get the next page of results in
  66790. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  66791. // (Default: 500)
  66792. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  66793. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  66794. return c
  66795. }
  66796. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  66797. // a certain order. By default, results are returned in alphanumerical
  66798. // order based on the resource name.
  66799. //
  66800. // You can also sort results in descending order based on the creation
  66801. // timestamp using orderBy="creationTimestamp desc". This sorts results
  66802. // based on the creationTimestamp field in reverse chronological order
  66803. // (newest result first). Use this to sort resources like operations so
  66804. // that the newest operation is returned first.
  66805. //
  66806. // Currently, only sorting by name or creationTimestamp desc is
  66807. // supported.
  66808. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  66809. c.urlParams_.Set("orderBy", orderBy)
  66810. return c
  66811. }
  66812. // PageToken sets the optional parameter "pageToken": Specifies a page
  66813. // token to use. Set pageToken to the nextPageToken returned by a
  66814. // previous list request to get the next page of results.
  66815. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  66816. c.urlParams_.Set("pageToken", pageToken)
  66817. return c
  66818. }
  66819. // Fields allows partial responses to be retrieved. See
  66820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66821. // for more information.
  66822. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  66823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66824. return c
  66825. }
  66826. // IfNoneMatch sets the optional parameter which makes the operation
  66827. // fail if the object's ETag matches the given value. This is useful for
  66828. // getting updates only after the object has changed since the last
  66829. // request. Use googleapi.IsNotModified to check whether the response
  66830. // error from Do is the result of In-None-Match.
  66831. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  66832. c.ifNoneMatch_ = entityTag
  66833. return c
  66834. }
  66835. // Context sets the context to be used in this call's Do method. Any
  66836. // pending HTTP request will be aborted if the provided context is
  66837. // canceled.
  66838. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  66839. c.ctx_ = ctx
  66840. return c
  66841. }
  66842. // Header returns an http.Header that can be modified by the caller to
  66843. // add HTTP headers to the request.
  66844. func (c *SslPoliciesListCall) Header() http.Header {
  66845. if c.header_ == nil {
  66846. c.header_ = make(http.Header)
  66847. }
  66848. return c.header_
  66849. }
  66850. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  66851. reqHeaders := make(http.Header)
  66852. for k, v := range c.header_ {
  66853. reqHeaders[k] = v
  66854. }
  66855. reqHeaders.Set("User-Agent", c.s.userAgent())
  66856. if c.ifNoneMatch_ != "" {
  66857. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66858. }
  66859. var body io.Reader = nil
  66860. c.urlParams_.Set("alt", alt)
  66861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  66862. urls += "?" + c.urlParams_.Encode()
  66863. req, _ := http.NewRequest("GET", urls, body)
  66864. req.Header = reqHeaders
  66865. googleapi.Expand(req.URL, map[string]string{
  66866. "project": c.project,
  66867. })
  66868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66869. }
  66870. // Do executes the "compute.sslPolicies.list" call.
  66871. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  66872. // status code is an error. Response headers are in either
  66873. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  66874. // at all) in error.(*googleapi.Error).Header. Use
  66875. // googleapi.IsNotModified to check whether the returned error was
  66876. // because http.StatusNotModified was returned.
  66877. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  66878. gensupport.SetOptions(c.urlParams_, opts...)
  66879. res, err := c.doRequest("json")
  66880. if res != nil && res.StatusCode == http.StatusNotModified {
  66881. if res.Body != nil {
  66882. res.Body.Close()
  66883. }
  66884. return nil, &googleapi.Error{
  66885. Code: res.StatusCode,
  66886. Header: res.Header,
  66887. }
  66888. }
  66889. if err != nil {
  66890. return nil, err
  66891. }
  66892. defer googleapi.CloseBody(res)
  66893. if err := googleapi.CheckResponse(res); err != nil {
  66894. return nil, err
  66895. }
  66896. ret := &SslPoliciesList{
  66897. ServerResponse: googleapi.ServerResponse{
  66898. Header: res.Header,
  66899. HTTPStatusCode: res.StatusCode,
  66900. },
  66901. }
  66902. target := &ret
  66903. if err := gensupport.DecodeResponse(target, res); err != nil {
  66904. return nil, err
  66905. }
  66906. return ret, nil
  66907. // {
  66908. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  66909. // "httpMethod": "GET",
  66910. // "id": "compute.sslPolicies.list",
  66911. // "parameterOrder": [
  66912. // "project"
  66913. // ],
  66914. // "parameters": {
  66915. // "filter": {
  66916. // "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).",
  66917. // "location": "query",
  66918. // "type": "string"
  66919. // },
  66920. // "maxResults": {
  66921. // "default": "500",
  66922. // "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)",
  66923. // "format": "uint32",
  66924. // "location": "query",
  66925. // "minimum": "0",
  66926. // "type": "integer"
  66927. // },
  66928. // "orderBy": {
  66929. // "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.",
  66930. // "location": "query",
  66931. // "type": "string"
  66932. // },
  66933. // "pageToken": {
  66934. // "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.",
  66935. // "location": "query",
  66936. // "type": "string"
  66937. // },
  66938. // "project": {
  66939. // "description": "Project ID for this request.",
  66940. // "location": "path",
  66941. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66942. // "required": true,
  66943. // "type": "string"
  66944. // }
  66945. // },
  66946. // "path": "{project}/global/sslPolicies",
  66947. // "response": {
  66948. // "$ref": "SslPoliciesList"
  66949. // },
  66950. // "scopes": [
  66951. // "https://www.googleapis.com/auth/cloud-platform",
  66952. // "https://www.googleapis.com/auth/compute",
  66953. // "https://www.googleapis.com/auth/compute.readonly"
  66954. // ]
  66955. // }
  66956. }
  66957. // Pages invokes f for each page of results.
  66958. // A non-nil error returned from f will halt the iteration.
  66959. // The provided context supersedes any context provided to the Context method.
  66960. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  66961. c.ctx_ = ctx
  66962. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  66963. for {
  66964. x, err := c.Do()
  66965. if err != nil {
  66966. return err
  66967. }
  66968. if err := f(x); err != nil {
  66969. return err
  66970. }
  66971. if x.NextPageToken == "" {
  66972. return nil
  66973. }
  66974. c.PageToken(x.NextPageToken)
  66975. }
  66976. }
  66977. // method id "compute.sslPolicies.listAvailableFeatures":
  66978. type SslPoliciesListAvailableFeaturesCall struct {
  66979. s *Service
  66980. project string
  66981. urlParams_ gensupport.URLParams
  66982. ifNoneMatch_ string
  66983. ctx_ context.Context
  66984. header_ http.Header
  66985. }
  66986. // ListAvailableFeatures: Lists all features that can be specified in
  66987. // the SSL policy when using custom profile.
  66988. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  66989. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66990. c.project = project
  66991. return c
  66992. }
  66993. // Filter sets the optional parameter "filter": A filter expression that
  66994. // filters resources listed in the response. The expression must specify
  66995. // the field name, a comparison operator, and the value that you want to
  66996. // use for filtering. The value must be a string, a number, or a
  66997. // boolean. The comparison operator must be either =, !=, >, or <.
  66998. //
  66999. // For example, if you are filtering Compute Engine instances, you can
  67000. // exclude instances named example-instance by specifying name !=
  67001. // example-instance.
  67002. //
  67003. // You can also filter nested fields. For example, you could specify
  67004. // scheduling.automaticRestart = false to include instances only if they
  67005. // are not scheduled for automatic restarts. You can use filtering on
  67006. // nested fields to filter based on resource labels.
  67007. //
  67008. // To filter on multiple expressions, provide each separate expression
  67009. // within parentheses. For example, (scheduling.automaticRestart = true)
  67010. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67011. // AND expression. However, you can include AND and OR expressions
  67012. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67013. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67014. // true).
  67015. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  67016. c.urlParams_.Set("filter", filter)
  67017. return c
  67018. }
  67019. // MaxResults sets the optional parameter "maxResults": The maximum
  67020. // number of results per page that should be returned. If the number of
  67021. // available results is larger than maxResults, Compute Engine returns a
  67022. // nextPageToken that can be used to get the next page of results in
  67023. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67024. // (Default: 500)
  67025. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  67026. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67027. return c
  67028. }
  67029. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67030. // a certain order. By default, results are returned in alphanumerical
  67031. // order based on the resource name.
  67032. //
  67033. // You can also sort results in descending order based on the creation
  67034. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67035. // based on the creationTimestamp field in reverse chronological order
  67036. // (newest result first). Use this to sort resources like operations so
  67037. // that the newest operation is returned first.
  67038. //
  67039. // Currently, only sorting by name or creationTimestamp desc is
  67040. // supported.
  67041. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  67042. c.urlParams_.Set("orderBy", orderBy)
  67043. return c
  67044. }
  67045. // PageToken sets the optional parameter "pageToken": Specifies a page
  67046. // token to use. Set pageToken to the nextPageToken returned by a
  67047. // previous list request to get the next page of results.
  67048. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  67049. c.urlParams_.Set("pageToken", pageToken)
  67050. return c
  67051. }
  67052. // Fields allows partial responses to be retrieved. See
  67053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67054. // for more information.
  67055. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  67056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67057. return c
  67058. }
  67059. // IfNoneMatch sets the optional parameter which makes the operation
  67060. // fail if the object's ETag matches the given value. This is useful for
  67061. // getting updates only after the object has changed since the last
  67062. // request. Use googleapi.IsNotModified to check whether the response
  67063. // error from Do is the result of In-None-Match.
  67064. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  67065. c.ifNoneMatch_ = entityTag
  67066. return c
  67067. }
  67068. // Context sets the context to be used in this call's Do method. Any
  67069. // pending HTTP request will be aborted if the provided context is
  67070. // canceled.
  67071. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  67072. c.ctx_ = ctx
  67073. return c
  67074. }
  67075. // Header returns an http.Header that can be modified by the caller to
  67076. // add HTTP headers to the request.
  67077. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  67078. if c.header_ == nil {
  67079. c.header_ = make(http.Header)
  67080. }
  67081. return c.header_
  67082. }
  67083. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  67084. reqHeaders := make(http.Header)
  67085. for k, v := range c.header_ {
  67086. reqHeaders[k] = v
  67087. }
  67088. reqHeaders.Set("User-Agent", c.s.userAgent())
  67089. if c.ifNoneMatch_ != "" {
  67090. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67091. }
  67092. var body io.Reader = nil
  67093. c.urlParams_.Set("alt", alt)
  67094. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  67095. urls += "?" + c.urlParams_.Encode()
  67096. req, _ := http.NewRequest("GET", urls, body)
  67097. req.Header = reqHeaders
  67098. googleapi.Expand(req.URL, map[string]string{
  67099. "project": c.project,
  67100. })
  67101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67102. }
  67103. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  67104. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  67105. // will be non-nil. Any non-2xx status code is an error. Response
  67106. // headers are in either
  67107. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  67108. // (if a response was returned at all) in
  67109. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  67110. // whether the returned error was because http.StatusNotModified was
  67111. // returned.
  67112. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  67113. gensupport.SetOptions(c.urlParams_, opts...)
  67114. res, err := c.doRequest("json")
  67115. if res != nil && res.StatusCode == http.StatusNotModified {
  67116. if res.Body != nil {
  67117. res.Body.Close()
  67118. }
  67119. return nil, &googleapi.Error{
  67120. Code: res.StatusCode,
  67121. Header: res.Header,
  67122. }
  67123. }
  67124. if err != nil {
  67125. return nil, err
  67126. }
  67127. defer googleapi.CloseBody(res)
  67128. if err := googleapi.CheckResponse(res); err != nil {
  67129. return nil, err
  67130. }
  67131. ret := &SslPoliciesListAvailableFeaturesResponse{
  67132. ServerResponse: googleapi.ServerResponse{
  67133. Header: res.Header,
  67134. HTTPStatusCode: res.StatusCode,
  67135. },
  67136. }
  67137. target := &ret
  67138. if err := gensupport.DecodeResponse(target, res); err != nil {
  67139. return nil, err
  67140. }
  67141. return ret, nil
  67142. // {
  67143. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  67144. // "httpMethod": "GET",
  67145. // "id": "compute.sslPolicies.listAvailableFeatures",
  67146. // "parameterOrder": [
  67147. // "project"
  67148. // ],
  67149. // "parameters": {
  67150. // "filter": {
  67151. // "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).",
  67152. // "location": "query",
  67153. // "type": "string"
  67154. // },
  67155. // "maxResults": {
  67156. // "default": "500",
  67157. // "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)",
  67158. // "format": "uint32",
  67159. // "location": "query",
  67160. // "minimum": "0",
  67161. // "type": "integer"
  67162. // },
  67163. // "orderBy": {
  67164. // "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.",
  67165. // "location": "query",
  67166. // "type": "string"
  67167. // },
  67168. // "pageToken": {
  67169. // "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.",
  67170. // "location": "query",
  67171. // "type": "string"
  67172. // },
  67173. // "project": {
  67174. // "description": "Project ID for this request.",
  67175. // "location": "path",
  67176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67177. // "required": true,
  67178. // "type": "string"
  67179. // }
  67180. // },
  67181. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  67182. // "response": {
  67183. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  67184. // },
  67185. // "scopes": [
  67186. // "https://www.googleapis.com/auth/cloud-platform",
  67187. // "https://www.googleapis.com/auth/compute",
  67188. // "https://www.googleapis.com/auth/compute.readonly"
  67189. // ]
  67190. // }
  67191. }
  67192. // method id "compute.sslPolicies.patch":
  67193. type SslPoliciesPatchCall struct {
  67194. s *Service
  67195. project string
  67196. sslPolicy string
  67197. sslpolicy *SslPolicy
  67198. urlParams_ gensupport.URLParams
  67199. ctx_ context.Context
  67200. header_ http.Header
  67201. }
  67202. // Patch: Patches the specified SSL policy with the data included in the
  67203. // request.
  67204. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  67205. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67206. c.project = project
  67207. c.sslPolicy = sslPolicy
  67208. c.sslpolicy = sslpolicy
  67209. return c
  67210. }
  67211. // RequestId sets the optional parameter "requestId": An optional
  67212. // request ID to identify requests. Specify a unique request ID so that
  67213. // if you must retry your request, the server will know to ignore the
  67214. // request if it has already been completed.
  67215. //
  67216. // For example, consider a situation where you make an initial request
  67217. // and the request times out. If you make the request again with the
  67218. // same request ID, the server can check if original operation with the
  67219. // same request ID was received, and if so, will ignore the second
  67220. // request. This prevents clients from accidentally creating duplicate
  67221. // commitments.
  67222. //
  67223. // The request ID must be a valid UUID with the exception that zero UUID
  67224. // is not supported (00000000-0000-0000-0000-000000000000).
  67225. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  67226. c.urlParams_.Set("requestId", requestId)
  67227. return c
  67228. }
  67229. // Fields allows partial responses to be retrieved. See
  67230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67231. // for more information.
  67232. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  67233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67234. return c
  67235. }
  67236. // Context sets the context to be used in this call's Do method. Any
  67237. // pending HTTP request will be aborted if the provided context is
  67238. // canceled.
  67239. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  67240. c.ctx_ = ctx
  67241. return c
  67242. }
  67243. // Header returns an http.Header that can be modified by the caller to
  67244. // add HTTP headers to the request.
  67245. func (c *SslPoliciesPatchCall) Header() http.Header {
  67246. if c.header_ == nil {
  67247. c.header_ = make(http.Header)
  67248. }
  67249. return c.header_
  67250. }
  67251. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  67252. reqHeaders := make(http.Header)
  67253. for k, v := range c.header_ {
  67254. reqHeaders[k] = v
  67255. }
  67256. reqHeaders.Set("User-Agent", c.s.userAgent())
  67257. var body io.Reader = nil
  67258. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  67259. if err != nil {
  67260. return nil, err
  67261. }
  67262. reqHeaders.Set("Content-Type", "application/json")
  67263. c.urlParams_.Set("alt", alt)
  67264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  67265. urls += "?" + c.urlParams_.Encode()
  67266. req, _ := http.NewRequest("PATCH", urls, body)
  67267. req.Header = reqHeaders
  67268. googleapi.Expand(req.URL, map[string]string{
  67269. "project": c.project,
  67270. "sslPolicy": c.sslPolicy,
  67271. })
  67272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67273. }
  67274. // Do executes the "compute.sslPolicies.patch" call.
  67275. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67276. // status code is an error. Response headers are in either
  67277. // *Operation.ServerResponse.Header or (if a response was returned at
  67278. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67279. // to check whether the returned error was because
  67280. // http.StatusNotModified was returned.
  67281. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67282. gensupport.SetOptions(c.urlParams_, opts...)
  67283. res, err := c.doRequest("json")
  67284. if res != nil && res.StatusCode == http.StatusNotModified {
  67285. if res.Body != nil {
  67286. res.Body.Close()
  67287. }
  67288. return nil, &googleapi.Error{
  67289. Code: res.StatusCode,
  67290. Header: res.Header,
  67291. }
  67292. }
  67293. if err != nil {
  67294. return nil, err
  67295. }
  67296. defer googleapi.CloseBody(res)
  67297. if err := googleapi.CheckResponse(res); err != nil {
  67298. return nil, err
  67299. }
  67300. ret := &Operation{
  67301. ServerResponse: googleapi.ServerResponse{
  67302. Header: res.Header,
  67303. HTTPStatusCode: res.StatusCode,
  67304. },
  67305. }
  67306. target := &ret
  67307. if err := gensupport.DecodeResponse(target, res); err != nil {
  67308. return nil, err
  67309. }
  67310. return ret, nil
  67311. // {
  67312. // "description": "Patches the specified SSL policy with the data included in the request.",
  67313. // "httpMethod": "PATCH",
  67314. // "id": "compute.sslPolicies.patch",
  67315. // "parameterOrder": [
  67316. // "project",
  67317. // "sslPolicy"
  67318. // ],
  67319. // "parameters": {
  67320. // "project": {
  67321. // "description": "Project ID for this request.",
  67322. // "location": "path",
  67323. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67324. // "required": true,
  67325. // "type": "string"
  67326. // },
  67327. // "requestId": {
  67328. // "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).",
  67329. // "location": "query",
  67330. // "type": "string"
  67331. // },
  67332. // "sslPolicy": {
  67333. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  67334. // "location": "path",
  67335. // "required": true,
  67336. // "type": "string"
  67337. // }
  67338. // },
  67339. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  67340. // "request": {
  67341. // "$ref": "SslPolicy"
  67342. // },
  67343. // "response": {
  67344. // "$ref": "Operation"
  67345. // },
  67346. // "scopes": [
  67347. // "https://www.googleapis.com/auth/cloud-platform",
  67348. // "https://www.googleapis.com/auth/compute"
  67349. // ]
  67350. // }
  67351. }
  67352. // method id "compute.subnetworks.aggregatedList":
  67353. type SubnetworksAggregatedListCall struct {
  67354. s *Service
  67355. project string
  67356. urlParams_ gensupport.URLParams
  67357. ifNoneMatch_ string
  67358. ctx_ context.Context
  67359. header_ http.Header
  67360. }
  67361. // AggregatedList: Retrieves an aggregated list of subnetworks.
  67362. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  67363. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67364. c.project = project
  67365. return c
  67366. }
  67367. // Filter sets the optional parameter "filter": A filter expression that
  67368. // filters resources listed in the response. The expression must specify
  67369. // the field name, a comparison operator, and the value that you want to
  67370. // use for filtering. The value must be a string, a number, or a
  67371. // boolean. The comparison operator must be either =, !=, >, or <.
  67372. //
  67373. // For example, if you are filtering Compute Engine instances, you can
  67374. // exclude instances named example-instance by specifying name !=
  67375. // example-instance.
  67376. //
  67377. // You can also filter nested fields. For example, you could specify
  67378. // scheduling.automaticRestart = false to include instances only if they
  67379. // are not scheduled for automatic restarts. You can use filtering on
  67380. // nested fields to filter based on resource labels.
  67381. //
  67382. // To filter on multiple expressions, provide each separate expression
  67383. // within parentheses. For example, (scheduling.automaticRestart = true)
  67384. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67385. // AND expression. However, you can include AND and OR expressions
  67386. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67387. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67388. // true).
  67389. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  67390. c.urlParams_.Set("filter", filter)
  67391. return c
  67392. }
  67393. // MaxResults sets the optional parameter "maxResults": The maximum
  67394. // number of results per page that should be returned. If the number of
  67395. // available results is larger than maxResults, Compute Engine returns a
  67396. // nextPageToken that can be used to get the next page of results in
  67397. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67398. // (Default: 500)
  67399. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  67400. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67401. return c
  67402. }
  67403. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67404. // a certain order. By default, results are returned in alphanumerical
  67405. // order based on the resource name.
  67406. //
  67407. // You can also sort results in descending order based on the creation
  67408. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67409. // based on the creationTimestamp field in reverse chronological order
  67410. // (newest result first). Use this to sort resources like operations so
  67411. // that the newest operation is returned first.
  67412. //
  67413. // Currently, only sorting by name or creationTimestamp desc is
  67414. // supported.
  67415. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  67416. c.urlParams_.Set("orderBy", orderBy)
  67417. return c
  67418. }
  67419. // PageToken sets the optional parameter "pageToken": Specifies a page
  67420. // token to use. Set pageToken to the nextPageToken returned by a
  67421. // previous list request to get the next page of results.
  67422. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  67423. c.urlParams_.Set("pageToken", pageToken)
  67424. return c
  67425. }
  67426. // Fields allows partial responses to be retrieved. See
  67427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67428. // for more information.
  67429. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  67430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67431. return c
  67432. }
  67433. // IfNoneMatch sets the optional parameter which makes the operation
  67434. // fail if the object's ETag matches the given value. This is useful for
  67435. // getting updates only after the object has changed since the last
  67436. // request. Use googleapi.IsNotModified to check whether the response
  67437. // error from Do is the result of In-None-Match.
  67438. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  67439. c.ifNoneMatch_ = entityTag
  67440. return c
  67441. }
  67442. // Context sets the context to be used in this call's Do method. Any
  67443. // pending HTTP request will be aborted if the provided context is
  67444. // canceled.
  67445. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  67446. c.ctx_ = ctx
  67447. return c
  67448. }
  67449. // Header returns an http.Header that can be modified by the caller to
  67450. // add HTTP headers to the request.
  67451. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  67452. if c.header_ == nil {
  67453. c.header_ = make(http.Header)
  67454. }
  67455. return c.header_
  67456. }
  67457. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  67458. reqHeaders := make(http.Header)
  67459. for k, v := range c.header_ {
  67460. reqHeaders[k] = v
  67461. }
  67462. reqHeaders.Set("User-Agent", c.s.userAgent())
  67463. if c.ifNoneMatch_ != "" {
  67464. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67465. }
  67466. var body io.Reader = nil
  67467. c.urlParams_.Set("alt", alt)
  67468. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  67469. urls += "?" + c.urlParams_.Encode()
  67470. req, _ := http.NewRequest("GET", urls, body)
  67471. req.Header = reqHeaders
  67472. googleapi.Expand(req.URL, map[string]string{
  67473. "project": c.project,
  67474. })
  67475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67476. }
  67477. // Do executes the "compute.subnetworks.aggregatedList" call.
  67478. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  67479. // Any non-2xx status code is an error. Response headers are in either
  67480. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  67481. // returned at all) in error.(*googleapi.Error).Header. Use
  67482. // googleapi.IsNotModified to check whether the returned error was
  67483. // because http.StatusNotModified was returned.
  67484. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  67485. gensupport.SetOptions(c.urlParams_, opts...)
  67486. res, err := c.doRequest("json")
  67487. if res != nil && res.StatusCode == http.StatusNotModified {
  67488. if res.Body != nil {
  67489. res.Body.Close()
  67490. }
  67491. return nil, &googleapi.Error{
  67492. Code: res.StatusCode,
  67493. Header: res.Header,
  67494. }
  67495. }
  67496. if err != nil {
  67497. return nil, err
  67498. }
  67499. defer googleapi.CloseBody(res)
  67500. if err := googleapi.CheckResponse(res); err != nil {
  67501. return nil, err
  67502. }
  67503. ret := &SubnetworkAggregatedList{
  67504. ServerResponse: googleapi.ServerResponse{
  67505. Header: res.Header,
  67506. HTTPStatusCode: res.StatusCode,
  67507. },
  67508. }
  67509. target := &ret
  67510. if err := gensupport.DecodeResponse(target, res); err != nil {
  67511. return nil, err
  67512. }
  67513. return ret, nil
  67514. // {
  67515. // "description": "Retrieves an aggregated list of subnetworks.",
  67516. // "httpMethod": "GET",
  67517. // "id": "compute.subnetworks.aggregatedList",
  67518. // "parameterOrder": [
  67519. // "project"
  67520. // ],
  67521. // "parameters": {
  67522. // "filter": {
  67523. // "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).",
  67524. // "location": "query",
  67525. // "type": "string"
  67526. // },
  67527. // "maxResults": {
  67528. // "default": "500",
  67529. // "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)",
  67530. // "format": "uint32",
  67531. // "location": "query",
  67532. // "minimum": "0",
  67533. // "type": "integer"
  67534. // },
  67535. // "orderBy": {
  67536. // "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.",
  67537. // "location": "query",
  67538. // "type": "string"
  67539. // },
  67540. // "pageToken": {
  67541. // "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.",
  67542. // "location": "query",
  67543. // "type": "string"
  67544. // },
  67545. // "project": {
  67546. // "description": "Project ID for this request.",
  67547. // "location": "path",
  67548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67549. // "required": true,
  67550. // "type": "string"
  67551. // }
  67552. // },
  67553. // "path": "{project}/aggregated/subnetworks",
  67554. // "response": {
  67555. // "$ref": "SubnetworkAggregatedList"
  67556. // },
  67557. // "scopes": [
  67558. // "https://www.googleapis.com/auth/cloud-platform",
  67559. // "https://www.googleapis.com/auth/compute",
  67560. // "https://www.googleapis.com/auth/compute.readonly"
  67561. // ]
  67562. // }
  67563. }
  67564. // Pages invokes f for each page of results.
  67565. // A non-nil error returned from f will halt the iteration.
  67566. // The provided context supersedes any context provided to the Context method.
  67567. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  67568. c.ctx_ = ctx
  67569. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67570. for {
  67571. x, err := c.Do()
  67572. if err != nil {
  67573. return err
  67574. }
  67575. if err := f(x); err != nil {
  67576. return err
  67577. }
  67578. if x.NextPageToken == "" {
  67579. return nil
  67580. }
  67581. c.PageToken(x.NextPageToken)
  67582. }
  67583. }
  67584. // method id "compute.subnetworks.delete":
  67585. type SubnetworksDeleteCall struct {
  67586. s *Service
  67587. project string
  67588. region string
  67589. subnetwork string
  67590. urlParams_ gensupport.URLParams
  67591. ctx_ context.Context
  67592. header_ http.Header
  67593. }
  67594. // Delete: Deletes the specified subnetwork.
  67595. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  67596. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67597. c.project = project
  67598. c.region = region
  67599. c.subnetwork = subnetwork
  67600. return c
  67601. }
  67602. // RequestId sets the optional parameter "requestId": An optional
  67603. // request ID to identify requests. Specify a unique request ID so that
  67604. // if you must retry your request, the server will know to ignore the
  67605. // request if it has already been completed.
  67606. //
  67607. // For example, consider a situation where you make an initial request
  67608. // and the request times out. If you make the request again with the
  67609. // same request ID, the server can check if original operation with the
  67610. // same request ID was received, and if so, will ignore the second
  67611. // request. This prevents clients from accidentally creating duplicate
  67612. // commitments.
  67613. //
  67614. // The request ID must be a valid UUID with the exception that zero UUID
  67615. // is not supported (00000000-0000-0000-0000-000000000000).
  67616. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  67617. c.urlParams_.Set("requestId", requestId)
  67618. return c
  67619. }
  67620. // Fields allows partial responses to be retrieved. See
  67621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67622. // for more information.
  67623. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  67624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67625. return c
  67626. }
  67627. // Context sets the context to be used in this call's Do method. Any
  67628. // pending HTTP request will be aborted if the provided context is
  67629. // canceled.
  67630. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  67631. c.ctx_ = ctx
  67632. return c
  67633. }
  67634. // Header returns an http.Header that can be modified by the caller to
  67635. // add HTTP headers to the request.
  67636. func (c *SubnetworksDeleteCall) Header() http.Header {
  67637. if c.header_ == nil {
  67638. c.header_ = make(http.Header)
  67639. }
  67640. return c.header_
  67641. }
  67642. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  67643. reqHeaders := make(http.Header)
  67644. for k, v := range c.header_ {
  67645. reqHeaders[k] = v
  67646. }
  67647. reqHeaders.Set("User-Agent", c.s.userAgent())
  67648. var body io.Reader = nil
  67649. c.urlParams_.Set("alt", alt)
  67650. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  67651. urls += "?" + c.urlParams_.Encode()
  67652. req, _ := http.NewRequest("DELETE", urls, body)
  67653. req.Header = reqHeaders
  67654. googleapi.Expand(req.URL, map[string]string{
  67655. "project": c.project,
  67656. "region": c.region,
  67657. "subnetwork": c.subnetwork,
  67658. })
  67659. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67660. }
  67661. // Do executes the "compute.subnetworks.delete" call.
  67662. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67663. // status code is an error. Response headers are in either
  67664. // *Operation.ServerResponse.Header or (if a response was returned at
  67665. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67666. // to check whether the returned error was because
  67667. // http.StatusNotModified was returned.
  67668. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67669. gensupport.SetOptions(c.urlParams_, opts...)
  67670. res, err := c.doRequest("json")
  67671. if res != nil && res.StatusCode == http.StatusNotModified {
  67672. if res.Body != nil {
  67673. res.Body.Close()
  67674. }
  67675. return nil, &googleapi.Error{
  67676. Code: res.StatusCode,
  67677. Header: res.Header,
  67678. }
  67679. }
  67680. if err != nil {
  67681. return nil, err
  67682. }
  67683. defer googleapi.CloseBody(res)
  67684. if err := googleapi.CheckResponse(res); err != nil {
  67685. return nil, err
  67686. }
  67687. ret := &Operation{
  67688. ServerResponse: googleapi.ServerResponse{
  67689. Header: res.Header,
  67690. HTTPStatusCode: res.StatusCode,
  67691. },
  67692. }
  67693. target := &ret
  67694. if err := gensupport.DecodeResponse(target, res); err != nil {
  67695. return nil, err
  67696. }
  67697. return ret, nil
  67698. // {
  67699. // "description": "Deletes the specified subnetwork.",
  67700. // "httpMethod": "DELETE",
  67701. // "id": "compute.subnetworks.delete",
  67702. // "parameterOrder": [
  67703. // "project",
  67704. // "region",
  67705. // "subnetwork"
  67706. // ],
  67707. // "parameters": {
  67708. // "project": {
  67709. // "description": "Project ID for this request.",
  67710. // "location": "path",
  67711. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67712. // "required": true,
  67713. // "type": "string"
  67714. // },
  67715. // "region": {
  67716. // "description": "Name of the region scoping this request.",
  67717. // "location": "path",
  67718. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67719. // "required": true,
  67720. // "type": "string"
  67721. // },
  67722. // "requestId": {
  67723. // "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).",
  67724. // "location": "query",
  67725. // "type": "string"
  67726. // },
  67727. // "subnetwork": {
  67728. // "description": "Name of the Subnetwork resource to delete.",
  67729. // "location": "path",
  67730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67731. // "required": true,
  67732. // "type": "string"
  67733. // }
  67734. // },
  67735. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  67736. // "response": {
  67737. // "$ref": "Operation"
  67738. // },
  67739. // "scopes": [
  67740. // "https://www.googleapis.com/auth/cloud-platform",
  67741. // "https://www.googleapis.com/auth/compute"
  67742. // ]
  67743. // }
  67744. }
  67745. // method id "compute.subnetworks.expandIpCidrRange":
  67746. type SubnetworksExpandIpCidrRangeCall struct {
  67747. s *Service
  67748. project string
  67749. region string
  67750. subnetwork string
  67751. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  67752. urlParams_ gensupport.URLParams
  67753. ctx_ context.Context
  67754. header_ http.Header
  67755. }
  67756. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  67757. // specified value.
  67758. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  67759. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67760. c.project = project
  67761. c.region = region
  67762. c.subnetwork = subnetwork
  67763. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  67764. return c
  67765. }
  67766. // RequestId sets the optional parameter "requestId": An optional
  67767. // request ID to identify requests. Specify a unique request ID so that
  67768. // if you must retry your request, the server will know to ignore the
  67769. // request if it has already been completed.
  67770. //
  67771. // For example, consider a situation where you make an initial request
  67772. // and the request times out. If you make the request again with the
  67773. // same request ID, the server can check if original operation with the
  67774. // same request ID was received, and if so, will ignore the second
  67775. // request. This prevents clients from accidentally creating duplicate
  67776. // commitments.
  67777. //
  67778. // The request ID must be a valid UUID with the exception that zero UUID
  67779. // is not supported (00000000-0000-0000-0000-000000000000).
  67780. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  67781. c.urlParams_.Set("requestId", requestId)
  67782. return c
  67783. }
  67784. // Fields allows partial responses to be retrieved. See
  67785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67786. // for more information.
  67787. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  67788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67789. return c
  67790. }
  67791. // Context sets the context to be used in this call's Do method. Any
  67792. // pending HTTP request will be aborted if the provided context is
  67793. // canceled.
  67794. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  67795. c.ctx_ = ctx
  67796. return c
  67797. }
  67798. // Header returns an http.Header that can be modified by the caller to
  67799. // add HTTP headers to the request.
  67800. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  67801. if c.header_ == nil {
  67802. c.header_ = make(http.Header)
  67803. }
  67804. return c.header_
  67805. }
  67806. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  67807. reqHeaders := make(http.Header)
  67808. for k, v := range c.header_ {
  67809. reqHeaders[k] = v
  67810. }
  67811. reqHeaders.Set("User-Agent", c.s.userAgent())
  67812. var body io.Reader = nil
  67813. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  67814. if err != nil {
  67815. return nil, err
  67816. }
  67817. reqHeaders.Set("Content-Type", "application/json")
  67818. c.urlParams_.Set("alt", alt)
  67819. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  67820. urls += "?" + c.urlParams_.Encode()
  67821. req, _ := http.NewRequest("POST", urls, body)
  67822. req.Header = reqHeaders
  67823. googleapi.Expand(req.URL, map[string]string{
  67824. "project": c.project,
  67825. "region": c.region,
  67826. "subnetwork": c.subnetwork,
  67827. })
  67828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67829. }
  67830. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  67831. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67832. // status code is an error. Response headers are in either
  67833. // *Operation.ServerResponse.Header or (if a response was returned at
  67834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67835. // to check whether the returned error was because
  67836. // http.StatusNotModified was returned.
  67837. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67838. gensupport.SetOptions(c.urlParams_, opts...)
  67839. res, err := c.doRequest("json")
  67840. if res != nil && res.StatusCode == http.StatusNotModified {
  67841. if res.Body != nil {
  67842. res.Body.Close()
  67843. }
  67844. return nil, &googleapi.Error{
  67845. Code: res.StatusCode,
  67846. Header: res.Header,
  67847. }
  67848. }
  67849. if err != nil {
  67850. return nil, err
  67851. }
  67852. defer googleapi.CloseBody(res)
  67853. if err := googleapi.CheckResponse(res); err != nil {
  67854. return nil, err
  67855. }
  67856. ret := &Operation{
  67857. ServerResponse: googleapi.ServerResponse{
  67858. Header: res.Header,
  67859. HTTPStatusCode: res.StatusCode,
  67860. },
  67861. }
  67862. target := &ret
  67863. if err := gensupport.DecodeResponse(target, res); err != nil {
  67864. return nil, err
  67865. }
  67866. return ret, nil
  67867. // {
  67868. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  67869. // "httpMethod": "POST",
  67870. // "id": "compute.subnetworks.expandIpCidrRange",
  67871. // "parameterOrder": [
  67872. // "project",
  67873. // "region",
  67874. // "subnetwork"
  67875. // ],
  67876. // "parameters": {
  67877. // "project": {
  67878. // "description": "Project ID for this request.",
  67879. // "location": "path",
  67880. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67881. // "required": true,
  67882. // "type": "string"
  67883. // },
  67884. // "region": {
  67885. // "description": "Name of the region scoping this request.",
  67886. // "location": "path",
  67887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67888. // "required": true,
  67889. // "type": "string"
  67890. // },
  67891. // "requestId": {
  67892. // "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).",
  67893. // "location": "query",
  67894. // "type": "string"
  67895. // },
  67896. // "subnetwork": {
  67897. // "description": "Name of the Subnetwork resource to update.",
  67898. // "location": "path",
  67899. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67900. // "required": true,
  67901. // "type": "string"
  67902. // }
  67903. // },
  67904. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  67905. // "request": {
  67906. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  67907. // },
  67908. // "response": {
  67909. // "$ref": "Operation"
  67910. // },
  67911. // "scopes": [
  67912. // "https://www.googleapis.com/auth/cloud-platform",
  67913. // "https://www.googleapis.com/auth/compute"
  67914. // ]
  67915. // }
  67916. }
  67917. // method id "compute.subnetworks.get":
  67918. type SubnetworksGetCall struct {
  67919. s *Service
  67920. project string
  67921. region string
  67922. subnetwork string
  67923. urlParams_ gensupport.URLParams
  67924. ifNoneMatch_ string
  67925. ctx_ context.Context
  67926. header_ http.Header
  67927. }
  67928. // Get: Returns the specified subnetwork. Gets a list of available
  67929. // subnetworks list() request.
  67930. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  67931. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67932. c.project = project
  67933. c.region = region
  67934. c.subnetwork = subnetwork
  67935. return c
  67936. }
  67937. // Fields allows partial responses to be retrieved. See
  67938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67939. // for more information.
  67940. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  67941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67942. return c
  67943. }
  67944. // IfNoneMatch sets the optional parameter which makes the operation
  67945. // fail if the object's ETag matches the given value. This is useful for
  67946. // getting updates only after the object has changed since the last
  67947. // request. Use googleapi.IsNotModified to check whether the response
  67948. // error from Do is the result of In-None-Match.
  67949. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  67950. c.ifNoneMatch_ = entityTag
  67951. return c
  67952. }
  67953. // Context sets the context to be used in this call's Do method. Any
  67954. // pending HTTP request will be aborted if the provided context is
  67955. // canceled.
  67956. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  67957. c.ctx_ = ctx
  67958. return c
  67959. }
  67960. // Header returns an http.Header that can be modified by the caller to
  67961. // add HTTP headers to the request.
  67962. func (c *SubnetworksGetCall) Header() http.Header {
  67963. if c.header_ == nil {
  67964. c.header_ = make(http.Header)
  67965. }
  67966. return c.header_
  67967. }
  67968. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  67969. reqHeaders := make(http.Header)
  67970. for k, v := range c.header_ {
  67971. reqHeaders[k] = v
  67972. }
  67973. reqHeaders.Set("User-Agent", c.s.userAgent())
  67974. if c.ifNoneMatch_ != "" {
  67975. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67976. }
  67977. var body io.Reader = nil
  67978. c.urlParams_.Set("alt", alt)
  67979. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  67980. urls += "?" + c.urlParams_.Encode()
  67981. req, _ := http.NewRequest("GET", urls, body)
  67982. req.Header = reqHeaders
  67983. googleapi.Expand(req.URL, map[string]string{
  67984. "project": c.project,
  67985. "region": c.region,
  67986. "subnetwork": c.subnetwork,
  67987. })
  67988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67989. }
  67990. // Do executes the "compute.subnetworks.get" call.
  67991. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  67992. // status code is an error. Response headers are in either
  67993. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  67994. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67995. // to check whether the returned error was because
  67996. // http.StatusNotModified was returned.
  67997. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  67998. gensupport.SetOptions(c.urlParams_, opts...)
  67999. res, err := c.doRequest("json")
  68000. if res != nil && res.StatusCode == http.StatusNotModified {
  68001. if res.Body != nil {
  68002. res.Body.Close()
  68003. }
  68004. return nil, &googleapi.Error{
  68005. Code: res.StatusCode,
  68006. Header: res.Header,
  68007. }
  68008. }
  68009. if err != nil {
  68010. return nil, err
  68011. }
  68012. defer googleapi.CloseBody(res)
  68013. if err := googleapi.CheckResponse(res); err != nil {
  68014. return nil, err
  68015. }
  68016. ret := &Subnetwork{
  68017. ServerResponse: googleapi.ServerResponse{
  68018. Header: res.Header,
  68019. HTTPStatusCode: res.StatusCode,
  68020. },
  68021. }
  68022. target := &ret
  68023. if err := gensupport.DecodeResponse(target, res); err != nil {
  68024. return nil, err
  68025. }
  68026. return ret, nil
  68027. // {
  68028. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  68029. // "httpMethod": "GET",
  68030. // "id": "compute.subnetworks.get",
  68031. // "parameterOrder": [
  68032. // "project",
  68033. // "region",
  68034. // "subnetwork"
  68035. // ],
  68036. // "parameters": {
  68037. // "project": {
  68038. // "description": "Project ID for this request.",
  68039. // "location": "path",
  68040. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68041. // "required": true,
  68042. // "type": "string"
  68043. // },
  68044. // "region": {
  68045. // "description": "Name of the region scoping this request.",
  68046. // "location": "path",
  68047. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68048. // "required": true,
  68049. // "type": "string"
  68050. // },
  68051. // "subnetwork": {
  68052. // "description": "Name of the Subnetwork resource to return.",
  68053. // "location": "path",
  68054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68055. // "required": true,
  68056. // "type": "string"
  68057. // }
  68058. // },
  68059. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  68060. // "response": {
  68061. // "$ref": "Subnetwork"
  68062. // },
  68063. // "scopes": [
  68064. // "https://www.googleapis.com/auth/cloud-platform",
  68065. // "https://www.googleapis.com/auth/compute",
  68066. // "https://www.googleapis.com/auth/compute.readonly"
  68067. // ]
  68068. // }
  68069. }
  68070. // method id "compute.subnetworks.insert":
  68071. type SubnetworksInsertCall struct {
  68072. s *Service
  68073. project string
  68074. region string
  68075. subnetwork *Subnetwork
  68076. urlParams_ gensupport.URLParams
  68077. ctx_ context.Context
  68078. header_ http.Header
  68079. }
  68080. // Insert: Creates a subnetwork in the specified project using the data
  68081. // included in the request.
  68082. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  68083. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68084. c.project = project
  68085. c.region = region
  68086. c.subnetwork = subnetwork
  68087. return c
  68088. }
  68089. // RequestId sets the optional parameter "requestId": An optional
  68090. // request ID to identify requests. Specify a unique request ID so that
  68091. // if you must retry your request, the server will know to ignore the
  68092. // request if it has already been completed.
  68093. //
  68094. // For example, consider a situation where you make an initial request
  68095. // and the request times out. If you make the request again with the
  68096. // same request ID, the server can check if original operation with the
  68097. // same request ID was received, and if so, will ignore the second
  68098. // request. This prevents clients from accidentally creating duplicate
  68099. // commitments.
  68100. //
  68101. // The request ID must be a valid UUID with the exception that zero UUID
  68102. // is not supported (00000000-0000-0000-0000-000000000000).
  68103. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  68104. c.urlParams_.Set("requestId", requestId)
  68105. return c
  68106. }
  68107. // Fields allows partial responses to be retrieved. See
  68108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68109. // for more information.
  68110. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  68111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68112. return c
  68113. }
  68114. // Context sets the context to be used in this call's Do method. Any
  68115. // pending HTTP request will be aborted if the provided context is
  68116. // canceled.
  68117. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  68118. c.ctx_ = ctx
  68119. return c
  68120. }
  68121. // Header returns an http.Header that can be modified by the caller to
  68122. // add HTTP headers to the request.
  68123. func (c *SubnetworksInsertCall) Header() http.Header {
  68124. if c.header_ == nil {
  68125. c.header_ = make(http.Header)
  68126. }
  68127. return c.header_
  68128. }
  68129. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  68130. reqHeaders := make(http.Header)
  68131. for k, v := range c.header_ {
  68132. reqHeaders[k] = v
  68133. }
  68134. reqHeaders.Set("User-Agent", c.s.userAgent())
  68135. var body io.Reader = nil
  68136. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  68137. if err != nil {
  68138. return nil, err
  68139. }
  68140. reqHeaders.Set("Content-Type", "application/json")
  68141. c.urlParams_.Set("alt", alt)
  68142. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  68143. urls += "?" + c.urlParams_.Encode()
  68144. req, _ := http.NewRequest("POST", urls, body)
  68145. req.Header = reqHeaders
  68146. googleapi.Expand(req.URL, map[string]string{
  68147. "project": c.project,
  68148. "region": c.region,
  68149. })
  68150. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68151. }
  68152. // Do executes the "compute.subnetworks.insert" call.
  68153. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68154. // status code is an error. Response headers are in either
  68155. // *Operation.ServerResponse.Header or (if a response was returned at
  68156. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68157. // to check whether the returned error was because
  68158. // http.StatusNotModified was returned.
  68159. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68160. gensupport.SetOptions(c.urlParams_, opts...)
  68161. res, err := c.doRequest("json")
  68162. if res != nil && res.StatusCode == http.StatusNotModified {
  68163. if res.Body != nil {
  68164. res.Body.Close()
  68165. }
  68166. return nil, &googleapi.Error{
  68167. Code: res.StatusCode,
  68168. Header: res.Header,
  68169. }
  68170. }
  68171. if err != nil {
  68172. return nil, err
  68173. }
  68174. defer googleapi.CloseBody(res)
  68175. if err := googleapi.CheckResponse(res); err != nil {
  68176. return nil, err
  68177. }
  68178. ret := &Operation{
  68179. ServerResponse: googleapi.ServerResponse{
  68180. Header: res.Header,
  68181. HTTPStatusCode: res.StatusCode,
  68182. },
  68183. }
  68184. target := &ret
  68185. if err := gensupport.DecodeResponse(target, res); err != nil {
  68186. return nil, err
  68187. }
  68188. return ret, nil
  68189. // {
  68190. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  68191. // "httpMethod": "POST",
  68192. // "id": "compute.subnetworks.insert",
  68193. // "parameterOrder": [
  68194. // "project",
  68195. // "region"
  68196. // ],
  68197. // "parameters": {
  68198. // "project": {
  68199. // "description": "Project ID for this request.",
  68200. // "location": "path",
  68201. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68202. // "required": true,
  68203. // "type": "string"
  68204. // },
  68205. // "region": {
  68206. // "description": "Name of the region scoping this request.",
  68207. // "location": "path",
  68208. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68209. // "required": true,
  68210. // "type": "string"
  68211. // },
  68212. // "requestId": {
  68213. // "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).",
  68214. // "location": "query",
  68215. // "type": "string"
  68216. // }
  68217. // },
  68218. // "path": "{project}/regions/{region}/subnetworks",
  68219. // "request": {
  68220. // "$ref": "Subnetwork"
  68221. // },
  68222. // "response": {
  68223. // "$ref": "Operation"
  68224. // },
  68225. // "scopes": [
  68226. // "https://www.googleapis.com/auth/cloud-platform",
  68227. // "https://www.googleapis.com/auth/compute"
  68228. // ]
  68229. // }
  68230. }
  68231. // method id "compute.subnetworks.list":
  68232. type SubnetworksListCall struct {
  68233. s *Service
  68234. project string
  68235. region string
  68236. urlParams_ gensupport.URLParams
  68237. ifNoneMatch_ string
  68238. ctx_ context.Context
  68239. header_ http.Header
  68240. }
  68241. // List: Retrieves a list of subnetworks available to the specified
  68242. // project.
  68243. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  68244. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68245. c.project = project
  68246. c.region = region
  68247. return c
  68248. }
  68249. // Filter sets the optional parameter "filter": A filter expression that
  68250. // filters resources listed in the response. The expression must specify
  68251. // the field name, a comparison operator, and the value that you want to
  68252. // use for filtering. The value must be a string, a number, or a
  68253. // boolean. The comparison operator must be either =, !=, >, or <.
  68254. //
  68255. // For example, if you are filtering Compute Engine instances, you can
  68256. // exclude instances named example-instance by specifying name !=
  68257. // example-instance.
  68258. //
  68259. // You can also filter nested fields. For example, you could specify
  68260. // scheduling.automaticRestart = false to include instances only if they
  68261. // are not scheduled for automatic restarts. You can use filtering on
  68262. // nested fields to filter based on resource labels.
  68263. //
  68264. // To filter on multiple expressions, provide each separate expression
  68265. // within parentheses. For example, (scheduling.automaticRestart = true)
  68266. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68267. // AND expression. However, you can include AND and OR expressions
  68268. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68269. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68270. // true).
  68271. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  68272. c.urlParams_.Set("filter", filter)
  68273. return c
  68274. }
  68275. // MaxResults sets the optional parameter "maxResults": The maximum
  68276. // number of results per page that should be returned. If the number of
  68277. // available results is larger than maxResults, Compute Engine returns a
  68278. // nextPageToken that can be used to get the next page of results in
  68279. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68280. // (Default: 500)
  68281. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  68282. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68283. return c
  68284. }
  68285. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68286. // a certain order. By default, results are returned in alphanumerical
  68287. // order based on the resource name.
  68288. //
  68289. // You can also sort results in descending order based on the creation
  68290. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68291. // based on the creationTimestamp field in reverse chronological order
  68292. // (newest result first). Use this to sort resources like operations so
  68293. // that the newest operation is returned first.
  68294. //
  68295. // Currently, only sorting by name or creationTimestamp desc is
  68296. // supported.
  68297. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  68298. c.urlParams_.Set("orderBy", orderBy)
  68299. return c
  68300. }
  68301. // PageToken sets the optional parameter "pageToken": Specifies a page
  68302. // token to use. Set pageToken to the nextPageToken returned by a
  68303. // previous list request to get the next page of results.
  68304. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  68305. c.urlParams_.Set("pageToken", pageToken)
  68306. return c
  68307. }
  68308. // Fields allows partial responses to be retrieved. See
  68309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68310. // for more information.
  68311. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  68312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68313. return c
  68314. }
  68315. // IfNoneMatch sets the optional parameter which makes the operation
  68316. // fail if the object's ETag matches the given value. This is useful for
  68317. // getting updates only after the object has changed since the last
  68318. // request. Use googleapi.IsNotModified to check whether the response
  68319. // error from Do is the result of In-None-Match.
  68320. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  68321. c.ifNoneMatch_ = entityTag
  68322. return c
  68323. }
  68324. // Context sets the context to be used in this call's Do method. Any
  68325. // pending HTTP request will be aborted if the provided context is
  68326. // canceled.
  68327. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  68328. c.ctx_ = ctx
  68329. return c
  68330. }
  68331. // Header returns an http.Header that can be modified by the caller to
  68332. // add HTTP headers to the request.
  68333. func (c *SubnetworksListCall) Header() http.Header {
  68334. if c.header_ == nil {
  68335. c.header_ = make(http.Header)
  68336. }
  68337. return c.header_
  68338. }
  68339. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  68340. reqHeaders := make(http.Header)
  68341. for k, v := range c.header_ {
  68342. reqHeaders[k] = v
  68343. }
  68344. reqHeaders.Set("User-Agent", c.s.userAgent())
  68345. if c.ifNoneMatch_ != "" {
  68346. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68347. }
  68348. var body io.Reader = nil
  68349. c.urlParams_.Set("alt", alt)
  68350. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  68351. urls += "?" + c.urlParams_.Encode()
  68352. req, _ := http.NewRequest("GET", urls, body)
  68353. req.Header = reqHeaders
  68354. googleapi.Expand(req.URL, map[string]string{
  68355. "project": c.project,
  68356. "region": c.region,
  68357. })
  68358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68359. }
  68360. // Do executes the "compute.subnetworks.list" call.
  68361. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  68362. // status code is an error. Response headers are in either
  68363. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  68364. // at all) in error.(*googleapi.Error).Header. Use
  68365. // googleapi.IsNotModified to check whether the returned error was
  68366. // because http.StatusNotModified was returned.
  68367. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  68368. gensupport.SetOptions(c.urlParams_, opts...)
  68369. res, err := c.doRequest("json")
  68370. if res != nil && res.StatusCode == http.StatusNotModified {
  68371. if res.Body != nil {
  68372. res.Body.Close()
  68373. }
  68374. return nil, &googleapi.Error{
  68375. Code: res.StatusCode,
  68376. Header: res.Header,
  68377. }
  68378. }
  68379. if err != nil {
  68380. return nil, err
  68381. }
  68382. defer googleapi.CloseBody(res)
  68383. if err := googleapi.CheckResponse(res); err != nil {
  68384. return nil, err
  68385. }
  68386. ret := &SubnetworkList{
  68387. ServerResponse: googleapi.ServerResponse{
  68388. Header: res.Header,
  68389. HTTPStatusCode: res.StatusCode,
  68390. },
  68391. }
  68392. target := &ret
  68393. if err := gensupport.DecodeResponse(target, res); err != nil {
  68394. return nil, err
  68395. }
  68396. return ret, nil
  68397. // {
  68398. // "description": "Retrieves a list of subnetworks available to the specified project.",
  68399. // "httpMethod": "GET",
  68400. // "id": "compute.subnetworks.list",
  68401. // "parameterOrder": [
  68402. // "project",
  68403. // "region"
  68404. // ],
  68405. // "parameters": {
  68406. // "filter": {
  68407. // "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).",
  68408. // "location": "query",
  68409. // "type": "string"
  68410. // },
  68411. // "maxResults": {
  68412. // "default": "500",
  68413. // "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)",
  68414. // "format": "uint32",
  68415. // "location": "query",
  68416. // "minimum": "0",
  68417. // "type": "integer"
  68418. // },
  68419. // "orderBy": {
  68420. // "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.",
  68421. // "location": "query",
  68422. // "type": "string"
  68423. // },
  68424. // "pageToken": {
  68425. // "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.",
  68426. // "location": "query",
  68427. // "type": "string"
  68428. // },
  68429. // "project": {
  68430. // "description": "Project ID for this request.",
  68431. // "location": "path",
  68432. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68433. // "required": true,
  68434. // "type": "string"
  68435. // },
  68436. // "region": {
  68437. // "description": "Name of the region scoping this request.",
  68438. // "location": "path",
  68439. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68440. // "required": true,
  68441. // "type": "string"
  68442. // }
  68443. // },
  68444. // "path": "{project}/regions/{region}/subnetworks",
  68445. // "response": {
  68446. // "$ref": "SubnetworkList"
  68447. // },
  68448. // "scopes": [
  68449. // "https://www.googleapis.com/auth/cloud-platform",
  68450. // "https://www.googleapis.com/auth/compute",
  68451. // "https://www.googleapis.com/auth/compute.readonly"
  68452. // ]
  68453. // }
  68454. }
  68455. // Pages invokes f for each page of results.
  68456. // A non-nil error returned from f will halt the iteration.
  68457. // The provided context supersedes any context provided to the Context method.
  68458. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  68459. c.ctx_ = ctx
  68460. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68461. for {
  68462. x, err := c.Do()
  68463. if err != nil {
  68464. return err
  68465. }
  68466. if err := f(x); err != nil {
  68467. return err
  68468. }
  68469. if x.NextPageToken == "" {
  68470. return nil
  68471. }
  68472. c.PageToken(x.NextPageToken)
  68473. }
  68474. }
  68475. // method id "compute.subnetworks.patch":
  68476. type SubnetworksPatchCall struct {
  68477. s *Service
  68478. project string
  68479. region string
  68480. subnetwork string
  68481. subnetwork2 *Subnetwork
  68482. urlParams_ gensupport.URLParams
  68483. ctx_ context.Context
  68484. header_ http.Header
  68485. }
  68486. // Patch: Patches the specified subnetwork with the data included in the
  68487. // request. Only the following fields within the subnetwork resource can
  68488. // be specified in the request: secondary_ip_range,
  68489. // allow_subnet_cidr_routes_overlap and role. It is also mandatory to
  68490. // specify the current fingeprint of the subnetwork resource being
  68491. // patched.
  68492. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  68493. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68494. c.project = project
  68495. c.region = region
  68496. c.subnetwork = subnetwork
  68497. c.subnetwork2 = subnetwork2
  68498. return c
  68499. }
  68500. // RequestId sets the optional parameter "requestId": An optional
  68501. // request ID to identify requests. Specify a unique request ID so that
  68502. // if you must retry your request, the server will know to ignore the
  68503. // request if it has already been completed.
  68504. //
  68505. // For example, consider a situation where you make an initial request
  68506. // and the request times out. If you make the request again with the
  68507. // same request ID, the server can check if original operation with the
  68508. // same request ID was received, and if so, will ignore the second
  68509. // request. This prevents clients from accidentally creating duplicate
  68510. // commitments.
  68511. //
  68512. // The request ID must be a valid UUID with the exception that zero UUID
  68513. // is not supported (00000000-0000-0000-0000-000000000000).
  68514. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  68515. c.urlParams_.Set("requestId", requestId)
  68516. return c
  68517. }
  68518. // Fields allows partial responses to be retrieved. See
  68519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68520. // for more information.
  68521. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  68522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68523. return c
  68524. }
  68525. // Context sets the context to be used in this call's Do method. Any
  68526. // pending HTTP request will be aborted if the provided context is
  68527. // canceled.
  68528. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  68529. c.ctx_ = ctx
  68530. return c
  68531. }
  68532. // Header returns an http.Header that can be modified by the caller to
  68533. // add HTTP headers to the request.
  68534. func (c *SubnetworksPatchCall) Header() http.Header {
  68535. if c.header_ == nil {
  68536. c.header_ = make(http.Header)
  68537. }
  68538. return c.header_
  68539. }
  68540. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  68541. reqHeaders := make(http.Header)
  68542. for k, v := range c.header_ {
  68543. reqHeaders[k] = v
  68544. }
  68545. reqHeaders.Set("User-Agent", c.s.userAgent())
  68546. var body io.Reader = nil
  68547. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  68548. if err != nil {
  68549. return nil, err
  68550. }
  68551. reqHeaders.Set("Content-Type", "application/json")
  68552. c.urlParams_.Set("alt", alt)
  68553. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  68554. urls += "?" + c.urlParams_.Encode()
  68555. req, _ := http.NewRequest("PATCH", urls, body)
  68556. req.Header = reqHeaders
  68557. googleapi.Expand(req.URL, map[string]string{
  68558. "project": c.project,
  68559. "region": c.region,
  68560. "subnetwork": c.subnetwork,
  68561. })
  68562. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68563. }
  68564. // Do executes the "compute.subnetworks.patch" call.
  68565. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68566. // status code is an error. Response headers are in either
  68567. // *Operation.ServerResponse.Header or (if a response was returned at
  68568. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68569. // to check whether the returned error was because
  68570. // http.StatusNotModified was returned.
  68571. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68572. gensupport.SetOptions(c.urlParams_, opts...)
  68573. res, err := c.doRequest("json")
  68574. if res != nil && res.StatusCode == http.StatusNotModified {
  68575. if res.Body != nil {
  68576. res.Body.Close()
  68577. }
  68578. return nil, &googleapi.Error{
  68579. Code: res.StatusCode,
  68580. Header: res.Header,
  68581. }
  68582. }
  68583. if err != nil {
  68584. return nil, err
  68585. }
  68586. defer googleapi.CloseBody(res)
  68587. if err := googleapi.CheckResponse(res); err != nil {
  68588. return nil, err
  68589. }
  68590. ret := &Operation{
  68591. ServerResponse: googleapi.ServerResponse{
  68592. Header: res.Header,
  68593. HTTPStatusCode: res.StatusCode,
  68594. },
  68595. }
  68596. target := &ret
  68597. if err := gensupport.DecodeResponse(target, res); err != nil {
  68598. return nil, err
  68599. }
  68600. return ret, nil
  68601. // {
  68602. // "description": "Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range, allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched.",
  68603. // "httpMethod": "PATCH",
  68604. // "id": "compute.subnetworks.patch",
  68605. // "parameterOrder": [
  68606. // "project",
  68607. // "region",
  68608. // "subnetwork"
  68609. // ],
  68610. // "parameters": {
  68611. // "project": {
  68612. // "description": "Project ID for this request.",
  68613. // "location": "path",
  68614. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68615. // "required": true,
  68616. // "type": "string"
  68617. // },
  68618. // "region": {
  68619. // "description": "Name of the region scoping this request.",
  68620. // "location": "path",
  68621. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68622. // "required": true,
  68623. // "type": "string"
  68624. // },
  68625. // "requestId": {
  68626. // "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).",
  68627. // "location": "query",
  68628. // "type": "string"
  68629. // },
  68630. // "subnetwork": {
  68631. // "description": "Name of the Subnetwork resource to patch.",
  68632. // "location": "path",
  68633. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68634. // "required": true,
  68635. // "type": "string"
  68636. // }
  68637. // },
  68638. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  68639. // "request": {
  68640. // "$ref": "Subnetwork"
  68641. // },
  68642. // "response": {
  68643. // "$ref": "Operation"
  68644. // },
  68645. // "scopes": [
  68646. // "https://www.googleapis.com/auth/cloud-platform",
  68647. // "https://www.googleapis.com/auth/compute"
  68648. // ]
  68649. // }
  68650. }
  68651. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  68652. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  68653. s *Service
  68654. project string
  68655. region string
  68656. subnetwork string
  68657. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  68658. urlParams_ gensupport.URLParams
  68659. ctx_ context.Context
  68660. header_ http.Header
  68661. }
  68662. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  68663. // Google services without assigning external IP addresses through
  68664. // Private Google Access.
  68665. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  68666. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68667. c.project = project
  68668. c.region = region
  68669. c.subnetwork = subnetwork
  68670. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  68671. return c
  68672. }
  68673. // RequestId sets the optional parameter "requestId": An optional
  68674. // request ID to identify requests. Specify a unique request ID so that
  68675. // if you must retry your request, the server will know to ignore the
  68676. // request if it has already been completed.
  68677. //
  68678. // For example, consider a situation where you make an initial request
  68679. // and the request times out. If you make the request again with the
  68680. // same request ID, the server can check if original operation with the
  68681. // same request ID was received, and if so, will ignore the second
  68682. // request. This prevents clients from accidentally creating duplicate
  68683. // commitments.
  68684. //
  68685. // The request ID must be a valid UUID with the exception that zero UUID
  68686. // is not supported (00000000-0000-0000-0000-000000000000).
  68687. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  68688. c.urlParams_.Set("requestId", requestId)
  68689. return c
  68690. }
  68691. // Fields allows partial responses to be retrieved. See
  68692. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68693. // for more information.
  68694. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  68695. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68696. return c
  68697. }
  68698. // Context sets the context to be used in this call's Do method. Any
  68699. // pending HTTP request will be aborted if the provided context is
  68700. // canceled.
  68701. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  68702. c.ctx_ = ctx
  68703. return c
  68704. }
  68705. // Header returns an http.Header that can be modified by the caller to
  68706. // add HTTP headers to the request.
  68707. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  68708. if c.header_ == nil {
  68709. c.header_ = make(http.Header)
  68710. }
  68711. return c.header_
  68712. }
  68713. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  68714. reqHeaders := make(http.Header)
  68715. for k, v := range c.header_ {
  68716. reqHeaders[k] = v
  68717. }
  68718. reqHeaders.Set("User-Agent", c.s.userAgent())
  68719. var body io.Reader = nil
  68720. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  68721. if err != nil {
  68722. return nil, err
  68723. }
  68724. reqHeaders.Set("Content-Type", "application/json")
  68725. c.urlParams_.Set("alt", alt)
  68726. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  68727. urls += "?" + c.urlParams_.Encode()
  68728. req, _ := http.NewRequest("POST", urls, body)
  68729. req.Header = reqHeaders
  68730. googleapi.Expand(req.URL, map[string]string{
  68731. "project": c.project,
  68732. "region": c.region,
  68733. "subnetwork": c.subnetwork,
  68734. })
  68735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68736. }
  68737. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  68738. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68739. // status code is an error. Response headers are in either
  68740. // *Operation.ServerResponse.Header or (if a response was returned at
  68741. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68742. // to check whether the returned error was because
  68743. // http.StatusNotModified was returned.
  68744. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68745. gensupport.SetOptions(c.urlParams_, opts...)
  68746. res, err := c.doRequest("json")
  68747. if res != nil && res.StatusCode == http.StatusNotModified {
  68748. if res.Body != nil {
  68749. res.Body.Close()
  68750. }
  68751. return nil, &googleapi.Error{
  68752. Code: res.StatusCode,
  68753. Header: res.Header,
  68754. }
  68755. }
  68756. if err != nil {
  68757. return nil, err
  68758. }
  68759. defer googleapi.CloseBody(res)
  68760. if err := googleapi.CheckResponse(res); err != nil {
  68761. return nil, err
  68762. }
  68763. ret := &Operation{
  68764. ServerResponse: googleapi.ServerResponse{
  68765. Header: res.Header,
  68766. HTTPStatusCode: res.StatusCode,
  68767. },
  68768. }
  68769. target := &ret
  68770. if err := gensupport.DecodeResponse(target, res); err != nil {
  68771. return nil, err
  68772. }
  68773. return ret, nil
  68774. // {
  68775. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  68776. // "httpMethod": "POST",
  68777. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  68778. // "parameterOrder": [
  68779. // "project",
  68780. // "region",
  68781. // "subnetwork"
  68782. // ],
  68783. // "parameters": {
  68784. // "project": {
  68785. // "description": "Project ID for this request.",
  68786. // "location": "path",
  68787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68788. // "required": true,
  68789. // "type": "string"
  68790. // },
  68791. // "region": {
  68792. // "description": "Name of the region scoping this request.",
  68793. // "location": "path",
  68794. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68795. // "required": true,
  68796. // "type": "string"
  68797. // },
  68798. // "requestId": {
  68799. // "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).",
  68800. // "location": "query",
  68801. // "type": "string"
  68802. // },
  68803. // "subnetwork": {
  68804. // "description": "Name of the Subnetwork resource.",
  68805. // "location": "path",
  68806. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68807. // "required": true,
  68808. // "type": "string"
  68809. // }
  68810. // },
  68811. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  68812. // "request": {
  68813. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  68814. // },
  68815. // "response": {
  68816. // "$ref": "Operation"
  68817. // },
  68818. // "scopes": [
  68819. // "https://www.googleapis.com/auth/cloud-platform",
  68820. // "https://www.googleapis.com/auth/compute"
  68821. // ]
  68822. // }
  68823. }
  68824. // method id "compute.targetHttpProxies.delete":
  68825. type TargetHttpProxiesDeleteCall struct {
  68826. s *Service
  68827. project string
  68828. targetHttpProxy string
  68829. urlParams_ gensupport.URLParams
  68830. ctx_ context.Context
  68831. header_ http.Header
  68832. }
  68833. // Delete: Deletes the specified TargetHttpProxy resource.
  68834. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  68835. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  68836. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68837. c.project = project
  68838. c.targetHttpProxy = targetHttpProxy
  68839. return c
  68840. }
  68841. // RequestId sets the optional parameter "requestId": An optional
  68842. // request ID to identify requests. Specify a unique request ID so that
  68843. // if you must retry your request, the server will know to ignore the
  68844. // request if it has already been completed.
  68845. //
  68846. // For example, consider a situation where you make an initial request
  68847. // and the request times out. If you make the request again with the
  68848. // same request ID, the server can check if original operation with the
  68849. // same request ID was received, and if so, will ignore the second
  68850. // request. This prevents clients from accidentally creating duplicate
  68851. // commitments.
  68852. //
  68853. // The request ID must be a valid UUID with the exception that zero UUID
  68854. // is not supported (00000000-0000-0000-0000-000000000000).
  68855. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  68856. c.urlParams_.Set("requestId", requestId)
  68857. return c
  68858. }
  68859. // Fields allows partial responses to be retrieved. See
  68860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68861. // for more information.
  68862. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  68863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68864. return c
  68865. }
  68866. // Context sets the context to be used in this call's Do method. Any
  68867. // pending HTTP request will be aborted if the provided context is
  68868. // canceled.
  68869. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  68870. c.ctx_ = ctx
  68871. return c
  68872. }
  68873. // Header returns an http.Header that can be modified by the caller to
  68874. // add HTTP headers to the request.
  68875. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  68876. if c.header_ == nil {
  68877. c.header_ = make(http.Header)
  68878. }
  68879. return c.header_
  68880. }
  68881. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  68882. reqHeaders := make(http.Header)
  68883. for k, v := range c.header_ {
  68884. reqHeaders[k] = v
  68885. }
  68886. reqHeaders.Set("User-Agent", c.s.userAgent())
  68887. var body io.Reader = nil
  68888. c.urlParams_.Set("alt", alt)
  68889. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  68890. urls += "?" + c.urlParams_.Encode()
  68891. req, _ := http.NewRequest("DELETE", urls, body)
  68892. req.Header = reqHeaders
  68893. googleapi.Expand(req.URL, map[string]string{
  68894. "project": c.project,
  68895. "targetHttpProxy": c.targetHttpProxy,
  68896. })
  68897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68898. }
  68899. // Do executes the "compute.targetHttpProxies.delete" call.
  68900. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68901. // status code is an error. Response headers are in either
  68902. // *Operation.ServerResponse.Header or (if a response was returned at
  68903. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68904. // to check whether the returned error was because
  68905. // http.StatusNotModified was returned.
  68906. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68907. gensupport.SetOptions(c.urlParams_, opts...)
  68908. res, err := c.doRequest("json")
  68909. if res != nil && res.StatusCode == http.StatusNotModified {
  68910. if res.Body != nil {
  68911. res.Body.Close()
  68912. }
  68913. return nil, &googleapi.Error{
  68914. Code: res.StatusCode,
  68915. Header: res.Header,
  68916. }
  68917. }
  68918. if err != nil {
  68919. return nil, err
  68920. }
  68921. defer googleapi.CloseBody(res)
  68922. if err := googleapi.CheckResponse(res); err != nil {
  68923. return nil, err
  68924. }
  68925. ret := &Operation{
  68926. ServerResponse: googleapi.ServerResponse{
  68927. Header: res.Header,
  68928. HTTPStatusCode: res.StatusCode,
  68929. },
  68930. }
  68931. target := &ret
  68932. if err := gensupport.DecodeResponse(target, res); err != nil {
  68933. return nil, err
  68934. }
  68935. return ret, nil
  68936. // {
  68937. // "description": "Deletes the specified TargetHttpProxy resource.",
  68938. // "httpMethod": "DELETE",
  68939. // "id": "compute.targetHttpProxies.delete",
  68940. // "parameterOrder": [
  68941. // "project",
  68942. // "targetHttpProxy"
  68943. // ],
  68944. // "parameters": {
  68945. // "project": {
  68946. // "description": "Project ID for this request.",
  68947. // "location": "path",
  68948. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68949. // "required": true,
  68950. // "type": "string"
  68951. // },
  68952. // "requestId": {
  68953. // "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).",
  68954. // "location": "query",
  68955. // "type": "string"
  68956. // },
  68957. // "targetHttpProxy": {
  68958. // "description": "Name of the TargetHttpProxy resource to delete.",
  68959. // "location": "path",
  68960. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68961. // "required": true,
  68962. // "type": "string"
  68963. // }
  68964. // },
  68965. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  68966. // "response": {
  68967. // "$ref": "Operation"
  68968. // },
  68969. // "scopes": [
  68970. // "https://www.googleapis.com/auth/cloud-platform",
  68971. // "https://www.googleapis.com/auth/compute"
  68972. // ]
  68973. // }
  68974. }
  68975. // method id "compute.targetHttpProxies.get":
  68976. type TargetHttpProxiesGetCall struct {
  68977. s *Service
  68978. project string
  68979. targetHttpProxy string
  68980. urlParams_ gensupport.URLParams
  68981. ifNoneMatch_ string
  68982. ctx_ context.Context
  68983. header_ http.Header
  68984. }
  68985. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  68986. // available target HTTP proxies by making a list() request.
  68987. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  68988. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  68989. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68990. c.project = project
  68991. c.targetHttpProxy = targetHttpProxy
  68992. return c
  68993. }
  68994. // Fields allows partial responses to be retrieved. See
  68995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68996. // for more information.
  68997. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  68998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68999. return c
  69000. }
  69001. // IfNoneMatch sets the optional parameter which makes the operation
  69002. // fail if the object's ETag matches the given value. This is useful for
  69003. // getting updates only after the object has changed since the last
  69004. // request. Use googleapi.IsNotModified to check whether the response
  69005. // error from Do is the result of In-None-Match.
  69006. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  69007. c.ifNoneMatch_ = entityTag
  69008. return c
  69009. }
  69010. // Context sets the context to be used in this call's Do method. Any
  69011. // pending HTTP request will be aborted if the provided context is
  69012. // canceled.
  69013. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  69014. c.ctx_ = ctx
  69015. return c
  69016. }
  69017. // Header returns an http.Header that can be modified by the caller to
  69018. // add HTTP headers to the request.
  69019. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  69020. if c.header_ == nil {
  69021. c.header_ = make(http.Header)
  69022. }
  69023. return c.header_
  69024. }
  69025. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  69026. reqHeaders := make(http.Header)
  69027. for k, v := range c.header_ {
  69028. reqHeaders[k] = v
  69029. }
  69030. reqHeaders.Set("User-Agent", c.s.userAgent())
  69031. if c.ifNoneMatch_ != "" {
  69032. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69033. }
  69034. var body io.Reader = nil
  69035. c.urlParams_.Set("alt", alt)
  69036. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  69037. urls += "?" + c.urlParams_.Encode()
  69038. req, _ := http.NewRequest("GET", urls, body)
  69039. req.Header = reqHeaders
  69040. googleapi.Expand(req.URL, map[string]string{
  69041. "project": c.project,
  69042. "targetHttpProxy": c.targetHttpProxy,
  69043. })
  69044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69045. }
  69046. // Do executes the "compute.targetHttpProxies.get" call.
  69047. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  69048. // status code is an error. Response headers are in either
  69049. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  69050. // at all) in error.(*googleapi.Error).Header. Use
  69051. // googleapi.IsNotModified to check whether the returned error was
  69052. // because http.StatusNotModified was returned.
  69053. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  69054. gensupport.SetOptions(c.urlParams_, opts...)
  69055. res, err := c.doRequest("json")
  69056. if res != nil && res.StatusCode == http.StatusNotModified {
  69057. if res.Body != nil {
  69058. res.Body.Close()
  69059. }
  69060. return nil, &googleapi.Error{
  69061. Code: res.StatusCode,
  69062. Header: res.Header,
  69063. }
  69064. }
  69065. if err != nil {
  69066. return nil, err
  69067. }
  69068. defer googleapi.CloseBody(res)
  69069. if err := googleapi.CheckResponse(res); err != nil {
  69070. return nil, err
  69071. }
  69072. ret := &TargetHttpProxy{
  69073. ServerResponse: googleapi.ServerResponse{
  69074. Header: res.Header,
  69075. HTTPStatusCode: res.StatusCode,
  69076. },
  69077. }
  69078. target := &ret
  69079. if err := gensupport.DecodeResponse(target, res); err != nil {
  69080. return nil, err
  69081. }
  69082. return ret, nil
  69083. // {
  69084. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  69085. // "httpMethod": "GET",
  69086. // "id": "compute.targetHttpProxies.get",
  69087. // "parameterOrder": [
  69088. // "project",
  69089. // "targetHttpProxy"
  69090. // ],
  69091. // "parameters": {
  69092. // "project": {
  69093. // "description": "Project ID for this request.",
  69094. // "location": "path",
  69095. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69096. // "required": true,
  69097. // "type": "string"
  69098. // },
  69099. // "targetHttpProxy": {
  69100. // "description": "Name of the TargetHttpProxy resource to return.",
  69101. // "location": "path",
  69102. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69103. // "required": true,
  69104. // "type": "string"
  69105. // }
  69106. // },
  69107. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  69108. // "response": {
  69109. // "$ref": "TargetHttpProxy"
  69110. // },
  69111. // "scopes": [
  69112. // "https://www.googleapis.com/auth/cloud-platform",
  69113. // "https://www.googleapis.com/auth/compute",
  69114. // "https://www.googleapis.com/auth/compute.readonly"
  69115. // ]
  69116. // }
  69117. }
  69118. // method id "compute.targetHttpProxies.insert":
  69119. type TargetHttpProxiesInsertCall struct {
  69120. s *Service
  69121. project string
  69122. targethttpproxy *TargetHttpProxy
  69123. urlParams_ gensupport.URLParams
  69124. ctx_ context.Context
  69125. header_ http.Header
  69126. }
  69127. // Insert: Creates a TargetHttpProxy resource in the specified project
  69128. // using the data included in the request.
  69129. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  69130. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  69131. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69132. c.project = project
  69133. c.targethttpproxy = targethttpproxy
  69134. return c
  69135. }
  69136. // RequestId sets the optional parameter "requestId": An optional
  69137. // request ID to identify requests. Specify a unique request ID so that
  69138. // if you must retry your request, the server will know to ignore the
  69139. // request if it has already been completed.
  69140. //
  69141. // For example, consider a situation where you make an initial request
  69142. // and the request times out. If you make the request again with the
  69143. // same request ID, the server can check if original operation with the
  69144. // same request ID was received, and if so, will ignore the second
  69145. // request. This prevents clients from accidentally creating duplicate
  69146. // commitments.
  69147. //
  69148. // The request ID must be a valid UUID with the exception that zero UUID
  69149. // is not supported (00000000-0000-0000-0000-000000000000).
  69150. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  69151. c.urlParams_.Set("requestId", requestId)
  69152. return c
  69153. }
  69154. // Fields allows partial responses to be retrieved. See
  69155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69156. // for more information.
  69157. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  69158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69159. return c
  69160. }
  69161. // Context sets the context to be used in this call's Do method. Any
  69162. // pending HTTP request will be aborted if the provided context is
  69163. // canceled.
  69164. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  69165. c.ctx_ = ctx
  69166. return c
  69167. }
  69168. // Header returns an http.Header that can be modified by the caller to
  69169. // add HTTP headers to the request.
  69170. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  69171. if c.header_ == nil {
  69172. c.header_ = make(http.Header)
  69173. }
  69174. return c.header_
  69175. }
  69176. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  69177. reqHeaders := make(http.Header)
  69178. for k, v := range c.header_ {
  69179. reqHeaders[k] = v
  69180. }
  69181. reqHeaders.Set("User-Agent", c.s.userAgent())
  69182. var body io.Reader = nil
  69183. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  69184. if err != nil {
  69185. return nil, err
  69186. }
  69187. reqHeaders.Set("Content-Type", "application/json")
  69188. c.urlParams_.Set("alt", alt)
  69189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  69190. urls += "?" + c.urlParams_.Encode()
  69191. req, _ := http.NewRequest("POST", urls, body)
  69192. req.Header = reqHeaders
  69193. googleapi.Expand(req.URL, map[string]string{
  69194. "project": c.project,
  69195. })
  69196. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69197. }
  69198. // Do executes the "compute.targetHttpProxies.insert" call.
  69199. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69200. // status code is an error. Response headers are in either
  69201. // *Operation.ServerResponse.Header or (if a response was returned at
  69202. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69203. // to check whether the returned error was because
  69204. // http.StatusNotModified was returned.
  69205. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69206. gensupport.SetOptions(c.urlParams_, opts...)
  69207. res, err := c.doRequest("json")
  69208. if res != nil && res.StatusCode == http.StatusNotModified {
  69209. if res.Body != nil {
  69210. res.Body.Close()
  69211. }
  69212. return nil, &googleapi.Error{
  69213. Code: res.StatusCode,
  69214. Header: res.Header,
  69215. }
  69216. }
  69217. if err != nil {
  69218. return nil, err
  69219. }
  69220. defer googleapi.CloseBody(res)
  69221. if err := googleapi.CheckResponse(res); err != nil {
  69222. return nil, err
  69223. }
  69224. ret := &Operation{
  69225. ServerResponse: googleapi.ServerResponse{
  69226. Header: res.Header,
  69227. HTTPStatusCode: res.StatusCode,
  69228. },
  69229. }
  69230. target := &ret
  69231. if err := gensupport.DecodeResponse(target, res); err != nil {
  69232. return nil, err
  69233. }
  69234. return ret, nil
  69235. // {
  69236. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  69237. // "httpMethod": "POST",
  69238. // "id": "compute.targetHttpProxies.insert",
  69239. // "parameterOrder": [
  69240. // "project"
  69241. // ],
  69242. // "parameters": {
  69243. // "project": {
  69244. // "description": "Project ID for this request.",
  69245. // "location": "path",
  69246. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69247. // "required": true,
  69248. // "type": "string"
  69249. // },
  69250. // "requestId": {
  69251. // "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).",
  69252. // "location": "query",
  69253. // "type": "string"
  69254. // }
  69255. // },
  69256. // "path": "{project}/global/targetHttpProxies",
  69257. // "request": {
  69258. // "$ref": "TargetHttpProxy"
  69259. // },
  69260. // "response": {
  69261. // "$ref": "Operation"
  69262. // },
  69263. // "scopes": [
  69264. // "https://www.googleapis.com/auth/cloud-platform",
  69265. // "https://www.googleapis.com/auth/compute"
  69266. // ]
  69267. // }
  69268. }
  69269. // method id "compute.targetHttpProxies.list":
  69270. type TargetHttpProxiesListCall struct {
  69271. s *Service
  69272. project string
  69273. urlParams_ gensupport.URLParams
  69274. ifNoneMatch_ string
  69275. ctx_ context.Context
  69276. header_ http.Header
  69277. }
  69278. // List: Retrieves the list of TargetHttpProxy resources available to
  69279. // the specified project.
  69280. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  69281. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  69282. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69283. c.project = project
  69284. return c
  69285. }
  69286. // Filter sets the optional parameter "filter": A filter expression that
  69287. // filters resources listed in the response. The expression must specify
  69288. // the field name, a comparison operator, and the value that you want to
  69289. // use for filtering. The value must be a string, a number, or a
  69290. // boolean. The comparison operator must be either =, !=, >, or <.
  69291. //
  69292. // For example, if you are filtering Compute Engine instances, you can
  69293. // exclude instances named example-instance by specifying name !=
  69294. // example-instance.
  69295. //
  69296. // You can also filter nested fields. For example, you could specify
  69297. // scheduling.automaticRestart = false to include instances only if they
  69298. // are not scheduled for automatic restarts. You can use filtering on
  69299. // nested fields to filter based on resource labels.
  69300. //
  69301. // To filter on multiple expressions, provide each separate expression
  69302. // within parentheses. For example, (scheduling.automaticRestart = true)
  69303. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69304. // AND expression. However, you can include AND and OR expressions
  69305. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69306. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69307. // true).
  69308. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  69309. c.urlParams_.Set("filter", filter)
  69310. return c
  69311. }
  69312. // MaxResults sets the optional parameter "maxResults": The maximum
  69313. // number of results per page that should be returned. If the number of
  69314. // available results is larger than maxResults, Compute Engine returns a
  69315. // nextPageToken that can be used to get the next page of results in
  69316. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69317. // (Default: 500)
  69318. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  69319. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69320. return c
  69321. }
  69322. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69323. // a certain order. By default, results are returned in alphanumerical
  69324. // order based on the resource name.
  69325. //
  69326. // You can also sort results in descending order based on the creation
  69327. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69328. // based on the creationTimestamp field in reverse chronological order
  69329. // (newest result first). Use this to sort resources like operations so
  69330. // that the newest operation is returned first.
  69331. //
  69332. // Currently, only sorting by name or creationTimestamp desc is
  69333. // supported.
  69334. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  69335. c.urlParams_.Set("orderBy", orderBy)
  69336. return c
  69337. }
  69338. // PageToken sets the optional parameter "pageToken": Specifies a page
  69339. // token to use. Set pageToken to the nextPageToken returned by a
  69340. // previous list request to get the next page of results.
  69341. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  69342. c.urlParams_.Set("pageToken", pageToken)
  69343. return c
  69344. }
  69345. // Fields allows partial responses to be retrieved. See
  69346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69347. // for more information.
  69348. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  69349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69350. return c
  69351. }
  69352. // IfNoneMatch sets the optional parameter which makes the operation
  69353. // fail if the object's ETag matches the given value. This is useful for
  69354. // getting updates only after the object has changed since the last
  69355. // request. Use googleapi.IsNotModified to check whether the response
  69356. // error from Do is the result of In-None-Match.
  69357. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  69358. c.ifNoneMatch_ = entityTag
  69359. return c
  69360. }
  69361. // Context sets the context to be used in this call's Do method. Any
  69362. // pending HTTP request will be aborted if the provided context is
  69363. // canceled.
  69364. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  69365. c.ctx_ = ctx
  69366. return c
  69367. }
  69368. // Header returns an http.Header that can be modified by the caller to
  69369. // add HTTP headers to the request.
  69370. func (c *TargetHttpProxiesListCall) Header() http.Header {
  69371. if c.header_ == nil {
  69372. c.header_ = make(http.Header)
  69373. }
  69374. return c.header_
  69375. }
  69376. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  69377. reqHeaders := make(http.Header)
  69378. for k, v := range c.header_ {
  69379. reqHeaders[k] = v
  69380. }
  69381. reqHeaders.Set("User-Agent", c.s.userAgent())
  69382. if c.ifNoneMatch_ != "" {
  69383. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69384. }
  69385. var body io.Reader = nil
  69386. c.urlParams_.Set("alt", alt)
  69387. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  69388. urls += "?" + c.urlParams_.Encode()
  69389. req, _ := http.NewRequest("GET", urls, body)
  69390. req.Header = reqHeaders
  69391. googleapi.Expand(req.URL, map[string]string{
  69392. "project": c.project,
  69393. })
  69394. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69395. }
  69396. // Do executes the "compute.targetHttpProxies.list" call.
  69397. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  69398. // non-2xx status code is an error. Response headers are in either
  69399. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  69400. // returned at all) in error.(*googleapi.Error).Header. Use
  69401. // googleapi.IsNotModified to check whether the returned error was
  69402. // because http.StatusNotModified was returned.
  69403. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  69404. gensupport.SetOptions(c.urlParams_, opts...)
  69405. res, err := c.doRequest("json")
  69406. if res != nil && res.StatusCode == http.StatusNotModified {
  69407. if res.Body != nil {
  69408. res.Body.Close()
  69409. }
  69410. return nil, &googleapi.Error{
  69411. Code: res.StatusCode,
  69412. Header: res.Header,
  69413. }
  69414. }
  69415. if err != nil {
  69416. return nil, err
  69417. }
  69418. defer googleapi.CloseBody(res)
  69419. if err := googleapi.CheckResponse(res); err != nil {
  69420. return nil, err
  69421. }
  69422. ret := &TargetHttpProxyList{
  69423. ServerResponse: googleapi.ServerResponse{
  69424. Header: res.Header,
  69425. HTTPStatusCode: res.StatusCode,
  69426. },
  69427. }
  69428. target := &ret
  69429. if err := gensupport.DecodeResponse(target, res); err != nil {
  69430. return nil, err
  69431. }
  69432. return ret, nil
  69433. // {
  69434. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  69435. // "httpMethod": "GET",
  69436. // "id": "compute.targetHttpProxies.list",
  69437. // "parameterOrder": [
  69438. // "project"
  69439. // ],
  69440. // "parameters": {
  69441. // "filter": {
  69442. // "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).",
  69443. // "location": "query",
  69444. // "type": "string"
  69445. // },
  69446. // "maxResults": {
  69447. // "default": "500",
  69448. // "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)",
  69449. // "format": "uint32",
  69450. // "location": "query",
  69451. // "minimum": "0",
  69452. // "type": "integer"
  69453. // },
  69454. // "orderBy": {
  69455. // "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.",
  69456. // "location": "query",
  69457. // "type": "string"
  69458. // },
  69459. // "pageToken": {
  69460. // "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.",
  69461. // "location": "query",
  69462. // "type": "string"
  69463. // },
  69464. // "project": {
  69465. // "description": "Project ID for this request.",
  69466. // "location": "path",
  69467. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69468. // "required": true,
  69469. // "type": "string"
  69470. // }
  69471. // },
  69472. // "path": "{project}/global/targetHttpProxies",
  69473. // "response": {
  69474. // "$ref": "TargetHttpProxyList"
  69475. // },
  69476. // "scopes": [
  69477. // "https://www.googleapis.com/auth/cloud-platform",
  69478. // "https://www.googleapis.com/auth/compute",
  69479. // "https://www.googleapis.com/auth/compute.readonly"
  69480. // ]
  69481. // }
  69482. }
  69483. // Pages invokes f for each page of results.
  69484. // A non-nil error returned from f will halt the iteration.
  69485. // The provided context supersedes any context provided to the Context method.
  69486. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  69487. c.ctx_ = ctx
  69488. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69489. for {
  69490. x, err := c.Do()
  69491. if err != nil {
  69492. return err
  69493. }
  69494. if err := f(x); err != nil {
  69495. return err
  69496. }
  69497. if x.NextPageToken == "" {
  69498. return nil
  69499. }
  69500. c.PageToken(x.NextPageToken)
  69501. }
  69502. }
  69503. // method id "compute.targetHttpProxies.setUrlMap":
  69504. type TargetHttpProxiesSetUrlMapCall struct {
  69505. s *Service
  69506. project string
  69507. targetHttpProxy string
  69508. urlmapreference *UrlMapReference
  69509. urlParams_ gensupport.URLParams
  69510. ctx_ context.Context
  69511. header_ http.Header
  69512. }
  69513. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  69514. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  69515. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  69516. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69517. c.project = project
  69518. c.targetHttpProxy = targetHttpProxy
  69519. c.urlmapreference = urlmapreference
  69520. return c
  69521. }
  69522. // RequestId sets the optional parameter "requestId": An optional
  69523. // request ID to identify requests. Specify a unique request ID so that
  69524. // if you must retry your request, the server will know to ignore the
  69525. // request if it has already been completed.
  69526. //
  69527. // For example, consider a situation where you make an initial request
  69528. // and the request times out. If you make the request again with the
  69529. // same request ID, the server can check if original operation with the
  69530. // same request ID was received, and if so, will ignore the second
  69531. // request. This prevents clients from accidentally creating duplicate
  69532. // commitments.
  69533. //
  69534. // The request ID must be a valid UUID with the exception that zero UUID
  69535. // is not supported (00000000-0000-0000-0000-000000000000).
  69536. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  69537. c.urlParams_.Set("requestId", requestId)
  69538. return c
  69539. }
  69540. // Fields allows partial responses to be retrieved. See
  69541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69542. // for more information.
  69543. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  69544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69545. return c
  69546. }
  69547. // Context sets the context to be used in this call's Do method. Any
  69548. // pending HTTP request will be aborted if the provided context is
  69549. // canceled.
  69550. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  69551. c.ctx_ = ctx
  69552. return c
  69553. }
  69554. // Header returns an http.Header that can be modified by the caller to
  69555. // add HTTP headers to the request.
  69556. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  69557. if c.header_ == nil {
  69558. c.header_ = make(http.Header)
  69559. }
  69560. return c.header_
  69561. }
  69562. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  69563. reqHeaders := make(http.Header)
  69564. for k, v := range c.header_ {
  69565. reqHeaders[k] = v
  69566. }
  69567. reqHeaders.Set("User-Agent", c.s.userAgent())
  69568. var body io.Reader = nil
  69569. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  69570. if err != nil {
  69571. return nil, err
  69572. }
  69573. reqHeaders.Set("Content-Type", "application/json")
  69574. c.urlParams_.Set("alt", alt)
  69575. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  69576. urls += "?" + c.urlParams_.Encode()
  69577. req, _ := http.NewRequest("POST", urls, body)
  69578. req.Header = reqHeaders
  69579. googleapi.Expand(req.URL, map[string]string{
  69580. "project": c.project,
  69581. "targetHttpProxy": c.targetHttpProxy,
  69582. })
  69583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69584. }
  69585. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  69586. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69587. // status code is an error. Response headers are in either
  69588. // *Operation.ServerResponse.Header or (if a response was returned at
  69589. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69590. // to check whether the returned error was because
  69591. // http.StatusNotModified was returned.
  69592. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69593. gensupport.SetOptions(c.urlParams_, opts...)
  69594. res, err := c.doRequest("json")
  69595. if res != nil && res.StatusCode == http.StatusNotModified {
  69596. if res.Body != nil {
  69597. res.Body.Close()
  69598. }
  69599. return nil, &googleapi.Error{
  69600. Code: res.StatusCode,
  69601. Header: res.Header,
  69602. }
  69603. }
  69604. if err != nil {
  69605. return nil, err
  69606. }
  69607. defer googleapi.CloseBody(res)
  69608. if err := googleapi.CheckResponse(res); err != nil {
  69609. return nil, err
  69610. }
  69611. ret := &Operation{
  69612. ServerResponse: googleapi.ServerResponse{
  69613. Header: res.Header,
  69614. HTTPStatusCode: res.StatusCode,
  69615. },
  69616. }
  69617. target := &ret
  69618. if err := gensupport.DecodeResponse(target, res); err != nil {
  69619. return nil, err
  69620. }
  69621. return ret, nil
  69622. // {
  69623. // "description": "Changes the URL map for TargetHttpProxy.",
  69624. // "httpMethod": "POST",
  69625. // "id": "compute.targetHttpProxies.setUrlMap",
  69626. // "parameterOrder": [
  69627. // "project",
  69628. // "targetHttpProxy"
  69629. // ],
  69630. // "parameters": {
  69631. // "project": {
  69632. // "description": "Project ID for this request.",
  69633. // "location": "path",
  69634. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69635. // "required": true,
  69636. // "type": "string"
  69637. // },
  69638. // "requestId": {
  69639. // "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).",
  69640. // "location": "query",
  69641. // "type": "string"
  69642. // },
  69643. // "targetHttpProxy": {
  69644. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  69645. // "location": "path",
  69646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69647. // "required": true,
  69648. // "type": "string"
  69649. // }
  69650. // },
  69651. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  69652. // "request": {
  69653. // "$ref": "UrlMapReference"
  69654. // },
  69655. // "response": {
  69656. // "$ref": "Operation"
  69657. // },
  69658. // "scopes": [
  69659. // "https://www.googleapis.com/auth/cloud-platform",
  69660. // "https://www.googleapis.com/auth/compute"
  69661. // ]
  69662. // }
  69663. }
  69664. // method id "compute.targetHttpsProxies.delete":
  69665. type TargetHttpsProxiesDeleteCall struct {
  69666. s *Service
  69667. project string
  69668. targetHttpsProxy string
  69669. urlParams_ gensupport.URLParams
  69670. ctx_ context.Context
  69671. header_ http.Header
  69672. }
  69673. // Delete: Deletes the specified TargetHttpsProxy resource.
  69674. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  69675. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69676. c.project = project
  69677. c.targetHttpsProxy = targetHttpsProxy
  69678. return c
  69679. }
  69680. // RequestId sets the optional parameter "requestId": An optional
  69681. // request ID to identify requests. Specify a unique request ID so that
  69682. // if you must retry your request, the server will know to ignore the
  69683. // request if it has already been completed.
  69684. //
  69685. // For example, consider a situation where you make an initial request
  69686. // and the request times out. If you make the request again with the
  69687. // same request ID, the server can check if original operation with the
  69688. // same request ID was received, and if so, will ignore the second
  69689. // request. This prevents clients from accidentally creating duplicate
  69690. // commitments.
  69691. //
  69692. // The request ID must be a valid UUID with the exception that zero UUID
  69693. // is not supported (00000000-0000-0000-0000-000000000000).
  69694. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  69695. c.urlParams_.Set("requestId", requestId)
  69696. return c
  69697. }
  69698. // Fields allows partial responses to be retrieved. See
  69699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69700. // for more information.
  69701. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  69702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69703. return c
  69704. }
  69705. // Context sets the context to be used in this call's Do method. Any
  69706. // pending HTTP request will be aborted if the provided context is
  69707. // canceled.
  69708. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  69709. c.ctx_ = ctx
  69710. return c
  69711. }
  69712. // Header returns an http.Header that can be modified by the caller to
  69713. // add HTTP headers to the request.
  69714. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  69715. if c.header_ == nil {
  69716. c.header_ = make(http.Header)
  69717. }
  69718. return c.header_
  69719. }
  69720. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  69721. reqHeaders := make(http.Header)
  69722. for k, v := range c.header_ {
  69723. reqHeaders[k] = v
  69724. }
  69725. reqHeaders.Set("User-Agent", c.s.userAgent())
  69726. var body io.Reader = nil
  69727. c.urlParams_.Set("alt", alt)
  69728. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  69729. urls += "?" + c.urlParams_.Encode()
  69730. req, _ := http.NewRequest("DELETE", urls, body)
  69731. req.Header = reqHeaders
  69732. googleapi.Expand(req.URL, map[string]string{
  69733. "project": c.project,
  69734. "targetHttpsProxy": c.targetHttpsProxy,
  69735. })
  69736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69737. }
  69738. // Do executes the "compute.targetHttpsProxies.delete" call.
  69739. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69740. // status code is an error. Response headers are in either
  69741. // *Operation.ServerResponse.Header or (if a response was returned at
  69742. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69743. // to check whether the returned error was because
  69744. // http.StatusNotModified was returned.
  69745. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69746. gensupport.SetOptions(c.urlParams_, opts...)
  69747. res, err := c.doRequest("json")
  69748. if res != nil && res.StatusCode == http.StatusNotModified {
  69749. if res.Body != nil {
  69750. res.Body.Close()
  69751. }
  69752. return nil, &googleapi.Error{
  69753. Code: res.StatusCode,
  69754. Header: res.Header,
  69755. }
  69756. }
  69757. if err != nil {
  69758. return nil, err
  69759. }
  69760. defer googleapi.CloseBody(res)
  69761. if err := googleapi.CheckResponse(res); err != nil {
  69762. return nil, err
  69763. }
  69764. ret := &Operation{
  69765. ServerResponse: googleapi.ServerResponse{
  69766. Header: res.Header,
  69767. HTTPStatusCode: res.StatusCode,
  69768. },
  69769. }
  69770. target := &ret
  69771. if err := gensupport.DecodeResponse(target, res); err != nil {
  69772. return nil, err
  69773. }
  69774. return ret, nil
  69775. // {
  69776. // "description": "Deletes the specified TargetHttpsProxy resource.",
  69777. // "httpMethod": "DELETE",
  69778. // "id": "compute.targetHttpsProxies.delete",
  69779. // "parameterOrder": [
  69780. // "project",
  69781. // "targetHttpsProxy"
  69782. // ],
  69783. // "parameters": {
  69784. // "project": {
  69785. // "description": "Project ID for this request.",
  69786. // "location": "path",
  69787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69788. // "required": true,
  69789. // "type": "string"
  69790. // },
  69791. // "requestId": {
  69792. // "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).",
  69793. // "location": "query",
  69794. // "type": "string"
  69795. // },
  69796. // "targetHttpsProxy": {
  69797. // "description": "Name of the TargetHttpsProxy resource to delete.",
  69798. // "location": "path",
  69799. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69800. // "required": true,
  69801. // "type": "string"
  69802. // }
  69803. // },
  69804. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  69805. // "response": {
  69806. // "$ref": "Operation"
  69807. // },
  69808. // "scopes": [
  69809. // "https://www.googleapis.com/auth/cloud-platform",
  69810. // "https://www.googleapis.com/auth/compute"
  69811. // ]
  69812. // }
  69813. }
  69814. // method id "compute.targetHttpsProxies.get":
  69815. type TargetHttpsProxiesGetCall struct {
  69816. s *Service
  69817. project string
  69818. targetHttpsProxy string
  69819. urlParams_ gensupport.URLParams
  69820. ifNoneMatch_ string
  69821. ctx_ context.Context
  69822. header_ http.Header
  69823. }
  69824. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  69825. // available target HTTPS proxies by making a list() request.
  69826. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  69827. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69828. c.project = project
  69829. c.targetHttpsProxy = targetHttpsProxy
  69830. return c
  69831. }
  69832. // Fields allows partial responses to be retrieved. See
  69833. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69834. // for more information.
  69835. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  69836. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69837. return c
  69838. }
  69839. // IfNoneMatch sets the optional parameter which makes the operation
  69840. // fail if the object's ETag matches the given value. This is useful for
  69841. // getting updates only after the object has changed since the last
  69842. // request. Use googleapi.IsNotModified to check whether the response
  69843. // error from Do is the result of In-None-Match.
  69844. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  69845. c.ifNoneMatch_ = entityTag
  69846. return c
  69847. }
  69848. // Context sets the context to be used in this call's Do method. Any
  69849. // pending HTTP request will be aborted if the provided context is
  69850. // canceled.
  69851. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  69852. c.ctx_ = ctx
  69853. return c
  69854. }
  69855. // Header returns an http.Header that can be modified by the caller to
  69856. // add HTTP headers to the request.
  69857. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  69858. if c.header_ == nil {
  69859. c.header_ = make(http.Header)
  69860. }
  69861. return c.header_
  69862. }
  69863. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  69864. reqHeaders := make(http.Header)
  69865. for k, v := range c.header_ {
  69866. reqHeaders[k] = v
  69867. }
  69868. reqHeaders.Set("User-Agent", c.s.userAgent())
  69869. if c.ifNoneMatch_ != "" {
  69870. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69871. }
  69872. var body io.Reader = nil
  69873. c.urlParams_.Set("alt", alt)
  69874. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  69875. urls += "?" + c.urlParams_.Encode()
  69876. req, _ := http.NewRequest("GET", urls, body)
  69877. req.Header = reqHeaders
  69878. googleapi.Expand(req.URL, map[string]string{
  69879. "project": c.project,
  69880. "targetHttpsProxy": c.targetHttpsProxy,
  69881. })
  69882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69883. }
  69884. // Do executes the "compute.targetHttpsProxies.get" call.
  69885. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  69886. // non-2xx status code is an error. Response headers are in either
  69887. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  69888. // returned at all) in error.(*googleapi.Error).Header. Use
  69889. // googleapi.IsNotModified to check whether the returned error was
  69890. // because http.StatusNotModified was returned.
  69891. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  69892. gensupport.SetOptions(c.urlParams_, opts...)
  69893. res, err := c.doRequest("json")
  69894. if res != nil && res.StatusCode == http.StatusNotModified {
  69895. if res.Body != nil {
  69896. res.Body.Close()
  69897. }
  69898. return nil, &googleapi.Error{
  69899. Code: res.StatusCode,
  69900. Header: res.Header,
  69901. }
  69902. }
  69903. if err != nil {
  69904. return nil, err
  69905. }
  69906. defer googleapi.CloseBody(res)
  69907. if err := googleapi.CheckResponse(res); err != nil {
  69908. return nil, err
  69909. }
  69910. ret := &TargetHttpsProxy{
  69911. ServerResponse: googleapi.ServerResponse{
  69912. Header: res.Header,
  69913. HTTPStatusCode: res.StatusCode,
  69914. },
  69915. }
  69916. target := &ret
  69917. if err := gensupport.DecodeResponse(target, res); err != nil {
  69918. return nil, err
  69919. }
  69920. return ret, nil
  69921. // {
  69922. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  69923. // "httpMethod": "GET",
  69924. // "id": "compute.targetHttpsProxies.get",
  69925. // "parameterOrder": [
  69926. // "project",
  69927. // "targetHttpsProxy"
  69928. // ],
  69929. // "parameters": {
  69930. // "project": {
  69931. // "description": "Project ID for this request.",
  69932. // "location": "path",
  69933. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69934. // "required": true,
  69935. // "type": "string"
  69936. // },
  69937. // "targetHttpsProxy": {
  69938. // "description": "Name of the TargetHttpsProxy resource to return.",
  69939. // "location": "path",
  69940. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69941. // "required": true,
  69942. // "type": "string"
  69943. // }
  69944. // },
  69945. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  69946. // "response": {
  69947. // "$ref": "TargetHttpsProxy"
  69948. // },
  69949. // "scopes": [
  69950. // "https://www.googleapis.com/auth/cloud-platform",
  69951. // "https://www.googleapis.com/auth/compute",
  69952. // "https://www.googleapis.com/auth/compute.readonly"
  69953. // ]
  69954. // }
  69955. }
  69956. // method id "compute.targetHttpsProxies.insert":
  69957. type TargetHttpsProxiesInsertCall struct {
  69958. s *Service
  69959. project string
  69960. targethttpsproxy *TargetHttpsProxy
  69961. urlParams_ gensupport.URLParams
  69962. ctx_ context.Context
  69963. header_ http.Header
  69964. }
  69965. // Insert: Creates a TargetHttpsProxy resource in the specified project
  69966. // using the data included in the request.
  69967. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  69968. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69969. c.project = project
  69970. c.targethttpsproxy = targethttpsproxy
  69971. return c
  69972. }
  69973. // RequestId sets the optional parameter "requestId": An optional
  69974. // request ID to identify requests. Specify a unique request ID so that
  69975. // if you must retry your request, the server will know to ignore the
  69976. // request if it has already been completed.
  69977. //
  69978. // For example, consider a situation where you make an initial request
  69979. // and the request times out. If you make the request again with the
  69980. // same request ID, the server can check if original operation with the
  69981. // same request ID was received, and if so, will ignore the second
  69982. // request. This prevents clients from accidentally creating duplicate
  69983. // commitments.
  69984. //
  69985. // The request ID must be a valid UUID with the exception that zero UUID
  69986. // is not supported (00000000-0000-0000-0000-000000000000).
  69987. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  69988. c.urlParams_.Set("requestId", requestId)
  69989. return c
  69990. }
  69991. // Fields allows partial responses to be retrieved. See
  69992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69993. // for more information.
  69994. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  69995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69996. return c
  69997. }
  69998. // Context sets the context to be used in this call's Do method. Any
  69999. // pending HTTP request will be aborted if the provided context is
  70000. // canceled.
  70001. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  70002. c.ctx_ = ctx
  70003. return c
  70004. }
  70005. // Header returns an http.Header that can be modified by the caller to
  70006. // add HTTP headers to the request.
  70007. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  70008. if c.header_ == nil {
  70009. c.header_ = make(http.Header)
  70010. }
  70011. return c.header_
  70012. }
  70013. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  70014. reqHeaders := make(http.Header)
  70015. for k, v := range c.header_ {
  70016. reqHeaders[k] = v
  70017. }
  70018. reqHeaders.Set("User-Agent", c.s.userAgent())
  70019. var body io.Reader = nil
  70020. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  70021. if err != nil {
  70022. return nil, err
  70023. }
  70024. reqHeaders.Set("Content-Type", "application/json")
  70025. c.urlParams_.Set("alt", alt)
  70026. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  70027. urls += "?" + c.urlParams_.Encode()
  70028. req, _ := http.NewRequest("POST", urls, body)
  70029. req.Header = reqHeaders
  70030. googleapi.Expand(req.URL, map[string]string{
  70031. "project": c.project,
  70032. })
  70033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70034. }
  70035. // Do executes the "compute.targetHttpsProxies.insert" call.
  70036. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70037. // status code is an error. Response headers are in either
  70038. // *Operation.ServerResponse.Header or (if a response was returned at
  70039. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70040. // to check whether the returned error was because
  70041. // http.StatusNotModified was returned.
  70042. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70043. gensupport.SetOptions(c.urlParams_, opts...)
  70044. res, err := c.doRequest("json")
  70045. if res != nil && res.StatusCode == http.StatusNotModified {
  70046. if res.Body != nil {
  70047. res.Body.Close()
  70048. }
  70049. return nil, &googleapi.Error{
  70050. Code: res.StatusCode,
  70051. Header: res.Header,
  70052. }
  70053. }
  70054. if err != nil {
  70055. return nil, err
  70056. }
  70057. defer googleapi.CloseBody(res)
  70058. if err := googleapi.CheckResponse(res); err != nil {
  70059. return nil, err
  70060. }
  70061. ret := &Operation{
  70062. ServerResponse: googleapi.ServerResponse{
  70063. Header: res.Header,
  70064. HTTPStatusCode: res.StatusCode,
  70065. },
  70066. }
  70067. target := &ret
  70068. if err := gensupport.DecodeResponse(target, res); err != nil {
  70069. return nil, err
  70070. }
  70071. return ret, nil
  70072. // {
  70073. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  70074. // "httpMethod": "POST",
  70075. // "id": "compute.targetHttpsProxies.insert",
  70076. // "parameterOrder": [
  70077. // "project"
  70078. // ],
  70079. // "parameters": {
  70080. // "project": {
  70081. // "description": "Project ID for this request.",
  70082. // "location": "path",
  70083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70084. // "required": true,
  70085. // "type": "string"
  70086. // },
  70087. // "requestId": {
  70088. // "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).",
  70089. // "location": "query",
  70090. // "type": "string"
  70091. // }
  70092. // },
  70093. // "path": "{project}/global/targetHttpsProxies",
  70094. // "request": {
  70095. // "$ref": "TargetHttpsProxy"
  70096. // },
  70097. // "response": {
  70098. // "$ref": "Operation"
  70099. // },
  70100. // "scopes": [
  70101. // "https://www.googleapis.com/auth/cloud-platform",
  70102. // "https://www.googleapis.com/auth/compute"
  70103. // ]
  70104. // }
  70105. }
  70106. // method id "compute.targetHttpsProxies.list":
  70107. type TargetHttpsProxiesListCall struct {
  70108. s *Service
  70109. project string
  70110. urlParams_ gensupport.URLParams
  70111. ifNoneMatch_ string
  70112. ctx_ context.Context
  70113. header_ http.Header
  70114. }
  70115. // List: Retrieves the list of TargetHttpsProxy resources available to
  70116. // the specified project.
  70117. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  70118. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70119. c.project = project
  70120. return c
  70121. }
  70122. // Filter sets the optional parameter "filter": A filter expression that
  70123. // filters resources listed in the response. The expression must specify
  70124. // the field name, a comparison operator, and the value that you want to
  70125. // use for filtering. The value must be a string, a number, or a
  70126. // boolean. The comparison operator must be either =, !=, >, or <.
  70127. //
  70128. // For example, if you are filtering Compute Engine instances, you can
  70129. // exclude instances named example-instance by specifying name !=
  70130. // example-instance.
  70131. //
  70132. // You can also filter nested fields. For example, you could specify
  70133. // scheduling.automaticRestart = false to include instances only if they
  70134. // are not scheduled for automatic restarts. You can use filtering on
  70135. // nested fields to filter based on resource labels.
  70136. //
  70137. // To filter on multiple expressions, provide each separate expression
  70138. // within parentheses. For example, (scheduling.automaticRestart = true)
  70139. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70140. // AND expression. However, you can include AND and OR expressions
  70141. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70142. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70143. // true).
  70144. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  70145. c.urlParams_.Set("filter", filter)
  70146. return c
  70147. }
  70148. // MaxResults sets the optional parameter "maxResults": The maximum
  70149. // number of results per page that should be returned. If the number of
  70150. // available results is larger than maxResults, Compute Engine returns a
  70151. // nextPageToken that can be used to get the next page of results in
  70152. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70153. // (Default: 500)
  70154. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  70155. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70156. return c
  70157. }
  70158. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70159. // a certain order. By default, results are returned in alphanumerical
  70160. // order based on the resource name.
  70161. //
  70162. // You can also sort results in descending order based on the creation
  70163. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70164. // based on the creationTimestamp field in reverse chronological order
  70165. // (newest result first). Use this to sort resources like operations so
  70166. // that the newest operation is returned first.
  70167. //
  70168. // Currently, only sorting by name or creationTimestamp desc is
  70169. // supported.
  70170. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  70171. c.urlParams_.Set("orderBy", orderBy)
  70172. return c
  70173. }
  70174. // PageToken sets the optional parameter "pageToken": Specifies a page
  70175. // token to use. Set pageToken to the nextPageToken returned by a
  70176. // previous list request to get the next page of results.
  70177. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  70178. c.urlParams_.Set("pageToken", pageToken)
  70179. return c
  70180. }
  70181. // Fields allows partial responses to be retrieved. See
  70182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70183. // for more information.
  70184. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  70185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70186. return c
  70187. }
  70188. // IfNoneMatch sets the optional parameter which makes the operation
  70189. // fail if the object's ETag matches the given value. This is useful for
  70190. // getting updates only after the object has changed since the last
  70191. // request. Use googleapi.IsNotModified to check whether the response
  70192. // error from Do is the result of In-None-Match.
  70193. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  70194. c.ifNoneMatch_ = entityTag
  70195. return c
  70196. }
  70197. // Context sets the context to be used in this call's Do method. Any
  70198. // pending HTTP request will be aborted if the provided context is
  70199. // canceled.
  70200. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  70201. c.ctx_ = ctx
  70202. return c
  70203. }
  70204. // Header returns an http.Header that can be modified by the caller to
  70205. // add HTTP headers to the request.
  70206. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  70207. if c.header_ == nil {
  70208. c.header_ = make(http.Header)
  70209. }
  70210. return c.header_
  70211. }
  70212. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  70213. reqHeaders := make(http.Header)
  70214. for k, v := range c.header_ {
  70215. reqHeaders[k] = v
  70216. }
  70217. reqHeaders.Set("User-Agent", c.s.userAgent())
  70218. if c.ifNoneMatch_ != "" {
  70219. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70220. }
  70221. var body io.Reader = nil
  70222. c.urlParams_.Set("alt", alt)
  70223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  70224. urls += "?" + c.urlParams_.Encode()
  70225. req, _ := http.NewRequest("GET", urls, body)
  70226. req.Header = reqHeaders
  70227. googleapi.Expand(req.URL, map[string]string{
  70228. "project": c.project,
  70229. })
  70230. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70231. }
  70232. // Do executes the "compute.targetHttpsProxies.list" call.
  70233. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  70234. // non-2xx status code is an error. Response headers are in either
  70235. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  70236. // returned at all) in error.(*googleapi.Error).Header. Use
  70237. // googleapi.IsNotModified to check whether the returned error was
  70238. // because http.StatusNotModified was returned.
  70239. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  70240. gensupport.SetOptions(c.urlParams_, opts...)
  70241. res, err := c.doRequest("json")
  70242. if res != nil && res.StatusCode == http.StatusNotModified {
  70243. if res.Body != nil {
  70244. res.Body.Close()
  70245. }
  70246. return nil, &googleapi.Error{
  70247. Code: res.StatusCode,
  70248. Header: res.Header,
  70249. }
  70250. }
  70251. if err != nil {
  70252. return nil, err
  70253. }
  70254. defer googleapi.CloseBody(res)
  70255. if err := googleapi.CheckResponse(res); err != nil {
  70256. return nil, err
  70257. }
  70258. ret := &TargetHttpsProxyList{
  70259. ServerResponse: googleapi.ServerResponse{
  70260. Header: res.Header,
  70261. HTTPStatusCode: res.StatusCode,
  70262. },
  70263. }
  70264. target := &ret
  70265. if err := gensupport.DecodeResponse(target, res); err != nil {
  70266. return nil, err
  70267. }
  70268. return ret, nil
  70269. // {
  70270. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  70271. // "httpMethod": "GET",
  70272. // "id": "compute.targetHttpsProxies.list",
  70273. // "parameterOrder": [
  70274. // "project"
  70275. // ],
  70276. // "parameters": {
  70277. // "filter": {
  70278. // "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).",
  70279. // "location": "query",
  70280. // "type": "string"
  70281. // },
  70282. // "maxResults": {
  70283. // "default": "500",
  70284. // "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)",
  70285. // "format": "uint32",
  70286. // "location": "query",
  70287. // "minimum": "0",
  70288. // "type": "integer"
  70289. // },
  70290. // "orderBy": {
  70291. // "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.",
  70292. // "location": "query",
  70293. // "type": "string"
  70294. // },
  70295. // "pageToken": {
  70296. // "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.",
  70297. // "location": "query",
  70298. // "type": "string"
  70299. // },
  70300. // "project": {
  70301. // "description": "Project ID for this request.",
  70302. // "location": "path",
  70303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70304. // "required": true,
  70305. // "type": "string"
  70306. // }
  70307. // },
  70308. // "path": "{project}/global/targetHttpsProxies",
  70309. // "response": {
  70310. // "$ref": "TargetHttpsProxyList"
  70311. // },
  70312. // "scopes": [
  70313. // "https://www.googleapis.com/auth/cloud-platform",
  70314. // "https://www.googleapis.com/auth/compute",
  70315. // "https://www.googleapis.com/auth/compute.readonly"
  70316. // ]
  70317. // }
  70318. }
  70319. // Pages invokes f for each page of results.
  70320. // A non-nil error returned from f will halt the iteration.
  70321. // The provided context supersedes any context provided to the Context method.
  70322. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  70323. c.ctx_ = ctx
  70324. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70325. for {
  70326. x, err := c.Do()
  70327. if err != nil {
  70328. return err
  70329. }
  70330. if err := f(x); err != nil {
  70331. return err
  70332. }
  70333. if x.NextPageToken == "" {
  70334. return nil
  70335. }
  70336. c.PageToken(x.NextPageToken)
  70337. }
  70338. }
  70339. // method id "compute.targetHttpsProxies.setQuicOverride":
  70340. type TargetHttpsProxiesSetQuicOverrideCall struct {
  70341. s *Service
  70342. project string
  70343. targetHttpsProxy string
  70344. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  70345. urlParams_ gensupport.URLParams
  70346. ctx_ context.Context
  70347. header_ http.Header
  70348. }
  70349. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  70350. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  70351. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70352. c.project = project
  70353. c.targetHttpsProxy = targetHttpsProxy
  70354. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  70355. return c
  70356. }
  70357. // RequestId sets the optional parameter "requestId": An optional
  70358. // request ID to identify requests. Specify a unique request ID so that
  70359. // if you must retry your request, the server will know to ignore the
  70360. // request if it has already been completed.
  70361. //
  70362. // For example, consider a situation where you make an initial request
  70363. // and the request times out. If you make the request again with the
  70364. // same request ID, the server can check if original operation with the
  70365. // same request ID was received, and if so, will ignore the second
  70366. // request. This prevents clients from accidentally creating duplicate
  70367. // commitments.
  70368. //
  70369. // The request ID must be a valid UUID with the exception that zero UUID
  70370. // is not supported (00000000-0000-0000-0000-000000000000).
  70371. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  70372. c.urlParams_.Set("requestId", requestId)
  70373. return c
  70374. }
  70375. // Fields allows partial responses to be retrieved. See
  70376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70377. // for more information.
  70378. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  70379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70380. return c
  70381. }
  70382. // Context sets the context to be used in this call's Do method. Any
  70383. // pending HTTP request will be aborted if the provided context is
  70384. // canceled.
  70385. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  70386. c.ctx_ = ctx
  70387. return c
  70388. }
  70389. // Header returns an http.Header that can be modified by the caller to
  70390. // add HTTP headers to the request.
  70391. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  70392. if c.header_ == nil {
  70393. c.header_ = make(http.Header)
  70394. }
  70395. return c.header_
  70396. }
  70397. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  70398. reqHeaders := make(http.Header)
  70399. for k, v := range c.header_ {
  70400. reqHeaders[k] = v
  70401. }
  70402. reqHeaders.Set("User-Agent", c.s.userAgent())
  70403. var body io.Reader = nil
  70404. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  70405. if err != nil {
  70406. return nil, err
  70407. }
  70408. reqHeaders.Set("Content-Type", "application/json")
  70409. c.urlParams_.Set("alt", alt)
  70410. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  70411. urls += "?" + c.urlParams_.Encode()
  70412. req, _ := http.NewRequest("POST", urls, body)
  70413. req.Header = reqHeaders
  70414. googleapi.Expand(req.URL, map[string]string{
  70415. "project": c.project,
  70416. "targetHttpsProxy": c.targetHttpsProxy,
  70417. })
  70418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70419. }
  70420. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  70421. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70422. // status code is an error. Response headers are in either
  70423. // *Operation.ServerResponse.Header or (if a response was returned at
  70424. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70425. // to check whether the returned error was because
  70426. // http.StatusNotModified was returned.
  70427. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70428. gensupport.SetOptions(c.urlParams_, opts...)
  70429. res, err := c.doRequest("json")
  70430. if res != nil && res.StatusCode == http.StatusNotModified {
  70431. if res.Body != nil {
  70432. res.Body.Close()
  70433. }
  70434. return nil, &googleapi.Error{
  70435. Code: res.StatusCode,
  70436. Header: res.Header,
  70437. }
  70438. }
  70439. if err != nil {
  70440. return nil, err
  70441. }
  70442. defer googleapi.CloseBody(res)
  70443. if err := googleapi.CheckResponse(res); err != nil {
  70444. return nil, err
  70445. }
  70446. ret := &Operation{
  70447. ServerResponse: googleapi.ServerResponse{
  70448. Header: res.Header,
  70449. HTTPStatusCode: res.StatusCode,
  70450. },
  70451. }
  70452. target := &ret
  70453. if err := gensupport.DecodeResponse(target, res); err != nil {
  70454. return nil, err
  70455. }
  70456. return ret, nil
  70457. // {
  70458. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  70459. // "httpMethod": "POST",
  70460. // "id": "compute.targetHttpsProxies.setQuicOverride",
  70461. // "parameterOrder": [
  70462. // "project",
  70463. // "targetHttpsProxy"
  70464. // ],
  70465. // "parameters": {
  70466. // "project": {
  70467. // "description": "Project ID for this request.",
  70468. // "location": "path",
  70469. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70470. // "required": true,
  70471. // "type": "string"
  70472. // },
  70473. // "requestId": {
  70474. // "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).",
  70475. // "location": "query",
  70476. // "type": "string"
  70477. // },
  70478. // "targetHttpsProxy": {
  70479. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  70480. // "location": "path",
  70481. // "required": true,
  70482. // "type": "string"
  70483. // }
  70484. // },
  70485. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  70486. // "request": {
  70487. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  70488. // },
  70489. // "response": {
  70490. // "$ref": "Operation"
  70491. // },
  70492. // "scopes": [
  70493. // "https://www.googleapis.com/auth/cloud-platform",
  70494. // "https://www.googleapis.com/auth/compute"
  70495. // ]
  70496. // }
  70497. }
  70498. // method id "compute.targetHttpsProxies.setSslCertificates":
  70499. type TargetHttpsProxiesSetSslCertificatesCall struct {
  70500. s *Service
  70501. project string
  70502. targetHttpsProxy string
  70503. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  70504. urlParams_ gensupport.URLParams
  70505. ctx_ context.Context
  70506. header_ http.Header
  70507. }
  70508. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  70509. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  70510. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70511. c.project = project
  70512. c.targetHttpsProxy = targetHttpsProxy
  70513. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  70514. return c
  70515. }
  70516. // RequestId sets the optional parameter "requestId": An optional
  70517. // request ID to identify requests. Specify a unique request ID so that
  70518. // if you must retry your request, the server will know to ignore the
  70519. // request if it has already been completed.
  70520. //
  70521. // For example, consider a situation where you make an initial request
  70522. // and the request times out. If you make the request again with the
  70523. // same request ID, the server can check if original operation with the
  70524. // same request ID was received, and if so, will ignore the second
  70525. // request. This prevents clients from accidentally creating duplicate
  70526. // commitments.
  70527. //
  70528. // The request ID must be a valid UUID with the exception that zero UUID
  70529. // is not supported (00000000-0000-0000-0000-000000000000).
  70530. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  70531. c.urlParams_.Set("requestId", requestId)
  70532. return c
  70533. }
  70534. // Fields allows partial responses to be retrieved. See
  70535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70536. // for more information.
  70537. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  70538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70539. return c
  70540. }
  70541. // Context sets the context to be used in this call's Do method. Any
  70542. // pending HTTP request will be aborted if the provided context is
  70543. // canceled.
  70544. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  70545. c.ctx_ = ctx
  70546. return c
  70547. }
  70548. // Header returns an http.Header that can be modified by the caller to
  70549. // add HTTP headers to the request.
  70550. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  70551. if c.header_ == nil {
  70552. c.header_ = make(http.Header)
  70553. }
  70554. return c.header_
  70555. }
  70556. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  70557. reqHeaders := make(http.Header)
  70558. for k, v := range c.header_ {
  70559. reqHeaders[k] = v
  70560. }
  70561. reqHeaders.Set("User-Agent", c.s.userAgent())
  70562. var body io.Reader = nil
  70563. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  70564. if err != nil {
  70565. return nil, err
  70566. }
  70567. reqHeaders.Set("Content-Type", "application/json")
  70568. c.urlParams_.Set("alt", alt)
  70569. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  70570. urls += "?" + c.urlParams_.Encode()
  70571. req, _ := http.NewRequest("POST", urls, body)
  70572. req.Header = reqHeaders
  70573. googleapi.Expand(req.URL, map[string]string{
  70574. "project": c.project,
  70575. "targetHttpsProxy": c.targetHttpsProxy,
  70576. })
  70577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70578. }
  70579. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  70580. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70581. // status code is an error. Response headers are in either
  70582. // *Operation.ServerResponse.Header or (if a response was returned at
  70583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70584. // to check whether the returned error was because
  70585. // http.StatusNotModified was returned.
  70586. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70587. gensupport.SetOptions(c.urlParams_, opts...)
  70588. res, err := c.doRequest("json")
  70589. if res != nil && res.StatusCode == http.StatusNotModified {
  70590. if res.Body != nil {
  70591. res.Body.Close()
  70592. }
  70593. return nil, &googleapi.Error{
  70594. Code: res.StatusCode,
  70595. Header: res.Header,
  70596. }
  70597. }
  70598. if err != nil {
  70599. return nil, err
  70600. }
  70601. defer googleapi.CloseBody(res)
  70602. if err := googleapi.CheckResponse(res); err != nil {
  70603. return nil, err
  70604. }
  70605. ret := &Operation{
  70606. ServerResponse: googleapi.ServerResponse{
  70607. Header: res.Header,
  70608. HTTPStatusCode: res.StatusCode,
  70609. },
  70610. }
  70611. target := &ret
  70612. if err := gensupport.DecodeResponse(target, res); err != nil {
  70613. return nil, err
  70614. }
  70615. return ret, nil
  70616. // {
  70617. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  70618. // "httpMethod": "POST",
  70619. // "id": "compute.targetHttpsProxies.setSslCertificates",
  70620. // "parameterOrder": [
  70621. // "project",
  70622. // "targetHttpsProxy"
  70623. // ],
  70624. // "parameters": {
  70625. // "project": {
  70626. // "description": "Project ID for this request.",
  70627. // "location": "path",
  70628. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70629. // "required": true,
  70630. // "type": "string"
  70631. // },
  70632. // "requestId": {
  70633. // "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).",
  70634. // "location": "query",
  70635. // "type": "string"
  70636. // },
  70637. // "targetHttpsProxy": {
  70638. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  70639. // "location": "path",
  70640. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70641. // "required": true,
  70642. // "type": "string"
  70643. // }
  70644. // },
  70645. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  70646. // "request": {
  70647. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  70648. // },
  70649. // "response": {
  70650. // "$ref": "Operation"
  70651. // },
  70652. // "scopes": [
  70653. // "https://www.googleapis.com/auth/cloud-platform",
  70654. // "https://www.googleapis.com/auth/compute"
  70655. // ]
  70656. // }
  70657. }
  70658. // method id "compute.targetHttpsProxies.setSslPolicy":
  70659. type TargetHttpsProxiesSetSslPolicyCall struct {
  70660. s *Service
  70661. project string
  70662. targetHttpsProxy string
  70663. sslpolicyreference *SslPolicyReference
  70664. urlParams_ gensupport.URLParams
  70665. ctx_ context.Context
  70666. header_ http.Header
  70667. }
  70668. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  70669. // policy specifies the server-side support for SSL features. This
  70670. // affects connections between clients and the HTTPS proxy load
  70671. // balancer. They do not affect the connection between the load balancer
  70672. // and the backends.
  70673. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  70674. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70675. c.project = project
  70676. c.targetHttpsProxy = targetHttpsProxy
  70677. c.sslpolicyreference = sslpolicyreference
  70678. return c
  70679. }
  70680. // RequestId sets the optional parameter "requestId": An optional
  70681. // request ID to identify requests. Specify a unique request ID so that
  70682. // if you must retry your request, the server will know to ignore the
  70683. // request if it has already been completed.
  70684. //
  70685. // For example, consider a situation where you make an initial request
  70686. // and the request times out. If you make the request again with the
  70687. // same request ID, the server can check if original operation with the
  70688. // same request ID was received, and if so, will ignore the second
  70689. // request. This prevents clients from accidentally creating duplicate
  70690. // commitments.
  70691. //
  70692. // The request ID must be a valid UUID with the exception that zero UUID
  70693. // is not supported (00000000-0000-0000-0000-000000000000).
  70694. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  70695. c.urlParams_.Set("requestId", requestId)
  70696. return c
  70697. }
  70698. // Fields allows partial responses to be retrieved. See
  70699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70700. // for more information.
  70701. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  70702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70703. return c
  70704. }
  70705. // Context sets the context to be used in this call's Do method. Any
  70706. // pending HTTP request will be aborted if the provided context is
  70707. // canceled.
  70708. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  70709. c.ctx_ = ctx
  70710. return c
  70711. }
  70712. // Header returns an http.Header that can be modified by the caller to
  70713. // add HTTP headers to the request.
  70714. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  70715. if c.header_ == nil {
  70716. c.header_ = make(http.Header)
  70717. }
  70718. return c.header_
  70719. }
  70720. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  70721. reqHeaders := make(http.Header)
  70722. for k, v := range c.header_ {
  70723. reqHeaders[k] = v
  70724. }
  70725. reqHeaders.Set("User-Agent", c.s.userAgent())
  70726. var body io.Reader = nil
  70727. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  70728. if err != nil {
  70729. return nil, err
  70730. }
  70731. reqHeaders.Set("Content-Type", "application/json")
  70732. c.urlParams_.Set("alt", alt)
  70733. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  70734. urls += "?" + c.urlParams_.Encode()
  70735. req, _ := http.NewRequest("POST", urls, body)
  70736. req.Header = reqHeaders
  70737. googleapi.Expand(req.URL, map[string]string{
  70738. "project": c.project,
  70739. "targetHttpsProxy": c.targetHttpsProxy,
  70740. })
  70741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70742. }
  70743. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  70744. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70745. // status code is an error. Response headers are in either
  70746. // *Operation.ServerResponse.Header or (if a response was returned at
  70747. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70748. // to check whether the returned error was because
  70749. // http.StatusNotModified was returned.
  70750. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70751. gensupport.SetOptions(c.urlParams_, opts...)
  70752. res, err := c.doRequest("json")
  70753. if res != nil && res.StatusCode == http.StatusNotModified {
  70754. if res.Body != nil {
  70755. res.Body.Close()
  70756. }
  70757. return nil, &googleapi.Error{
  70758. Code: res.StatusCode,
  70759. Header: res.Header,
  70760. }
  70761. }
  70762. if err != nil {
  70763. return nil, err
  70764. }
  70765. defer googleapi.CloseBody(res)
  70766. if err := googleapi.CheckResponse(res); err != nil {
  70767. return nil, err
  70768. }
  70769. ret := &Operation{
  70770. ServerResponse: googleapi.ServerResponse{
  70771. Header: res.Header,
  70772. HTTPStatusCode: res.StatusCode,
  70773. },
  70774. }
  70775. target := &ret
  70776. if err := gensupport.DecodeResponse(target, res); err != nil {
  70777. return nil, err
  70778. }
  70779. return ret, nil
  70780. // {
  70781. // "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.",
  70782. // "httpMethod": "POST",
  70783. // "id": "compute.targetHttpsProxies.setSslPolicy",
  70784. // "parameterOrder": [
  70785. // "project",
  70786. // "targetHttpsProxy"
  70787. // ],
  70788. // "parameters": {
  70789. // "project": {
  70790. // "description": "Project ID for this request.",
  70791. // "location": "path",
  70792. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70793. // "required": true,
  70794. // "type": "string"
  70795. // },
  70796. // "requestId": {
  70797. // "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).",
  70798. // "location": "query",
  70799. // "type": "string"
  70800. // },
  70801. // "targetHttpsProxy": {
  70802. // "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.",
  70803. // "location": "path",
  70804. // "required": true,
  70805. // "type": "string"
  70806. // }
  70807. // },
  70808. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  70809. // "request": {
  70810. // "$ref": "SslPolicyReference"
  70811. // },
  70812. // "response": {
  70813. // "$ref": "Operation"
  70814. // },
  70815. // "scopes": [
  70816. // "https://www.googleapis.com/auth/cloud-platform",
  70817. // "https://www.googleapis.com/auth/compute"
  70818. // ]
  70819. // }
  70820. }
  70821. // method id "compute.targetHttpsProxies.setUrlMap":
  70822. type TargetHttpsProxiesSetUrlMapCall struct {
  70823. s *Service
  70824. project string
  70825. targetHttpsProxy string
  70826. urlmapreference *UrlMapReference
  70827. urlParams_ gensupport.URLParams
  70828. ctx_ context.Context
  70829. header_ http.Header
  70830. }
  70831. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  70832. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  70833. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70834. c.project = project
  70835. c.targetHttpsProxy = targetHttpsProxy
  70836. c.urlmapreference = urlmapreference
  70837. return c
  70838. }
  70839. // RequestId sets the optional parameter "requestId": An optional
  70840. // request ID to identify requests. Specify a unique request ID so that
  70841. // if you must retry your request, the server will know to ignore the
  70842. // request if it has already been completed.
  70843. //
  70844. // For example, consider a situation where you make an initial request
  70845. // and the request times out. If you make the request again with the
  70846. // same request ID, the server can check if original operation with the
  70847. // same request ID was received, and if so, will ignore the second
  70848. // request. This prevents clients from accidentally creating duplicate
  70849. // commitments.
  70850. //
  70851. // The request ID must be a valid UUID with the exception that zero UUID
  70852. // is not supported (00000000-0000-0000-0000-000000000000).
  70853. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  70854. c.urlParams_.Set("requestId", requestId)
  70855. return c
  70856. }
  70857. // Fields allows partial responses to be retrieved. See
  70858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70859. // for more information.
  70860. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  70861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70862. return c
  70863. }
  70864. // Context sets the context to be used in this call's Do method. Any
  70865. // pending HTTP request will be aborted if the provided context is
  70866. // canceled.
  70867. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  70868. c.ctx_ = ctx
  70869. return c
  70870. }
  70871. // Header returns an http.Header that can be modified by the caller to
  70872. // add HTTP headers to the request.
  70873. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  70874. if c.header_ == nil {
  70875. c.header_ = make(http.Header)
  70876. }
  70877. return c.header_
  70878. }
  70879. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  70880. reqHeaders := make(http.Header)
  70881. for k, v := range c.header_ {
  70882. reqHeaders[k] = v
  70883. }
  70884. reqHeaders.Set("User-Agent", c.s.userAgent())
  70885. var body io.Reader = nil
  70886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  70887. if err != nil {
  70888. return nil, err
  70889. }
  70890. reqHeaders.Set("Content-Type", "application/json")
  70891. c.urlParams_.Set("alt", alt)
  70892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  70893. urls += "?" + c.urlParams_.Encode()
  70894. req, _ := http.NewRequest("POST", urls, body)
  70895. req.Header = reqHeaders
  70896. googleapi.Expand(req.URL, map[string]string{
  70897. "project": c.project,
  70898. "targetHttpsProxy": c.targetHttpsProxy,
  70899. })
  70900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70901. }
  70902. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  70903. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70904. // status code is an error. Response headers are in either
  70905. // *Operation.ServerResponse.Header or (if a response was returned at
  70906. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70907. // to check whether the returned error was because
  70908. // http.StatusNotModified was returned.
  70909. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70910. gensupport.SetOptions(c.urlParams_, opts...)
  70911. res, err := c.doRequest("json")
  70912. if res != nil && res.StatusCode == http.StatusNotModified {
  70913. if res.Body != nil {
  70914. res.Body.Close()
  70915. }
  70916. return nil, &googleapi.Error{
  70917. Code: res.StatusCode,
  70918. Header: res.Header,
  70919. }
  70920. }
  70921. if err != nil {
  70922. return nil, err
  70923. }
  70924. defer googleapi.CloseBody(res)
  70925. if err := googleapi.CheckResponse(res); err != nil {
  70926. return nil, err
  70927. }
  70928. ret := &Operation{
  70929. ServerResponse: googleapi.ServerResponse{
  70930. Header: res.Header,
  70931. HTTPStatusCode: res.StatusCode,
  70932. },
  70933. }
  70934. target := &ret
  70935. if err := gensupport.DecodeResponse(target, res); err != nil {
  70936. return nil, err
  70937. }
  70938. return ret, nil
  70939. // {
  70940. // "description": "Changes the URL map for TargetHttpsProxy.",
  70941. // "httpMethod": "POST",
  70942. // "id": "compute.targetHttpsProxies.setUrlMap",
  70943. // "parameterOrder": [
  70944. // "project",
  70945. // "targetHttpsProxy"
  70946. // ],
  70947. // "parameters": {
  70948. // "project": {
  70949. // "description": "Project ID for this request.",
  70950. // "location": "path",
  70951. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70952. // "required": true,
  70953. // "type": "string"
  70954. // },
  70955. // "requestId": {
  70956. // "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).",
  70957. // "location": "query",
  70958. // "type": "string"
  70959. // },
  70960. // "targetHttpsProxy": {
  70961. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  70962. // "location": "path",
  70963. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70964. // "required": true,
  70965. // "type": "string"
  70966. // }
  70967. // },
  70968. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  70969. // "request": {
  70970. // "$ref": "UrlMapReference"
  70971. // },
  70972. // "response": {
  70973. // "$ref": "Operation"
  70974. // },
  70975. // "scopes": [
  70976. // "https://www.googleapis.com/auth/cloud-platform",
  70977. // "https://www.googleapis.com/auth/compute"
  70978. // ]
  70979. // }
  70980. }
  70981. // method id "compute.targetInstances.aggregatedList":
  70982. type TargetInstancesAggregatedListCall struct {
  70983. s *Service
  70984. project string
  70985. urlParams_ gensupport.URLParams
  70986. ifNoneMatch_ string
  70987. ctx_ context.Context
  70988. header_ http.Header
  70989. }
  70990. // AggregatedList: Retrieves an aggregated list of target instances.
  70991. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  70992. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  70993. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70994. c.project = project
  70995. return c
  70996. }
  70997. // Filter sets the optional parameter "filter": A filter expression that
  70998. // filters resources listed in the response. The expression must specify
  70999. // the field name, a comparison operator, and the value that you want to
  71000. // use for filtering. The value must be a string, a number, or a
  71001. // boolean. The comparison operator must be either =, !=, >, or <.
  71002. //
  71003. // For example, if you are filtering Compute Engine instances, you can
  71004. // exclude instances named example-instance by specifying name !=
  71005. // example-instance.
  71006. //
  71007. // You can also filter nested fields. For example, you could specify
  71008. // scheduling.automaticRestart = false to include instances only if they
  71009. // are not scheduled for automatic restarts. You can use filtering on
  71010. // nested fields to filter based on resource labels.
  71011. //
  71012. // To filter on multiple expressions, provide each separate expression
  71013. // within parentheses. For example, (scheduling.automaticRestart = true)
  71014. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71015. // AND expression. However, you can include AND and OR expressions
  71016. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71017. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71018. // true).
  71019. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  71020. c.urlParams_.Set("filter", filter)
  71021. return c
  71022. }
  71023. // MaxResults sets the optional parameter "maxResults": The maximum
  71024. // number of results per page that should be returned. If the number of
  71025. // available results is larger than maxResults, Compute Engine returns a
  71026. // nextPageToken that can be used to get the next page of results in
  71027. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71028. // (Default: 500)
  71029. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  71030. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71031. return c
  71032. }
  71033. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71034. // a certain order. By default, results are returned in alphanumerical
  71035. // order based on the resource name.
  71036. //
  71037. // You can also sort results in descending order based on the creation
  71038. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71039. // based on the creationTimestamp field in reverse chronological order
  71040. // (newest result first). Use this to sort resources like operations so
  71041. // that the newest operation is returned first.
  71042. //
  71043. // Currently, only sorting by name or creationTimestamp desc is
  71044. // supported.
  71045. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  71046. c.urlParams_.Set("orderBy", orderBy)
  71047. return c
  71048. }
  71049. // PageToken sets the optional parameter "pageToken": Specifies a page
  71050. // token to use. Set pageToken to the nextPageToken returned by a
  71051. // previous list request to get the next page of results.
  71052. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  71053. c.urlParams_.Set("pageToken", pageToken)
  71054. return c
  71055. }
  71056. // Fields allows partial responses to be retrieved. See
  71057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71058. // for more information.
  71059. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  71060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71061. return c
  71062. }
  71063. // IfNoneMatch sets the optional parameter which makes the operation
  71064. // fail if the object's ETag matches the given value. This is useful for
  71065. // getting updates only after the object has changed since the last
  71066. // request. Use googleapi.IsNotModified to check whether the response
  71067. // error from Do is the result of In-None-Match.
  71068. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  71069. c.ifNoneMatch_ = entityTag
  71070. return c
  71071. }
  71072. // Context sets the context to be used in this call's Do method. Any
  71073. // pending HTTP request will be aborted if the provided context is
  71074. // canceled.
  71075. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  71076. c.ctx_ = ctx
  71077. return c
  71078. }
  71079. // Header returns an http.Header that can be modified by the caller to
  71080. // add HTTP headers to the request.
  71081. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  71082. if c.header_ == nil {
  71083. c.header_ = make(http.Header)
  71084. }
  71085. return c.header_
  71086. }
  71087. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  71088. reqHeaders := make(http.Header)
  71089. for k, v := range c.header_ {
  71090. reqHeaders[k] = v
  71091. }
  71092. reqHeaders.Set("User-Agent", c.s.userAgent())
  71093. if c.ifNoneMatch_ != "" {
  71094. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71095. }
  71096. var body io.Reader = nil
  71097. c.urlParams_.Set("alt", alt)
  71098. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  71099. urls += "?" + c.urlParams_.Encode()
  71100. req, _ := http.NewRequest("GET", urls, body)
  71101. req.Header = reqHeaders
  71102. googleapi.Expand(req.URL, map[string]string{
  71103. "project": c.project,
  71104. })
  71105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71106. }
  71107. // Do executes the "compute.targetInstances.aggregatedList" call.
  71108. // Exactly one of *TargetInstanceAggregatedList or error will be
  71109. // non-nil. Any non-2xx status code is an error. Response headers are in
  71110. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  71111. // response was returned at all) in error.(*googleapi.Error).Header. Use
  71112. // googleapi.IsNotModified to check whether the returned error was
  71113. // because http.StatusNotModified was returned.
  71114. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  71115. gensupport.SetOptions(c.urlParams_, opts...)
  71116. res, err := c.doRequest("json")
  71117. if res != nil && res.StatusCode == http.StatusNotModified {
  71118. if res.Body != nil {
  71119. res.Body.Close()
  71120. }
  71121. return nil, &googleapi.Error{
  71122. Code: res.StatusCode,
  71123. Header: res.Header,
  71124. }
  71125. }
  71126. if err != nil {
  71127. return nil, err
  71128. }
  71129. defer googleapi.CloseBody(res)
  71130. if err := googleapi.CheckResponse(res); err != nil {
  71131. return nil, err
  71132. }
  71133. ret := &TargetInstanceAggregatedList{
  71134. ServerResponse: googleapi.ServerResponse{
  71135. Header: res.Header,
  71136. HTTPStatusCode: res.StatusCode,
  71137. },
  71138. }
  71139. target := &ret
  71140. if err := gensupport.DecodeResponse(target, res); err != nil {
  71141. return nil, err
  71142. }
  71143. return ret, nil
  71144. // {
  71145. // "description": "Retrieves an aggregated list of target instances.",
  71146. // "httpMethod": "GET",
  71147. // "id": "compute.targetInstances.aggregatedList",
  71148. // "parameterOrder": [
  71149. // "project"
  71150. // ],
  71151. // "parameters": {
  71152. // "filter": {
  71153. // "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).",
  71154. // "location": "query",
  71155. // "type": "string"
  71156. // },
  71157. // "maxResults": {
  71158. // "default": "500",
  71159. // "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)",
  71160. // "format": "uint32",
  71161. // "location": "query",
  71162. // "minimum": "0",
  71163. // "type": "integer"
  71164. // },
  71165. // "orderBy": {
  71166. // "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.",
  71167. // "location": "query",
  71168. // "type": "string"
  71169. // },
  71170. // "pageToken": {
  71171. // "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.",
  71172. // "location": "query",
  71173. // "type": "string"
  71174. // },
  71175. // "project": {
  71176. // "description": "Project ID for this request.",
  71177. // "location": "path",
  71178. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71179. // "required": true,
  71180. // "type": "string"
  71181. // }
  71182. // },
  71183. // "path": "{project}/aggregated/targetInstances",
  71184. // "response": {
  71185. // "$ref": "TargetInstanceAggregatedList"
  71186. // },
  71187. // "scopes": [
  71188. // "https://www.googleapis.com/auth/cloud-platform",
  71189. // "https://www.googleapis.com/auth/compute",
  71190. // "https://www.googleapis.com/auth/compute.readonly"
  71191. // ]
  71192. // }
  71193. }
  71194. // Pages invokes f for each page of results.
  71195. // A non-nil error returned from f will halt the iteration.
  71196. // The provided context supersedes any context provided to the Context method.
  71197. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  71198. c.ctx_ = ctx
  71199. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71200. for {
  71201. x, err := c.Do()
  71202. if err != nil {
  71203. return err
  71204. }
  71205. if err := f(x); err != nil {
  71206. return err
  71207. }
  71208. if x.NextPageToken == "" {
  71209. return nil
  71210. }
  71211. c.PageToken(x.NextPageToken)
  71212. }
  71213. }
  71214. // method id "compute.targetInstances.delete":
  71215. type TargetInstancesDeleteCall struct {
  71216. s *Service
  71217. project string
  71218. zone string
  71219. targetInstance string
  71220. urlParams_ gensupport.URLParams
  71221. ctx_ context.Context
  71222. header_ http.Header
  71223. }
  71224. // Delete: Deletes the specified TargetInstance resource.
  71225. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  71226. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  71227. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71228. c.project = project
  71229. c.zone = zone
  71230. c.targetInstance = targetInstance
  71231. return c
  71232. }
  71233. // RequestId sets the optional parameter "requestId": An optional
  71234. // request ID to identify requests. Specify a unique request ID so that
  71235. // if you must retry your request, the server will know to ignore the
  71236. // request if it has already been completed.
  71237. //
  71238. // For example, consider a situation where you make an initial request
  71239. // and the request times out. If you make the request again with the
  71240. // same request ID, the server can check if original operation with the
  71241. // same request ID was received, and if so, will ignore the second
  71242. // request. This prevents clients from accidentally creating duplicate
  71243. // commitments.
  71244. //
  71245. // The request ID must be a valid UUID with the exception that zero UUID
  71246. // is not supported (00000000-0000-0000-0000-000000000000).
  71247. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  71248. c.urlParams_.Set("requestId", requestId)
  71249. return c
  71250. }
  71251. // Fields allows partial responses to be retrieved. See
  71252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71253. // for more information.
  71254. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  71255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71256. return c
  71257. }
  71258. // Context sets the context to be used in this call's Do method. Any
  71259. // pending HTTP request will be aborted if the provided context is
  71260. // canceled.
  71261. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  71262. c.ctx_ = ctx
  71263. return c
  71264. }
  71265. // Header returns an http.Header that can be modified by the caller to
  71266. // add HTTP headers to the request.
  71267. func (c *TargetInstancesDeleteCall) Header() http.Header {
  71268. if c.header_ == nil {
  71269. c.header_ = make(http.Header)
  71270. }
  71271. return c.header_
  71272. }
  71273. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  71274. reqHeaders := make(http.Header)
  71275. for k, v := range c.header_ {
  71276. reqHeaders[k] = v
  71277. }
  71278. reqHeaders.Set("User-Agent", c.s.userAgent())
  71279. var body io.Reader = nil
  71280. c.urlParams_.Set("alt", alt)
  71281. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  71282. urls += "?" + c.urlParams_.Encode()
  71283. req, _ := http.NewRequest("DELETE", urls, body)
  71284. req.Header = reqHeaders
  71285. googleapi.Expand(req.URL, map[string]string{
  71286. "project": c.project,
  71287. "zone": c.zone,
  71288. "targetInstance": c.targetInstance,
  71289. })
  71290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71291. }
  71292. // Do executes the "compute.targetInstances.delete" call.
  71293. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71294. // status code is an error. Response headers are in either
  71295. // *Operation.ServerResponse.Header or (if a response was returned at
  71296. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71297. // to check whether the returned error was because
  71298. // http.StatusNotModified was returned.
  71299. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71300. gensupport.SetOptions(c.urlParams_, opts...)
  71301. res, err := c.doRequest("json")
  71302. if res != nil && res.StatusCode == http.StatusNotModified {
  71303. if res.Body != nil {
  71304. res.Body.Close()
  71305. }
  71306. return nil, &googleapi.Error{
  71307. Code: res.StatusCode,
  71308. Header: res.Header,
  71309. }
  71310. }
  71311. if err != nil {
  71312. return nil, err
  71313. }
  71314. defer googleapi.CloseBody(res)
  71315. if err := googleapi.CheckResponse(res); err != nil {
  71316. return nil, err
  71317. }
  71318. ret := &Operation{
  71319. ServerResponse: googleapi.ServerResponse{
  71320. Header: res.Header,
  71321. HTTPStatusCode: res.StatusCode,
  71322. },
  71323. }
  71324. target := &ret
  71325. if err := gensupport.DecodeResponse(target, res); err != nil {
  71326. return nil, err
  71327. }
  71328. return ret, nil
  71329. // {
  71330. // "description": "Deletes the specified TargetInstance resource.",
  71331. // "httpMethod": "DELETE",
  71332. // "id": "compute.targetInstances.delete",
  71333. // "parameterOrder": [
  71334. // "project",
  71335. // "zone",
  71336. // "targetInstance"
  71337. // ],
  71338. // "parameters": {
  71339. // "project": {
  71340. // "description": "Project ID for this request.",
  71341. // "location": "path",
  71342. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71343. // "required": true,
  71344. // "type": "string"
  71345. // },
  71346. // "requestId": {
  71347. // "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).",
  71348. // "location": "query",
  71349. // "type": "string"
  71350. // },
  71351. // "targetInstance": {
  71352. // "description": "Name of the TargetInstance resource to delete.",
  71353. // "location": "path",
  71354. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71355. // "required": true,
  71356. // "type": "string"
  71357. // },
  71358. // "zone": {
  71359. // "description": "Name of the zone scoping this request.",
  71360. // "location": "path",
  71361. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71362. // "required": true,
  71363. // "type": "string"
  71364. // }
  71365. // },
  71366. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  71367. // "response": {
  71368. // "$ref": "Operation"
  71369. // },
  71370. // "scopes": [
  71371. // "https://www.googleapis.com/auth/cloud-platform",
  71372. // "https://www.googleapis.com/auth/compute"
  71373. // ]
  71374. // }
  71375. }
  71376. // method id "compute.targetInstances.get":
  71377. type TargetInstancesGetCall struct {
  71378. s *Service
  71379. project string
  71380. zone string
  71381. targetInstance string
  71382. urlParams_ gensupport.URLParams
  71383. ifNoneMatch_ string
  71384. ctx_ context.Context
  71385. header_ http.Header
  71386. }
  71387. // Get: Returns the specified TargetInstance resource. Gets a list of
  71388. // available target instances by making a list() request.
  71389. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  71390. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  71391. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71392. c.project = project
  71393. c.zone = zone
  71394. c.targetInstance = targetInstance
  71395. return c
  71396. }
  71397. // Fields allows partial responses to be retrieved. See
  71398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71399. // for more information.
  71400. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  71401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71402. return c
  71403. }
  71404. // IfNoneMatch sets the optional parameter which makes the operation
  71405. // fail if the object's ETag matches the given value. This is useful for
  71406. // getting updates only after the object has changed since the last
  71407. // request. Use googleapi.IsNotModified to check whether the response
  71408. // error from Do is the result of In-None-Match.
  71409. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  71410. c.ifNoneMatch_ = entityTag
  71411. return c
  71412. }
  71413. // Context sets the context to be used in this call's Do method. Any
  71414. // pending HTTP request will be aborted if the provided context is
  71415. // canceled.
  71416. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  71417. c.ctx_ = ctx
  71418. return c
  71419. }
  71420. // Header returns an http.Header that can be modified by the caller to
  71421. // add HTTP headers to the request.
  71422. func (c *TargetInstancesGetCall) Header() http.Header {
  71423. if c.header_ == nil {
  71424. c.header_ = make(http.Header)
  71425. }
  71426. return c.header_
  71427. }
  71428. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  71429. reqHeaders := make(http.Header)
  71430. for k, v := range c.header_ {
  71431. reqHeaders[k] = v
  71432. }
  71433. reqHeaders.Set("User-Agent", c.s.userAgent())
  71434. if c.ifNoneMatch_ != "" {
  71435. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71436. }
  71437. var body io.Reader = nil
  71438. c.urlParams_.Set("alt", alt)
  71439. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  71440. urls += "?" + c.urlParams_.Encode()
  71441. req, _ := http.NewRequest("GET", urls, body)
  71442. req.Header = reqHeaders
  71443. googleapi.Expand(req.URL, map[string]string{
  71444. "project": c.project,
  71445. "zone": c.zone,
  71446. "targetInstance": c.targetInstance,
  71447. })
  71448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71449. }
  71450. // Do executes the "compute.targetInstances.get" call.
  71451. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  71452. // status code is an error. Response headers are in either
  71453. // *TargetInstance.ServerResponse.Header or (if a response was returned
  71454. // at all) in error.(*googleapi.Error).Header. Use
  71455. // googleapi.IsNotModified to check whether the returned error was
  71456. // because http.StatusNotModified was returned.
  71457. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  71458. gensupport.SetOptions(c.urlParams_, opts...)
  71459. res, err := c.doRequest("json")
  71460. if res != nil && res.StatusCode == http.StatusNotModified {
  71461. if res.Body != nil {
  71462. res.Body.Close()
  71463. }
  71464. return nil, &googleapi.Error{
  71465. Code: res.StatusCode,
  71466. Header: res.Header,
  71467. }
  71468. }
  71469. if err != nil {
  71470. return nil, err
  71471. }
  71472. defer googleapi.CloseBody(res)
  71473. if err := googleapi.CheckResponse(res); err != nil {
  71474. return nil, err
  71475. }
  71476. ret := &TargetInstance{
  71477. ServerResponse: googleapi.ServerResponse{
  71478. Header: res.Header,
  71479. HTTPStatusCode: res.StatusCode,
  71480. },
  71481. }
  71482. target := &ret
  71483. if err := gensupport.DecodeResponse(target, res); err != nil {
  71484. return nil, err
  71485. }
  71486. return ret, nil
  71487. // {
  71488. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  71489. // "httpMethod": "GET",
  71490. // "id": "compute.targetInstances.get",
  71491. // "parameterOrder": [
  71492. // "project",
  71493. // "zone",
  71494. // "targetInstance"
  71495. // ],
  71496. // "parameters": {
  71497. // "project": {
  71498. // "description": "Project ID for this request.",
  71499. // "location": "path",
  71500. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71501. // "required": true,
  71502. // "type": "string"
  71503. // },
  71504. // "targetInstance": {
  71505. // "description": "Name of the TargetInstance resource to return.",
  71506. // "location": "path",
  71507. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71508. // "required": true,
  71509. // "type": "string"
  71510. // },
  71511. // "zone": {
  71512. // "description": "Name of the zone scoping this request.",
  71513. // "location": "path",
  71514. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71515. // "required": true,
  71516. // "type": "string"
  71517. // }
  71518. // },
  71519. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  71520. // "response": {
  71521. // "$ref": "TargetInstance"
  71522. // },
  71523. // "scopes": [
  71524. // "https://www.googleapis.com/auth/cloud-platform",
  71525. // "https://www.googleapis.com/auth/compute",
  71526. // "https://www.googleapis.com/auth/compute.readonly"
  71527. // ]
  71528. // }
  71529. }
  71530. // method id "compute.targetInstances.insert":
  71531. type TargetInstancesInsertCall struct {
  71532. s *Service
  71533. project string
  71534. zone string
  71535. targetinstance *TargetInstance
  71536. urlParams_ gensupport.URLParams
  71537. ctx_ context.Context
  71538. header_ http.Header
  71539. }
  71540. // Insert: Creates a TargetInstance resource in the specified project
  71541. // and zone using the data included in the request.
  71542. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  71543. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  71544. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71545. c.project = project
  71546. c.zone = zone
  71547. c.targetinstance = targetinstance
  71548. return c
  71549. }
  71550. // RequestId sets the optional parameter "requestId": An optional
  71551. // request ID to identify requests. Specify a unique request ID so that
  71552. // if you must retry your request, the server will know to ignore the
  71553. // request if it has already been completed.
  71554. //
  71555. // For example, consider a situation where you make an initial request
  71556. // and the request times out. If you make the request again with the
  71557. // same request ID, the server can check if original operation with the
  71558. // same request ID was received, and if so, will ignore the second
  71559. // request. This prevents clients from accidentally creating duplicate
  71560. // commitments.
  71561. //
  71562. // The request ID must be a valid UUID with the exception that zero UUID
  71563. // is not supported (00000000-0000-0000-0000-000000000000).
  71564. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  71565. c.urlParams_.Set("requestId", requestId)
  71566. return c
  71567. }
  71568. // Fields allows partial responses to be retrieved. See
  71569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71570. // for more information.
  71571. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  71572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71573. return c
  71574. }
  71575. // Context sets the context to be used in this call's Do method. Any
  71576. // pending HTTP request will be aborted if the provided context is
  71577. // canceled.
  71578. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  71579. c.ctx_ = ctx
  71580. return c
  71581. }
  71582. // Header returns an http.Header that can be modified by the caller to
  71583. // add HTTP headers to the request.
  71584. func (c *TargetInstancesInsertCall) Header() http.Header {
  71585. if c.header_ == nil {
  71586. c.header_ = make(http.Header)
  71587. }
  71588. return c.header_
  71589. }
  71590. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  71591. reqHeaders := make(http.Header)
  71592. for k, v := range c.header_ {
  71593. reqHeaders[k] = v
  71594. }
  71595. reqHeaders.Set("User-Agent", c.s.userAgent())
  71596. var body io.Reader = nil
  71597. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  71598. if err != nil {
  71599. return nil, err
  71600. }
  71601. reqHeaders.Set("Content-Type", "application/json")
  71602. c.urlParams_.Set("alt", alt)
  71603. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  71604. urls += "?" + c.urlParams_.Encode()
  71605. req, _ := http.NewRequest("POST", urls, body)
  71606. req.Header = reqHeaders
  71607. googleapi.Expand(req.URL, map[string]string{
  71608. "project": c.project,
  71609. "zone": c.zone,
  71610. })
  71611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71612. }
  71613. // Do executes the "compute.targetInstances.insert" call.
  71614. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71615. // status code is an error. Response headers are in either
  71616. // *Operation.ServerResponse.Header or (if a response was returned at
  71617. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71618. // to check whether the returned error was because
  71619. // http.StatusNotModified was returned.
  71620. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71621. gensupport.SetOptions(c.urlParams_, opts...)
  71622. res, err := c.doRequest("json")
  71623. if res != nil && res.StatusCode == http.StatusNotModified {
  71624. if res.Body != nil {
  71625. res.Body.Close()
  71626. }
  71627. return nil, &googleapi.Error{
  71628. Code: res.StatusCode,
  71629. Header: res.Header,
  71630. }
  71631. }
  71632. if err != nil {
  71633. return nil, err
  71634. }
  71635. defer googleapi.CloseBody(res)
  71636. if err := googleapi.CheckResponse(res); err != nil {
  71637. return nil, err
  71638. }
  71639. ret := &Operation{
  71640. ServerResponse: googleapi.ServerResponse{
  71641. Header: res.Header,
  71642. HTTPStatusCode: res.StatusCode,
  71643. },
  71644. }
  71645. target := &ret
  71646. if err := gensupport.DecodeResponse(target, res); err != nil {
  71647. return nil, err
  71648. }
  71649. return ret, nil
  71650. // {
  71651. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  71652. // "httpMethod": "POST",
  71653. // "id": "compute.targetInstances.insert",
  71654. // "parameterOrder": [
  71655. // "project",
  71656. // "zone"
  71657. // ],
  71658. // "parameters": {
  71659. // "project": {
  71660. // "description": "Project ID for this request.",
  71661. // "location": "path",
  71662. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71663. // "required": true,
  71664. // "type": "string"
  71665. // },
  71666. // "requestId": {
  71667. // "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).",
  71668. // "location": "query",
  71669. // "type": "string"
  71670. // },
  71671. // "zone": {
  71672. // "description": "Name of the zone scoping this request.",
  71673. // "location": "path",
  71674. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71675. // "required": true,
  71676. // "type": "string"
  71677. // }
  71678. // },
  71679. // "path": "{project}/zones/{zone}/targetInstances",
  71680. // "request": {
  71681. // "$ref": "TargetInstance"
  71682. // },
  71683. // "response": {
  71684. // "$ref": "Operation"
  71685. // },
  71686. // "scopes": [
  71687. // "https://www.googleapis.com/auth/cloud-platform",
  71688. // "https://www.googleapis.com/auth/compute"
  71689. // ]
  71690. // }
  71691. }
  71692. // method id "compute.targetInstances.list":
  71693. type TargetInstancesListCall struct {
  71694. s *Service
  71695. project string
  71696. zone string
  71697. urlParams_ gensupport.URLParams
  71698. ifNoneMatch_ string
  71699. ctx_ context.Context
  71700. header_ http.Header
  71701. }
  71702. // List: Retrieves a list of TargetInstance resources available to the
  71703. // specified project and zone.
  71704. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  71705. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  71706. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71707. c.project = project
  71708. c.zone = zone
  71709. return c
  71710. }
  71711. // Filter sets the optional parameter "filter": A filter expression that
  71712. // filters resources listed in the response. The expression must specify
  71713. // the field name, a comparison operator, and the value that you want to
  71714. // use for filtering. The value must be a string, a number, or a
  71715. // boolean. The comparison operator must be either =, !=, >, or <.
  71716. //
  71717. // For example, if you are filtering Compute Engine instances, you can
  71718. // exclude instances named example-instance by specifying name !=
  71719. // example-instance.
  71720. //
  71721. // You can also filter nested fields. For example, you could specify
  71722. // scheduling.automaticRestart = false to include instances only if they
  71723. // are not scheduled for automatic restarts. You can use filtering on
  71724. // nested fields to filter based on resource labels.
  71725. //
  71726. // To filter on multiple expressions, provide each separate expression
  71727. // within parentheses. For example, (scheduling.automaticRestart = true)
  71728. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71729. // AND expression. However, you can include AND and OR expressions
  71730. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71731. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71732. // true).
  71733. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  71734. c.urlParams_.Set("filter", filter)
  71735. return c
  71736. }
  71737. // MaxResults sets the optional parameter "maxResults": The maximum
  71738. // number of results per page that should be returned. If the number of
  71739. // available results is larger than maxResults, Compute Engine returns a
  71740. // nextPageToken that can be used to get the next page of results in
  71741. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71742. // (Default: 500)
  71743. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  71744. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71745. return c
  71746. }
  71747. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71748. // a certain order. By default, results are returned in alphanumerical
  71749. // order based on the resource name.
  71750. //
  71751. // You can also sort results in descending order based on the creation
  71752. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71753. // based on the creationTimestamp field in reverse chronological order
  71754. // (newest result first). Use this to sort resources like operations so
  71755. // that the newest operation is returned first.
  71756. //
  71757. // Currently, only sorting by name or creationTimestamp desc is
  71758. // supported.
  71759. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  71760. c.urlParams_.Set("orderBy", orderBy)
  71761. return c
  71762. }
  71763. // PageToken sets the optional parameter "pageToken": Specifies a page
  71764. // token to use. Set pageToken to the nextPageToken returned by a
  71765. // previous list request to get the next page of results.
  71766. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  71767. c.urlParams_.Set("pageToken", pageToken)
  71768. return c
  71769. }
  71770. // Fields allows partial responses to be retrieved. See
  71771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71772. // for more information.
  71773. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  71774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71775. return c
  71776. }
  71777. // IfNoneMatch sets the optional parameter which makes the operation
  71778. // fail if the object's ETag matches the given value. This is useful for
  71779. // getting updates only after the object has changed since the last
  71780. // request. Use googleapi.IsNotModified to check whether the response
  71781. // error from Do is the result of In-None-Match.
  71782. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  71783. c.ifNoneMatch_ = entityTag
  71784. return c
  71785. }
  71786. // Context sets the context to be used in this call's Do method. Any
  71787. // pending HTTP request will be aborted if the provided context is
  71788. // canceled.
  71789. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  71790. c.ctx_ = ctx
  71791. return c
  71792. }
  71793. // Header returns an http.Header that can be modified by the caller to
  71794. // add HTTP headers to the request.
  71795. func (c *TargetInstancesListCall) Header() http.Header {
  71796. if c.header_ == nil {
  71797. c.header_ = make(http.Header)
  71798. }
  71799. return c.header_
  71800. }
  71801. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  71802. reqHeaders := make(http.Header)
  71803. for k, v := range c.header_ {
  71804. reqHeaders[k] = v
  71805. }
  71806. reqHeaders.Set("User-Agent", c.s.userAgent())
  71807. if c.ifNoneMatch_ != "" {
  71808. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71809. }
  71810. var body io.Reader = nil
  71811. c.urlParams_.Set("alt", alt)
  71812. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  71813. urls += "?" + c.urlParams_.Encode()
  71814. req, _ := http.NewRequest("GET", urls, body)
  71815. req.Header = reqHeaders
  71816. googleapi.Expand(req.URL, map[string]string{
  71817. "project": c.project,
  71818. "zone": c.zone,
  71819. })
  71820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71821. }
  71822. // Do executes the "compute.targetInstances.list" call.
  71823. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  71824. // non-2xx status code is an error. Response headers are in either
  71825. // *TargetInstanceList.ServerResponse.Header or (if a response was
  71826. // returned at all) in error.(*googleapi.Error).Header. Use
  71827. // googleapi.IsNotModified to check whether the returned error was
  71828. // because http.StatusNotModified was returned.
  71829. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  71830. gensupport.SetOptions(c.urlParams_, opts...)
  71831. res, err := c.doRequest("json")
  71832. if res != nil && res.StatusCode == http.StatusNotModified {
  71833. if res.Body != nil {
  71834. res.Body.Close()
  71835. }
  71836. return nil, &googleapi.Error{
  71837. Code: res.StatusCode,
  71838. Header: res.Header,
  71839. }
  71840. }
  71841. if err != nil {
  71842. return nil, err
  71843. }
  71844. defer googleapi.CloseBody(res)
  71845. if err := googleapi.CheckResponse(res); err != nil {
  71846. return nil, err
  71847. }
  71848. ret := &TargetInstanceList{
  71849. ServerResponse: googleapi.ServerResponse{
  71850. Header: res.Header,
  71851. HTTPStatusCode: res.StatusCode,
  71852. },
  71853. }
  71854. target := &ret
  71855. if err := gensupport.DecodeResponse(target, res); err != nil {
  71856. return nil, err
  71857. }
  71858. return ret, nil
  71859. // {
  71860. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  71861. // "httpMethod": "GET",
  71862. // "id": "compute.targetInstances.list",
  71863. // "parameterOrder": [
  71864. // "project",
  71865. // "zone"
  71866. // ],
  71867. // "parameters": {
  71868. // "filter": {
  71869. // "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).",
  71870. // "location": "query",
  71871. // "type": "string"
  71872. // },
  71873. // "maxResults": {
  71874. // "default": "500",
  71875. // "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)",
  71876. // "format": "uint32",
  71877. // "location": "query",
  71878. // "minimum": "0",
  71879. // "type": "integer"
  71880. // },
  71881. // "orderBy": {
  71882. // "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.",
  71883. // "location": "query",
  71884. // "type": "string"
  71885. // },
  71886. // "pageToken": {
  71887. // "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.",
  71888. // "location": "query",
  71889. // "type": "string"
  71890. // },
  71891. // "project": {
  71892. // "description": "Project ID for this request.",
  71893. // "location": "path",
  71894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71895. // "required": true,
  71896. // "type": "string"
  71897. // },
  71898. // "zone": {
  71899. // "description": "Name of the zone scoping this request.",
  71900. // "location": "path",
  71901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71902. // "required": true,
  71903. // "type": "string"
  71904. // }
  71905. // },
  71906. // "path": "{project}/zones/{zone}/targetInstances",
  71907. // "response": {
  71908. // "$ref": "TargetInstanceList"
  71909. // },
  71910. // "scopes": [
  71911. // "https://www.googleapis.com/auth/cloud-platform",
  71912. // "https://www.googleapis.com/auth/compute",
  71913. // "https://www.googleapis.com/auth/compute.readonly"
  71914. // ]
  71915. // }
  71916. }
  71917. // Pages invokes f for each page of results.
  71918. // A non-nil error returned from f will halt the iteration.
  71919. // The provided context supersedes any context provided to the Context method.
  71920. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  71921. c.ctx_ = ctx
  71922. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71923. for {
  71924. x, err := c.Do()
  71925. if err != nil {
  71926. return err
  71927. }
  71928. if err := f(x); err != nil {
  71929. return err
  71930. }
  71931. if x.NextPageToken == "" {
  71932. return nil
  71933. }
  71934. c.PageToken(x.NextPageToken)
  71935. }
  71936. }
  71937. // method id "compute.targetPools.addHealthCheck":
  71938. type TargetPoolsAddHealthCheckCall struct {
  71939. s *Service
  71940. project string
  71941. region string
  71942. targetPool string
  71943. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  71944. urlParams_ gensupport.URLParams
  71945. ctx_ context.Context
  71946. header_ http.Header
  71947. }
  71948. // AddHealthCheck: Adds health check URLs to a target pool.
  71949. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  71950. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  71951. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71952. c.project = project
  71953. c.region = region
  71954. c.targetPool = targetPool
  71955. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  71956. return c
  71957. }
  71958. // RequestId sets the optional parameter "requestId": An optional
  71959. // request ID to identify requests. Specify a unique request ID so that
  71960. // if you must retry your request, the server will know to ignore the
  71961. // request if it has already been completed.
  71962. //
  71963. // For example, consider a situation where you make an initial request
  71964. // and the request times out. If you make the request again with the
  71965. // same request ID, the server can check if original operation with the
  71966. // same request ID was received, and if so, will ignore the second
  71967. // request. This prevents clients from accidentally creating duplicate
  71968. // commitments.
  71969. //
  71970. // The request ID must be a valid UUID with the exception that zero UUID
  71971. // is not supported (00000000-0000-0000-0000-000000000000).
  71972. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  71973. c.urlParams_.Set("requestId", requestId)
  71974. return c
  71975. }
  71976. // Fields allows partial responses to be retrieved. See
  71977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71978. // for more information.
  71979. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  71980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71981. return c
  71982. }
  71983. // Context sets the context to be used in this call's Do method. Any
  71984. // pending HTTP request will be aborted if the provided context is
  71985. // canceled.
  71986. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  71987. c.ctx_ = ctx
  71988. return c
  71989. }
  71990. // Header returns an http.Header that can be modified by the caller to
  71991. // add HTTP headers to the request.
  71992. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  71993. if c.header_ == nil {
  71994. c.header_ = make(http.Header)
  71995. }
  71996. return c.header_
  71997. }
  71998. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  71999. reqHeaders := make(http.Header)
  72000. for k, v := range c.header_ {
  72001. reqHeaders[k] = v
  72002. }
  72003. reqHeaders.Set("User-Agent", c.s.userAgent())
  72004. var body io.Reader = nil
  72005. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  72006. if err != nil {
  72007. return nil, err
  72008. }
  72009. reqHeaders.Set("Content-Type", "application/json")
  72010. c.urlParams_.Set("alt", alt)
  72011. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  72012. urls += "?" + c.urlParams_.Encode()
  72013. req, _ := http.NewRequest("POST", urls, body)
  72014. req.Header = reqHeaders
  72015. googleapi.Expand(req.URL, map[string]string{
  72016. "project": c.project,
  72017. "region": c.region,
  72018. "targetPool": c.targetPool,
  72019. })
  72020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72021. }
  72022. // Do executes the "compute.targetPools.addHealthCheck" call.
  72023. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72024. // status code is an error. Response headers are in either
  72025. // *Operation.ServerResponse.Header or (if a response was returned at
  72026. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72027. // to check whether the returned error was because
  72028. // http.StatusNotModified was returned.
  72029. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72030. gensupport.SetOptions(c.urlParams_, opts...)
  72031. res, err := c.doRequest("json")
  72032. if res != nil && res.StatusCode == http.StatusNotModified {
  72033. if res.Body != nil {
  72034. res.Body.Close()
  72035. }
  72036. return nil, &googleapi.Error{
  72037. Code: res.StatusCode,
  72038. Header: res.Header,
  72039. }
  72040. }
  72041. if err != nil {
  72042. return nil, err
  72043. }
  72044. defer googleapi.CloseBody(res)
  72045. if err := googleapi.CheckResponse(res); err != nil {
  72046. return nil, err
  72047. }
  72048. ret := &Operation{
  72049. ServerResponse: googleapi.ServerResponse{
  72050. Header: res.Header,
  72051. HTTPStatusCode: res.StatusCode,
  72052. },
  72053. }
  72054. target := &ret
  72055. if err := gensupport.DecodeResponse(target, res); err != nil {
  72056. return nil, err
  72057. }
  72058. return ret, nil
  72059. // {
  72060. // "description": "Adds health check URLs to a target pool.",
  72061. // "httpMethod": "POST",
  72062. // "id": "compute.targetPools.addHealthCheck",
  72063. // "parameterOrder": [
  72064. // "project",
  72065. // "region",
  72066. // "targetPool"
  72067. // ],
  72068. // "parameters": {
  72069. // "project": {
  72070. // "description": "Project ID for this request.",
  72071. // "location": "path",
  72072. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72073. // "required": true,
  72074. // "type": "string"
  72075. // },
  72076. // "region": {
  72077. // "description": "Name of the region scoping this request.",
  72078. // "location": "path",
  72079. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72080. // "required": true,
  72081. // "type": "string"
  72082. // },
  72083. // "requestId": {
  72084. // "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).",
  72085. // "location": "query",
  72086. // "type": "string"
  72087. // },
  72088. // "targetPool": {
  72089. // "description": "Name of the target pool to add a health check to.",
  72090. // "location": "path",
  72091. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72092. // "required": true,
  72093. // "type": "string"
  72094. // }
  72095. // },
  72096. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  72097. // "request": {
  72098. // "$ref": "TargetPoolsAddHealthCheckRequest"
  72099. // },
  72100. // "response": {
  72101. // "$ref": "Operation"
  72102. // },
  72103. // "scopes": [
  72104. // "https://www.googleapis.com/auth/cloud-platform",
  72105. // "https://www.googleapis.com/auth/compute"
  72106. // ]
  72107. // }
  72108. }
  72109. // method id "compute.targetPools.addInstance":
  72110. type TargetPoolsAddInstanceCall struct {
  72111. s *Service
  72112. project string
  72113. region string
  72114. targetPool string
  72115. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  72116. urlParams_ gensupport.URLParams
  72117. ctx_ context.Context
  72118. header_ http.Header
  72119. }
  72120. // AddInstance: Adds an instance to a target pool.
  72121. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  72122. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  72123. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72124. c.project = project
  72125. c.region = region
  72126. c.targetPool = targetPool
  72127. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  72128. return c
  72129. }
  72130. // RequestId sets the optional parameter "requestId": An optional
  72131. // request ID to identify requests. Specify a unique request ID so that
  72132. // if you must retry your request, the server will know to ignore the
  72133. // request if it has already been completed.
  72134. //
  72135. // For example, consider a situation where you make an initial request
  72136. // and the request times out. If you make the request again with the
  72137. // same request ID, the server can check if original operation with the
  72138. // same request ID was received, and if so, will ignore the second
  72139. // request. This prevents clients from accidentally creating duplicate
  72140. // commitments.
  72141. //
  72142. // The request ID must be a valid UUID with the exception that zero UUID
  72143. // is not supported (00000000-0000-0000-0000-000000000000).
  72144. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  72145. c.urlParams_.Set("requestId", requestId)
  72146. return c
  72147. }
  72148. // Fields allows partial responses to be retrieved. See
  72149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72150. // for more information.
  72151. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  72152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72153. return c
  72154. }
  72155. // Context sets the context to be used in this call's Do method. Any
  72156. // pending HTTP request will be aborted if the provided context is
  72157. // canceled.
  72158. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  72159. c.ctx_ = ctx
  72160. return c
  72161. }
  72162. // Header returns an http.Header that can be modified by the caller to
  72163. // add HTTP headers to the request.
  72164. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  72165. if c.header_ == nil {
  72166. c.header_ = make(http.Header)
  72167. }
  72168. return c.header_
  72169. }
  72170. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  72171. reqHeaders := make(http.Header)
  72172. for k, v := range c.header_ {
  72173. reqHeaders[k] = v
  72174. }
  72175. reqHeaders.Set("User-Agent", c.s.userAgent())
  72176. var body io.Reader = nil
  72177. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  72178. if err != nil {
  72179. return nil, err
  72180. }
  72181. reqHeaders.Set("Content-Type", "application/json")
  72182. c.urlParams_.Set("alt", alt)
  72183. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  72184. urls += "?" + c.urlParams_.Encode()
  72185. req, _ := http.NewRequest("POST", urls, body)
  72186. req.Header = reqHeaders
  72187. googleapi.Expand(req.URL, map[string]string{
  72188. "project": c.project,
  72189. "region": c.region,
  72190. "targetPool": c.targetPool,
  72191. })
  72192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72193. }
  72194. // Do executes the "compute.targetPools.addInstance" call.
  72195. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72196. // status code is an error. Response headers are in either
  72197. // *Operation.ServerResponse.Header or (if a response was returned at
  72198. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72199. // to check whether the returned error was because
  72200. // http.StatusNotModified was returned.
  72201. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72202. gensupport.SetOptions(c.urlParams_, opts...)
  72203. res, err := c.doRequest("json")
  72204. if res != nil && res.StatusCode == http.StatusNotModified {
  72205. if res.Body != nil {
  72206. res.Body.Close()
  72207. }
  72208. return nil, &googleapi.Error{
  72209. Code: res.StatusCode,
  72210. Header: res.Header,
  72211. }
  72212. }
  72213. if err != nil {
  72214. return nil, err
  72215. }
  72216. defer googleapi.CloseBody(res)
  72217. if err := googleapi.CheckResponse(res); err != nil {
  72218. return nil, err
  72219. }
  72220. ret := &Operation{
  72221. ServerResponse: googleapi.ServerResponse{
  72222. Header: res.Header,
  72223. HTTPStatusCode: res.StatusCode,
  72224. },
  72225. }
  72226. target := &ret
  72227. if err := gensupport.DecodeResponse(target, res); err != nil {
  72228. return nil, err
  72229. }
  72230. return ret, nil
  72231. // {
  72232. // "description": "Adds an instance to a target pool.",
  72233. // "httpMethod": "POST",
  72234. // "id": "compute.targetPools.addInstance",
  72235. // "parameterOrder": [
  72236. // "project",
  72237. // "region",
  72238. // "targetPool"
  72239. // ],
  72240. // "parameters": {
  72241. // "project": {
  72242. // "description": "Project ID for this request.",
  72243. // "location": "path",
  72244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72245. // "required": true,
  72246. // "type": "string"
  72247. // },
  72248. // "region": {
  72249. // "description": "Name of the region scoping this request.",
  72250. // "location": "path",
  72251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72252. // "required": true,
  72253. // "type": "string"
  72254. // },
  72255. // "requestId": {
  72256. // "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).",
  72257. // "location": "query",
  72258. // "type": "string"
  72259. // },
  72260. // "targetPool": {
  72261. // "description": "Name of the TargetPool resource to add instances to.",
  72262. // "location": "path",
  72263. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72264. // "required": true,
  72265. // "type": "string"
  72266. // }
  72267. // },
  72268. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  72269. // "request": {
  72270. // "$ref": "TargetPoolsAddInstanceRequest"
  72271. // },
  72272. // "response": {
  72273. // "$ref": "Operation"
  72274. // },
  72275. // "scopes": [
  72276. // "https://www.googleapis.com/auth/cloud-platform",
  72277. // "https://www.googleapis.com/auth/compute"
  72278. // ]
  72279. // }
  72280. }
  72281. // method id "compute.targetPools.aggregatedList":
  72282. type TargetPoolsAggregatedListCall struct {
  72283. s *Service
  72284. project string
  72285. urlParams_ gensupport.URLParams
  72286. ifNoneMatch_ string
  72287. ctx_ context.Context
  72288. header_ http.Header
  72289. }
  72290. // AggregatedList: Retrieves an aggregated list of target pools.
  72291. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  72292. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  72293. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72294. c.project = project
  72295. return c
  72296. }
  72297. // Filter sets the optional parameter "filter": A filter expression that
  72298. // filters resources listed in the response. The expression must specify
  72299. // the field name, a comparison operator, and the value that you want to
  72300. // use for filtering. The value must be a string, a number, or a
  72301. // boolean. The comparison operator must be either =, !=, >, or <.
  72302. //
  72303. // For example, if you are filtering Compute Engine instances, you can
  72304. // exclude instances named example-instance by specifying name !=
  72305. // example-instance.
  72306. //
  72307. // You can also filter nested fields. For example, you could specify
  72308. // scheduling.automaticRestart = false to include instances only if they
  72309. // are not scheduled for automatic restarts. You can use filtering on
  72310. // nested fields to filter based on resource labels.
  72311. //
  72312. // To filter on multiple expressions, provide each separate expression
  72313. // within parentheses. For example, (scheduling.automaticRestart = true)
  72314. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72315. // AND expression. However, you can include AND and OR expressions
  72316. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72317. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72318. // true).
  72319. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  72320. c.urlParams_.Set("filter", filter)
  72321. return c
  72322. }
  72323. // MaxResults sets the optional parameter "maxResults": The maximum
  72324. // number of results per page that should be returned. If the number of
  72325. // available results is larger than maxResults, Compute Engine returns a
  72326. // nextPageToken that can be used to get the next page of results in
  72327. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72328. // (Default: 500)
  72329. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  72330. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72331. return c
  72332. }
  72333. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72334. // a certain order. By default, results are returned in alphanumerical
  72335. // order based on the resource name.
  72336. //
  72337. // You can also sort results in descending order based on the creation
  72338. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72339. // based on the creationTimestamp field in reverse chronological order
  72340. // (newest result first). Use this to sort resources like operations so
  72341. // that the newest operation is returned first.
  72342. //
  72343. // Currently, only sorting by name or creationTimestamp desc is
  72344. // supported.
  72345. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  72346. c.urlParams_.Set("orderBy", orderBy)
  72347. return c
  72348. }
  72349. // PageToken sets the optional parameter "pageToken": Specifies a page
  72350. // token to use. Set pageToken to the nextPageToken returned by a
  72351. // previous list request to get the next page of results.
  72352. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  72353. c.urlParams_.Set("pageToken", pageToken)
  72354. return c
  72355. }
  72356. // Fields allows partial responses to be retrieved. See
  72357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72358. // for more information.
  72359. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  72360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72361. return c
  72362. }
  72363. // IfNoneMatch sets the optional parameter which makes the operation
  72364. // fail if the object's ETag matches the given value. This is useful for
  72365. // getting updates only after the object has changed since the last
  72366. // request. Use googleapi.IsNotModified to check whether the response
  72367. // error from Do is the result of In-None-Match.
  72368. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  72369. c.ifNoneMatch_ = entityTag
  72370. return c
  72371. }
  72372. // Context sets the context to be used in this call's Do method. Any
  72373. // pending HTTP request will be aborted if the provided context is
  72374. // canceled.
  72375. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  72376. c.ctx_ = ctx
  72377. return c
  72378. }
  72379. // Header returns an http.Header that can be modified by the caller to
  72380. // add HTTP headers to the request.
  72381. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  72382. if c.header_ == nil {
  72383. c.header_ = make(http.Header)
  72384. }
  72385. return c.header_
  72386. }
  72387. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  72388. reqHeaders := make(http.Header)
  72389. for k, v := range c.header_ {
  72390. reqHeaders[k] = v
  72391. }
  72392. reqHeaders.Set("User-Agent", c.s.userAgent())
  72393. if c.ifNoneMatch_ != "" {
  72394. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72395. }
  72396. var body io.Reader = nil
  72397. c.urlParams_.Set("alt", alt)
  72398. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  72399. urls += "?" + c.urlParams_.Encode()
  72400. req, _ := http.NewRequest("GET", urls, body)
  72401. req.Header = reqHeaders
  72402. googleapi.Expand(req.URL, map[string]string{
  72403. "project": c.project,
  72404. })
  72405. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72406. }
  72407. // Do executes the "compute.targetPools.aggregatedList" call.
  72408. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  72409. // Any non-2xx status code is an error. Response headers are in either
  72410. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  72411. // returned at all) in error.(*googleapi.Error).Header. Use
  72412. // googleapi.IsNotModified to check whether the returned error was
  72413. // because http.StatusNotModified was returned.
  72414. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  72415. gensupport.SetOptions(c.urlParams_, opts...)
  72416. res, err := c.doRequest("json")
  72417. if res != nil && res.StatusCode == http.StatusNotModified {
  72418. if res.Body != nil {
  72419. res.Body.Close()
  72420. }
  72421. return nil, &googleapi.Error{
  72422. Code: res.StatusCode,
  72423. Header: res.Header,
  72424. }
  72425. }
  72426. if err != nil {
  72427. return nil, err
  72428. }
  72429. defer googleapi.CloseBody(res)
  72430. if err := googleapi.CheckResponse(res); err != nil {
  72431. return nil, err
  72432. }
  72433. ret := &TargetPoolAggregatedList{
  72434. ServerResponse: googleapi.ServerResponse{
  72435. Header: res.Header,
  72436. HTTPStatusCode: res.StatusCode,
  72437. },
  72438. }
  72439. target := &ret
  72440. if err := gensupport.DecodeResponse(target, res); err != nil {
  72441. return nil, err
  72442. }
  72443. return ret, nil
  72444. // {
  72445. // "description": "Retrieves an aggregated list of target pools.",
  72446. // "httpMethod": "GET",
  72447. // "id": "compute.targetPools.aggregatedList",
  72448. // "parameterOrder": [
  72449. // "project"
  72450. // ],
  72451. // "parameters": {
  72452. // "filter": {
  72453. // "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).",
  72454. // "location": "query",
  72455. // "type": "string"
  72456. // },
  72457. // "maxResults": {
  72458. // "default": "500",
  72459. // "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)",
  72460. // "format": "uint32",
  72461. // "location": "query",
  72462. // "minimum": "0",
  72463. // "type": "integer"
  72464. // },
  72465. // "orderBy": {
  72466. // "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.",
  72467. // "location": "query",
  72468. // "type": "string"
  72469. // },
  72470. // "pageToken": {
  72471. // "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.",
  72472. // "location": "query",
  72473. // "type": "string"
  72474. // },
  72475. // "project": {
  72476. // "description": "Project ID for this request.",
  72477. // "location": "path",
  72478. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72479. // "required": true,
  72480. // "type": "string"
  72481. // }
  72482. // },
  72483. // "path": "{project}/aggregated/targetPools",
  72484. // "response": {
  72485. // "$ref": "TargetPoolAggregatedList"
  72486. // },
  72487. // "scopes": [
  72488. // "https://www.googleapis.com/auth/cloud-platform",
  72489. // "https://www.googleapis.com/auth/compute",
  72490. // "https://www.googleapis.com/auth/compute.readonly"
  72491. // ]
  72492. // }
  72493. }
  72494. // Pages invokes f for each page of results.
  72495. // A non-nil error returned from f will halt the iteration.
  72496. // The provided context supersedes any context provided to the Context method.
  72497. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  72498. c.ctx_ = ctx
  72499. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72500. for {
  72501. x, err := c.Do()
  72502. if err != nil {
  72503. return err
  72504. }
  72505. if err := f(x); err != nil {
  72506. return err
  72507. }
  72508. if x.NextPageToken == "" {
  72509. return nil
  72510. }
  72511. c.PageToken(x.NextPageToken)
  72512. }
  72513. }
  72514. // method id "compute.targetPools.delete":
  72515. type TargetPoolsDeleteCall struct {
  72516. s *Service
  72517. project string
  72518. region string
  72519. targetPool string
  72520. urlParams_ gensupport.URLParams
  72521. ctx_ context.Context
  72522. header_ http.Header
  72523. }
  72524. // Delete: Deletes the specified target pool.
  72525. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  72526. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  72527. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72528. c.project = project
  72529. c.region = region
  72530. c.targetPool = targetPool
  72531. return c
  72532. }
  72533. // RequestId sets the optional parameter "requestId": An optional
  72534. // request ID to identify requests. Specify a unique request ID so that
  72535. // if you must retry your request, the server will know to ignore the
  72536. // request if it has already been completed.
  72537. //
  72538. // For example, consider a situation where you make an initial request
  72539. // and the request times out. If you make the request again with the
  72540. // same request ID, the server can check if original operation with the
  72541. // same request ID was received, and if so, will ignore the second
  72542. // request. This prevents clients from accidentally creating duplicate
  72543. // commitments.
  72544. //
  72545. // The request ID must be a valid UUID with the exception that zero UUID
  72546. // is not supported (00000000-0000-0000-0000-000000000000).
  72547. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  72548. c.urlParams_.Set("requestId", requestId)
  72549. return c
  72550. }
  72551. // Fields allows partial responses to be retrieved. See
  72552. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72553. // for more information.
  72554. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  72555. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72556. return c
  72557. }
  72558. // Context sets the context to be used in this call's Do method. Any
  72559. // pending HTTP request will be aborted if the provided context is
  72560. // canceled.
  72561. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  72562. c.ctx_ = ctx
  72563. return c
  72564. }
  72565. // Header returns an http.Header that can be modified by the caller to
  72566. // add HTTP headers to the request.
  72567. func (c *TargetPoolsDeleteCall) Header() http.Header {
  72568. if c.header_ == nil {
  72569. c.header_ = make(http.Header)
  72570. }
  72571. return c.header_
  72572. }
  72573. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  72574. reqHeaders := make(http.Header)
  72575. for k, v := range c.header_ {
  72576. reqHeaders[k] = v
  72577. }
  72578. reqHeaders.Set("User-Agent", c.s.userAgent())
  72579. var body io.Reader = nil
  72580. c.urlParams_.Set("alt", alt)
  72581. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  72582. urls += "?" + c.urlParams_.Encode()
  72583. req, _ := http.NewRequest("DELETE", urls, body)
  72584. req.Header = reqHeaders
  72585. googleapi.Expand(req.URL, map[string]string{
  72586. "project": c.project,
  72587. "region": c.region,
  72588. "targetPool": c.targetPool,
  72589. })
  72590. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72591. }
  72592. // Do executes the "compute.targetPools.delete" call.
  72593. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72594. // status code is an error. Response headers are in either
  72595. // *Operation.ServerResponse.Header or (if a response was returned at
  72596. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72597. // to check whether the returned error was because
  72598. // http.StatusNotModified was returned.
  72599. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72600. gensupport.SetOptions(c.urlParams_, opts...)
  72601. res, err := c.doRequest("json")
  72602. if res != nil && res.StatusCode == http.StatusNotModified {
  72603. if res.Body != nil {
  72604. res.Body.Close()
  72605. }
  72606. return nil, &googleapi.Error{
  72607. Code: res.StatusCode,
  72608. Header: res.Header,
  72609. }
  72610. }
  72611. if err != nil {
  72612. return nil, err
  72613. }
  72614. defer googleapi.CloseBody(res)
  72615. if err := googleapi.CheckResponse(res); err != nil {
  72616. return nil, err
  72617. }
  72618. ret := &Operation{
  72619. ServerResponse: googleapi.ServerResponse{
  72620. Header: res.Header,
  72621. HTTPStatusCode: res.StatusCode,
  72622. },
  72623. }
  72624. target := &ret
  72625. if err := gensupport.DecodeResponse(target, res); err != nil {
  72626. return nil, err
  72627. }
  72628. return ret, nil
  72629. // {
  72630. // "description": "Deletes the specified target pool.",
  72631. // "httpMethod": "DELETE",
  72632. // "id": "compute.targetPools.delete",
  72633. // "parameterOrder": [
  72634. // "project",
  72635. // "region",
  72636. // "targetPool"
  72637. // ],
  72638. // "parameters": {
  72639. // "project": {
  72640. // "description": "Project ID for this request.",
  72641. // "location": "path",
  72642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72643. // "required": true,
  72644. // "type": "string"
  72645. // },
  72646. // "region": {
  72647. // "description": "Name of the region scoping this request.",
  72648. // "location": "path",
  72649. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72650. // "required": true,
  72651. // "type": "string"
  72652. // },
  72653. // "requestId": {
  72654. // "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).",
  72655. // "location": "query",
  72656. // "type": "string"
  72657. // },
  72658. // "targetPool": {
  72659. // "description": "Name of the TargetPool resource to delete.",
  72660. // "location": "path",
  72661. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72662. // "required": true,
  72663. // "type": "string"
  72664. // }
  72665. // },
  72666. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  72667. // "response": {
  72668. // "$ref": "Operation"
  72669. // },
  72670. // "scopes": [
  72671. // "https://www.googleapis.com/auth/cloud-platform",
  72672. // "https://www.googleapis.com/auth/compute"
  72673. // ]
  72674. // }
  72675. }
  72676. // method id "compute.targetPools.get":
  72677. type TargetPoolsGetCall struct {
  72678. s *Service
  72679. project string
  72680. region string
  72681. targetPool string
  72682. urlParams_ gensupport.URLParams
  72683. ifNoneMatch_ string
  72684. ctx_ context.Context
  72685. header_ http.Header
  72686. }
  72687. // Get: Returns the specified target pool. Gets a list of available
  72688. // target pools by making a list() request.
  72689. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  72690. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  72691. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72692. c.project = project
  72693. c.region = region
  72694. c.targetPool = targetPool
  72695. return c
  72696. }
  72697. // Fields allows partial responses to be retrieved. See
  72698. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72699. // for more information.
  72700. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  72701. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72702. return c
  72703. }
  72704. // IfNoneMatch sets the optional parameter which makes the operation
  72705. // fail if the object's ETag matches the given value. This is useful for
  72706. // getting updates only after the object has changed since the last
  72707. // request. Use googleapi.IsNotModified to check whether the response
  72708. // error from Do is the result of In-None-Match.
  72709. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  72710. c.ifNoneMatch_ = entityTag
  72711. return c
  72712. }
  72713. // Context sets the context to be used in this call's Do method. Any
  72714. // pending HTTP request will be aborted if the provided context is
  72715. // canceled.
  72716. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  72717. c.ctx_ = ctx
  72718. return c
  72719. }
  72720. // Header returns an http.Header that can be modified by the caller to
  72721. // add HTTP headers to the request.
  72722. func (c *TargetPoolsGetCall) Header() http.Header {
  72723. if c.header_ == nil {
  72724. c.header_ = make(http.Header)
  72725. }
  72726. return c.header_
  72727. }
  72728. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  72729. reqHeaders := make(http.Header)
  72730. for k, v := range c.header_ {
  72731. reqHeaders[k] = v
  72732. }
  72733. reqHeaders.Set("User-Agent", c.s.userAgent())
  72734. if c.ifNoneMatch_ != "" {
  72735. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72736. }
  72737. var body io.Reader = nil
  72738. c.urlParams_.Set("alt", alt)
  72739. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  72740. urls += "?" + c.urlParams_.Encode()
  72741. req, _ := http.NewRequest("GET", urls, body)
  72742. req.Header = reqHeaders
  72743. googleapi.Expand(req.URL, map[string]string{
  72744. "project": c.project,
  72745. "region": c.region,
  72746. "targetPool": c.targetPool,
  72747. })
  72748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72749. }
  72750. // Do executes the "compute.targetPools.get" call.
  72751. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  72752. // status code is an error. Response headers are in either
  72753. // *TargetPool.ServerResponse.Header or (if a response was returned at
  72754. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72755. // to check whether the returned error was because
  72756. // http.StatusNotModified was returned.
  72757. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  72758. gensupport.SetOptions(c.urlParams_, opts...)
  72759. res, err := c.doRequest("json")
  72760. if res != nil && res.StatusCode == http.StatusNotModified {
  72761. if res.Body != nil {
  72762. res.Body.Close()
  72763. }
  72764. return nil, &googleapi.Error{
  72765. Code: res.StatusCode,
  72766. Header: res.Header,
  72767. }
  72768. }
  72769. if err != nil {
  72770. return nil, err
  72771. }
  72772. defer googleapi.CloseBody(res)
  72773. if err := googleapi.CheckResponse(res); err != nil {
  72774. return nil, err
  72775. }
  72776. ret := &TargetPool{
  72777. ServerResponse: googleapi.ServerResponse{
  72778. Header: res.Header,
  72779. HTTPStatusCode: res.StatusCode,
  72780. },
  72781. }
  72782. target := &ret
  72783. if err := gensupport.DecodeResponse(target, res); err != nil {
  72784. return nil, err
  72785. }
  72786. return ret, nil
  72787. // {
  72788. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  72789. // "httpMethod": "GET",
  72790. // "id": "compute.targetPools.get",
  72791. // "parameterOrder": [
  72792. // "project",
  72793. // "region",
  72794. // "targetPool"
  72795. // ],
  72796. // "parameters": {
  72797. // "project": {
  72798. // "description": "Project ID for this request.",
  72799. // "location": "path",
  72800. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72801. // "required": true,
  72802. // "type": "string"
  72803. // },
  72804. // "region": {
  72805. // "description": "Name of the region scoping this request.",
  72806. // "location": "path",
  72807. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72808. // "required": true,
  72809. // "type": "string"
  72810. // },
  72811. // "targetPool": {
  72812. // "description": "Name of the TargetPool resource to return.",
  72813. // "location": "path",
  72814. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72815. // "required": true,
  72816. // "type": "string"
  72817. // }
  72818. // },
  72819. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  72820. // "response": {
  72821. // "$ref": "TargetPool"
  72822. // },
  72823. // "scopes": [
  72824. // "https://www.googleapis.com/auth/cloud-platform",
  72825. // "https://www.googleapis.com/auth/compute",
  72826. // "https://www.googleapis.com/auth/compute.readonly"
  72827. // ]
  72828. // }
  72829. }
  72830. // method id "compute.targetPools.getHealth":
  72831. type TargetPoolsGetHealthCall struct {
  72832. s *Service
  72833. project string
  72834. region string
  72835. targetPool string
  72836. instancereference *InstanceReference
  72837. urlParams_ gensupport.URLParams
  72838. ctx_ context.Context
  72839. header_ http.Header
  72840. }
  72841. // GetHealth: Gets the most recent health check results for each IP for
  72842. // the instance that is referenced by the given target pool.
  72843. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  72844. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  72845. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72846. c.project = project
  72847. c.region = region
  72848. c.targetPool = targetPool
  72849. c.instancereference = instancereference
  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 *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  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 *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  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 *TargetPoolsGetHealthCall) Header() http.Header {
  72869. if c.header_ == nil {
  72870. c.header_ = make(http.Header)
  72871. }
  72872. return c.header_
  72873. }
  72874. func (c *TargetPoolsGetHealthCall) 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.instancereference)
  72882. if err != nil {
  72883. return nil, err
  72884. }
  72885. reqHeaders.Set("Content-Type", "application/json")
  72886. c.urlParams_.Set("alt", alt)
  72887. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  72888. urls += "?" + c.urlParams_.Encode()
  72889. req, _ := http.NewRequest("POST", urls, body)
  72890. req.Header = reqHeaders
  72891. googleapi.Expand(req.URL, map[string]string{
  72892. "project": c.project,
  72893. "region": c.region,
  72894. "targetPool": c.targetPool,
  72895. })
  72896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72897. }
  72898. // Do executes the "compute.targetPools.getHealth" call.
  72899. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  72900. // Any non-2xx status code is an error. Response headers are in either
  72901. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  72902. // returned at all) in error.(*googleapi.Error).Header. Use
  72903. // googleapi.IsNotModified to check whether the returned error was
  72904. // because http.StatusNotModified was returned.
  72905. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  72906. gensupport.SetOptions(c.urlParams_, opts...)
  72907. res, err := c.doRequest("json")
  72908. if res != nil && res.StatusCode == http.StatusNotModified {
  72909. if res.Body != nil {
  72910. res.Body.Close()
  72911. }
  72912. return nil, &googleapi.Error{
  72913. Code: res.StatusCode,
  72914. Header: res.Header,
  72915. }
  72916. }
  72917. if err != nil {
  72918. return nil, err
  72919. }
  72920. defer googleapi.CloseBody(res)
  72921. if err := googleapi.CheckResponse(res); err != nil {
  72922. return nil, err
  72923. }
  72924. ret := &TargetPoolInstanceHealth{
  72925. ServerResponse: googleapi.ServerResponse{
  72926. Header: res.Header,
  72927. HTTPStatusCode: res.StatusCode,
  72928. },
  72929. }
  72930. target := &ret
  72931. if err := gensupport.DecodeResponse(target, res); err != nil {
  72932. return nil, err
  72933. }
  72934. return ret, nil
  72935. // {
  72936. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  72937. // "httpMethod": "POST",
  72938. // "id": "compute.targetPools.getHealth",
  72939. // "parameterOrder": [
  72940. // "project",
  72941. // "region",
  72942. // "targetPool"
  72943. // ],
  72944. // "parameters": {
  72945. // "project": {
  72946. // "description": "Project ID for this request.",
  72947. // "location": "path",
  72948. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72949. // "required": true,
  72950. // "type": "string"
  72951. // },
  72952. // "region": {
  72953. // "description": "Name of the region scoping this request.",
  72954. // "location": "path",
  72955. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72956. // "required": true,
  72957. // "type": "string"
  72958. // },
  72959. // "targetPool": {
  72960. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  72961. // "location": "path",
  72962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72963. // "required": true,
  72964. // "type": "string"
  72965. // }
  72966. // },
  72967. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  72968. // "request": {
  72969. // "$ref": "InstanceReference"
  72970. // },
  72971. // "response": {
  72972. // "$ref": "TargetPoolInstanceHealth"
  72973. // },
  72974. // "scopes": [
  72975. // "https://www.googleapis.com/auth/cloud-platform",
  72976. // "https://www.googleapis.com/auth/compute",
  72977. // "https://www.googleapis.com/auth/compute.readonly"
  72978. // ]
  72979. // }
  72980. }
  72981. // method id "compute.targetPools.insert":
  72982. type TargetPoolsInsertCall struct {
  72983. s *Service
  72984. project string
  72985. region string
  72986. targetpool *TargetPool
  72987. urlParams_ gensupport.URLParams
  72988. ctx_ context.Context
  72989. header_ http.Header
  72990. }
  72991. // Insert: Creates a target pool in the specified project and region
  72992. // using the data included in the request.
  72993. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  72994. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  72995. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72996. c.project = project
  72997. c.region = region
  72998. c.targetpool = targetpool
  72999. return c
  73000. }
  73001. // RequestId sets the optional parameter "requestId": An optional
  73002. // request ID to identify requests. Specify a unique request ID so that
  73003. // if you must retry your request, the server will know to ignore the
  73004. // request if it has already been completed.
  73005. //
  73006. // For example, consider a situation where you make an initial request
  73007. // and the request times out. If you make the request again with the
  73008. // same request ID, the server can check if original operation with the
  73009. // same request ID was received, and if so, will ignore the second
  73010. // request. This prevents clients from accidentally creating duplicate
  73011. // commitments.
  73012. //
  73013. // The request ID must be a valid UUID with the exception that zero UUID
  73014. // is not supported (00000000-0000-0000-0000-000000000000).
  73015. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  73016. c.urlParams_.Set("requestId", requestId)
  73017. return c
  73018. }
  73019. // Fields allows partial responses to be retrieved. See
  73020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73021. // for more information.
  73022. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  73023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73024. return c
  73025. }
  73026. // Context sets the context to be used in this call's Do method. Any
  73027. // pending HTTP request will be aborted if the provided context is
  73028. // canceled.
  73029. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  73030. c.ctx_ = ctx
  73031. return c
  73032. }
  73033. // Header returns an http.Header that can be modified by the caller to
  73034. // add HTTP headers to the request.
  73035. func (c *TargetPoolsInsertCall) Header() http.Header {
  73036. if c.header_ == nil {
  73037. c.header_ = make(http.Header)
  73038. }
  73039. return c.header_
  73040. }
  73041. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  73042. reqHeaders := make(http.Header)
  73043. for k, v := range c.header_ {
  73044. reqHeaders[k] = v
  73045. }
  73046. reqHeaders.Set("User-Agent", c.s.userAgent())
  73047. var body io.Reader = nil
  73048. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  73049. if err != nil {
  73050. return nil, err
  73051. }
  73052. reqHeaders.Set("Content-Type", "application/json")
  73053. c.urlParams_.Set("alt", alt)
  73054. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  73055. urls += "?" + c.urlParams_.Encode()
  73056. req, _ := http.NewRequest("POST", urls, body)
  73057. req.Header = reqHeaders
  73058. googleapi.Expand(req.URL, map[string]string{
  73059. "project": c.project,
  73060. "region": c.region,
  73061. })
  73062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73063. }
  73064. // Do executes the "compute.targetPools.insert" call.
  73065. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73066. // status code is an error. Response headers are in either
  73067. // *Operation.ServerResponse.Header or (if a response was returned at
  73068. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73069. // to check whether the returned error was because
  73070. // http.StatusNotModified was returned.
  73071. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73072. gensupport.SetOptions(c.urlParams_, opts...)
  73073. res, err := c.doRequest("json")
  73074. if res != nil && res.StatusCode == http.StatusNotModified {
  73075. if res.Body != nil {
  73076. res.Body.Close()
  73077. }
  73078. return nil, &googleapi.Error{
  73079. Code: res.StatusCode,
  73080. Header: res.Header,
  73081. }
  73082. }
  73083. if err != nil {
  73084. return nil, err
  73085. }
  73086. defer googleapi.CloseBody(res)
  73087. if err := googleapi.CheckResponse(res); err != nil {
  73088. return nil, err
  73089. }
  73090. ret := &Operation{
  73091. ServerResponse: googleapi.ServerResponse{
  73092. Header: res.Header,
  73093. HTTPStatusCode: res.StatusCode,
  73094. },
  73095. }
  73096. target := &ret
  73097. if err := gensupport.DecodeResponse(target, res); err != nil {
  73098. return nil, err
  73099. }
  73100. return ret, nil
  73101. // {
  73102. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  73103. // "httpMethod": "POST",
  73104. // "id": "compute.targetPools.insert",
  73105. // "parameterOrder": [
  73106. // "project",
  73107. // "region"
  73108. // ],
  73109. // "parameters": {
  73110. // "project": {
  73111. // "description": "Project ID for this request.",
  73112. // "location": "path",
  73113. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73114. // "required": true,
  73115. // "type": "string"
  73116. // },
  73117. // "region": {
  73118. // "description": "Name of the region scoping this request.",
  73119. // "location": "path",
  73120. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73121. // "required": true,
  73122. // "type": "string"
  73123. // },
  73124. // "requestId": {
  73125. // "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).",
  73126. // "location": "query",
  73127. // "type": "string"
  73128. // }
  73129. // },
  73130. // "path": "{project}/regions/{region}/targetPools",
  73131. // "request": {
  73132. // "$ref": "TargetPool"
  73133. // },
  73134. // "response": {
  73135. // "$ref": "Operation"
  73136. // },
  73137. // "scopes": [
  73138. // "https://www.googleapis.com/auth/cloud-platform",
  73139. // "https://www.googleapis.com/auth/compute"
  73140. // ]
  73141. // }
  73142. }
  73143. // method id "compute.targetPools.list":
  73144. type TargetPoolsListCall struct {
  73145. s *Service
  73146. project string
  73147. region string
  73148. urlParams_ gensupport.URLParams
  73149. ifNoneMatch_ string
  73150. ctx_ context.Context
  73151. header_ http.Header
  73152. }
  73153. // List: Retrieves a list of target pools available to the specified
  73154. // project and region.
  73155. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  73156. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  73157. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73158. c.project = project
  73159. c.region = region
  73160. return c
  73161. }
  73162. // Filter sets the optional parameter "filter": A filter expression that
  73163. // filters resources listed in the response. The expression must specify
  73164. // the field name, a comparison operator, and the value that you want to
  73165. // use for filtering. The value must be a string, a number, or a
  73166. // boolean. The comparison operator must be either =, !=, >, or <.
  73167. //
  73168. // For example, if you are filtering Compute Engine instances, you can
  73169. // exclude instances named example-instance by specifying name !=
  73170. // example-instance.
  73171. //
  73172. // You can also filter nested fields. For example, you could specify
  73173. // scheduling.automaticRestart = false to include instances only if they
  73174. // are not scheduled for automatic restarts. You can use filtering on
  73175. // nested fields to filter based on resource labels.
  73176. //
  73177. // To filter on multiple expressions, provide each separate expression
  73178. // within parentheses. For example, (scheduling.automaticRestart = true)
  73179. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73180. // AND expression. However, you can include AND and OR expressions
  73181. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73182. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73183. // true).
  73184. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  73185. c.urlParams_.Set("filter", filter)
  73186. return c
  73187. }
  73188. // MaxResults sets the optional parameter "maxResults": The maximum
  73189. // number of results per page that should be returned. If the number of
  73190. // available results is larger than maxResults, Compute Engine returns a
  73191. // nextPageToken that can be used to get the next page of results in
  73192. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73193. // (Default: 500)
  73194. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  73195. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73196. return c
  73197. }
  73198. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73199. // a certain order. By default, results are returned in alphanumerical
  73200. // order based on the resource name.
  73201. //
  73202. // You can also sort results in descending order based on the creation
  73203. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73204. // based on the creationTimestamp field in reverse chronological order
  73205. // (newest result first). Use this to sort resources like operations so
  73206. // that the newest operation is returned first.
  73207. //
  73208. // Currently, only sorting by name or creationTimestamp desc is
  73209. // supported.
  73210. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  73211. c.urlParams_.Set("orderBy", orderBy)
  73212. return c
  73213. }
  73214. // PageToken sets the optional parameter "pageToken": Specifies a page
  73215. // token to use. Set pageToken to the nextPageToken returned by a
  73216. // previous list request to get the next page of results.
  73217. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  73218. c.urlParams_.Set("pageToken", pageToken)
  73219. return c
  73220. }
  73221. // Fields allows partial responses to be retrieved. See
  73222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73223. // for more information.
  73224. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  73225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73226. return c
  73227. }
  73228. // IfNoneMatch sets the optional parameter which makes the operation
  73229. // fail if the object's ETag matches the given value. This is useful for
  73230. // getting updates only after the object has changed since the last
  73231. // request. Use googleapi.IsNotModified to check whether the response
  73232. // error from Do is the result of In-None-Match.
  73233. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  73234. c.ifNoneMatch_ = entityTag
  73235. return c
  73236. }
  73237. // Context sets the context to be used in this call's Do method. Any
  73238. // pending HTTP request will be aborted if the provided context is
  73239. // canceled.
  73240. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  73241. c.ctx_ = ctx
  73242. return c
  73243. }
  73244. // Header returns an http.Header that can be modified by the caller to
  73245. // add HTTP headers to the request.
  73246. func (c *TargetPoolsListCall) Header() http.Header {
  73247. if c.header_ == nil {
  73248. c.header_ = make(http.Header)
  73249. }
  73250. return c.header_
  73251. }
  73252. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  73253. reqHeaders := make(http.Header)
  73254. for k, v := range c.header_ {
  73255. reqHeaders[k] = v
  73256. }
  73257. reqHeaders.Set("User-Agent", c.s.userAgent())
  73258. if c.ifNoneMatch_ != "" {
  73259. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73260. }
  73261. var body io.Reader = nil
  73262. c.urlParams_.Set("alt", alt)
  73263. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  73264. urls += "?" + c.urlParams_.Encode()
  73265. req, _ := http.NewRequest("GET", urls, body)
  73266. req.Header = reqHeaders
  73267. googleapi.Expand(req.URL, map[string]string{
  73268. "project": c.project,
  73269. "region": c.region,
  73270. })
  73271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73272. }
  73273. // Do executes the "compute.targetPools.list" call.
  73274. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  73275. // status code is an error. Response headers are in either
  73276. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  73277. // at all) in error.(*googleapi.Error).Header. Use
  73278. // googleapi.IsNotModified to check whether the returned error was
  73279. // because http.StatusNotModified was returned.
  73280. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  73281. gensupport.SetOptions(c.urlParams_, opts...)
  73282. res, err := c.doRequest("json")
  73283. if res != nil && res.StatusCode == http.StatusNotModified {
  73284. if res.Body != nil {
  73285. res.Body.Close()
  73286. }
  73287. return nil, &googleapi.Error{
  73288. Code: res.StatusCode,
  73289. Header: res.Header,
  73290. }
  73291. }
  73292. if err != nil {
  73293. return nil, err
  73294. }
  73295. defer googleapi.CloseBody(res)
  73296. if err := googleapi.CheckResponse(res); err != nil {
  73297. return nil, err
  73298. }
  73299. ret := &TargetPoolList{
  73300. ServerResponse: googleapi.ServerResponse{
  73301. Header: res.Header,
  73302. HTTPStatusCode: res.StatusCode,
  73303. },
  73304. }
  73305. target := &ret
  73306. if err := gensupport.DecodeResponse(target, res); err != nil {
  73307. return nil, err
  73308. }
  73309. return ret, nil
  73310. // {
  73311. // "description": "Retrieves a list of target pools available to the specified project and region.",
  73312. // "httpMethod": "GET",
  73313. // "id": "compute.targetPools.list",
  73314. // "parameterOrder": [
  73315. // "project",
  73316. // "region"
  73317. // ],
  73318. // "parameters": {
  73319. // "filter": {
  73320. // "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).",
  73321. // "location": "query",
  73322. // "type": "string"
  73323. // },
  73324. // "maxResults": {
  73325. // "default": "500",
  73326. // "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)",
  73327. // "format": "uint32",
  73328. // "location": "query",
  73329. // "minimum": "0",
  73330. // "type": "integer"
  73331. // },
  73332. // "orderBy": {
  73333. // "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.",
  73334. // "location": "query",
  73335. // "type": "string"
  73336. // },
  73337. // "pageToken": {
  73338. // "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.",
  73339. // "location": "query",
  73340. // "type": "string"
  73341. // },
  73342. // "project": {
  73343. // "description": "Project ID for this request.",
  73344. // "location": "path",
  73345. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73346. // "required": true,
  73347. // "type": "string"
  73348. // },
  73349. // "region": {
  73350. // "description": "Name of the region scoping this request.",
  73351. // "location": "path",
  73352. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73353. // "required": true,
  73354. // "type": "string"
  73355. // }
  73356. // },
  73357. // "path": "{project}/regions/{region}/targetPools",
  73358. // "response": {
  73359. // "$ref": "TargetPoolList"
  73360. // },
  73361. // "scopes": [
  73362. // "https://www.googleapis.com/auth/cloud-platform",
  73363. // "https://www.googleapis.com/auth/compute",
  73364. // "https://www.googleapis.com/auth/compute.readonly"
  73365. // ]
  73366. // }
  73367. }
  73368. // Pages invokes f for each page of results.
  73369. // A non-nil error returned from f will halt the iteration.
  73370. // The provided context supersedes any context provided to the Context method.
  73371. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  73372. c.ctx_ = ctx
  73373. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73374. for {
  73375. x, err := c.Do()
  73376. if err != nil {
  73377. return err
  73378. }
  73379. if err := f(x); err != nil {
  73380. return err
  73381. }
  73382. if x.NextPageToken == "" {
  73383. return nil
  73384. }
  73385. c.PageToken(x.NextPageToken)
  73386. }
  73387. }
  73388. // method id "compute.targetPools.removeHealthCheck":
  73389. type TargetPoolsRemoveHealthCheckCall struct {
  73390. s *Service
  73391. project string
  73392. region string
  73393. targetPool string
  73394. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  73395. urlParams_ gensupport.URLParams
  73396. ctx_ context.Context
  73397. header_ http.Header
  73398. }
  73399. // RemoveHealthCheck: Removes health check URL from a target pool.
  73400. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  73401. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  73402. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73403. c.project = project
  73404. c.region = region
  73405. c.targetPool = targetPool
  73406. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  73407. return c
  73408. }
  73409. // RequestId sets the optional parameter "requestId": An optional
  73410. // request ID to identify requests. Specify a unique request ID so that
  73411. // if you must retry your request, the server will know to ignore the
  73412. // request if it has already been completed.
  73413. //
  73414. // For example, consider a situation where you make an initial request
  73415. // and the request times out. If you make the request again with the
  73416. // same request ID, the server can check if original operation with the
  73417. // same request ID was received, and if so, will ignore the second
  73418. // request. This prevents clients from accidentally creating duplicate
  73419. // commitments.
  73420. //
  73421. // The request ID must be a valid UUID with the exception that zero UUID
  73422. // is not supported (00000000-0000-0000-0000-000000000000).
  73423. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  73424. c.urlParams_.Set("requestId", requestId)
  73425. return c
  73426. }
  73427. // Fields allows partial responses to be retrieved. See
  73428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73429. // for more information.
  73430. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  73431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73432. return c
  73433. }
  73434. // Context sets the context to be used in this call's Do method. Any
  73435. // pending HTTP request will be aborted if the provided context is
  73436. // canceled.
  73437. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  73438. c.ctx_ = ctx
  73439. return c
  73440. }
  73441. // Header returns an http.Header that can be modified by the caller to
  73442. // add HTTP headers to the request.
  73443. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  73444. if c.header_ == nil {
  73445. c.header_ = make(http.Header)
  73446. }
  73447. return c.header_
  73448. }
  73449. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  73450. reqHeaders := make(http.Header)
  73451. for k, v := range c.header_ {
  73452. reqHeaders[k] = v
  73453. }
  73454. reqHeaders.Set("User-Agent", c.s.userAgent())
  73455. var body io.Reader = nil
  73456. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  73457. if err != nil {
  73458. return nil, err
  73459. }
  73460. reqHeaders.Set("Content-Type", "application/json")
  73461. c.urlParams_.Set("alt", alt)
  73462. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  73463. urls += "?" + c.urlParams_.Encode()
  73464. req, _ := http.NewRequest("POST", urls, body)
  73465. req.Header = reqHeaders
  73466. googleapi.Expand(req.URL, map[string]string{
  73467. "project": c.project,
  73468. "region": c.region,
  73469. "targetPool": c.targetPool,
  73470. })
  73471. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73472. }
  73473. // Do executes the "compute.targetPools.removeHealthCheck" call.
  73474. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73475. // status code is an error. Response headers are in either
  73476. // *Operation.ServerResponse.Header or (if a response was returned at
  73477. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73478. // to check whether the returned error was because
  73479. // http.StatusNotModified was returned.
  73480. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73481. gensupport.SetOptions(c.urlParams_, opts...)
  73482. res, err := c.doRequest("json")
  73483. if res != nil && res.StatusCode == http.StatusNotModified {
  73484. if res.Body != nil {
  73485. res.Body.Close()
  73486. }
  73487. return nil, &googleapi.Error{
  73488. Code: res.StatusCode,
  73489. Header: res.Header,
  73490. }
  73491. }
  73492. if err != nil {
  73493. return nil, err
  73494. }
  73495. defer googleapi.CloseBody(res)
  73496. if err := googleapi.CheckResponse(res); err != nil {
  73497. return nil, err
  73498. }
  73499. ret := &Operation{
  73500. ServerResponse: googleapi.ServerResponse{
  73501. Header: res.Header,
  73502. HTTPStatusCode: res.StatusCode,
  73503. },
  73504. }
  73505. target := &ret
  73506. if err := gensupport.DecodeResponse(target, res); err != nil {
  73507. return nil, err
  73508. }
  73509. return ret, nil
  73510. // {
  73511. // "description": "Removes health check URL from a target pool.",
  73512. // "httpMethod": "POST",
  73513. // "id": "compute.targetPools.removeHealthCheck",
  73514. // "parameterOrder": [
  73515. // "project",
  73516. // "region",
  73517. // "targetPool"
  73518. // ],
  73519. // "parameters": {
  73520. // "project": {
  73521. // "description": "Project ID for this request.",
  73522. // "location": "path",
  73523. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73524. // "required": true,
  73525. // "type": "string"
  73526. // },
  73527. // "region": {
  73528. // "description": "Name of the region for this request.",
  73529. // "location": "path",
  73530. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73531. // "required": true,
  73532. // "type": "string"
  73533. // },
  73534. // "requestId": {
  73535. // "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).",
  73536. // "location": "query",
  73537. // "type": "string"
  73538. // },
  73539. // "targetPool": {
  73540. // "description": "Name of the target pool to remove health checks from.",
  73541. // "location": "path",
  73542. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73543. // "required": true,
  73544. // "type": "string"
  73545. // }
  73546. // },
  73547. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  73548. // "request": {
  73549. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  73550. // },
  73551. // "response": {
  73552. // "$ref": "Operation"
  73553. // },
  73554. // "scopes": [
  73555. // "https://www.googleapis.com/auth/cloud-platform",
  73556. // "https://www.googleapis.com/auth/compute"
  73557. // ]
  73558. // }
  73559. }
  73560. // method id "compute.targetPools.removeInstance":
  73561. type TargetPoolsRemoveInstanceCall struct {
  73562. s *Service
  73563. project string
  73564. region string
  73565. targetPool string
  73566. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  73567. urlParams_ gensupport.URLParams
  73568. ctx_ context.Context
  73569. header_ http.Header
  73570. }
  73571. // RemoveInstance: Removes instance URL from a target pool.
  73572. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  73573. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  73574. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73575. c.project = project
  73576. c.region = region
  73577. c.targetPool = targetPool
  73578. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  73579. return c
  73580. }
  73581. // RequestId sets the optional parameter "requestId": An optional
  73582. // request ID to identify requests. Specify a unique request ID so that
  73583. // if you must retry your request, the server will know to ignore the
  73584. // request if it has already been completed.
  73585. //
  73586. // For example, consider a situation where you make an initial request
  73587. // and the request times out. If you make the request again with the
  73588. // same request ID, the server can check if original operation with the
  73589. // same request ID was received, and if so, will ignore the second
  73590. // request. This prevents clients from accidentally creating duplicate
  73591. // commitments.
  73592. //
  73593. // The request ID must be a valid UUID with the exception that zero UUID
  73594. // is not supported (00000000-0000-0000-0000-000000000000).
  73595. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  73596. c.urlParams_.Set("requestId", requestId)
  73597. return c
  73598. }
  73599. // Fields allows partial responses to be retrieved. See
  73600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73601. // for more information.
  73602. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  73603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73604. return c
  73605. }
  73606. // Context sets the context to be used in this call's Do method. Any
  73607. // pending HTTP request will be aborted if the provided context is
  73608. // canceled.
  73609. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  73610. c.ctx_ = ctx
  73611. return c
  73612. }
  73613. // Header returns an http.Header that can be modified by the caller to
  73614. // add HTTP headers to the request.
  73615. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  73616. if c.header_ == nil {
  73617. c.header_ = make(http.Header)
  73618. }
  73619. return c.header_
  73620. }
  73621. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  73622. reqHeaders := make(http.Header)
  73623. for k, v := range c.header_ {
  73624. reqHeaders[k] = v
  73625. }
  73626. reqHeaders.Set("User-Agent", c.s.userAgent())
  73627. var body io.Reader = nil
  73628. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  73629. if err != nil {
  73630. return nil, err
  73631. }
  73632. reqHeaders.Set("Content-Type", "application/json")
  73633. c.urlParams_.Set("alt", alt)
  73634. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  73635. urls += "?" + c.urlParams_.Encode()
  73636. req, _ := http.NewRequest("POST", urls, body)
  73637. req.Header = reqHeaders
  73638. googleapi.Expand(req.URL, map[string]string{
  73639. "project": c.project,
  73640. "region": c.region,
  73641. "targetPool": c.targetPool,
  73642. })
  73643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73644. }
  73645. // Do executes the "compute.targetPools.removeInstance" call.
  73646. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73647. // status code is an error. Response headers are in either
  73648. // *Operation.ServerResponse.Header or (if a response was returned at
  73649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73650. // to check whether the returned error was because
  73651. // http.StatusNotModified was returned.
  73652. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73653. gensupport.SetOptions(c.urlParams_, opts...)
  73654. res, err := c.doRequest("json")
  73655. if res != nil && res.StatusCode == http.StatusNotModified {
  73656. if res.Body != nil {
  73657. res.Body.Close()
  73658. }
  73659. return nil, &googleapi.Error{
  73660. Code: res.StatusCode,
  73661. Header: res.Header,
  73662. }
  73663. }
  73664. if err != nil {
  73665. return nil, err
  73666. }
  73667. defer googleapi.CloseBody(res)
  73668. if err := googleapi.CheckResponse(res); err != nil {
  73669. return nil, err
  73670. }
  73671. ret := &Operation{
  73672. ServerResponse: googleapi.ServerResponse{
  73673. Header: res.Header,
  73674. HTTPStatusCode: res.StatusCode,
  73675. },
  73676. }
  73677. target := &ret
  73678. if err := gensupport.DecodeResponse(target, res); err != nil {
  73679. return nil, err
  73680. }
  73681. return ret, nil
  73682. // {
  73683. // "description": "Removes instance URL from a target pool.",
  73684. // "httpMethod": "POST",
  73685. // "id": "compute.targetPools.removeInstance",
  73686. // "parameterOrder": [
  73687. // "project",
  73688. // "region",
  73689. // "targetPool"
  73690. // ],
  73691. // "parameters": {
  73692. // "project": {
  73693. // "description": "Project ID for this request.",
  73694. // "location": "path",
  73695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73696. // "required": true,
  73697. // "type": "string"
  73698. // },
  73699. // "region": {
  73700. // "description": "Name of the region scoping this request.",
  73701. // "location": "path",
  73702. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73703. // "required": true,
  73704. // "type": "string"
  73705. // },
  73706. // "requestId": {
  73707. // "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).",
  73708. // "location": "query",
  73709. // "type": "string"
  73710. // },
  73711. // "targetPool": {
  73712. // "description": "Name of the TargetPool resource to remove instances from.",
  73713. // "location": "path",
  73714. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73715. // "required": true,
  73716. // "type": "string"
  73717. // }
  73718. // },
  73719. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  73720. // "request": {
  73721. // "$ref": "TargetPoolsRemoveInstanceRequest"
  73722. // },
  73723. // "response": {
  73724. // "$ref": "Operation"
  73725. // },
  73726. // "scopes": [
  73727. // "https://www.googleapis.com/auth/cloud-platform",
  73728. // "https://www.googleapis.com/auth/compute"
  73729. // ]
  73730. // }
  73731. }
  73732. // method id "compute.targetPools.setBackup":
  73733. type TargetPoolsSetBackupCall struct {
  73734. s *Service
  73735. project string
  73736. region string
  73737. targetPool string
  73738. targetreference *TargetReference
  73739. urlParams_ gensupport.URLParams
  73740. ctx_ context.Context
  73741. header_ http.Header
  73742. }
  73743. // SetBackup: Changes a backup target pool's configurations.
  73744. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  73745. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  73746. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73747. c.project = project
  73748. c.region = region
  73749. c.targetPool = targetPool
  73750. c.targetreference = targetreference
  73751. return c
  73752. }
  73753. // FailoverRatio sets the optional parameter "failoverRatio": New
  73754. // failoverRatio value for the target pool.
  73755. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  73756. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  73757. return c
  73758. }
  73759. // RequestId sets the optional parameter "requestId": An optional
  73760. // request ID to identify requests. Specify a unique request ID so that
  73761. // if you must retry your request, the server will know to ignore the
  73762. // request if it has already been completed.
  73763. //
  73764. // For example, consider a situation where you make an initial request
  73765. // and the request times out. If you make the request again with the
  73766. // same request ID, the server can check if original operation with the
  73767. // same request ID was received, and if so, will ignore the second
  73768. // request. This prevents clients from accidentally creating duplicate
  73769. // commitments.
  73770. //
  73771. // The request ID must be a valid UUID with the exception that zero UUID
  73772. // is not supported (00000000-0000-0000-0000-000000000000).
  73773. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  73774. c.urlParams_.Set("requestId", requestId)
  73775. return c
  73776. }
  73777. // Fields allows partial responses to be retrieved. See
  73778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73779. // for more information.
  73780. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  73781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73782. return c
  73783. }
  73784. // Context sets the context to be used in this call's Do method. Any
  73785. // pending HTTP request will be aborted if the provided context is
  73786. // canceled.
  73787. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  73788. c.ctx_ = ctx
  73789. return c
  73790. }
  73791. // Header returns an http.Header that can be modified by the caller to
  73792. // add HTTP headers to the request.
  73793. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  73794. if c.header_ == nil {
  73795. c.header_ = make(http.Header)
  73796. }
  73797. return c.header_
  73798. }
  73799. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  73800. reqHeaders := make(http.Header)
  73801. for k, v := range c.header_ {
  73802. reqHeaders[k] = v
  73803. }
  73804. reqHeaders.Set("User-Agent", c.s.userAgent())
  73805. var body io.Reader = nil
  73806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  73807. if err != nil {
  73808. return nil, err
  73809. }
  73810. reqHeaders.Set("Content-Type", "application/json")
  73811. c.urlParams_.Set("alt", alt)
  73812. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  73813. urls += "?" + c.urlParams_.Encode()
  73814. req, _ := http.NewRequest("POST", urls, body)
  73815. req.Header = reqHeaders
  73816. googleapi.Expand(req.URL, map[string]string{
  73817. "project": c.project,
  73818. "region": c.region,
  73819. "targetPool": c.targetPool,
  73820. })
  73821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73822. }
  73823. // Do executes the "compute.targetPools.setBackup" call.
  73824. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73825. // status code is an error. Response headers are in either
  73826. // *Operation.ServerResponse.Header or (if a response was returned at
  73827. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73828. // to check whether the returned error was because
  73829. // http.StatusNotModified was returned.
  73830. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73831. gensupport.SetOptions(c.urlParams_, opts...)
  73832. res, err := c.doRequest("json")
  73833. if res != nil && res.StatusCode == http.StatusNotModified {
  73834. if res.Body != nil {
  73835. res.Body.Close()
  73836. }
  73837. return nil, &googleapi.Error{
  73838. Code: res.StatusCode,
  73839. Header: res.Header,
  73840. }
  73841. }
  73842. if err != nil {
  73843. return nil, err
  73844. }
  73845. defer googleapi.CloseBody(res)
  73846. if err := googleapi.CheckResponse(res); err != nil {
  73847. return nil, err
  73848. }
  73849. ret := &Operation{
  73850. ServerResponse: googleapi.ServerResponse{
  73851. Header: res.Header,
  73852. HTTPStatusCode: res.StatusCode,
  73853. },
  73854. }
  73855. target := &ret
  73856. if err := gensupport.DecodeResponse(target, res); err != nil {
  73857. return nil, err
  73858. }
  73859. return ret, nil
  73860. // {
  73861. // "description": "Changes a backup target pool's configurations.",
  73862. // "httpMethod": "POST",
  73863. // "id": "compute.targetPools.setBackup",
  73864. // "parameterOrder": [
  73865. // "project",
  73866. // "region",
  73867. // "targetPool"
  73868. // ],
  73869. // "parameters": {
  73870. // "failoverRatio": {
  73871. // "description": "New failoverRatio value for the target pool.",
  73872. // "format": "float",
  73873. // "location": "query",
  73874. // "type": "number"
  73875. // },
  73876. // "project": {
  73877. // "description": "Project ID for this request.",
  73878. // "location": "path",
  73879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73880. // "required": true,
  73881. // "type": "string"
  73882. // },
  73883. // "region": {
  73884. // "description": "Name of the region scoping this request.",
  73885. // "location": "path",
  73886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73887. // "required": true,
  73888. // "type": "string"
  73889. // },
  73890. // "requestId": {
  73891. // "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).",
  73892. // "location": "query",
  73893. // "type": "string"
  73894. // },
  73895. // "targetPool": {
  73896. // "description": "Name of the TargetPool resource to set a backup pool for.",
  73897. // "location": "path",
  73898. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73899. // "required": true,
  73900. // "type": "string"
  73901. // }
  73902. // },
  73903. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  73904. // "request": {
  73905. // "$ref": "TargetReference"
  73906. // },
  73907. // "response": {
  73908. // "$ref": "Operation"
  73909. // },
  73910. // "scopes": [
  73911. // "https://www.googleapis.com/auth/cloud-platform",
  73912. // "https://www.googleapis.com/auth/compute"
  73913. // ]
  73914. // }
  73915. }
  73916. // method id "compute.targetSslProxies.delete":
  73917. type TargetSslProxiesDeleteCall struct {
  73918. s *Service
  73919. project string
  73920. targetSslProxy string
  73921. urlParams_ gensupport.URLParams
  73922. ctx_ context.Context
  73923. header_ http.Header
  73924. }
  73925. // Delete: Deletes the specified TargetSslProxy resource.
  73926. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  73927. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73928. c.project = project
  73929. c.targetSslProxy = targetSslProxy
  73930. return c
  73931. }
  73932. // RequestId sets the optional parameter "requestId": An optional
  73933. // request ID to identify requests. Specify a unique request ID so that
  73934. // if you must retry your request, the server will know to ignore the
  73935. // request if it has already been completed.
  73936. //
  73937. // For example, consider a situation where you make an initial request
  73938. // and the request times out. If you make the request again with the
  73939. // same request ID, the server can check if original operation with the
  73940. // same request ID was received, and if so, will ignore the second
  73941. // request. This prevents clients from accidentally creating duplicate
  73942. // commitments.
  73943. //
  73944. // The request ID must be a valid UUID with the exception that zero UUID
  73945. // is not supported (00000000-0000-0000-0000-000000000000).
  73946. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  73947. c.urlParams_.Set("requestId", requestId)
  73948. return c
  73949. }
  73950. // Fields allows partial responses to be retrieved. See
  73951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73952. // for more information.
  73953. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  73954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73955. return c
  73956. }
  73957. // Context sets the context to be used in this call's Do method. Any
  73958. // pending HTTP request will be aborted if the provided context is
  73959. // canceled.
  73960. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  73961. c.ctx_ = ctx
  73962. return c
  73963. }
  73964. // Header returns an http.Header that can be modified by the caller to
  73965. // add HTTP headers to the request.
  73966. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  73967. if c.header_ == nil {
  73968. c.header_ = make(http.Header)
  73969. }
  73970. return c.header_
  73971. }
  73972. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  73973. reqHeaders := make(http.Header)
  73974. for k, v := range c.header_ {
  73975. reqHeaders[k] = v
  73976. }
  73977. reqHeaders.Set("User-Agent", c.s.userAgent())
  73978. var body io.Reader = nil
  73979. c.urlParams_.Set("alt", alt)
  73980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  73981. urls += "?" + c.urlParams_.Encode()
  73982. req, _ := http.NewRequest("DELETE", urls, body)
  73983. req.Header = reqHeaders
  73984. googleapi.Expand(req.URL, map[string]string{
  73985. "project": c.project,
  73986. "targetSslProxy": c.targetSslProxy,
  73987. })
  73988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73989. }
  73990. // Do executes the "compute.targetSslProxies.delete" call.
  73991. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73992. // status code is an error. Response headers are in either
  73993. // *Operation.ServerResponse.Header or (if a response was returned at
  73994. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73995. // to check whether the returned error was because
  73996. // http.StatusNotModified was returned.
  73997. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73998. gensupport.SetOptions(c.urlParams_, opts...)
  73999. res, err := c.doRequest("json")
  74000. if res != nil && res.StatusCode == http.StatusNotModified {
  74001. if res.Body != nil {
  74002. res.Body.Close()
  74003. }
  74004. return nil, &googleapi.Error{
  74005. Code: res.StatusCode,
  74006. Header: res.Header,
  74007. }
  74008. }
  74009. if err != nil {
  74010. return nil, err
  74011. }
  74012. defer googleapi.CloseBody(res)
  74013. if err := googleapi.CheckResponse(res); err != nil {
  74014. return nil, err
  74015. }
  74016. ret := &Operation{
  74017. ServerResponse: googleapi.ServerResponse{
  74018. Header: res.Header,
  74019. HTTPStatusCode: res.StatusCode,
  74020. },
  74021. }
  74022. target := &ret
  74023. if err := gensupport.DecodeResponse(target, res); err != nil {
  74024. return nil, err
  74025. }
  74026. return ret, nil
  74027. // {
  74028. // "description": "Deletes the specified TargetSslProxy resource.",
  74029. // "httpMethod": "DELETE",
  74030. // "id": "compute.targetSslProxies.delete",
  74031. // "parameterOrder": [
  74032. // "project",
  74033. // "targetSslProxy"
  74034. // ],
  74035. // "parameters": {
  74036. // "project": {
  74037. // "description": "Project ID for this request.",
  74038. // "location": "path",
  74039. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74040. // "required": true,
  74041. // "type": "string"
  74042. // },
  74043. // "requestId": {
  74044. // "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).",
  74045. // "location": "query",
  74046. // "type": "string"
  74047. // },
  74048. // "targetSslProxy": {
  74049. // "description": "Name of the TargetSslProxy resource to delete.",
  74050. // "location": "path",
  74051. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74052. // "required": true,
  74053. // "type": "string"
  74054. // }
  74055. // },
  74056. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  74057. // "response": {
  74058. // "$ref": "Operation"
  74059. // },
  74060. // "scopes": [
  74061. // "https://www.googleapis.com/auth/cloud-platform",
  74062. // "https://www.googleapis.com/auth/compute"
  74063. // ]
  74064. // }
  74065. }
  74066. // method id "compute.targetSslProxies.get":
  74067. type TargetSslProxiesGetCall struct {
  74068. s *Service
  74069. project string
  74070. targetSslProxy string
  74071. urlParams_ gensupport.URLParams
  74072. ifNoneMatch_ string
  74073. ctx_ context.Context
  74074. header_ http.Header
  74075. }
  74076. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  74077. // available target SSL proxies by making a list() request.
  74078. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  74079. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74080. c.project = project
  74081. c.targetSslProxy = targetSslProxy
  74082. return c
  74083. }
  74084. // Fields allows partial responses to be retrieved. See
  74085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74086. // for more information.
  74087. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  74088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74089. return c
  74090. }
  74091. // IfNoneMatch sets the optional parameter which makes the operation
  74092. // fail if the object's ETag matches the given value. This is useful for
  74093. // getting updates only after the object has changed since the last
  74094. // request. Use googleapi.IsNotModified to check whether the response
  74095. // error from Do is the result of In-None-Match.
  74096. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  74097. c.ifNoneMatch_ = entityTag
  74098. return c
  74099. }
  74100. // Context sets the context to be used in this call's Do method. Any
  74101. // pending HTTP request will be aborted if the provided context is
  74102. // canceled.
  74103. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  74104. c.ctx_ = ctx
  74105. return c
  74106. }
  74107. // Header returns an http.Header that can be modified by the caller to
  74108. // add HTTP headers to the request.
  74109. func (c *TargetSslProxiesGetCall) Header() http.Header {
  74110. if c.header_ == nil {
  74111. c.header_ = make(http.Header)
  74112. }
  74113. return c.header_
  74114. }
  74115. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  74116. reqHeaders := make(http.Header)
  74117. for k, v := range c.header_ {
  74118. reqHeaders[k] = v
  74119. }
  74120. reqHeaders.Set("User-Agent", c.s.userAgent())
  74121. if c.ifNoneMatch_ != "" {
  74122. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74123. }
  74124. var body io.Reader = nil
  74125. c.urlParams_.Set("alt", alt)
  74126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  74127. urls += "?" + c.urlParams_.Encode()
  74128. req, _ := http.NewRequest("GET", urls, body)
  74129. req.Header = reqHeaders
  74130. googleapi.Expand(req.URL, map[string]string{
  74131. "project": c.project,
  74132. "targetSslProxy": c.targetSslProxy,
  74133. })
  74134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74135. }
  74136. // Do executes the "compute.targetSslProxies.get" call.
  74137. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  74138. // status code is an error. Response headers are in either
  74139. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  74140. // at all) in error.(*googleapi.Error).Header. Use
  74141. // googleapi.IsNotModified to check whether the returned error was
  74142. // because http.StatusNotModified was returned.
  74143. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  74144. gensupport.SetOptions(c.urlParams_, opts...)
  74145. res, err := c.doRequest("json")
  74146. if res != nil && res.StatusCode == http.StatusNotModified {
  74147. if res.Body != nil {
  74148. res.Body.Close()
  74149. }
  74150. return nil, &googleapi.Error{
  74151. Code: res.StatusCode,
  74152. Header: res.Header,
  74153. }
  74154. }
  74155. if err != nil {
  74156. return nil, err
  74157. }
  74158. defer googleapi.CloseBody(res)
  74159. if err := googleapi.CheckResponse(res); err != nil {
  74160. return nil, err
  74161. }
  74162. ret := &TargetSslProxy{
  74163. ServerResponse: googleapi.ServerResponse{
  74164. Header: res.Header,
  74165. HTTPStatusCode: res.StatusCode,
  74166. },
  74167. }
  74168. target := &ret
  74169. if err := gensupport.DecodeResponse(target, res); err != nil {
  74170. return nil, err
  74171. }
  74172. return ret, nil
  74173. // {
  74174. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  74175. // "httpMethod": "GET",
  74176. // "id": "compute.targetSslProxies.get",
  74177. // "parameterOrder": [
  74178. // "project",
  74179. // "targetSslProxy"
  74180. // ],
  74181. // "parameters": {
  74182. // "project": {
  74183. // "description": "Project ID for this request.",
  74184. // "location": "path",
  74185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74186. // "required": true,
  74187. // "type": "string"
  74188. // },
  74189. // "targetSslProxy": {
  74190. // "description": "Name of the TargetSslProxy resource to return.",
  74191. // "location": "path",
  74192. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74193. // "required": true,
  74194. // "type": "string"
  74195. // }
  74196. // },
  74197. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  74198. // "response": {
  74199. // "$ref": "TargetSslProxy"
  74200. // },
  74201. // "scopes": [
  74202. // "https://www.googleapis.com/auth/cloud-platform",
  74203. // "https://www.googleapis.com/auth/compute",
  74204. // "https://www.googleapis.com/auth/compute.readonly"
  74205. // ]
  74206. // }
  74207. }
  74208. // method id "compute.targetSslProxies.insert":
  74209. type TargetSslProxiesInsertCall struct {
  74210. s *Service
  74211. project string
  74212. targetsslproxy *TargetSslProxy
  74213. urlParams_ gensupport.URLParams
  74214. ctx_ context.Context
  74215. header_ http.Header
  74216. }
  74217. // Insert: Creates a TargetSslProxy resource in the specified project
  74218. // using the data included in the request.
  74219. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  74220. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74221. c.project = project
  74222. c.targetsslproxy = targetsslproxy
  74223. return c
  74224. }
  74225. // RequestId sets the optional parameter "requestId": An optional
  74226. // request ID to identify requests. Specify a unique request ID so that
  74227. // if you must retry your request, the server will know to ignore the
  74228. // request if it has already been completed.
  74229. //
  74230. // For example, consider a situation where you make an initial request
  74231. // and the request times out. If you make the request again with the
  74232. // same request ID, the server can check if original operation with the
  74233. // same request ID was received, and if so, will ignore the second
  74234. // request. This prevents clients from accidentally creating duplicate
  74235. // commitments.
  74236. //
  74237. // The request ID must be a valid UUID with the exception that zero UUID
  74238. // is not supported (00000000-0000-0000-0000-000000000000).
  74239. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  74240. c.urlParams_.Set("requestId", requestId)
  74241. return c
  74242. }
  74243. // Fields allows partial responses to be retrieved. See
  74244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74245. // for more information.
  74246. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  74247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74248. return c
  74249. }
  74250. // Context sets the context to be used in this call's Do method. Any
  74251. // pending HTTP request will be aborted if the provided context is
  74252. // canceled.
  74253. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  74254. c.ctx_ = ctx
  74255. return c
  74256. }
  74257. // Header returns an http.Header that can be modified by the caller to
  74258. // add HTTP headers to the request.
  74259. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  74260. if c.header_ == nil {
  74261. c.header_ = make(http.Header)
  74262. }
  74263. return c.header_
  74264. }
  74265. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  74266. reqHeaders := make(http.Header)
  74267. for k, v := range c.header_ {
  74268. reqHeaders[k] = v
  74269. }
  74270. reqHeaders.Set("User-Agent", c.s.userAgent())
  74271. var body io.Reader = nil
  74272. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  74273. if err != nil {
  74274. return nil, err
  74275. }
  74276. reqHeaders.Set("Content-Type", "application/json")
  74277. c.urlParams_.Set("alt", alt)
  74278. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  74279. urls += "?" + c.urlParams_.Encode()
  74280. req, _ := http.NewRequest("POST", urls, body)
  74281. req.Header = reqHeaders
  74282. googleapi.Expand(req.URL, map[string]string{
  74283. "project": c.project,
  74284. })
  74285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74286. }
  74287. // Do executes the "compute.targetSslProxies.insert" call.
  74288. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74289. // status code is an error. Response headers are in either
  74290. // *Operation.ServerResponse.Header or (if a response was returned at
  74291. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74292. // to check whether the returned error was because
  74293. // http.StatusNotModified was returned.
  74294. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74295. gensupport.SetOptions(c.urlParams_, opts...)
  74296. res, err := c.doRequest("json")
  74297. if res != nil && res.StatusCode == http.StatusNotModified {
  74298. if res.Body != nil {
  74299. res.Body.Close()
  74300. }
  74301. return nil, &googleapi.Error{
  74302. Code: res.StatusCode,
  74303. Header: res.Header,
  74304. }
  74305. }
  74306. if err != nil {
  74307. return nil, err
  74308. }
  74309. defer googleapi.CloseBody(res)
  74310. if err := googleapi.CheckResponse(res); err != nil {
  74311. return nil, err
  74312. }
  74313. ret := &Operation{
  74314. ServerResponse: googleapi.ServerResponse{
  74315. Header: res.Header,
  74316. HTTPStatusCode: res.StatusCode,
  74317. },
  74318. }
  74319. target := &ret
  74320. if err := gensupport.DecodeResponse(target, res); err != nil {
  74321. return nil, err
  74322. }
  74323. return ret, nil
  74324. // {
  74325. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  74326. // "httpMethod": "POST",
  74327. // "id": "compute.targetSslProxies.insert",
  74328. // "parameterOrder": [
  74329. // "project"
  74330. // ],
  74331. // "parameters": {
  74332. // "project": {
  74333. // "description": "Project ID for this request.",
  74334. // "location": "path",
  74335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74336. // "required": true,
  74337. // "type": "string"
  74338. // },
  74339. // "requestId": {
  74340. // "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).",
  74341. // "location": "query",
  74342. // "type": "string"
  74343. // }
  74344. // },
  74345. // "path": "{project}/global/targetSslProxies",
  74346. // "request": {
  74347. // "$ref": "TargetSslProxy"
  74348. // },
  74349. // "response": {
  74350. // "$ref": "Operation"
  74351. // },
  74352. // "scopes": [
  74353. // "https://www.googleapis.com/auth/cloud-platform",
  74354. // "https://www.googleapis.com/auth/compute"
  74355. // ]
  74356. // }
  74357. }
  74358. // method id "compute.targetSslProxies.list":
  74359. type TargetSslProxiesListCall struct {
  74360. s *Service
  74361. project string
  74362. urlParams_ gensupport.URLParams
  74363. ifNoneMatch_ string
  74364. ctx_ context.Context
  74365. header_ http.Header
  74366. }
  74367. // List: Retrieves the list of TargetSslProxy resources available to the
  74368. // specified project.
  74369. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  74370. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74371. c.project = project
  74372. return c
  74373. }
  74374. // Filter sets the optional parameter "filter": A filter expression that
  74375. // filters resources listed in the response. The expression must specify
  74376. // the field name, a comparison operator, and the value that you want to
  74377. // use for filtering. The value must be a string, a number, or a
  74378. // boolean. The comparison operator must be either =, !=, >, or <.
  74379. //
  74380. // For example, if you are filtering Compute Engine instances, you can
  74381. // exclude instances named example-instance by specifying name !=
  74382. // example-instance.
  74383. //
  74384. // You can also filter nested fields. For example, you could specify
  74385. // scheduling.automaticRestart = false to include instances only if they
  74386. // are not scheduled for automatic restarts. You can use filtering on
  74387. // nested fields to filter based on resource labels.
  74388. //
  74389. // To filter on multiple expressions, provide each separate expression
  74390. // within parentheses. For example, (scheduling.automaticRestart = true)
  74391. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74392. // AND expression. However, you can include AND and OR expressions
  74393. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74394. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74395. // true).
  74396. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  74397. c.urlParams_.Set("filter", filter)
  74398. return c
  74399. }
  74400. // MaxResults sets the optional parameter "maxResults": The maximum
  74401. // number of results per page that should be returned. If the number of
  74402. // available results is larger than maxResults, Compute Engine returns a
  74403. // nextPageToken that can be used to get the next page of results in
  74404. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74405. // (Default: 500)
  74406. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  74407. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74408. return c
  74409. }
  74410. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74411. // a certain order. By default, results are returned in alphanumerical
  74412. // order based on the resource name.
  74413. //
  74414. // You can also sort results in descending order based on the creation
  74415. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74416. // based on the creationTimestamp field in reverse chronological order
  74417. // (newest result first). Use this to sort resources like operations so
  74418. // that the newest operation is returned first.
  74419. //
  74420. // Currently, only sorting by name or creationTimestamp desc is
  74421. // supported.
  74422. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  74423. c.urlParams_.Set("orderBy", orderBy)
  74424. return c
  74425. }
  74426. // PageToken sets the optional parameter "pageToken": Specifies a page
  74427. // token to use. Set pageToken to the nextPageToken returned by a
  74428. // previous list request to get the next page of results.
  74429. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  74430. c.urlParams_.Set("pageToken", pageToken)
  74431. return c
  74432. }
  74433. // Fields allows partial responses to be retrieved. See
  74434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74435. // for more information.
  74436. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  74437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74438. return c
  74439. }
  74440. // IfNoneMatch sets the optional parameter which makes the operation
  74441. // fail if the object's ETag matches the given value. This is useful for
  74442. // getting updates only after the object has changed since the last
  74443. // request. Use googleapi.IsNotModified to check whether the response
  74444. // error from Do is the result of In-None-Match.
  74445. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  74446. c.ifNoneMatch_ = entityTag
  74447. return c
  74448. }
  74449. // Context sets the context to be used in this call's Do method. Any
  74450. // pending HTTP request will be aborted if the provided context is
  74451. // canceled.
  74452. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  74453. c.ctx_ = ctx
  74454. return c
  74455. }
  74456. // Header returns an http.Header that can be modified by the caller to
  74457. // add HTTP headers to the request.
  74458. func (c *TargetSslProxiesListCall) Header() http.Header {
  74459. if c.header_ == nil {
  74460. c.header_ = make(http.Header)
  74461. }
  74462. return c.header_
  74463. }
  74464. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  74465. reqHeaders := make(http.Header)
  74466. for k, v := range c.header_ {
  74467. reqHeaders[k] = v
  74468. }
  74469. reqHeaders.Set("User-Agent", c.s.userAgent())
  74470. if c.ifNoneMatch_ != "" {
  74471. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74472. }
  74473. var body io.Reader = nil
  74474. c.urlParams_.Set("alt", alt)
  74475. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  74476. urls += "?" + c.urlParams_.Encode()
  74477. req, _ := http.NewRequest("GET", urls, body)
  74478. req.Header = reqHeaders
  74479. googleapi.Expand(req.URL, map[string]string{
  74480. "project": c.project,
  74481. })
  74482. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74483. }
  74484. // Do executes the "compute.targetSslProxies.list" call.
  74485. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  74486. // non-2xx status code is an error. Response headers are in either
  74487. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  74488. // returned at all) in error.(*googleapi.Error).Header. Use
  74489. // googleapi.IsNotModified to check whether the returned error was
  74490. // because http.StatusNotModified was returned.
  74491. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  74492. gensupport.SetOptions(c.urlParams_, opts...)
  74493. res, err := c.doRequest("json")
  74494. if res != nil && res.StatusCode == http.StatusNotModified {
  74495. if res.Body != nil {
  74496. res.Body.Close()
  74497. }
  74498. return nil, &googleapi.Error{
  74499. Code: res.StatusCode,
  74500. Header: res.Header,
  74501. }
  74502. }
  74503. if err != nil {
  74504. return nil, err
  74505. }
  74506. defer googleapi.CloseBody(res)
  74507. if err := googleapi.CheckResponse(res); err != nil {
  74508. return nil, err
  74509. }
  74510. ret := &TargetSslProxyList{
  74511. ServerResponse: googleapi.ServerResponse{
  74512. Header: res.Header,
  74513. HTTPStatusCode: res.StatusCode,
  74514. },
  74515. }
  74516. target := &ret
  74517. if err := gensupport.DecodeResponse(target, res); err != nil {
  74518. return nil, err
  74519. }
  74520. return ret, nil
  74521. // {
  74522. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  74523. // "httpMethod": "GET",
  74524. // "id": "compute.targetSslProxies.list",
  74525. // "parameterOrder": [
  74526. // "project"
  74527. // ],
  74528. // "parameters": {
  74529. // "filter": {
  74530. // "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).",
  74531. // "location": "query",
  74532. // "type": "string"
  74533. // },
  74534. // "maxResults": {
  74535. // "default": "500",
  74536. // "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)",
  74537. // "format": "uint32",
  74538. // "location": "query",
  74539. // "minimum": "0",
  74540. // "type": "integer"
  74541. // },
  74542. // "orderBy": {
  74543. // "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.",
  74544. // "location": "query",
  74545. // "type": "string"
  74546. // },
  74547. // "pageToken": {
  74548. // "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.",
  74549. // "location": "query",
  74550. // "type": "string"
  74551. // },
  74552. // "project": {
  74553. // "description": "Project ID for this request.",
  74554. // "location": "path",
  74555. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74556. // "required": true,
  74557. // "type": "string"
  74558. // }
  74559. // },
  74560. // "path": "{project}/global/targetSslProxies",
  74561. // "response": {
  74562. // "$ref": "TargetSslProxyList"
  74563. // },
  74564. // "scopes": [
  74565. // "https://www.googleapis.com/auth/cloud-platform",
  74566. // "https://www.googleapis.com/auth/compute",
  74567. // "https://www.googleapis.com/auth/compute.readonly"
  74568. // ]
  74569. // }
  74570. }
  74571. // Pages invokes f for each page of results.
  74572. // A non-nil error returned from f will halt the iteration.
  74573. // The provided context supersedes any context provided to the Context method.
  74574. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  74575. c.ctx_ = ctx
  74576. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74577. for {
  74578. x, err := c.Do()
  74579. if err != nil {
  74580. return err
  74581. }
  74582. if err := f(x); err != nil {
  74583. return err
  74584. }
  74585. if x.NextPageToken == "" {
  74586. return nil
  74587. }
  74588. c.PageToken(x.NextPageToken)
  74589. }
  74590. }
  74591. // method id "compute.targetSslProxies.setBackendService":
  74592. type TargetSslProxiesSetBackendServiceCall struct {
  74593. s *Service
  74594. project string
  74595. targetSslProxy string
  74596. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  74597. urlParams_ gensupport.URLParams
  74598. ctx_ context.Context
  74599. header_ http.Header
  74600. }
  74601. // SetBackendService: Changes the BackendService for TargetSslProxy.
  74602. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  74603. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74604. c.project = project
  74605. c.targetSslProxy = targetSslProxy
  74606. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  74607. return c
  74608. }
  74609. // RequestId sets the optional parameter "requestId": An optional
  74610. // request ID to identify requests. Specify a unique request ID so that
  74611. // if you must retry your request, the server will know to ignore the
  74612. // request if it has already been completed.
  74613. //
  74614. // For example, consider a situation where you make an initial request
  74615. // and the request times out. If you make the request again with the
  74616. // same request ID, the server can check if original operation with the
  74617. // same request ID was received, and if so, will ignore the second
  74618. // request. This prevents clients from accidentally creating duplicate
  74619. // commitments.
  74620. //
  74621. // The request ID must be a valid UUID with the exception that zero UUID
  74622. // is not supported (00000000-0000-0000-0000-000000000000).
  74623. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  74624. c.urlParams_.Set("requestId", requestId)
  74625. return c
  74626. }
  74627. // Fields allows partial responses to be retrieved. See
  74628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74629. // for more information.
  74630. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  74631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74632. return c
  74633. }
  74634. // Context sets the context to be used in this call's Do method. Any
  74635. // pending HTTP request will be aborted if the provided context is
  74636. // canceled.
  74637. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  74638. c.ctx_ = ctx
  74639. return c
  74640. }
  74641. // Header returns an http.Header that can be modified by the caller to
  74642. // add HTTP headers to the request.
  74643. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  74644. if c.header_ == nil {
  74645. c.header_ = make(http.Header)
  74646. }
  74647. return c.header_
  74648. }
  74649. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  74650. reqHeaders := make(http.Header)
  74651. for k, v := range c.header_ {
  74652. reqHeaders[k] = v
  74653. }
  74654. reqHeaders.Set("User-Agent", c.s.userAgent())
  74655. var body io.Reader = nil
  74656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  74657. if err != nil {
  74658. return nil, err
  74659. }
  74660. reqHeaders.Set("Content-Type", "application/json")
  74661. c.urlParams_.Set("alt", alt)
  74662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  74663. urls += "?" + c.urlParams_.Encode()
  74664. req, _ := http.NewRequest("POST", urls, body)
  74665. req.Header = reqHeaders
  74666. googleapi.Expand(req.URL, map[string]string{
  74667. "project": c.project,
  74668. "targetSslProxy": c.targetSslProxy,
  74669. })
  74670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74671. }
  74672. // Do executes the "compute.targetSslProxies.setBackendService" call.
  74673. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74674. // status code is an error. Response headers are in either
  74675. // *Operation.ServerResponse.Header or (if a response was returned at
  74676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74677. // to check whether the returned error was because
  74678. // http.StatusNotModified was returned.
  74679. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74680. gensupport.SetOptions(c.urlParams_, opts...)
  74681. res, err := c.doRequest("json")
  74682. if res != nil && res.StatusCode == http.StatusNotModified {
  74683. if res.Body != nil {
  74684. res.Body.Close()
  74685. }
  74686. return nil, &googleapi.Error{
  74687. Code: res.StatusCode,
  74688. Header: res.Header,
  74689. }
  74690. }
  74691. if err != nil {
  74692. return nil, err
  74693. }
  74694. defer googleapi.CloseBody(res)
  74695. if err := googleapi.CheckResponse(res); err != nil {
  74696. return nil, err
  74697. }
  74698. ret := &Operation{
  74699. ServerResponse: googleapi.ServerResponse{
  74700. Header: res.Header,
  74701. HTTPStatusCode: res.StatusCode,
  74702. },
  74703. }
  74704. target := &ret
  74705. if err := gensupport.DecodeResponse(target, res); err != nil {
  74706. return nil, err
  74707. }
  74708. return ret, nil
  74709. // {
  74710. // "description": "Changes the BackendService for TargetSslProxy.",
  74711. // "httpMethod": "POST",
  74712. // "id": "compute.targetSslProxies.setBackendService",
  74713. // "parameterOrder": [
  74714. // "project",
  74715. // "targetSslProxy"
  74716. // ],
  74717. // "parameters": {
  74718. // "project": {
  74719. // "description": "Project ID for this request.",
  74720. // "location": "path",
  74721. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74722. // "required": true,
  74723. // "type": "string"
  74724. // },
  74725. // "requestId": {
  74726. // "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).",
  74727. // "location": "query",
  74728. // "type": "string"
  74729. // },
  74730. // "targetSslProxy": {
  74731. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  74732. // "location": "path",
  74733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74734. // "required": true,
  74735. // "type": "string"
  74736. // }
  74737. // },
  74738. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  74739. // "request": {
  74740. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  74741. // },
  74742. // "response": {
  74743. // "$ref": "Operation"
  74744. // },
  74745. // "scopes": [
  74746. // "https://www.googleapis.com/auth/cloud-platform",
  74747. // "https://www.googleapis.com/auth/compute"
  74748. // ]
  74749. // }
  74750. }
  74751. // method id "compute.targetSslProxies.setProxyHeader":
  74752. type TargetSslProxiesSetProxyHeaderCall struct {
  74753. s *Service
  74754. project string
  74755. targetSslProxy string
  74756. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  74757. urlParams_ gensupport.URLParams
  74758. ctx_ context.Context
  74759. header_ http.Header
  74760. }
  74761. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  74762. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  74763. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74764. c.project = project
  74765. c.targetSslProxy = targetSslProxy
  74766. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  74767. return c
  74768. }
  74769. // RequestId sets the optional parameter "requestId": An optional
  74770. // request ID to identify requests. Specify a unique request ID so that
  74771. // if you must retry your request, the server will know to ignore the
  74772. // request if it has already been completed.
  74773. //
  74774. // For example, consider a situation where you make an initial request
  74775. // and the request times out. If you make the request again with the
  74776. // same request ID, the server can check if original operation with the
  74777. // same request ID was received, and if so, will ignore the second
  74778. // request. This prevents clients from accidentally creating duplicate
  74779. // commitments.
  74780. //
  74781. // The request ID must be a valid UUID with the exception that zero UUID
  74782. // is not supported (00000000-0000-0000-0000-000000000000).
  74783. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  74784. c.urlParams_.Set("requestId", requestId)
  74785. return c
  74786. }
  74787. // Fields allows partial responses to be retrieved. See
  74788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74789. // for more information.
  74790. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  74791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74792. return c
  74793. }
  74794. // Context sets the context to be used in this call's Do method. Any
  74795. // pending HTTP request will be aborted if the provided context is
  74796. // canceled.
  74797. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  74798. c.ctx_ = ctx
  74799. return c
  74800. }
  74801. // Header returns an http.Header that can be modified by the caller to
  74802. // add HTTP headers to the request.
  74803. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  74804. if c.header_ == nil {
  74805. c.header_ = make(http.Header)
  74806. }
  74807. return c.header_
  74808. }
  74809. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  74810. reqHeaders := make(http.Header)
  74811. for k, v := range c.header_ {
  74812. reqHeaders[k] = v
  74813. }
  74814. reqHeaders.Set("User-Agent", c.s.userAgent())
  74815. var body io.Reader = nil
  74816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  74817. if err != nil {
  74818. return nil, err
  74819. }
  74820. reqHeaders.Set("Content-Type", "application/json")
  74821. c.urlParams_.Set("alt", alt)
  74822. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  74823. urls += "?" + c.urlParams_.Encode()
  74824. req, _ := http.NewRequest("POST", urls, body)
  74825. req.Header = reqHeaders
  74826. googleapi.Expand(req.URL, map[string]string{
  74827. "project": c.project,
  74828. "targetSslProxy": c.targetSslProxy,
  74829. })
  74830. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74831. }
  74832. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  74833. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74834. // status code is an error. Response headers are in either
  74835. // *Operation.ServerResponse.Header or (if a response was returned at
  74836. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74837. // to check whether the returned error was because
  74838. // http.StatusNotModified was returned.
  74839. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74840. gensupport.SetOptions(c.urlParams_, opts...)
  74841. res, err := c.doRequest("json")
  74842. if res != nil && res.StatusCode == http.StatusNotModified {
  74843. if res.Body != nil {
  74844. res.Body.Close()
  74845. }
  74846. return nil, &googleapi.Error{
  74847. Code: res.StatusCode,
  74848. Header: res.Header,
  74849. }
  74850. }
  74851. if err != nil {
  74852. return nil, err
  74853. }
  74854. defer googleapi.CloseBody(res)
  74855. if err := googleapi.CheckResponse(res); err != nil {
  74856. return nil, err
  74857. }
  74858. ret := &Operation{
  74859. ServerResponse: googleapi.ServerResponse{
  74860. Header: res.Header,
  74861. HTTPStatusCode: res.StatusCode,
  74862. },
  74863. }
  74864. target := &ret
  74865. if err := gensupport.DecodeResponse(target, res); err != nil {
  74866. return nil, err
  74867. }
  74868. return ret, nil
  74869. // {
  74870. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  74871. // "httpMethod": "POST",
  74872. // "id": "compute.targetSslProxies.setProxyHeader",
  74873. // "parameterOrder": [
  74874. // "project",
  74875. // "targetSslProxy"
  74876. // ],
  74877. // "parameters": {
  74878. // "project": {
  74879. // "description": "Project ID for this request.",
  74880. // "location": "path",
  74881. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74882. // "required": true,
  74883. // "type": "string"
  74884. // },
  74885. // "requestId": {
  74886. // "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).",
  74887. // "location": "query",
  74888. // "type": "string"
  74889. // },
  74890. // "targetSslProxy": {
  74891. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  74892. // "location": "path",
  74893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74894. // "required": true,
  74895. // "type": "string"
  74896. // }
  74897. // },
  74898. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  74899. // "request": {
  74900. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  74901. // },
  74902. // "response": {
  74903. // "$ref": "Operation"
  74904. // },
  74905. // "scopes": [
  74906. // "https://www.googleapis.com/auth/cloud-platform",
  74907. // "https://www.googleapis.com/auth/compute"
  74908. // ]
  74909. // }
  74910. }
  74911. // method id "compute.targetSslProxies.setSslCertificates":
  74912. type TargetSslProxiesSetSslCertificatesCall struct {
  74913. s *Service
  74914. project string
  74915. targetSslProxy string
  74916. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  74917. urlParams_ gensupport.URLParams
  74918. ctx_ context.Context
  74919. header_ http.Header
  74920. }
  74921. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  74922. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  74923. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74924. c.project = project
  74925. c.targetSslProxy = targetSslProxy
  74926. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  74927. return c
  74928. }
  74929. // RequestId sets the optional parameter "requestId": An optional
  74930. // request ID to identify requests. Specify a unique request ID so that
  74931. // if you must retry your request, the server will know to ignore the
  74932. // request if it has already been completed.
  74933. //
  74934. // For example, consider a situation where you make an initial request
  74935. // and the request times out. If you make the request again with the
  74936. // same request ID, the server can check if original operation with the
  74937. // same request ID was received, and if so, will ignore the second
  74938. // request. This prevents clients from accidentally creating duplicate
  74939. // commitments.
  74940. //
  74941. // The request ID must be a valid UUID with the exception that zero UUID
  74942. // is not supported (00000000-0000-0000-0000-000000000000).
  74943. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  74944. c.urlParams_.Set("requestId", requestId)
  74945. return c
  74946. }
  74947. // Fields allows partial responses to be retrieved. See
  74948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74949. // for more information.
  74950. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  74951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74952. return c
  74953. }
  74954. // Context sets the context to be used in this call's Do method. Any
  74955. // pending HTTP request will be aborted if the provided context is
  74956. // canceled.
  74957. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  74958. c.ctx_ = ctx
  74959. return c
  74960. }
  74961. // Header returns an http.Header that can be modified by the caller to
  74962. // add HTTP headers to the request.
  74963. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  74964. if c.header_ == nil {
  74965. c.header_ = make(http.Header)
  74966. }
  74967. return c.header_
  74968. }
  74969. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  74970. reqHeaders := make(http.Header)
  74971. for k, v := range c.header_ {
  74972. reqHeaders[k] = v
  74973. }
  74974. reqHeaders.Set("User-Agent", c.s.userAgent())
  74975. var body io.Reader = nil
  74976. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  74977. if err != nil {
  74978. return nil, err
  74979. }
  74980. reqHeaders.Set("Content-Type", "application/json")
  74981. c.urlParams_.Set("alt", alt)
  74982. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  74983. urls += "?" + c.urlParams_.Encode()
  74984. req, _ := http.NewRequest("POST", urls, body)
  74985. req.Header = reqHeaders
  74986. googleapi.Expand(req.URL, map[string]string{
  74987. "project": c.project,
  74988. "targetSslProxy": c.targetSslProxy,
  74989. })
  74990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74991. }
  74992. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  74993. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74994. // status code is an error. Response headers are in either
  74995. // *Operation.ServerResponse.Header or (if a response was returned at
  74996. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74997. // to check whether the returned error was because
  74998. // http.StatusNotModified was returned.
  74999. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75000. gensupport.SetOptions(c.urlParams_, opts...)
  75001. res, err := c.doRequest("json")
  75002. if res != nil && res.StatusCode == http.StatusNotModified {
  75003. if res.Body != nil {
  75004. res.Body.Close()
  75005. }
  75006. return nil, &googleapi.Error{
  75007. Code: res.StatusCode,
  75008. Header: res.Header,
  75009. }
  75010. }
  75011. if err != nil {
  75012. return nil, err
  75013. }
  75014. defer googleapi.CloseBody(res)
  75015. if err := googleapi.CheckResponse(res); err != nil {
  75016. return nil, err
  75017. }
  75018. ret := &Operation{
  75019. ServerResponse: googleapi.ServerResponse{
  75020. Header: res.Header,
  75021. HTTPStatusCode: res.StatusCode,
  75022. },
  75023. }
  75024. target := &ret
  75025. if err := gensupport.DecodeResponse(target, res); err != nil {
  75026. return nil, err
  75027. }
  75028. return ret, nil
  75029. // {
  75030. // "description": "Changes SslCertificates for TargetSslProxy.",
  75031. // "httpMethod": "POST",
  75032. // "id": "compute.targetSslProxies.setSslCertificates",
  75033. // "parameterOrder": [
  75034. // "project",
  75035. // "targetSslProxy"
  75036. // ],
  75037. // "parameters": {
  75038. // "project": {
  75039. // "description": "Project ID for this request.",
  75040. // "location": "path",
  75041. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75042. // "required": true,
  75043. // "type": "string"
  75044. // },
  75045. // "requestId": {
  75046. // "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).",
  75047. // "location": "query",
  75048. // "type": "string"
  75049. // },
  75050. // "targetSslProxy": {
  75051. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  75052. // "location": "path",
  75053. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75054. // "required": true,
  75055. // "type": "string"
  75056. // }
  75057. // },
  75058. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  75059. // "request": {
  75060. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  75061. // },
  75062. // "response": {
  75063. // "$ref": "Operation"
  75064. // },
  75065. // "scopes": [
  75066. // "https://www.googleapis.com/auth/cloud-platform",
  75067. // "https://www.googleapis.com/auth/compute"
  75068. // ]
  75069. // }
  75070. }
  75071. // method id "compute.targetSslProxies.setSslPolicy":
  75072. type TargetSslProxiesSetSslPolicyCall struct {
  75073. s *Service
  75074. project string
  75075. targetSslProxy string
  75076. sslpolicyreference *SslPolicyReference
  75077. urlParams_ gensupport.URLParams
  75078. ctx_ context.Context
  75079. header_ http.Header
  75080. }
  75081. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  75082. // specifies the server-side support for SSL features. This affects
  75083. // connections between clients and the SSL proxy load balancer. They do
  75084. // not affect the connection between the load balancer and the backends.
  75085. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  75086. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75087. c.project = project
  75088. c.targetSslProxy = targetSslProxy
  75089. c.sslpolicyreference = sslpolicyreference
  75090. return c
  75091. }
  75092. // RequestId sets the optional parameter "requestId": An optional
  75093. // request ID to identify requests. Specify a unique request ID so that
  75094. // if you must retry your request, the server will know to ignore the
  75095. // request if it has already been completed.
  75096. //
  75097. // For example, consider a situation where you make an initial request
  75098. // and the request times out. If you make the request again with the
  75099. // same request ID, the server can check if original operation with the
  75100. // same request ID was received, and if so, will ignore the second
  75101. // request. This prevents clients from accidentally creating duplicate
  75102. // commitments.
  75103. //
  75104. // The request ID must be a valid UUID with the exception that zero UUID
  75105. // is not supported (00000000-0000-0000-0000-000000000000).
  75106. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  75107. c.urlParams_.Set("requestId", requestId)
  75108. return c
  75109. }
  75110. // Fields allows partial responses to be retrieved. See
  75111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75112. // for more information.
  75113. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  75114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75115. return c
  75116. }
  75117. // Context sets the context to be used in this call's Do method. Any
  75118. // pending HTTP request will be aborted if the provided context is
  75119. // canceled.
  75120. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  75121. c.ctx_ = ctx
  75122. return c
  75123. }
  75124. // Header returns an http.Header that can be modified by the caller to
  75125. // add HTTP headers to the request.
  75126. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  75127. if c.header_ == nil {
  75128. c.header_ = make(http.Header)
  75129. }
  75130. return c.header_
  75131. }
  75132. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  75133. reqHeaders := make(http.Header)
  75134. for k, v := range c.header_ {
  75135. reqHeaders[k] = v
  75136. }
  75137. reqHeaders.Set("User-Agent", c.s.userAgent())
  75138. var body io.Reader = nil
  75139. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  75140. if err != nil {
  75141. return nil, err
  75142. }
  75143. reqHeaders.Set("Content-Type", "application/json")
  75144. c.urlParams_.Set("alt", alt)
  75145. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  75146. urls += "?" + c.urlParams_.Encode()
  75147. req, _ := http.NewRequest("POST", urls, body)
  75148. req.Header = reqHeaders
  75149. googleapi.Expand(req.URL, map[string]string{
  75150. "project": c.project,
  75151. "targetSslProxy": c.targetSslProxy,
  75152. })
  75153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75154. }
  75155. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  75156. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75157. // status code is an error. Response headers are in either
  75158. // *Operation.ServerResponse.Header or (if a response was returned at
  75159. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75160. // to check whether the returned error was because
  75161. // http.StatusNotModified was returned.
  75162. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75163. gensupport.SetOptions(c.urlParams_, opts...)
  75164. res, err := c.doRequest("json")
  75165. if res != nil && res.StatusCode == http.StatusNotModified {
  75166. if res.Body != nil {
  75167. res.Body.Close()
  75168. }
  75169. return nil, &googleapi.Error{
  75170. Code: res.StatusCode,
  75171. Header: res.Header,
  75172. }
  75173. }
  75174. if err != nil {
  75175. return nil, err
  75176. }
  75177. defer googleapi.CloseBody(res)
  75178. if err := googleapi.CheckResponse(res); err != nil {
  75179. return nil, err
  75180. }
  75181. ret := &Operation{
  75182. ServerResponse: googleapi.ServerResponse{
  75183. Header: res.Header,
  75184. HTTPStatusCode: res.StatusCode,
  75185. },
  75186. }
  75187. target := &ret
  75188. if err := gensupport.DecodeResponse(target, res); err != nil {
  75189. return nil, err
  75190. }
  75191. return ret, nil
  75192. // {
  75193. // "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.",
  75194. // "httpMethod": "POST",
  75195. // "id": "compute.targetSslProxies.setSslPolicy",
  75196. // "parameterOrder": [
  75197. // "project",
  75198. // "targetSslProxy"
  75199. // ],
  75200. // "parameters": {
  75201. // "project": {
  75202. // "description": "Project ID for this request.",
  75203. // "location": "path",
  75204. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75205. // "required": true,
  75206. // "type": "string"
  75207. // },
  75208. // "requestId": {
  75209. // "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).",
  75210. // "location": "query",
  75211. // "type": "string"
  75212. // },
  75213. // "targetSslProxy": {
  75214. // "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.",
  75215. // "location": "path",
  75216. // "required": true,
  75217. // "type": "string"
  75218. // }
  75219. // },
  75220. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  75221. // "request": {
  75222. // "$ref": "SslPolicyReference"
  75223. // },
  75224. // "response": {
  75225. // "$ref": "Operation"
  75226. // },
  75227. // "scopes": [
  75228. // "https://www.googleapis.com/auth/cloud-platform",
  75229. // "https://www.googleapis.com/auth/compute"
  75230. // ]
  75231. // }
  75232. }
  75233. // method id "compute.targetTcpProxies.delete":
  75234. type TargetTcpProxiesDeleteCall struct {
  75235. s *Service
  75236. project string
  75237. targetTcpProxy string
  75238. urlParams_ gensupport.URLParams
  75239. ctx_ context.Context
  75240. header_ http.Header
  75241. }
  75242. // Delete: Deletes the specified TargetTcpProxy resource.
  75243. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  75244. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75245. c.project = project
  75246. c.targetTcpProxy = targetTcpProxy
  75247. return c
  75248. }
  75249. // RequestId sets the optional parameter "requestId": An optional
  75250. // request ID to identify requests. Specify a unique request ID so that
  75251. // if you must retry your request, the server will know to ignore the
  75252. // request if it has already been completed.
  75253. //
  75254. // For example, consider a situation where you make an initial request
  75255. // and the request times out. If you make the request again with the
  75256. // same request ID, the server can check if original operation with the
  75257. // same request ID was received, and if so, will ignore the second
  75258. // request. This prevents clients from accidentally creating duplicate
  75259. // commitments.
  75260. //
  75261. // The request ID must be a valid UUID with the exception that zero UUID
  75262. // is not supported (00000000-0000-0000-0000-000000000000).
  75263. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  75264. c.urlParams_.Set("requestId", requestId)
  75265. return c
  75266. }
  75267. // Fields allows partial responses to be retrieved. See
  75268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75269. // for more information.
  75270. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  75271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75272. return c
  75273. }
  75274. // Context sets the context to be used in this call's Do method. Any
  75275. // pending HTTP request will be aborted if the provided context is
  75276. // canceled.
  75277. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  75278. c.ctx_ = ctx
  75279. return c
  75280. }
  75281. // Header returns an http.Header that can be modified by the caller to
  75282. // add HTTP headers to the request.
  75283. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  75284. if c.header_ == nil {
  75285. c.header_ = make(http.Header)
  75286. }
  75287. return c.header_
  75288. }
  75289. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  75290. reqHeaders := make(http.Header)
  75291. for k, v := range c.header_ {
  75292. reqHeaders[k] = v
  75293. }
  75294. reqHeaders.Set("User-Agent", c.s.userAgent())
  75295. var body io.Reader = nil
  75296. c.urlParams_.Set("alt", alt)
  75297. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  75298. urls += "?" + c.urlParams_.Encode()
  75299. req, _ := http.NewRequest("DELETE", urls, body)
  75300. req.Header = reqHeaders
  75301. googleapi.Expand(req.URL, map[string]string{
  75302. "project": c.project,
  75303. "targetTcpProxy": c.targetTcpProxy,
  75304. })
  75305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75306. }
  75307. // Do executes the "compute.targetTcpProxies.delete" call.
  75308. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75309. // status code is an error. Response headers are in either
  75310. // *Operation.ServerResponse.Header or (if a response was returned at
  75311. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75312. // to check whether the returned error was because
  75313. // http.StatusNotModified was returned.
  75314. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75315. gensupport.SetOptions(c.urlParams_, opts...)
  75316. res, err := c.doRequest("json")
  75317. if res != nil && res.StatusCode == http.StatusNotModified {
  75318. if res.Body != nil {
  75319. res.Body.Close()
  75320. }
  75321. return nil, &googleapi.Error{
  75322. Code: res.StatusCode,
  75323. Header: res.Header,
  75324. }
  75325. }
  75326. if err != nil {
  75327. return nil, err
  75328. }
  75329. defer googleapi.CloseBody(res)
  75330. if err := googleapi.CheckResponse(res); err != nil {
  75331. return nil, err
  75332. }
  75333. ret := &Operation{
  75334. ServerResponse: googleapi.ServerResponse{
  75335. Header: res.Header,
  75336. HTTPStatusCode: res.StatusCode,
  75337. },
  75338. }
  75339. target := &ret
  75340. if err := gensupport.DecodeResponse(target, res); err != nil {
  75341. return nil, err
  75342. }
  75343. return ret, nil
  75344. // {
  75345. // "description": "Deletes the specified TargetTcpProxy resource.",
  75346. // "httpMethod": "DELETE",
  75347. // "id": "compute.targetTcpProxies.delete",
  75348. // "parameterOrder": [
  75349. // "project",
  75350. // "targetTcpProxy"
  75351. // ],
  75352. // "parameters": {
  75353. // "project": {
  75354. // "description": "Project ID for this request.",
  75355. // "location": "path",
  75356. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75357. // "required": true,
  75358. // "type": "string"
  75359. // },
  75360. // "requestId": {
  75361. // "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).",
  75362. // "location": "query",
  75363. // "type": "string"
  75364. // },
  75365. // "targetTcpProxy": {
  75366. // "description": "Name of the TargetTcpProxy resource to delete.",
  75367. // "location": "path",
  75368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75369. // "required": true,
  75370. // "type": "string"
  75371. // }
  75372. // },
  75373. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  75374. // "response": {
  75375. // "$ref": "Operation"
  75376. // },
  75377. // "scopes": [
  75378. // "https://www.googleapis.com/auth/cloud-platform",
  75379. // "https://www.googleapis.com/auth/compute"
  75380. // ]
  75381. // }
  75382. }
  75383. // method id "compute.targetTcpProxies.get":
  75384. type TargetTcpProxiesGetCall struct {
  75385. s *Service
  75386. project string
  75387. targetTcpProxy string
  75388. urlParams_ gensupport.URLParams
  75389. ifNoneMatch_ string
  75390. ctx_ context.Context
  75391. header_ http.Header
  75392. }
  75393. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  75394. // available target TCP proxies by making a list() request.
  75395. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  75396. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75397. c.project = project
  75398. c.targetTcpProxy = targetTcpProxy
  75399. return c
  75400. }
  75401. // Fields allows partial responses to be retrieved. See
  75402. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75403. // for more information.
  75404. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  75405. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75406. return c
  75407. }
  75408. // IfNoneMatch sets the optional parameter which makes the operation
  75409. // fail if the object's ETag matches the given value. This is useful for
  75410. // getting updates only after the object has changed since the last
  75411. // request. Use googleapi.IsNotModified to check whether the response
  75412. // error from Do is the result of In-None-Match.
  75413. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  75414. c.ifNoneMatch_ = entityTag
  75415. return c
  75416. }
  75417. // Context sets the context to be used in this call's Do method. Any
  75418. // pending HTTP request will be aborted if the provided context is
  75419. // canceled.
  75420. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  75421. c.ctx_ = ctx
  75422. return c
  75423. }
  75424. // Header returns an http.Header that can be modified by the caller to
  75425. // add HTTP headers to the request.
  75426. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  75427. if c.header_ == nil {
  75428. c.header_ = make(http.Header)
  75429. }
  75430. return c.header_
  75431. }
  75432. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  75433. reqHeaders := make(http.Header)
  75434. for k, v := range c.header_ {
  75435. reqHeaders[k] = v
  75436. }
  75437. reqHeaders.Set("User-Agent", c.s.userAgent())
  75438. if c.ifNoneMatch_ != "" {
  75439. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75440. }
  75441. var body io.Reader = nil
  75442. c.urlParams_.Set("alt", alt)
  75443. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  75444. urls += "?" + c.urlParams_.Encode()
  75445. req, _ := http.NewRequest("GET", urls, body)
  75446. req.Header = reqHeaders
  75447. googleapi.Expand(req.URL, map[string]string{
  75448. "project": c.project,
  75449. "targetTcpProxy": c.targetTcpProxy,
  75450. })
  75451. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75452. }
  75453. // Do executes the "compute.targetTcpProxies.get" call.
  75454. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  75455. // status code is an error. Response headers are in either
  75456. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  75457. // at all) in error.(*googleapi.Error).Header. Use
  75458. // googleapi.IsNotModified to check whether the returned error was
  75459. // because http.StatusNotModified was returned.
  75460. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  75461. gensupport.SetOptions(c.urlParams_, opts...)
  75462. res, err := c.doRequest("json")
  75463. if res != nil && res.StatusCode == http.StatusNotModified {
  75464. if res.Body != nil {
  75465. res.Body.Close()
  75466. }
  75467. return nil, &googleapi.Error{
  75468. Code: res.StatusCode,
  75469. Header: res.Header,
  75470. }
  75471. }
  75472. if err != nil {
  75473. return nil, err
  75474. }
  75475. defer googleapi.CloseBody(res)
  75476. if err := googleapi.CheckResponse(res); err != nil {
  75477. return nil, err
  75478. }
  75479. ret := &TargetTcpProxy{
  75480. ServerResponse: googleapi.ServerResponse{
  75481. Header: res.Header,
  75482. HTTPStatusCode: res.StatusCode,
  75483. },
  75484. }
  75485. target := &ret
  75486. if err := gensupport.DecodeResponse(target, res); err != nil {
  75487. return nil, err
  75488. }
  75489. return ret, nil
  75490. // {
  75491. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  75492. // "httpMethod": "GET",
  75493. // "id": "compute.targetTcpProxies.get",
  75494. // "parameterOrder": [
  75495. // "project",
  75496. // "targetTcpProxy"
  75497. // ],
  75498. // "parameters": {
  75499. // "project": {
  75500. // "description": "Project ID for this request.",
  75501. // "location": "path",
  75502. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75503. // "required": true,
  75504. // "type": "string"
  75505. // },
  75506. // "targetTcpProxy": {
  75507. // "description": "Name of the TargetTcpProxy resource to return.",
  75508. // "location": "path",
  75509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75510. // "required": true,
  75511. // "type": "string"
  75512. // }
  75513. // },
  75514. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  75515. // "response": {
  75516. // "$ref": "TargetTcpProxy"
  75517. // },
  75518. // "scopes": [
  75519. // "https://www.googleapis.com/auth/cloud-platform",
  75520. // "https://www.googleapis.com/auth/compute",
  75521. // "https://www.googleapis.com/auth/compute.readonly"
  75522. // ]
  75523. // }
  75524. }
  75525. // method id "compute.targetTcpProxies.insert":
  75526. type TargetTcpProxiesInsertCall struct {
  75527. s *Service
  75528. project string
  75529. targettcpproxy *TargetTcpProxy
  75530. urlParams_ gensupport.URLParams
  75531. ctx_ context.Context
  75532. header_ http.Header
  75533. }
  75534. // Insert: Creates a TargetTcpProxy resource in the specified project
  75535. // using the data included in the request.
  75536. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  75537. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75538. c.project = project
  75539. c.targettcpproxy = targettcpproxy
  75540. return c
  75541. }
  75542. // RequestId sets the optional parameter "requestId": An optional
  75543. // request ID to identify requests. Specify a unique request ID so that
  75544. // if you must retry your request, the server will know to ignore the
  75545. // request if it has already been completed.
  75546. //
  75547. // For example, consider a situation where you make an initial request
  75548. // and the request times out. If you make the request again with the
  75549. // same request ID, the server can check if original operation with the
  75550. // same request ID was received, and if so, will ignore the second
  75551. // request. This prevents clients from accidentally creating duplicate
  75552. // commitments.
  75553. //
  75554. // The request ID must be a valid UUID with the exception that zero UUID
  75555. // is not supported (00000000-0000-0000-0000-000000000000).
  75556. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  75557. c.urlParams_.Set("requestId", requestId)
  75558. return c
  75559. }
  75560. // Fields allows partial responses to be retrieved. See
  75561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75562. // for more information.
  75563. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  75564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75565. return c
  75566. }
  75567. // Context sets the context to be used in this call's Do method. Any
  75568. // pending HTTP request will be aborted if the provided context is
  75569. // canceled.
  75570. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  75571. c.ctx_ = ctx
  75572. return c
  75573. }
  75574. // Header returns an http.Header that can be modified by the caller to
  75575. // add HTTP headers to the request.
  75576. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  75577. if c.header_ == nil {
  75578. c.header_ = make(http.Header)
  75579. }
  75580. return c.header_
  75581. }
  75582. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  75583. reqHeaders := make(http.Header)
  75584. for k, v := range c.header_ {
  75585. reqHeaders[k] = v
  75586. }
  75587. reqHeaders.Set("User-Agent", c.s.userAgent())
  75588. var body io.Reader = nil
  75589. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  75590. if err != nil {
  75591. return nil, err
  75592. }
  75593. reqHeaders.Set("Content-Type", "application/json")
  75594. c.urlParams_.Set("alt", alt)
  75595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  75596. urls += "?" + c.urlParams_.Encode()
  75597. req, _ := http.NewRequest("POST", urls, body)
  75598. req.Header = reqHeaders
  75599. googleapi.Expand(req.URL, map[string]string{
  75600. "project": c.project,
  75601. })
  75602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75603. }
  75604. // Do executes the "compute.targetTcpProxies.insert" call.
  75605. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75606. // status code is an error. Response headers are in either
  75607. // *Operation.ServerResponse.Header or (if a response was returned at
  75608. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75609. // to check whether the returned error was because
  75610. // http.StatusNotModified was returned.
  75611. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75612. gensupport.SetOptions(c.urlParams_, opts...)
  75613. res, err := c.doRequest("json")
  75614. if res != nil && res.StatusCode == http.StatusNotModified {
  75615. if res.Body != nil {
  75616. res.Body.Close()
  75617. }
  75618. return nil, &googleapi.Error{
  75619. Code: res.StatusCode,
  75620. Header: res.Header,
  75621. }
  75622. }
  75623. if err != nil {
  75624. return nil, err
  75625. }
  75626. defer googleapi.CloseBody(res)
  75627. if err := googleapi.CheckResponse(res); err != nil {
  75628. return nil, err
  75629. }
  75630. ret := &Operation{
  75631. ServerResponse: googleapi.ServerResponse{
  75632. Header: res.Header,
  75633. HTTPStatusCode: res.StatusCode,
  75634. },
  75635. }
  75636. target := &ret
  75637. if err := gensupport.DecodeResponse(target, res); err != nil {
  75638. return nil, err
  75639. }
  75640. return ret, nil
  75641. // {
  75642. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  75643. // "httpMethod": "POST",
  75644. // "id": "compute.targetTcpProxies.insert",
  75645. // "parameterOrder": [
  75646. // "project"
  75647. // ],
  75648. // "parameters": {
  75649. // "project": {
  75650. // "description": "Project ID for this request.",
  75651. // "location": "path",
  75652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75653. // "required": true,
  75654. // "type": "string"
  75655. // },
  75656. // "requestId": {
  75657. // "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).",
  75658. // "location": "query",
  75659. // "type": "string"
  75660. // }
  75661. // },
  75662. // "path": "{project}/global/targetTcpProxies",
  75663. // "request": {
  75664. // "$ref": "TargetTcpProxy"
  75665. // },
  75666. // "response": {
  75667. // "$ref": "Operation"
  75668. // },
  75669. // "scopes": [
  75670. // "https://www.googleapis.com/auth/cloud-platform",
  75671. // "https://www.googleapis.com/auth/compute"
  75672. // ]
  75673. // }
  75674. }
  75675. // method id "compute.targetTcpProxies.list":
  75676. type TargetTcpProxiesListCall struct {
  75677. s *Service
  75678. project string
  75679. urlParams_ gensupport.URLParams
  75680. ifNoneMatch_ string
  75681. ctx_ context.Context
  75682. header_ http.Header
  75683. }
  75684. // List: Retrieves the list of TargetTcpProxy resources available to the
  75685. // specified project.
  75686. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  75687. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75688. c.project = project
  75689. return c
  75690. }
  75691. // Filter sets the optional parameter "filter": A filter expression that
  75692. // filters resources listed in the response. The expression must specify
  75693. // the field name, a comparison operator, and the value that you want to
  75694. // use for filtering. The value must be a string, a number, or a
  75695. // boolean. The comparison operator must be either =, !=, >, or <.
  75696. //
  75697. // For example, if you are filtering Compute Engine instances, you can
  75698. // exclude instances named example-instance by specifying name !=
  75699. // example-instance.
  75700. //
  75701. // You can also filter nested fields. For example, you could specify
  75702. // scheduling.automaticRestart = false to include instances only if they
  75703. // are not scheduled for automatic restarts. You can use filtering on
  75704. // nested fields to filter based on resource labels.
  75705. //
  75706. // To filter on multiple expressions, provide each separate expression
  75707. // within parentheses. For example, (scheduling.automaticRestart = true)
  75708. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75709. // AND expression. However, you can include AND and OR expressions
  75710. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75711. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75712. // true).
  75713. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  75714. c.urlParams_.Set("filter", filter)
  75715. return c
  75716. }
  75717. // MaxResults sets the optional parameter "maxResults": The maximum
  75718. // number of results per page that should be returned. If the number of
  75719. // available results is larger than maxResults, Compute Engine returns a
  75720. // nextPageToken that can be used to get the next page of results in
  75721. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75722. // (Default: 500)
  75723. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  75724. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75725. return c
  75726. }
  75727. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75728. // a certain order. By default, results are returned in alphanumerical
  75729. // order based on the resource name.
  75730. //
  75731. // You can also sort results in descending order based on the creation
  75732. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75733. // based on the creationTimestamp field in reverse chronological order
  75734. // (newest result first). Use this to sort resources like operations so
  75735. // that the newest operation is returned first.
  75736. //
  75737. // Currently, only sorting by name or creationTimestamp desc is
  75738. // supported.
  75739. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  75740. c.urlParams_.Set("orderBy", orderBy)
  75741. return c
  75742. }
  75743. // PageToken sets the optional parameter "pageToken": Specifies a page
  75744. // token to use. Set pageToken to the nextPageToken returned by a
  75745. // previous list request to get the next page of results.
  75746. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  75747. c.urlParams_.Set("pageToken", pageToken)
  75748. return c
  75749. }
  75750. // Fields allows partial responses to be retrieved. See
  75751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75752. // for more information.
  75753. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  75754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75755. return c
  75756. }
  75757. // IfNoneMatch sets the optional parameter which makes the operation
  75758. // fail if the object's ETag matches the given value. This is useful for
  75759. // getting updates only after the object has changed since the last
  75760. // request. Use googleapi.IsNotModified to check whether the response
  75761. // error from Do is the result of In-None-Match.
  75762. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  75763. c.ifNoneMatch_ = entityTag
  75764. return c
  75765. }
  75766. // Context sets the context to be used in this call's Do method. Any
  75767. // pending HTTP request will be aborted if the provided context is
  75768. // canceled.
  75769. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  75770. c.ctx_ = ctx
  75771. return c
  75772. }
  75773. // Header returns an http.Header that can be modified by the caller to
  75774. // add HTTP headers to the request.
  75775. func (c *TargetTcpProxiesListCall) Header() http.Header {
  75776. if c.header_ == nil {
  75777. c.header_ = make(http.Header)
  75778. }
  75779. return c.header_
  75780. }
  75781. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  75782. reqHeaders := make(http.Header)
  75783. for k, v := range c.header_ {
  75784. reqHeaders[k] = v
  75785. }
  75786. reqHeaders.Set("User-Agent", c.s.userAgent())
  75787. if c.ifNoneMatch_ != "" {
  75788. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75789. }
  75790. var body io.Reader = nil
  75791. c.urlParams_.Set("alt", alt)
  75792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  75793. urls += "?" + c.urlParams_.Encode()
  75794. req, _ := http.NewRequest("GET", urls, body)
  75795. req.Header = reqHeaders
  75796. googleapi.Expand(req.URL, map[string]string{
  75797. "project": c.project,
  75798. })
  75799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75800. }
  75801. // Do executes the "compute.targetTcpProxies.list" call.
  75802. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  75803. // non-2xx status code is an error. Response headers are in either
  75804. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  75805. // returned at all) in error.(*googleapi.Error).Header. Use
  75806. // googleapi.IsNotModified to check whether the returned error was
  75807. // because http.StatusNotModified was returned.
  75808. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  75809. gensupport.SetOptions(c.urlParams_, opts...)
  75810. res, err := c.doRequest("json")
  75811. if res != nil && res.StatusCode == http.StatusNotModified {
  75812. if res.Body != nil {
  75813. res.Body.Close()
  75814. }
  75815. return nil, &googleapi.Error{
  75816. Code: res.StatusCode,
  75817. Header: res.Header,
  75818. }
  75819. }
  75820. if err != nil {
  75821. return nil, err
  75822. }
  75823. defer googleapi.CloseBody(res)
  75824. if err := googleapi.CheckResponse(res); err != nil {
  75825. return nil, err
  75826. }
  75827. ret := &TargetTcpProxyList{
  75828. ServerResponse: googleapi.ServerResponse{
  75829. Header: res.Header,
  75830. HTTPStatusCode: res.StatusCode,
  75831. },
  75832. }
  75833. target := &ret
  75834. if err := gensupport.DecodeResponse(target, res); err != nil {
  75835. return nil, err
  75836. }
  75837. return ret, nil
  75838. // {
  75839. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  75840. // "httpMethod": "GET",
  75841. // "id": "compute.targetTcpProxies.list",
  75842. // "parameterOrder": [
  75843. // "project"
  75844. // ],
  75845. // "parameters": {
  75846. // "filter": {
  75847. // "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).",
  75848. // "location": "query",
  75849. // "type": "string"
  75850. // },
  75851. // "maxResults": {
  75852. // "default": "500",
  75853. // "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)",
  75854. // "format": "uint32",
  75855. // "location": "query",
  75856. // "minimum": "0",
  75857. // "type": "integer"
  75858. // },
  75859. // "orderBy": {
  75860. // "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.",
  75861. // "location": "query",
  75862. // "type": "string"
  75863. // },
  75864. // "pageToken": {
  75865. // "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.",
  75866. // "location": "query",
  75867. // "type": "string"
  75868. // },
  75869. // "project": {
  75870. // "description": "Project ID for this request.",
  75871. // "location": "path",
  75872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75873. // "required": true,
  75874. // "type": "string"
  75875. // }
  75876. // },
  75877. // "path": "{project}/global/targetTcpProxies",
  75878. // "response": {
  75879. // "$ref": "TargetTcpProxyList"
  75880. // },
  75881. // "scopes": [
  75882. // "https://www.googleapis.com/auth/cloud-platform",
  75883. // "https://www.googleapis.com/auth/compute",
  75884. // "https://www.googleapis.com/auth/compute.readonly"
  75885. // ]
  75886. // }
  75887. }
  75888. // Pages invokes f for each page of results.
  75889. // A non-nil error returned from f will halt the iteration.
  75890. // The provided context supersedes any context provided to the Context method.
  75891. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  75892. c.ctx_ = ctx
  75893. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75894. for {
  75895. x, err := c.Do()
  75896. if err != nil {
  75897. return err
  75898. }
  75899. if err := f(x); err != nil {
  75900. return err
  75901. }
  75902. if x.NextPageToken == "" {
  75903. return nil
  75904. }
  75905. c.PageToken(x.NextPageToken)
  75906. }
  75907. }
  75908. // method id "compute.targetTcpProxies.setBackendService":
  75909. type TargetTcpProxiesSetBackendServiceCall struct {
  75910. s *Service
  75911. project string
  75912. targetTcpProxy string
  75913. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  75914. urlParams_ gensupport.URLParams
  75915. ctx_ context.Context
  75916. header_ http.Header
  75917. }
  75918. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  75919. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  75920. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75921. c.project = project
  75922. c.targetTcpProxy = targetTcpProxy
  75923. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  75924. return c
  75925. }
  75926. // RequestId sets the optional parameter "requestId": An optional
  75927. // request ID to identify requests. Specify a unique request ID so that
  75928. // if you must retry your request, the server will know to ignore the
  75929. // request if it has already been completed.
  75930. //
  75931. // For example, consider a situation where you make an initial request
  75932. // and the request times out. If you make the request again with the
  75933. // same request ID, the server can check if original operation with the
  75934. // same request ID was received, and if so, will ignore the second
  75935. // request. This prevents clients from accidentally creating duplicate
  75936. // commitments.
  75937. //
  75938. // The request ID must be a valid UUID with the exception that zero UUID
  75939. // is not supported (00000000-0000-0000-0000-000000000000).
  75940. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  75941. c.urlParams_.Set("requestId", requestId)
  75942. return c
  75943. }
  75944. // Fields allows partial responses to be retrieved. See
  75945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75946. // for more information.
  75947. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  75948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75949. return c
  75950. }
  75951. // Context sets the context to be used in this call's Do method. Any
  75952. // pending HTTP request will be aborted if the provided context is
  75953. // canceled.
  75954. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  75955. c.ctx_ = ctx
  75956. return c
  75957. }
  75958. // Header returns an http.Header that can be modified by the caller to
  75959. // add HTTP headers to the request.
  75960. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  75961. if c.header_ == nil {
  75962. c.header_ = make(http.Header)
  75963. }
  75964. return c.header_
  75965. }
  75966. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  75967. reqHeaders := make(http.Header)
  75968. for k, v := range c.header_ {
  75969. reqHeaders[k] = v
  75970. }
  75971. reqHeaders.Set("User-Agent", c.s.userAgent())
  75972. var body io.Reader = nil
  75973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  75974. if err != nil {
  75975. return nil, err
  75976. }
  75977. reqHeaders.Set("Content-Type", "application/json")
  75978. c.urlParams_.Set("alt", alt)
  75979. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  75980. urls += "?" + c.urlParams_.Encode()
  75981. req, _ := http.NewRequest("POST", urls, body)
  75982. req.Header = reqHeaders
  75983. googleapi.Expand(req.URL, map[string]string{
  75984. "project": c.project,
  75985. "targetTcpProxy": c.targetTcpProxy,
  75986. })
  75987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75988. }
  75989. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  75990. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75991. // status code is an error. Response headers are in either
  75992. // *Operation.ServerResponse.Header or (if a response was returned at
  75993. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75994. // to check whether the returned error was because
  75995. // http.StatusNotModified was returned.
  75996. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75997. gensupport.SetOptions(c.urlParams_, opts...)
  75998. res, err := c.doRequest("json")
  75999. if res != nil && res.StatusCode == http.StatusNotModified {
  76000. if res.Body != nil {
  76001. res.Body.Close()
  76002. }
  76003. return nil, &googleapi.Error{
  76004. Code: res.StatusCode,
  76005. Header: res.Header,
  76006. }
  76007. }
  76008. if err != nil {
  76009. return nil, err
  76010. }
  76011. defer googleapi.CloseBody(res)
  76012. if err := googleapi.CheckResponse(res); err != nil {
  76013. return nil, err
  76014. }
  76015. ret := &Operation{
  76016. ServerResponse: googleapi.ServerResponse{
  76017. Header: res.Header,
  76018. HTTPStatusCode: res.StatusCode,
  76019. },
  76020. }
  76021. target := &ret
  76022. if err := gensupport.DecodeResponse(target, res); err != nil {
  76023. return nil, err
  76024. }
  76025. return ret, nil
  76026. // {
  76027. // "description": "Changes the BackendService for TargetTcpProxy.",
  76028. // "httpMethod": "POST",
  76029. // "id": "compute.targetTcpProxies.setBackendService",
  76030. // "parameterOrder": [
  76031. // "project",
  76032. // "targetTcpProxy"
  76033. // ],
  76034. // "parameters": {
  76035. // "project": {
  76036. // "description": "Project ID for this request.",
  76037. // "location": "path",
  76038. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76039. // "required": true,
  76040. // "type": "string"
  76041. // },
  76042. // "requestId": {
  76043. // "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).",
  76044. // "location": "query",
  76045. // "type": "string"
  76046. // },
  76047. // "targetTcpProxy": {
  76048. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  76049. // "location": "path",
  76050. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76051. // "required": true,
  76052. // "type": "string"
  76053. // }
  76054. // },
  76055. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  76056. // "request": {
  76057. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  76058. // },
  76059. // "response": {
  76060. // "$ref": "Operation"
  76061. // },
  76062. // "scopes": [
  76063. // "https://www.googleapis.com/auth/cloud-platform",
  76064. // "https://www.googleapis.com/auth/compute"
  76065. // ]
  76066. // }
  76067. }
  76068. // method id "compute.targetTcpProxies.setProxyHeader":
  76069. type TargetTcpProxiesSetProxyHeaderCall struct {
  76070. s *Service
  76071. project string
  76072. targetTcpProxy string
  76073. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  76074. urlParams_ gensupport.URLParams
  76075. ctx_ context.Context
  76076. header_ http.Header
  76077. }
  76078. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  76079. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  76080. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76081. c.project = project
  76082. c.targetTcpProxy = targetTcpProxy
  76083. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  76084. return c
  76085. }
  76086. // RequestId sets the optional parameter "requestId": An optional
  76087. // request ID to identify requests. Specify a unique request ID so that
  76088. // if you must retry your request, the server will know to ignore the
  76089. // request if it has already been completed.
  76090. //
  76091. // For example, consider a situation where you make an initial request
  76092. // and the request times out. If you make the request again with the
  76093. // same request ID, the server can check if original operation with the
  76094. // same request ID was received, and if so, will ignore the second
  76095. // request. This prevents clients from accidentally creating duplicate
  76096. // commitments.
  76097. //
  76098. // The request ID must be a valid UUID with the exception that zero UUID
  76099. // is not supported (00000000-0000-0000-0000-000000000000).
  76100. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  76101. c.urlParams_.Set("requestId", requestId)
  76102. return c
  76103. }
  76104. // Fields allows partial responses to be retrieved. See
  76105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76106. // for more information.
  76107. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  76108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76109. return c
  76110. }
  76111. // Context sets the context to be used in this call's Do method. Any
  76112. // pending HTTP request will be aborted if the provided context is
  76113. // canceled.
  76114. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  76115. c.ctx_ = ctx
  76116. return c
  76117. }
  76118. // Header returns an http.Header that can be modified by the caller to
  76119. // add HTTP headers to the request.
  76120. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  76121. if c.header_ == nil {
  76122. c.header_ = make(http.Header)
  76123. }
  76124. return c.header_
  76125. }
  76126. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  76127. reqHeaders := make(http.Header)
  76128. for k, v := range c.header_ {
  76129. reqHeaders[k] = v
  76130. }
  76131. reqHeaders.Set("User-Agent", c.s.userAgent())
  76132. var body io.Reader = nil
  76133. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  76134. if err != nil {
  76135. return nil, err
  76136. }
  76137. reqHeaders.Set("Content-Type", "application/json")
  76138. c.urlParams_.Set("alt", alt)
  76139. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  76140. urls += "?" + c.urlParams_.Encode()
  76141. req, _ := http.NewRequest("POST", urls, body)
  76142. req.Header = reqHeaders
  76143. googleapi.Expand(req.URL, map[string]string{
  76144. "project": c.project,
  76145. "targetTcpProxy": c.targetTcpProxy,
  76146. })
  76147. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76148. }
  76149. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  76150. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76151. // status code is an error. Response headers are in either
  76152. // *Operation.ServerResponse.Header or (if a response was returned at
  76153. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76154. // to check whether the returned error was because
  76155. // http.StatusNotModified was returned.
  76156. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76157. gensupport.SetOptions(c.urlParams_, opts...)
  76158. res, err := c.doRequest("json")
  76159. if res != nil && res.StatusCode == http.StatusNotModified {
  76160. if res.Body != nil {
  76161. res.Body.Close()
  76162. }
  76163. return nil, &googleapi.Error{
  76164. Code: res.StatusCode,
  76165. Header: res.Header,
  76166. }
  76167. }
  76168. if err != nil {
  76169. return nil, err
  76170. }
  76171. defer googleapi.CloseBody(res)
  76172. if err := googleapi.CheckResponse(res); err != nil {
  76173. return nil, err
  76174. }
  76175. ret := &Operation{
  76176. ServerResponse: googleapi.ServerResponse{
  76177. Header: res.Header,
  76178. HTTPStatusCode: res.StatusCode,
  76179. },
  76180. }
  76181. target := &ret
  76182. if err := gensupport.DecodeResponse(target, res); err != nil {
  76183. return nil, err
  76184. }
  76185. return ret, nil
  76186. // {
  76187. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  76188. // "httpMethod": "POST",
  76189. // "id": "compute.targetTcpProxies.setProxyHeader",
  76190. // "parameterOrder": [
  76191. // "project",
  76192. // "targetTcpProxy"
  76193. // ],
  76194. // "parameters": {
  76195. // "project": {
  76196. // "description": "Project ID for this request.",
  76197. // "location": "path",
  76198. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76199. // "required": true,
  76200. // "type": "string"
  76201. // },
  76202. // "requestId": {
  76203. // "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).",
  76204. // "location": "query",
  76205. // "type": "string"
  76206. // },
  76207. // "targetTcpProxy": {
  76208. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  76209. // "location": "path",
  76210. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76211. // "required": true,
  76212. // "type": "string"
  76213. // }
  76214. // },
  76215. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  76216. // "request": {
  76217. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  76218. // },
  76219. // "response": {
  76220. // "$ref": "Operation"
  76221. // },
  76222. // "scopes": [
  76223. // "https://www.googleapis.com/auth/cloud-platform",
  76224. // "https://www.googleapis.com/auth/compute"
  76225. // ]
  76226. // }
  76227. }
  76228. // method id "compute.targetVpnGateways.aggregatedList":
  76229. type TargetVpnGatewaysAggregatedListCall struct {
  76230. s *Service
  76231. project string
  76232. urlParams_ gensupport.URLParams
  76233. ifNoneMatch_ string
  76234. ctx_ context.Context
  76235. header_ http.Header
  76236. }
  76237. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  76238. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  76239. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76240. c.project = project
  76241. return c
  76242. }
  76243. // Filter sets the optional parameter "filter": A filter expression that
  76244. // filters resources listed in the response. The expression must specify
  76245. // the field name, a comparison operator, and the value that you want to
  76246. // use for filtering. The value must be a string, a number, or a
  76247. // boolean. The comparison operator must be either =, !=, >, or <.
  76248. //
  76249. // For example, if you are filtering Compute Engine instances, you can
  76250. // exclude instances named example-instance by specifying name !=
  76251. // example-instance.
  76252. //
  76253. // You can also filter nested fields. For example, you could specify
  76254. // scheduling.automaticRestart = false to include instances only if they
  76255. // are not scheduled for automatic restarts. You can use filtering on
  76256. // nested fields to filter based on resource labels.
  76257. //
  76258. // To filter on multiple expressions, provide each separate expression
  76259. // within parentheses. For example, (scheduling.automaticRestart = true)
  76260. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76261. // AND expression. However, you can include AND and OR expressions
  76262. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76263. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76264. // true).
  76265. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  76266. c.urlParams_.Set("filter", filter)
  76267. return c
  76268. }
  76269. // MaxResults sets the optional parameter "maxResults": The maximum
  76270. // number of results per page that should be returned. If the number of
  76271. // available results is larger than maxResults, Compute Engine returns a
  76272. // nextPageToken that can be used to get the next page of results in
  76273. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76274. // (Default: 500)
  76275. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  76276. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76277. return c
  76278. }
  76279. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76280. // a certain order. By default, results are returned in alphanumerical
  76281. // order based on the resource name.
  76282. //
  76283. // You can also sort results in descending order based on the creation
  76284. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76285. // based on the creationTimestamp field in reverse chronological order
  76286. // (newest result first). Use this to sort resources like operations so
  76287. // that the newest operation is returned first.
  76288. //
  76289. // Currently, only sorting by name or creationTimestamp desc is
  76290. // supported.
  76291. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  76292. c.urlParams_.Set("orderBy", orderBy)
  76293. return c
  76294. }
  76295. // PageToken sets the optional parameter "pageToken": Specifies a page
  76296. // token to use. Set pageToken to the nextPageToken returned by a
  76297. // previous list request to get the next page of results.
  76298. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  76299. c.urlParams_.Set("pageToken", pageToken)
  76300. return c
  76301. }
  76302. // Fields allows partial responses to be retrieved. See
  76303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76304. // for more information.
  76305. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  76306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76307. return c
  76308. }
  76309. // IfNoneMatch sets the optional parameter which makes the operation
  76310. // fail if the object's ETag matches the given value. This is useful for
  76311. // getting updates only after the object has changed since the last
  76312. // request. Use googleapi.IsNotModified to check whether the response
  76313. // error from Do is the result of In-None-Match.
  76314. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  76315. c.ifNoneMatch_ = entityTag
  76316. return c
  76317. }
  76318. // Context sets the context to be used in this call's Do method. Any
  76319. // pending HTTP request will be aborted if the provided context is
  76320. // canceled.
  76321. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  76322. c.ctx_ = ctx
  76323. return c
  76324. }
  76325. // Header returns an http.Header that can be modified by the caller to
  76326. // add HTTP headers to the request.
  76327. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  76328. if c.header_ == nil {
  76329. c.header_ = make(http.Header)
  76330. }
  76331. return c.header_
  76332. }
  76333. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  76334. reqHeaders := make(http.Header)
  76335. for k, v := range c.header_ {
  76336. reqHeaders[k] = v
  76337. }
  76338. reqHeaders.Set("User-Agent", c.s.userAgent())
  76339. if c.ifNoneMatch_ != "" {
  76340. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76341. }
  76342. var body io.Reader = nil
  76343. c.urlParams_.Set("alt", alt)
  76344. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  76345. urls += "?" + c.urlParams_.Encode()
  76346. req, _ := http.NewRequest("GET", urls, body)
  76347. req.Header = reqHeaders
  76348. googleapi.Expand(req.URL, map[string]string{
  76349. "project": c.project,
  76350. })
  76351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76352. }
  76353. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  76354. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  76355. // non-nil. Any non-2xx status code is an error. Response headers are in
  76356. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  76357. // response was returned at all) in error.(*googleapi.Error).Header. Use
  76358. // googleapi.IsNotModified to check whether the returned error was
  76359. // because http.StatusNotModified was returned.
  76360. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  76361. gensupport.SetOptions(c.urlParams_, opts...)
  76362. res, err := c.doRequest("json")
  76363. if res != nil && res.StatusCode == http.StatusNotModified {
  76364. if res.Body != nil {
  76365. res.Body.Close()
  76366. }
  76367. return nil, &googleapi.Error{
  76368. Code: res.StatusCode,
  76369. Header: res.Header,
  76370. }
  76371. }
  76372. if err != nil {
  76373. return nil, err
  76374. }
  76375. defer googleapi.CloseBody(res)
  76376. if err := googleapi.CheckResponse(res); err != nil {
  76377. return nil, err
  76378. }
  76379. ret := &TargetVpnGatewayAggregatedList{
  76380. ServerResponse: googleapi.ServerResponse{
  76381. Header: res.Header,
  76382. HTTPStatusCode: res.StatusCode,
  76383. },
  76384. }
  76385. target := &ret
  76386. if err := gensupport.DecodeResponse(target, res); err != nil {
  76387. return nil, err
  76388. }
  76389. return ret, nil
  76390. // {
  76391. // "description": "Retrieves an aggregated list of target VPN gateways.",
  76392. // "httpMethod": "GET",
  76393. // "id": "compute.targetVpnGateways.aggregatedList",
  76394. // "parameterOrder": [
  76395. // "project"
  76396. // ],
  76397. // "parameters": {
  76398. // "filter": {
  76399. // "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).",
  76400. // "location": "query",
  76401. // "type": "string"
  76402. // },
  76403. // "maxResults": {
  76404. // "default": "500",
  76405. // "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)",
  76406. // "format": "uint32",
  76407. // "location": "query",
  76408. // "minimum": "0",
  76409. // "type": "integer"
  76410. // },
  76411. // "orderBy": {
  76412. // "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.",
  76413. // "location": "query",
  76414. // "type": "string"
  76415. // },
  76416. // "pageToken": {
  76417. // "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.",
  76418. // "location": "query",
  76419. // "type": "string"
  76420. // },
  76421. // "project": {
  76422. // "description": "Project ID for this request.",
  76423. // "location": "path",
  76424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76425. // "required": true,
  76426. // "type": "string"
  76427. // }
  76428. // },
  76429. // "path": "{project}/aggregated/targetVpnGateways",
  76430. // "response": {
  76431. // "$ref": "TargetVpnGatewayAggregatedList"
  76432. // },
  76433. // "scopes": [
  76434. // "https://www.googleapis.com/auth/cloud-platform",
  76435. // "https://www.googleapis.com/auth/compute",
  76436. // "https://www.googleapis.com/auth/compute.readonly"
  76437. // ]
  76438. // }
  76439. }
  76440. // Pages invokes f for each page of results.
  76441. // A non-nil error returned from f will halt the iteration.
  76442. // The provided context supersedes any context provided to the Context method.
  76443. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  76444. c.ctx_ = ctx
  76445. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76446. for {
  76447. x, err := c.Do()
  76448. if err != nil {
  76449. return err
  76450. }
  76451. if err := f(x); err != nil {
  76452. return err
  76453. }
  76454. if x.NextPageToken == "" {
  76455. return nil
  76456. }
  76457. c.PageToken(x.NextPageToken)
  76458. }
  76459. }
  76460. // method id "compute.targetVpnGateways.delete":
  76461. type TargetVpnGatewaysDeleteCall struct {
  76462. s *Service
  76463. project string
  76464. region string
  76465. targetVpnGateway string
  76466. urlParams_ gensupport.URLParams
  76467. ctx_ context.Context
  76468. header_ http.Header
  76469. }
  76470. // Delete: Deletes the specified target VPN gateway.
  76471. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  76472. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76473. c.project = project
  76474. c.region = region
  76475. c.targetVpnGateway = targetVpnGateway
  76476. return c
  76477. }
  76478. // RequestId sets the optional parameter "requestId": An optional
  76479. // request ID to identify requests. Specify a unique request ID so that
  76480. // if you must retry your request, the server will know to ignore the
  76481. // request if it has already been completed.
  76482. //
  76483. // For example, consider a situation where you make an initial request
  76484. // and the request times out. If you make the request again with the
  76485. // same request ID, the server can check if original operation with the
  76486. // same request ID was received, and if so, will ignore the second
  76487. // request. This prevents clients from accidentally creating duplicate
  76488. // commitments.
  76489. //
  76490. // The request ID must be a valid UUID with the exception that zero UUID
  76491. // is not supported (00000000-0000-0000-0000-000000000000).
  76492. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  76493. c.urlParams_.Set("requestId", requestId)
  76494. return c
  76495. }
  76496. // Fields allows partial responses to be retrieved. See
  76497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76498. // for more information.
  76499. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  76500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76501. return c
  76502. }
  76503. // Context sets the context to be used in this call's Do method. Any
  76504. // pending HTTP request will be aborted if the provided context is
  76505. // canceled.
  76506. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  76507. c.ctx_ = ctx
  76508. return c
  76509. }
  76510. // Header returns an http.Header that can be modified by the caller to
  76511. // add HTTP headers to the request.
  76512. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  76513. if c.header_ == nil {
  76514. c.header_ = make(http.Header)
  76515. }
  76516. return c.header_
  76517. }
  76518. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  76519. reqHeaders := make(http.Header)
  76520. for k, v := range c.header_ {
  76521. reqHeaders[k] = v
  76522. }
  76523. reqHeaders.Set("User-Agent", c.s.userAgent())
  76524. var body io.Reader = nil
  76525. c.urlParams_.Set("alt", alt)
  76526. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  76527. urls += "?" + c.urlParams_.Encode()
  76528. req, _ := http.NewRequest("DELETE", urls, body)
  76529. req.Header = reqHeaders
  76530. googleapi.Expand(req.URL, map[string]string{
  76531. "project": c.project,
  76532. "region": c.region,
  76533. "targetVpnGateway": c.targetVpnGateway,
  76534. })
  76535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76536. }
  76537. // Do executes the "compute.targetVpnGateways.delete" call.
  76538. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76539. // status code is an error. Response headers are in either
  76540. // *Operation.ServerResponse.Header or (if a response was returned at
  76541. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76542. // to check whether the returned error was because
  76543. // http.StatusNotModified was returned.
  76544. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76545. gensupport.SetOptions(c.urlParams_, opts...)
  76546. res, err := c.doRequest("json")
  76547. if res != nil && res.StatusCode == http.StatusNotModified {
  76548. if res.Body != nil {
  76549. res.Body.Close()
  76550. }
  76551. return nil, &googleapi.Error{
  76552. Code: res.StatusCode,
  76553. Header: res.Header,
  76554. }
  76555. }
  76556. if err != nil {
  76557. return nil, err
  76558. }
  76559. defer googleapi.CloseBody(res)
  76560. if err := googleapi.CheckResponse(res); err != nil {
  76561. return nil, err
  76562. }
  76563. ret := &Operation{
  76564. ServerResponse: googleapi.ServerResponse{
  76565. Header: res.Header,
  76566. HTTPStatusCode: res.StatusCode,
  76567. },
  76568. }
  76569. target := &ret
  76570. if err := gensupport.DecodeResponse(target, res); err != nil {
  76571. return nil, err
  76572. }
  76573. return ret, nil
  76574. // {
  76575. // "description": "Deletes the specified target VPN gateway.",
  76576. // "httpMethod": "DELETE",
  76577. // "id": "compute.targetVpnGateways.delete",
  76578. // "parameterOrder": [
  76579. // "project",
  76580. // "region",
  76581. // "targetVpnGateway"
  76582. // ],
  76583. // "parameters": {
  76584. // "project": {
  76585. // "description": "Project ID for this request.",
  76586. // "location": "path",
  76587. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76588. // "required": true,
  76589. // "type": "string"
  76590. // },
  76591. // "region": {
  76592. // "description": "Name of the region for this request.",
  76593. // "location": "path",
  76594. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76595. // "required": true,
  76596. // "type": "string"
  76597. // },
  76598. // "requestId": {
  76599. // "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).",
  76600. // "location": "query",
  76601. // "type": "string"
  76602. // },
  76603. // "targetVpnGateway": {
  76604. // "description": "Name of the target VPN gateway to delete.",
  76605. // "location": "path",
  76606. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76607. // "required": true,
  76608. // "type": "string"
  76609. // }
  76610. // },
  76611. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  76612. // "response": {
  76613. // "$ref": "Operation"
  76614. // },
  76615. // "scopes": [
  76616. // "https://www.googleapis.com/auth/cloud-platform",
  76617. // "https://www.googleapis.com/auth/compute"
  76618. // ]
  76619. // }
  76620. }
  76621. // method id "compute.targetVpnGateways.get":
  76622. type TargetVpnGatewaysGetCall struct {
  76623. s *Service
  76624. project string
  76625. region string
  76626. targetVpnGateway string
  76627. urlParams_ gensupport.URLParams
  76628. ifNoneMatch_ string
  76629. ctx_ context.Context
  76630. header_ http.Header
  76631. }
  76632. // Get: Returns the specified target VPN gateway. Gets a list of
  76633. // available target VPN gateways by making a list() request.
  76634. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  76635. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76636. c.project = project
  76637. c.region = region
  76638. c.targetVpnGateway = targetVpnGateway
  76639. return c
  76640. }
  76641. // Fields allows partial responses to be retrieved. See
  76642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76643. // for more information.
  76644. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  76645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76646. return c
  76647. }
  76648. // IfNoneMatch sets the optional parameter which makes the operation
  76649. // fail if the object's ETag matches the given value. This is useful for
  76650. // getting updates only after the object has changed since the last
  76651. // request. Use googleapi.IsNotModified to check whether the response
  76652. // error from Do is the result of In-None-Match.
  76653. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  76654. c.ifNoneMatch_ = entityTag
  76655. return c
  76656. }
  76657. // Context sets the context to be used in this call's Do method. Any
  76658. // pending HTTP request will be aborted if the provided context is
  76659. // canceled.
  76660. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  76661. c.ctx_ = ctx
  76662. return c
  76663. }
  76664. // Header returns an http.Header that can be modified by the caller to
  76665. // add HTTP headers to the request.
  76666. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  76667. if c.header_ == nil {
  76668. c.header_ = make(http.Header)
  76669. }
  76670. return c.header_
  76671. }
  76672. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  76673. reqHeaders := make(http.Header)
  76674. for k, v := range c.header_ {
  76675. reqHeaders[k] = v
  76676. }
  76677. reqHeaders.Set("User-Agent", c.s.userAgent())
  76678. if c.ifNoneMatch_ != "" {
  76679. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76680. }
  76681. var body io.Reader = nil
  76682. c.urlParams_.Set("alt", alt)
  76683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  76684. urls += "?" + c.urlParams_.Encode()
  76685. req, _ := http.NewRequest("GET", urls, body)
  76686. req.Header = reqHeaders
  76687. googleapi.Expand(req.URL, map[string]string{
  76688. "project": c.project,
  76689. "region": c.region,
  76690. "targetVpnGateway": c.targetVpnGateway,
  76691. })
  76692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76693. }
  76694. // Do executes the "compute.targetVpnGateways.get" call.
  76695. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  76696. // non-2xx status code is an error. Response headers are in either
  76697. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  76698. // returned at all) in error.(*googleapi.Error).Header. Use
  76699. // googleapi.IsNotModified to check whether the returned error was
  76700. // because http.StatusNotModified was returned.
  76701. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  76702. gensupport.SetOptions(c.urlParams_, opts...)
  76703. res, err := c.doRequest("json")
  76704. if res != nil && res.StatusCode == http.StatusNotModified {
  76705. if res.Body != nil {
  76706. res.Body.Close()
  76707. }
  76708. return nil, &googleapi.Error{
  76709. Code: res.StatusCode,
  76710. Header: res.Header,
  76711. }
  76712. }
  76713. if err != nil {
  76714. return nil, err
  76715. }
  76716. defer googleapi.CloseBody(res)
  76717. if err := googleapi.CheckResponse(res); err != nil {
  76718. return nil, err
  76719. }
  76720. ret := &TargetVpnGateway{
  76721. ServerResponse: googleapi.ServerResponse{
  76722. Header: res.Header,
  76723. HTTPStatusCode: res.StatusCode,
  76724. },
  76725. }
  76726. target := &ret
  76727. if err := gensupport.DecodeResponse(target, res); err != nil {
  76728. return nil, err
  76729. }
  76730. return ret, nil
  76731. // {
  76732. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  76733. // "httpMethod": "GET",
  76734. // "id": "compute.targetVpnGateways.get",
  76735. // "parameterOrder": [
  76736. // "project",
  76737. // "region",
  76738. // "targetVpnGateway"
  76739. // ],
  76740. // "parameters": {
  76741. // "project": {
  76742. // "description": "Project ID for this request.",
  76743. // "location": "path",
  76744. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76745. // "required": true,
  76746. // "type": "string"
  76747. // },
  76748. // "region": {
  76749. // "description": "Name of the region for this request.",
  76750. // "location": "path",
  76751. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76752. // "required": true,
  76753. // "type": "string"
  76754. // },
  76755. // "targetVpnGateway": {
  76756. // "description": "Name of the target VPN gateway to return.",
  76757. // "location": "path",
  76758. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76759. // "required": true,
  76760. // "type": "string"
  76761. // }
  76762. // },
  76763. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  76764. // "response": {
  76765. // "$ref": "TargetVpnGateway"
  76766. // },
  76767. // "scopes": [
  76768. // "https://www.googleapis.com/auth/cloud-platform",
  76769. // "https://www.googleapis.com/auth/compute",
  76770. // "https://www.googleapis.com/auth/compute.readonly"
  76771. // ]
  76772. // }
  76773. }
  76774. // method id "compute.targetVpnGateways.insert":
  76775. type TargetVpnGatewaysInsertCall struct {
  76776. s *Service
  76777. project string
  76778. region string
  76779. targetvpngateway *TargetVpnGateway
  76780. urlParams_ gensupport.URLParams
  76781. ctx_ context.Context
  76782. header_ http.Header
  76783. }
  76784. // Insert: Creates a target VPN gateway in the specified project and
  76785. // region using the data included in the request.
  76786. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  76787. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76788. c.project = project
  76789. c.region = region
  76790. c.targetvpngateway = targetvpngateway
  76791. return c
  76792. }
  76793. // RequestId sets the optional parameter "requestId": An optional
  76794. // request ID to identify requests. Specify a unique request ID so that
  76795. // if you must retry your request, the server will know to ignore the
  76796. // request if it has already been completed.
  76797. //
  76798. // For example, consider a situation where you make an initial request
  76799. // and the request times out. If you make the request again with the
  76800. // same request ID, the server can check if original operation with the
  76801. // same request ID was received, and if so, will ignore the second
  76802. // request. This prevents clients from accidentally creating duplicate
  76803. // commitments.
  76804. //
  76805. // The request ID must be a valid UUID with the exception that zero UUID
  76806. // is not supported (00000000-0000-0000-0000-000000000000).
  76807. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  76808. c.urlParams_.Set("requestId", requestId)
  76809. return c
  76810. }
  76811. // Fields allows partial responses to be retrieved. See
  76812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76813. // for more information.
  76814. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  76815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76816. return c
  76817. }
  76818. // Context sets the context to be used in this call's Do method. Any
  76819. // pending HTTP request will be aborted if the provided context is
  76820. // canceled.
  76821. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  76822. c.ctx_ = ctx
  76823. return c
  76824. }
  76825. // Header returns an http.Header that can be modified by the caller to
  76826. // add HTTP headers to the request.
  76827. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  76828. if c.header_ == nil {
  76829. c.header_ = make(http.Header)
  76830. }
  76831. return c.header_
  76832. }
  76833. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  76834. reqHeaders := make(http.Header)
  76835. for k, v := range c.header_ {
  76836. reqHeaders[k] = v
  76837. }
  76838. reqHeaders.Set("User-Agent", c.s.userAgent())
  76839. var body io.Reader = nil
  76840. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  76841. if err != nil {
  76842. return nil, err
  76843. }
  76844. reqHeaders.Set("Content-Type", "application/json")
  76845. c.urlParams_.Set("alt", alt)
  76846. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  76847. urls += "?" + c.urlParams_.Encode()
  76848. req, _ := http.NewRequest("POST", urls, body)
  76849. req.Header = reqHeaders
  76850. googleapi.Expand(req.URL, map[string]string{
  76851. "project": c.project,
  76852. "region": c.region,
  76853. })
  76854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76855. }
  76856. // Do executes the "compute.targetVpnGateways.insert" call.
  76857. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76858. // status code is an error. Response headers are in either
  76859. // *Operation.ServerResponse.Header or (if a response was returned at
  76860. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76861. // to check whether the returned error was because
  76862. // http.StatusNotModified was returned.
  76863. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76864. gensupport.SetOptions(c.urlParams_, opts...)
  76865. res, err := c.doRequest("json")
  76866. if res != nil && res.StatusCode == http.StatusNotModified {
  76867. if res.Body != nil {
  76868. res.Body.Close()
  76869. }
  76870. return nil, &googleapi.Error{
  76871. Code: res.StatusCode,
  76872. Header: res.Header,
  76873. }
  76874. }
  76875. if err != nil {
  76876. return nil, err
  76877. }
  76878. defer googleapi.CloseBody(res)
  76879. if err := googleapi.CheckResponse(res); err != nil {
  76880. return nil, err
  76881. }
  76882. ret := &Operation{
  76883. ServerResponse: googleapi.ServerResponse{
  76884. Header: res.Header,
  76885. HTTPStatusCode: res.StatusCode,
  76886. },
  76887. }
  76888. target := &ret
  76889. if err := gensupport.DecodeResponse(target, res); err != nil {
  76890. return nil, err
  76891. }
  76892. return ret, nil
  76893. // {
  76894. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  76895. // "httpMethod": "POST",
  76896. // "id": "compute.targetVpnGateways.insert",
  76897. // "parameterOrder": [
  76898. // "project",
  76899. // "region"
  76900. // ],
  76901. // "parameters": {
  76902. // "project": {
  76903. // "description": "Project ID for this request.",
  76904. // "location": "path",
  76905. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76906. // "required": true,
  76907. // "type": "string"
  76908. // },
  76909. // "region": {
  76910. // "description": "Name of the region for this request.",
  76911. // "location": "path",
  76912. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76913. // "required": true,
  76914. // "type": "string"
  76915. // },
  76916. // "requestId": {
  76917. // "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).",
  76918. // "location": "query",
  76919. // "type": "string"
  76920. // }
  76921. // },
  76922. // "path": "{project}/regions/{region}/targetVpnGateways",
  76923. // "request": {
  76924. // "$ref": "TargetVpnGateway"
  76925. // },
  76926. // "response": {
  76927. // "$ref": "Operation"
  76928. // },
  76929. // "scopes": [
  76930. // "https://www.googleapis.com/auth/cloud-platform",
  76931. // "https://www.googleapis.com/auth/compute"
  76932. // ]
  76933. // }
  76934. }
  76935. // method id "compute.targetVpnGateways.list":
  76936. type TargetVpnGatewaysListCall struct {
  76937. s *Service
  76938. project string
  76939. region string
  76940. urlParams_ gensupport.URLParams
  76941. ifNoneMatch_ string
  76942. ctx_ context.Context
  76943. header_ http.Header
  76944. }
  76945. // List: Retrieves a list of target VPN gateways available to the
  76946. // specified project and region.
  76947. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  76948. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76949. c.project = project
  76950. c.region = region
  76951. return c
  76952. }
  76953. // Filter sets the optional parameter "filter": A filter expression that
  76954. // filters resources listed in the response. The expression must specify
  76955. // the field name, a comparison operator, and the value that you want to
  76956. // use for filtering. The value must be a string, a number, or a
  76957. // boolean. The comparison operator must be either =, !=, >, or <.
  76958. //
  76959. // For example, if you are filtering Compute Engine instances, you can
  76960. // exclude instances named example-instance by specifying name !=
  76961. // example-instance.
  76962. //
  76963. // You can also filter nested fields. For example, you could specify
  76964. // scheduling.automaticRestart = false to include instances only if they
  76965. // are not scheduled for automatic restarts. You can use filtering on
  76966. // nested fields to filter based on resource labels.
  76967. //
  76968. // To filter on multiple expressions, provide each separate expression
  76969. // within parentheses. For example, (scheduling.automaticRestart = true)
  76970. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76971. // AND expression. However, you can include AND and OR expressions
  76972. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76973. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76974. // true).
  76975. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  76976. c.urlParams_.Set("filter", filter)
  76977. return c
  76978. }
  76979. // MaxResults sets the optional parameter "maxResults": The maximum
  76980. // number of results per page that should be returned. If the number of
  76981. // available results is larger than maxResults, Compute Engine returns a
  76982. // nextPageToken that can be used to get the next page of results in
  76983. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76984. // (Default: 500)
  76985. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  76986. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76987. return c
  76988. }
  76989. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76990. // a certain order. By default, results are returned in alphanumerical
  76991. // order based on the resource name.
  76992. //
  76993. // You can also sort results in descending order based on the creation
  76994. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76995. // based on the creationTimestamp field in reverse chronological order
  76996. // (newest result first). Use this to sort resources like operations so
  76997. // that the newest operation is returned first.
  76998. //
  76999. // Currently, only sorting by name or creationTimestamp desc is
  77000. // supported.
  77001. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  77002. c.urlParams_.Set("orderBy", orderBy)
  77003. return c
  77004. }
  77005. // PageToken sets the optional parameter "pageToken": Specifies a page
  77006. // token to use. Set pageToken to the nextPageToken returned by a
  77007. // previous list request to get the next page of results.
  77008. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  77009. c.urlParams_.Set("pageToken", pageToken)
  77010. return c
  77011. }
  77012. // Fields allows partial responses to be retrieved. See
  77013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77014. // for more information.
  77015. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  77016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77017. return c
  77018. }
  77019. // IfNoneMatch sets the optional parameter which makes the operation
  77020. // fail if the object's ETag matches the given value. This is useful for
  77021. // getting updates only after the object has changed since the last
  77022. // request. Use googleapi.IsNotModified to check whether the response
  77023. // error from Do is the result of In-None-Match.
  77024. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  77025. c.ifNoneMatch_ = entityTag
  77026. return c
  77027. }
  77028. // Context sets the context to be used in this call's Do method. Any
  77029. // pending HTTP request will be aborted if the provided context is
  77030. // canceled.
  77031. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  77032. c.ctx_ = ctx
  77033. return c
  77034. }
  77035. // Header returns an http.Header that can be modified by the caller to
  77036. // add HTTP headers to the request.
  77037. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  77038. if c.header_ == nil {
  77039. c.header_ = make(http.Header)
  77040. }
  77041. return c.header_
  77042. }
  77043. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  77044. reqHeaders := make(http.Header)
  77045. for k, v := range c.header_ {
  77046. reqHeaders[k] = v
  77047. }
  77048. reqHeaders.Set("User-Agent", c.s.userAgent())
  77049. if c.ifNoneMatch_ != "" {
  77050. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77051. }
  77052. var body io.Reader = nil
  77053. c.urlParams_.Set("alt", alt)
  77054. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  77055. urls += "?" + c.urlParams_.Encode()
  77056. req, _ := http.NewRequest("GET", urls, body)
  77057. req.Header = reqHeaders
  77058. googleapi.Expand(req.URL, map[string]string{
  77059. "project": c.project,
  77060. "region": c.region,
  77061. })
  77062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77063. }
  77064. // Do executes the "compute.targetVpnGateways.list" call.
  77065. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  77066. // non-2xx status code is an error. Response headers are in either
  77067. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  77068. // returned at all) in error.(*googleapi.Error).Header. Use
  77069. // googleapi.IsNotModified to check whether the returned error was
  77070. // because http.StatusNotModified was returned.
  77071. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  77072. gensupport.SetOptions(c.urlParams_, opts...)
  77073. res, err := c.doRequest("json")
  77074. if res != nil && res.StatusCode == http.StatusNotModified {
  77075. if res.Body != nil {
  77076. res.Body.Close()
  77077. }
  77078. return nil, &googleapi.Error{
  77079. Code: res.StatusCode,
  77080. Header: res.Header,
  77081. }
  77082. }
  77083. if err != nil {
  77084. return nil, err
  77085. }
  77086. defer googleapi.CloseBody(res)
  77087. if err := googleapi.CheckResponse(res); err != nil {
  77088. return nil, err
  77089. }
  77090. ret := &TargetVpnGatewayList{
  77091. ServerResponse: googleapi.ServerResponse{
  77092. Header: res.Header,
  77093. HTTPStatusCode: res.StatusCode,
  77094. },
  77095. }
  77096. target := &ret
  77097. if err := gensupport.DecodeResponse(target, res); err != nil {
  77098. return nil, err
  77099. }
  77100. return ret, nil
  77101. // {
  77102. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  77103. // "httpMethod": "GET",
  77104. // "id": "compute.targetVpnGateways.list",
  77105. // "parameterOrder": [
  77106. // "project",
  77107. // "region"
  77108. // ],
  77109. // "parameters": {
  77110. // "filter": {
  77111. // "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).",
  77112. // "location": "query",
  77113. // "type": "string"
  77114. // },
  77115. // "maxResults": {
  77116. // "default": "500",
  77117. // "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)",
  77118. // "format": "uint32",
  77119. // "location": "query",
  77120. // "minimum": "0",
  77121. // "type": "integer"
  77122. // },
  77123. // "orderBy": {
  77124. // "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.",
  77125. // "location": "query",
  77126. // "type": "string"
  77127. // },
  77128. // "pageToken": {
  77129. // "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.",
  77130. // "location": "query",
  77131. // "type": "string"
  77132. // },
  77133. // "project": {
  77134. // "description": "Project ID for this request.",
  77135. // "location": "path",
  77136. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77137. // "required": true,
  77138. // "type": "string"
  77139. // },
  77140. // "region": {
  77141. // "description": "Name of the region for this request.",
  77142. // "location": "path",
  77143. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77144. // "required": true,
  77145. // "type": "string"
  77146. // }
  77147. // },
  77148. // "path": "{project}/regions/{region}/targetVpnGateways",
  77149. // "response": {
  77150. // "$ref": "TargetVpnGatewayList"
  77151. // },
  77152. // "scopes": [
  77153. // "https://www.googleapis.com/auth/cloud-platform",
  77154. // "https://www.googleapis.com/auth/compute",
  77155. // "https://www.googleapis.com/auth/compute.readonly"
  77156. // ]
  77157. // }
  77158. }
  77159. // Pages invokes f for each page of results.
  77160. // A non-nil error returned from f will halt the iteration.
  77161. // The provided context supersedes any context provided to the Context method.
  77162. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  77163. c.ctx_ = ctx
  77164. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  77165. for {
  77166. x, err := c.Do()
  77167. if err != nil {
  77168. return err
  77169. }
  77170. if err := f(x); err != nil {
  77171. return err
  77172. }
  77173. if x.NextPageToken == "" {
  77174. return nil
  77175. }
  77176. c.PageToken(x.NextPageToken)
  77177. }
  77178. }
  77179. // method id "compute.urlMaps.delete":
  77180. type UrlMapsDeleteCall struct {
  77181. s *Service
  77182. project string
  77183. urlMap string
  77184. urlParams_ gensupport.URLParams
  77185. ctx_ context.Context
  77186. header_ http.Header
  77187. }
  77188. // Delete: Deletes the specified UrlMap resource.
  77189. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  77190. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  77191. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77192. c.project = project
  77193. c.urlMap = urlMap
  77194. return c
  77195. }
  77196. // RequestId sets the optional parameter "requestId": An optional
  77197. // request ID to identify requests. Specify a unique request ID so that
  77198. // if you must retry your request, the server will know to ignore the
  77199. // request if it has already been completed.
  77200. //
  77201. // For example, consider a situation where you make an initial request
  77202. // and the request times out. If you make the request again with the
  77203. // same request ID, the server can check if original operation with the
  77204. // same request ID was received, and if so, will ignore the second
  77205. // request. This prevents clients from accidentally creating duplicate
  77206. // commitments.
  77207. //
  77208. // The request ID must be a valid UUID with the exception that zero UUID
  77209. // is not supported (00000000-0000-0000-0000-000000000000).
  77210. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  77211. c.urlParams_.Set("requestId", requestId)
  77212. return c
  77213. }
  77214. // Fields allows partial responses to be retrieved. See
  77215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77216. // for more information.
  77217. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  77218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77219. return c
  77220. }
  77221. // Context sets the context to be used in this call's Do method. Any
  77222. // pending HTTP request will be aborted if the provided context is
  77223. // canceled.
  77224. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  77225. c.ctx_ = ctx
  77226. return c
  77227. }
  77228. // Header returns an http.Header that can be modified by the caller to
  77229. // add HTTP headers to the request.
  77230. func (c *UrlMapsDeleteCall) Header() http.Header {
  77231. if c.header_ == nil {
  77232. c.header_ = make(http.Header)
  77233. }
  77234. return c.header_
  77235. }
  77236. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  77237. reqHeaders := make(http.Header)
  77238. for k, v := range c.header_ {
  77239. reqHeaders[k] = v
  77240. }
  77241. reqHeaders.Set("User-Agent", c.s.userAgent())
  77242. var body io.Reader = nil
  77243. c.urlParams_.Set("alt", alt)
  77244. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  77245. urls += "?" + c.urlParams_.Encode()
  77246. req, _ := http.NewRequest("DELETE", urls, body)
  77247. req.Header = reqHeaders
  77248. googleapi.Expand(req.URL, map[string]string{
  77249. "project": c.project,
  77250. "urlMap": c.urlMap,
  77251. })
  77252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77253. }
  77254. // Do executes the "compute.urlMaps.delete" call.
  77255. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77256. // status code is an error. Response headers are in either
  77257. // *Operation.ServerResponse.Header or (if a response was returned at
  77258. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77259. // to check whether the returned error was because
  77260. // http.StatusNotModified was returned.
  77261. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77262. gensupport.SetOptions(c.urlParams_, opts...)
  77263. res, err := c.doRequest("json")
  77264. if res != nil && res.StatusCode == http.StatusNotModified {
  77265. if res.Body != nil {
  77266. res.Body.Close()
  77267. }
  77268. return nil, &googleapi.Error{
  77269. Code: res.StatusCode,
  77270. Header: res.Header,
  77271. }
  77272. }
  77273. if err != nil {
  77274. return nil, err
  77275. }
  77276. defer googleapi.CloseBody(res)
  77277. if err := googleapi.CheckResponse(res); err != nil {
  77278. return nil, err
  77279. }
  77280. ret := &Operation{
  77281. ServerResponse: googleapi.ServerResponse{
  77282. Header: res.Header,
  77283. HTTPStatusCode: res.StatusCode,
  77284. },
  77285. }
  77286. target := &ret
  77287. if err := gensupport.DecodeResponse(target, res); err != nil {
  77288. return nil, err
  77289. }
  77290. return ret, nil
  77291. // {
  77292. // "description": "Deletes the specified UrlMap resource.",
  77293. // "httpMethod": "DELETE",
  77294. // "id": "compute.urlMaps.delete",
  77295. // "parameterOrder": [
  77296. // "project",
  77297. // "urlMap"
  77298. // ],
  77299. // "parameters": {
  77300. // "project": {
  77301. // "description": "Project ID for this request.",
  77302. // "location": "path",
  77303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77304. // "required": true,
  77305. // "type": "string"
  77306. // },
  77307. // "requestId": {
  77308. // "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).",
  77309. // "location": "query",
  77310. // "type": "string"
  77311. // },
  77312. // "urlMap": {
  77313. // "description": "Name of the UrlMap resource to delete.",
  77314. // "location": "path",
  77315. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77316. // "required": true,
  77317. // "type": "string"
  77318. // }
  77319. // },
  77320. // "path": "{project}/global/urlMaps/{urlMap}",
  77321. // "response": {
  77322. // "$ref": "Operation"
  77323. // },
  77324. // "scopes": [
  77325. // "https://www.googleapis.com/auth/cloud-platform",
  77326. // "https://www.googleapis.com/auth/compute"
  77327. // ]
  77328. // }
  77329. }
  77330. // method id "compute.urlMaps.get":
  77331. type UrlMapsGetCall struct {
  77332. s *Service
  77333. project string
  77334. urlMap string
  77335. urlParams_ gensupport.URLParams
  77336. ifNoneMatch_ string
  77337. ctx_ context.Context
  77338. header_ http.Header
  77339. }
  77340. // Get: Returns the specified UrlMap resource. Gets a list of available
  77341. // URL maps by making a list() request.
  77342. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  77343. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  77344. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77345. c.project = project
  77346. c.urlMap = urlMap
  77347. return c
  77348. }
  77349. // Fields allows partial responses to be retrieved. See
  77350. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77351. // for more information.
  77352. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  77353. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77354. return c
  77355. }
  77356. // IfNoneMatch sets the optional parameter which makes the operation
  77357. // fail if the object's ETag matches the given value. This is useful for
  77358. // getting updates only after the object has changed since the last
  77359. // request. Use googleapi.IsNotModified to check whether the response
  77360. // error from Do is the result of In-None-Match.
  77361. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  77362. c.ifNoneMatch_ = entityTag
  77363. return c
  77364. }
  77365. // Context sets the context to be used in this call's Do method. Any
  77366. // pending HTTP request will be aborted if the provided context is
  77367. // canceled.
  77368. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  77369. c.ctx_ = ctx
  77370. return c
  77371. }
  77372. // Header returns an http.Header that can be modified by the caller to
  77373. // add HTTP headers to the request.
  77374. func (c *UrlMapsGetCall) Header() http.Header {
  77375. if c.header_ == nil {
  77376. c.header_ = make(http.Header)
  77377. }
  77378. return c.header_
  77379. }
  77380. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  77381. reqHeaders := make(http.Header)
  77382. for k, v := range c.header_ {
  77383. reqHeaders[k] = v
  77384. }
  77385. reqHeaders.Set("User-Agent", c.s.userAgent())
  77386. if c.ifNoneMatch_ != "" {
  77387. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77388. }
  77389. var body io.Reader = nil
  77390. c.urlParams_.Set("alt", alt)
  77391. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  77392. urls += "?" + c.urlParams_.Encode()
  77393. req, _ := http.NewRequest("GET", urls, body)
  77394. req.Header = reqHeaders
  77395. googleapi.Expand(req.URL, map[string]string{
  77396. "project": c.project,
  77397. "urlMap": c.urlMap,
  77398. })
  77399. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77400. }
  77401. // Do executes the "compute.urlMaps.get" call.
  77402. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  77403. // code is an error. Response headers are in either
  77404. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  77405. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77406. // check whether the returned error was because http.StatusNotModified
  77407. // was returned.
  77408. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  77409. gensupport.SetOptions(c.urlParams_, opts...)
  77410. res, err := c.doRequest("json")
  77411. if res != nil && res.StatusCode == http.StatusNotModified {
  77412. if res.Body != nil {
  77413. res.Body.Close()
  77414. }
  77415. return nil, &googleapi.Error{
  77416. Code: res.StatusCode,
  77417. Header: res.Header,
  77418. }
  77419. }
  77420. if err != nil {
  77421. return nil, err
  77422. }
  77423. defer googleapi.CloseBody(res)
  77424. if err := googleapi.CheckResponse(res); err != nil {
  77425. return nil, err
  77426. }
  77427. ret := &UrlMap{
  77428. ServerResponse: googleapi.ServerResponse{
  77429. Header: res.Header,
  77430. HTTPStatusCode: res.StatusCode,
  77431. },
  77432. }
  77433. target := &ret
  77434. if err := gensupport.DecodeResponse(target, res); err != nil {
  77435. return nil, err
  77436. }
  77437. return ret, nil
  77438. // {
  77439. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  77440. // "httpMethod": "GET",
  77441. // "id": "compute.urlMaps.get",
  77442. // "parameterOrder": [
  77443. // "project",
  77444. // "urlMap"
  77445. // ],
  77446. // "parameters": {
  77447. // "project": {
  77448. // "description": "Project ID for this request.",
  77449. // "location": "path",
  77450. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77451. // "required": true,
  77452. // "type": "string"
  77453. // },
  77454. // "urlMap": {
  77455. // "description": "Name of the UrlMap resource to return.",
  77456. // "location": "path",
  77457. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77458. // "required": true,
  77459. // "type": "string"
  77460. // }
  77461. // },
  77462. // "path": "{project}/global/urlMaps/{urlMap}",
  77463. // "response": {
  77464. // "$ref": "UrlMap"
  77465. // },
  77466. // "scopes": [
  77467. // "https://www.googleapis.com/auth/cloud-platform",
  77468. // "https://www.googleapis.com/auth/compute",
  77469. // "https://www.googleapis.com/auth/compute.readonly"
  77470. // ]
  77471. // }
  77472. }
  77473. // method id "compute.urlMaps.insert":
  77474. type UrlMapsInsertCall struct {
  77475. s *Service
  77476. project string
  77477. urlmap *UrlMap
  77478. urlParams_ gensupport.URLParams
  77479. ctx_ context.Context
  77480. header_ http.Header
  77481. }
  77482. // Insert: Creates a UrlMap resource in the specified project using the
  77483. // data included in the request.
  77484. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  77485. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  77486. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77487. c.project = project
  77488. c.urlmap = urlmap
  77489. return c
  77490. }
  77491. // RequestId sets the optional parameter "requestId": An optional
  77492. // request ID to identify requests. Specify a unique request ID so that
  77493. // if you must retry your request, the server will know to ignore the
  77494. // request if it has already been completed.
  77495. //
  77496. // For example, consider a situation where you make an initial request
  77497. // and the request times out. If you make the request again with the
  77498. // same request ID, the server can check if original operation with the
  77499. // same request ID was received, and if so, will ignore the second
  77500. // request. This prevents clients from accidentally creating duplicate
  77501. // commitments.
  77502. //
  77503. // The request ID must be a valid UUID with the exception that zero UUID
  77504. // is not supported (00000000-0000-0000-0000-000000000000).
  77505. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  77506. c.urlParams_.Set("requestId", requestId)
  77507. return c
  77508. }
  77509. // Fields allows partial responses to be retrieved. See
  77510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77511. // for more information.
  77512. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  77513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77514. return c
  77515. }
  77516. // Context sets the context to be used in this call's Do method. Any
  77517. // pending HTTP request will be aborted if the provided context is
  77518. // canceled.
  77519. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  77520. c.ctx_ = ctx
  77521. return c
  77522. }
  77523. // Header returns an http.Header that can be modified by the caller to
  77524. // add HTTP headers to the request.
  77525. func (c *UrlMapsInsertCall) Header() http.Header {
  77526. if c.header_ == nil {
  77527. c.header_ = make(http.Header)
  77528. }
  77529. return c.header_
  77530. }
  77531. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  77532. reqHeaders := make(http.Header)
  77533. for k, v := range c.header_ {
  77534. reqHeaders[k] = v
  77535. }
  77536. reqHeaders.Set("User-Agent", c.s.userAgent())
  77537. var body io.Reader = nil
  77538. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  77539. if err != nil {
  77540. return nil, err
  77541. }
  77542. reqHeaders.Set("Content-Type", "application/json")
  77543. c.urlParams_.Set("alt", alt)
  77544. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  77545. urls += "?" + c.urlParams_.Encode()
  77546. req, _ := http.NewRequest("POST", urls, body)
  77547. req.Header = reqHeaders
  77548. googleapi.Expand(req.URL, map[string]string{
  77549. "project": c.project,
  77550. })
  77551. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77552. }
  77553. // Do executes the "compute.urlMaps.insert" call.
  77554. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77555. // status code is an error. Response headers are in either
  77556. // *Operation.ServerResponse.Header or (if a response was returned at
  77557. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77558. // to check whether the returned error was because
  77559. // http.StatusNotModified was returned.
  77560. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77561. gensupport.SetOptions(c.urlParams_, opts...)
  77562. res, err := c.doRequest("json")
  77563. if res != nil && res.StatusCode == http.StatusNotModified {
  77564. if res.Body != nil {
  77565. res.Body.Close()
  77566. }
  77567. return nil, &googleapi.Error{
  77568. Code: res.StatusCode,
  77569. Header: res.Header,
  77570. }
  77571. }
  77572. if err != nil {
  77573. return nil, err
  77574. }
  77575. defer googleapi.CloseBody(res)
  77576. if err := googleapi.CheckResponse(res); err != nil {
  77577. return nil, err
  77578. }
  77579. ret := &Operation{
  77580. ServerResponse: googleapi.ServerResponse{
  77581. Header: res.Header,
  77582. HTTPStatusCode: res.StatusCode,
  77583. },
  77584. }
  77585. target := &ret
  77586. if err := gensupport.DecodeResponse(target, res); err != nil {
  77587. return nil, err
  77588. }
  77589. return ret, nil
  77590. // {
  77591. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  77592. // "httpMethod": "POST",
  77593. // "id": "compute.urlMaps.insert",
  77594. // "parameterOrder": [
  77595. // "project"
  77596. // ],
  77597. // "parameters": {
  77598. // "project": {
  77599. // "description": "Project ID for this request.",
  77600. // "location": "path",
  77601. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77602. // "required": true,
  77603. // "type": "string"
  77604. // },
  77605. // "requestId": {
  77606. // "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).",
  77607. // "location": "query",
  77608. // "type": "string"
  77609. // }
  77610. // },
  77611. // "path": "{project}/global/urlMaps",
  77612. // "request": {
  77613. // "$ref": "UrlMap"
  77614. // },
  77615. // "response": {
  77616. // "$ref": "Operation"
  77617. // },
  77618. // "scopes": [
  77619. // "https://www.googleapis.com/auth/cloud-platform",
  77620. // "https://www.googleapis.com/auth/compute"
  77621. // ]
  77622. // }
  77623. }
  77624. // method id "compute.urlMaps.invalidateCache":
  77625. type UrlMapsInvalidateCacheCall struct {
  77626. s *Service
  77627. project string
  77628. urlMap string
  77629. cacheinvalidationrule *CacheInvalidationRule
  77630. urlParams_ gensupport.URLParams
  77631. ctx_ context.Context
  77632. header_ http.Header
  77633. }
  77634. // InvalidateCache: Initiates a cache invalidation operation,
  77635. // invalidating the specified path, scoped to the specified UrlMap.
  77636. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  77637. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77638. c.project = project
  77639. c.urlMap = urlMap
  77640. c.cacheinvalidationrule = cacheinvalidationrule
  77641. return c
  77642. }
  77643. // RequestId sets the optional parameter "requestId": An optional
  77644. // request ID to identify requests. Specify a unique request ID so that
  77645. // if you must retry your request, the server will know to ignore the
  77646. // request if it has already been completed.
  77647. //
  77648. // For example, consider a situation where you make an initial request
  77649. // and the request times out. If you make the request again with the
  77650. // same request ID, the server can check if original operation with the
  77651. // same request ID was received, and if so, will ignore the second
  77652. // request. This prevents clients from accidentally creating duplicate
  77653. // commitments.
  77654. //
  77655. // The request ID must be a valid UUID with the exception that zero UUID
  77656. // is not supported (00000000-0000-0000-0000-000000000000).
  77657. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  77658. c.urlParams_.Set("requestId", requestId)
  77659. return c
  77660. }
  77661. // Fields allows partial responses to be retrieved. See
  77662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77663. // for more information.
  77664. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  77665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77666. return c
  77667. }
  77668. // Context sets the context to be used in this call's Do method. Any
  77669. // pending HTTP request will be aborted if the provided context is
  77670. // canceled.
  77671. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  77672. c.ctx_ = ctx
  77673. return c
  77674. }
  77675. // Header returns an http.Header that can be modified by the caller to
  77676. // add HTTP headers to the request.
  77677. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  77678. if c.header_ == nil {
  77679. c.header_ = make(http.Header)
  77680. }
  77681. return c.header_
  77682. }
  77683. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  77684. reqHeaders := make(http.Header)
  77685. for k, v := range c.header_ {
  77686. reqHeaders[k] = v
  77687. }
  77688. reqHeaders.Set("User-Agent", c.s.userAgent())
  77689. var body io.Reader = nil
  77690. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  77691. if err != nil {
  77692. return nil, err
  77693. }
  77694. reqHeaders.Set("Content-Type", "application/json")
  77695. c.urlParams_.Set("alt", alt)
  77696. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  77697. urls += "?" + c.urlParams_.Encode()
  77698. req, _ := http.NewRequest("POST", urls, body)
  77699. req.Header = reqHeaders
  77700. googleapi.Expand(req.URL, map[string]string{
  77701. "project": c.project,
  77702. "urlMap": c.urlMap,
  77703. })
  77704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77705. }
  77706. // Do executes the "compute.urlMaps.invalidateCache" call.
  77707. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77708. // status code is an error. Response headers are in either
  77709. // *Operation.ServerResponse.Header or (if a response was returned at
  77710. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77711. // to check whether the returned error was because
  77712. // http.StatusNotModified was returned.
  77713. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77714. gensupport.SetOptions(c.urlParams_, opts...)
  77715. res, err := c.doRequest("json")
  77716. if res != nil && res.StatusCode == http.StatusNotModified {
  77717. if res.Body != nil {
  77718. res.Body.Close()
  77719. }
  77720. return nil, &googleapi.Error{
  77721. Code: res.StatusCode,
  77722. Header: res.Header,
  77723. }
  77724. }
  77725. if err != nil {
  77726. return nil, err
  77727. }
  77728. defer googleapi.CloseBody(res)
  77729. if err := googleapi.CheckResponse(res); err != nil {
  77730. return nil, err
  77731. }
  77732. ret := &Operation{
  77733. ServerResponse: googleapi.ServerResponse{
  77734. Header: res.Header,
  77735. HTTPStatusCode: res.StatusCode,
  77736. },
  77737. }
  77738. target := &ret
  77739. if err := gensupport.DecodeResponse(target, res); err != nil {
  77740. return nil, err
  77741. }
  77742. return ret, nil
  77743. // {
  77744. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  77745. // "httpMethod": "POST",
  77746. // "id": "compute.urlMaps.invalidateCache",
  77747. // "parameterOrder": [
  77748. // "project",
  77749. // "urlMap"
  77750. // ],
  77751. // "parameters": {
  77752. // "project": {
  77753. // "description": "Project ID for this request.",
  77754. // "location": "path",
  77755. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77756. // "required": true,
  77757. // "type": "string"
  77758. // },
  77759. // "requestId": {
  77760. // "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).",
  77761. // "location": "query",
  77762. // "type": "string"
  77763. // },
  77764. // "urlMap": {
  77765. // "description": "Name of the UrlMap scoping this request.",
  77766. // "location": "path",
  77767. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77768. // "required": true,
  77769. // "type": "string"
  77770. // }
  77771. // },
  77772. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  77773. // "request": {
  77774. // "$ref": "CacheInvalidationRule"
  77775. // },
  77776. // "response": {
  77777. // "$ref": "Operation"
  77778. // },
  77779. // "scopes": [
  77780. // "https://www.googleapis.com/auth/cloud-platform",
  77781. // "https://www.googleapis.com/auth/compute"
  77782. // ]
  77783. // }
  77784. }
  77785. // method id "compute.urlMaps.list":
  77786. type UrlMapsListCall struct {
  77787. s *Service
  77788. project string
  77789. urlParams_ gensupport.URLParams
  77790. ifNoneMatch_ string
  77791. ctx_ context.Context
  77792. header_ http.Header
  77793. }
  77794. // List: Retrieves the list of UrlMap resources available to the
  77795. // specified project.
  77796. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  77797. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  77798. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77799. c.project = project
  77800. return c
  77801. }
  77802. // Filter sets the optional parameter "filter": A filter expression that
  77803. // filters resources listed in the response. The expression must specify
  77804. // the field name, a comparison operator, and the value that you want to
  77805. // use for filtering. The value must be a string, a number, or a
  77806. // boolean. The comparison operator must be either =, !=, >, or <.
  77807. //
  77808. // For example, if you are filtering Compute Engine instances, you can
  77809. // exclude instances named example-instance by specifying name !=
  77810. // example-instance.
  77811. //
  77812. // You can also filter nested fields. For example, you could specify
  77813. // scheduling.automaticRestart = false to include instances only if they
  77814. // are not scheduled for automatic restarts. You can use filtering on
  77815. // nested fields to filter based on resource labels.
  77816. //
  77817. // To filter on multiple expressions, provide each separate expression
  77818. // within parentheses. For example, (scheduling.automaticRestart = true)
  77819. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77820. // AND expression. However, you can include AND and OR expressions
  77821. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77822. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77823. // true).
  77824. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  77825. c.urlParams_.Set("filter", filter)
  77826. return c
  77827. }
  77828. // MaxResults sets the optional parameter "maxResults": The maximum
  77829. // number of results per page that should be returned. If the number of
  77830. // available results is larger than maxResults, Compute Engine returns a
  77831. // nextPageToken that can be used to get the next page of results in
  77832. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  77833. // (Default: 500)
  77834. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  77835. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  77836. return c
  77837. }
  77838. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  77839. // a certain order. By default, results are returned in alphanumerical
  77840. // order based on the resource name.
  77841. //
  77842. // You can also sort results in descending order based on the creation
  77843. // timestamp using orderBy="creationTimestamp desc". This sorts results
  77844. // based on the creationTimestamp field in reverse chronological order
  77845. // (newest result first). Use this to sort resources like operations so
  77846. // that the newest operation is returned first.
  77847. //
  77848. // Currently, only sorting by name or creationTimestamp desc is
  77849. // supported.
  77850. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  77851. c.urlParams_.Set("orderBy", orderBy)
  77852. return c
  77853. }
  77854. // PageToken sets the optional parameter "pageToken": Specifies a page
  77855. // token to use. Set pageToken to the nextPageToken returned by a
  77856. // previous list request to get the next page of results.
  77857. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  77858. c.urlParams_.Set("pageToken", pageToken)
  77859. return c
  77860. }
  77861. // Fields allows partial responses to be retrieved. See
  77862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77863. // for more information.
  77864. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  77865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77866. return c
  77867. }
  77868. // IfNoneMatch sets the optional parameter which makes the operation
  77869. // fail if the object's ETag matches the given value. This is useful for
  77870. // getting updates only after the object has changed since the last
  77871. // request. Use googleapi.IsNotModified to check whether the response
  77872. // error from Do is the result of In-None-Match.
  77873. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  77874. c.ifNoneMatch_ = entityTag
  77875. return c
  77876. }
  77877. // Context sets the context to be used in this call's Do method. Any
  77878. // pending HTTP request will be aborted if the provided context is
  77879. // canceled.
  77880. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  77881. c.ctx_ = ctx
  77882. return c
  77883. }
  77884. // Header returns an http.Header that can be modified by the caller to
  77885. // add HTTP headers to the request.
  77886. func (c *UrlMapsListCall) Header() http.Header {
  77887. if c.header_ == nil {
  77888. c.header_ = make(http.Header)
  77889. }
  77890. return c.header_
  77891. }
  77892. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  77893. reqHeaders := make(http.Header)
  77894. for k, v := range c.header_ {
  77895. reqHeaders[k] = v
  77896. }
  77897. reqHeaders.Set("User-Agent", c.s.userAgent())
  77898. if c.ifNoneMatch_ != "" {
  77899. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77900. }
  77901. var body io.Reader = nil
  77902. c.urlParams_.Set("alt", alt)
  77903. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  77904. urls += "?" + c.urlParams_.Encode()
  77905. req, _ := http.NewRequest("GET", urls, body)
  77906. req.Header = reqHeaders
  77907. googleapi.Expand(req.URL, map[string]string{
  77908. "project": c.project,
  77909. })
  77910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77911. }
  77912. // Do executes the "compute.urlMaps.list" call.
  77913. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  77914. // status code is an error. Response headers are in either
  77915. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  77916. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77917. // to check whether the returned error was because
  77918. // http.StatusNotModified was returned.
  77919. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  77920. gensupport.SetOptions(c.urlParams_, opts...)
  77921. res, err := c.doRequest("json")
  77922. if res != nil && res.StatusCode == http.StatusNotModified {
  77923. if res.Body != nil {
  77924. res.Body.Close()
  77925. }
  77926. return nil, &googleapi.Error{
  77927. Code: res.StatusCode,
  77928. Header: res.Header,
  77929. }
  77930. }
  77931. if err != nil {
  77932. return nil, err
  77933. }
  77934. defer googleapi.CloseBody(res)
  77935. if err := googleapi.CheckResponse(res); err != nil {
  77936. return nil, err
  77937. }
  77938. ret := &UrlMapList{
  77939. ServerResponse: googleapi.ServerResponse{
  77940. Header: res.Header,
  77941. HTTPStatusCode: res.StatusCode,
  77942. },
  77943. }
  77944. target := &ret
  77945. if err := gensupport.DecodeResponse(target, res); err != nil {
  77946. return nil, err
  77947. }
  77948. return ret, nil
  77949. // {
  77950. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  77951. // "httpMethod": "GET",
  77952. // "id": "compute.urlMaps.list",
  77953. // "parameterOrder": [
  77954. // "project"
  77955. // ],
  77956. // "parameters": {
  77957. // "filter": {
  77958. // "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).",
  77959. // "location": "query",
  77960. // "type": "string"
  77961. // },
  77962. // "maxResults": {
  77963. // "default": "500",
  77964. // "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)",
  77965. // "format": "uint32",
  77966. // "location": "query",
  77967. // "minimum": "0",
  77968. // "type": "integer"
  77969. // },
  77970. // "orderBy": {
  77971. // "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.",
  77972. // "location": "query",
  77973. // "type": "string"
  77974. // },
  77975. // "pageToken": {
  77976. // "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.",
  77977. // "location": "query",
  77978. // "type": "string"
  77979. // },
  77980. // "project": {
  77981. // "description": "Project ID for this request.",
  77982. // "location": "path",
  77983. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77984. // "required": true,
  77985. // "type": "string"
  77986. // }
  77987. // },
  77988. // "path": "{project}/global/urlMaps",
  77989. // "response": {
  77990. // "$ref": "UrlMapList"
  77991. // },
  77992. // "scopes": [
  77993. // "https://www.googleapis.com/auth/cloud-platform",
  77994. // "https://www.googleapis.com/auth/compute",
  77995. // "https://www.googleapis.com/auth/compute.readonly"
  77996. // ]
  77997. // }
  77998. }
  77999. // Pages invokes f for each page of results.
  78000. // A non-nil error returned from f will halt the iteration.
  78001. // The provided context supersedes any context provided to the Context method.
  78002. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  78003. c.ctx_ = ctx
  78004. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78005. for {
  78006. x, err := c.Do()
  78007. if err != nil {
  78008. return err
  78009. }
  78010. if err := f(x); err != nil {
  78011. return err
  78012. }
  78013. if x.NextPageToken == "" {
  78014. return nil
  78015. }
  78016. c.PageToken(x.NextPageToken)
  78017. }
  78018. }
  78019. // method id "compute.urlMaps.patch":
  78020. type UrlMapsPatchCall struct {
  78021. s *Service
  78022. project string
  78023. urlMap string
  78024. urlmap *UrlMap
  78025. urlParams_ gensupport.URLParams
  78026. ctx_ context.Context
  78027. header_ http.Header
  78028. }
  78029. // Patch: Patches the specified UrlMap resource with the data included
  78030. // in the request. This method supports PATCH semantics and uses the
  78031. // JSON merge patch format and processing rules.
  78032. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  78033. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  78034. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78035. c.project = project
  78036. c.urlMap = urlMap
  78037. c.urlmap = urlmap
  78038. return c
  78039. }
  78040. // RequestId sets the optional parameter "requestId": An optional
  78041. // request ID to identify requests. Specify a unique request ID so that
  78042. // if you must retry your request, the server will know to ignore the
  78043. // request if it has already been completed.
  78044. //
  78045. // For example, consider a situation where you make an initial request
  78046. // and the request times out. If you make the request again with the
  78047. // same request ID, the server can check if original operation with the
  78048. // same request ID was received, and if so, will ignore the second
  78049. // request. This prevents clients from accidentally creating duplicate
  78050. // commitments.
  78051. //
  78052. // The request ID must be a valid UUID with the exception that zero UUID
  78053. // is not supported (00000000-0000-0000-0000-000000000000).
  78054. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  78055. c.urlParams_.Set("requestId", requestId)
  78056. return c
  78057. }
  78058. // Fields allows partial responses to be retrieved. See
  78059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78060. // for more information.
  78061. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  78062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78063. return c
  78064. }
  78065. // Context sets the context to be used in this call's Do method. Any
  78066. // pending HTTP request will be aborted if the provided context is
  78067. // canceled.
  78068. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  78069. c.ctx_ = ctx
  78070. return c
  78071. }
  78072. // Header returns an http.Header that can be modified by the caller to
  78073. // add HTTP headers to the request.
  78074. func (c *UrlMapsPatchCall) Header() http.Header {
  78075. if c.header_ == nil {
  78076. c.header_ = make(http.Header)
  78077. }
  78078. return c.header_
  78079. }
  78080. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  78081. reqHeaders := make(http.Header)
  78082. for k, v := range c.header_ {
  78083. reqHeaders[k] = v
  78084. }
  78085. reqHeaders.Set("User-Agent", c.s.userAgent())
  78086. var body io.Reader = nil
  78087. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  78088. if err != nil {
  78089. return nil, err
  78090. }
  78091. reqHeaders.Set("Content-Type", "application/json")
  78092. c.urlParams_.Set("alt", alt)
  78093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  78094. urls += "?" + c.urlParams_.Encode()
  78095. req, _ := http.NewRequest("PATCH", urls, body)
  78096. req.Header = reqHeaders
  78097. googleapi.Expand(req.URL, map[string]string{
  78098. "project": c.project,
  78099. "urlMap": c.urlMap,
  78100. })
  78101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78102. }
  78103. // Do executes the "compute.urlMaps.patch" call.
  78104. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78105. // status code is an error. Response headers are in either
  78106. // *Operation.ServerResponse.Header or (if a response was returned at
  78107. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78108. // to check whether the returned error was because
  78109. // http.StatusNotModified was returned.
  78110. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78111. gensupport.SetOptions(c.urlParams_, opts...)
  78112. res, err := c.doRequest("json")
  78113. if res != nil && res.StatusCode == http.StatusNotModified {
  78114. if res.Body != nil {
  78115. res.Body.Close()
  78116. }
  78117. return nil, &googleapi.Error{
  78118. Code: res.StatusCode,
  78119. Header: res.Header,
  78120. }
  78121. }
  78122. if err != nil {
  78123. return nil, err
  78124. }
  78125. defer googleapi.CloseBody(res)
  78126. if err := googleapi.CheckResponse(res); err != nil {
  78127. return nil, err
  78128. }
  78129. ret := &Operation{
  78130. ServerResponse: googleapi.ServerResponse{
  78131. Header: res.Header,
  78132. HTTPStatusCode: res.StatusCode,
  78133. },
  78134. }
  78135. target := &ret
  78136. if err := gensupport.DecodeResponse(target, res); err != nil {
  78137. return nil, err
  78138. }
  78139. return ret, nil
  78140. // {
  78141. // "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.",
  78142. // "httpMethod": "PATCH",
  78143. // "id": "compute.urlMaps.patch",
  78144. // "parameterOrder": [
  78145. // "project",
  78146. // "urlMap"
  78147. // ],
  78148. // "parameters": {
  78149. // "project": {
  78150. // "description": "Project ID for this request.",
  78151. // "location": "path",
  78152. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78153. // "required": true,
  78154. // "type": "string"
  78155. // },
  78156. // "requestId": {
  78157. // "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).",
  78158. // "location": "query",
  78159. // "type": "string"
  78160. // },
  78161. // "urlMap": {
  78162. // "description": "Name of the UrlMap resource to patch.",
  78163. // "location": "path",
  78164. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78165. // "required": true,
  78166. // "type": "string"
  78167. // }
  78168. // },
  78169. // "path": "{project}/global/urlMaps/{urlMap}",
  78170. // "request": {
  78171. // "$ref": "UrlMap"
  78172. // },
  78173. // "response": {
  78174. // "$ref": "Operation"
  78175. // },
  78176. // "scopes": [
  78177. // "https://www.googleapis.com/auth/cloud-platform",
  78178. // "https://www.googleapis.com/auth/compute"
  78179. // ]
  78180. // }
  78181. }
  78182. // method id "compute.urlMaps.update":
  78183. type UrlMapsUpdateCall struct {
  78184. s *Service
  78185. project string
  78186. urlMap string
  78187. urlmap *UrlMap
  78188. urlParams_ gensupport.URLParams
  78189. ctx_ context.Context
  78190. header_ http.Header
  78191. }
  78192. // Update: Updates the specified UrlMap resource with the data included
  78193. // in the request.
  78194. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  78195. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  78196. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78197. c.project = project
  78198. c.urlMap = urlMap
  78199. c.urlmap = urlmap
  78200. return c
  78201. }
  78202. // RequestId sets the optional parameter "requestId": An optional
  78203. // request ID to identify requests. Specify a unique request ID so that
  78204. // if you must retry your request, the server will know to ignore the
  78205. // request if it has already been completed.
  78206. //
  78207. // For example, consider a situation where you make an initial request
  78208. // and the request times out. If you make the request again with the
  78209. // same request ID, the server can check if original operation with the
  78210. // same request ID was received, and if so, will ignore the second
  78211. // request. This prevents clients from accidentally creating duplicate
  78212. // commitments.
  78213. //
  78214. // The request ID must be a valid UUID with the exception that zero UUID
  78215. // is not supported (00000000-0000-0000-0000-000000000000).
  78216. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  78217. c.urlParams_.Set("requestId", requestId)
  78218. return c
  78219. }
  78220. // Fields allows partial responses to be retrieved. See
  78221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78222. // for more information.
  78223. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  78224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78225. return c
  78226. }
  78227. // Context sets the context to be used in this call's Do method. Any
  78228. // pending HTTP request will be aborted if the provided context is
  78229. // canceled.
  78230. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  78231. c.ctx_ = ctx
  78232. return c
  78233. }
  78234. // Header returns an http.Header that can be modified by the caller to
  78235. // add HTTP headers to the request.
  78236. func (c *UrlMapsUpdateCall) Header() http.Header {
  78237. if c.header_ == nil {
  78238. c.header_ = make(http.Header)
  78239. }
  78240. return c.header_
  78241. }
  78242. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  78243. reqHeaders := make(http.Header)
  78244. for k, v := range c.header_ {
  78245. reqHeaders[k] = v
  78246. }
  78247. reqHeaders.Set("User-Agent", c.s.userAgent())
  78248. var body io.Reader = nil
  78249. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  78250. if err != nil {
  78251. return nil, err
  78252. }
  78253. reqHeaders.Set("Content-Type", "application/json")
  78254. c.urlParams_.Set("alt", alt)
  78255. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  78256. urls += "?" + c.urlParams_.Encode()
  78257. req, _ := http.NewRequest("PUT", urls, body)
  78258. req.Header = reqHeaders
  78259. googleapi.Expand(req.URL, map[string]string{
  78260. "project": c.project,
  78261. "urlMap": c.urlMap,
  78262. })
  78263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78264. }
  78265. // Do executes the "compute.urlMaps.update" call.
  78266. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78267. // status code is an error. Response headers are in either
  78268. // *Operation.ServerResponse.Header or (if a response was returned at
  78269. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78270. // to check whether the returned error was because
  78271. // http.StatusNotModified was returned.
  78272. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78273. gensupport.SetOptions(c.urlParams_, opts...)
  78274. res, err := c.doRequest("json")
  78275. if res != nil && res.StatusCode == http.StatusNotModified {
  78276. if res.Body != nil {
  78277. res.Body.Close()
  78278. }
  78279. return nil, &googleapi.Error{
  78280. Code: res.StatusCode,
  78281. Header: res.Header,
  78282. }
  78283. }
  78284. if err != nil {
  78285. return nil, err
  78286. }
  78287. defer googleapi.CloseBody(res)
  78288. if err := googleapi.CheckResponse(res); err != nil {
  78289. return nil, err
  78290. }
  78291. ret := &Operation{
  78292. ServerResponse: googleapi.ServerResponse{
  78293. Header: res.Header,
  78294. HTTPStatusCode: res.StatusCode,
  78295. },
  78296. }
  78297. target := &ret
  78298. if err := gensupport.DecodeResponse(target, res); err != nil {
  78299. return nil, err
  78300. }
  78301. return ret, nil
  78302. // {
  78303. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  78304. // "httpMethod": "PUT",
  78305. // "id": "compute.urlMaps.update",
  78306. // "parameterOrder": [
  78307. // "project",
  78308. // "urlMap"
  78309. // ],
  78310. // "parameters": {
  78311. // "project": {
  78312. // "description": "Project ID for this request.",
  78313. // "location": "path",
  78314. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78315. // "required": true,
  78316. // "type": "string"
  78317. // },
  78318. // "requestId": {
  78319. // "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).",
  78320. // "location": "query",
  78321. // "type": "string"
  78322. // },
  78323. // "urlMap": {
  78324. // "description": "Name of the UrlMap resource to update.",
  78325. // "location": "path",
  78326. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78327. // "required": true,
  78328. // "type": "string"
  78329. // }
  78330. // },
  78331. // "path": "{project}/global/urlMaps/{urlMap}",
  78332. // "request": {
  78333. // "$ref": "UrlMap"
  78334. // },
  78335. // "response": {
  78336. // "$ref": "Operation"
  78337. // },
  78338. // "scopes": [
  78339. // "https://www.googleapis.com/auth/cloud-platform",
  78340. // "https://www.googleapis.com/auth/compute"
  78341. // ]
  78342. // }
  78343. }
  78344. // method id "compute.urlMaps.validate":
  78345. type UrlMapsValidateCall struct {
  78346. s *Service
  78347. project string
  78348. urlMap string
  78349. urlmapsvalidaterequest *UrlMapsValidateRequest
  78350. urlParams_ gensupport.URLParams
  78351. ctx_ context.Context
  78352. header_ http.Header
  78353. }
  78354. // Validate: Runs static validation for the UrlMap. In particular, the
  78355. // tests of the provided UrlMap will be run. Calling this method does
  78356. // NOT create the UrlMap.
  78357. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  78358. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  78359. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78360. c.project = project
  78361. c.urlMap = urlMap
  78362. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  78363. return c
  78364. }
  78365. // Fields allows partial responses to be retrieved. See
  78366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78367. // for more information.
  78368. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  78369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78370. return c
  78371. }
  78372. // Context sets the context to be used in this call's Do method. Any
  78373. // pending HTTP request will be aborted if the provided context is
  78374. // canceled.
  78375. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  78376. c.ctx_ = ctx
  78377. return c
  78378. }
  78379. // Header returns an http.Header that can be modified by the caller to
  78380. // add HTTP headers to the request.
  78381. func (c *UrlMapsValidateCall) Header() http.Header {
  78382. if c.header_ == nil {
  78383. c.header_ = make(http.Header)
  78384. }
  78385. return c.header_
  78386. }
  78387. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  78388. reqHeaders := make(http.Header)
  78389. for k, v := range c.header_ {
  78390. reqHeaders[k] = v
  78391. }
  78392. reqHeaders.Set("User-Agent", c.s.userAgent())
  78393. var body io.Reader = nil
  78394. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  78395. if err != nil {
  78396. return nil, err
  78397. }
  78398. reqHeaders.Set("Content-Type", "application/json")
  78399. c.urlParams_.Set("alt", alt)
  78400. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  78401. urls += "?" + c.urlParams_.Encode()
  78402. req, _ := http.NewRequest("POST", urls, body)
  78403. req.Header = reqHeaders
  78404. googleapi.Expand(req.URL, map[string]string{
  78405. "project": c.project,
  78406. "urlMap": c.urlMap,
  78407. })
  78408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78409. }
  78410. // Do executes the "compute.urlMaps.validate" call.
  78411. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  78412. // non-2xx status code is an error. Response headers are in either
  78413. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  78414. // returned at all) in error.(*googleapi.Error).Header. Use
  78415. // googleapi.IsNotModified to check whether the returned error was
  78416. // because http.StatusNotModified was returned.
  78417. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  78418. gensupport.SetOptions(c.urlParams_, opts...)
  78419. res, err := c.doRequest("json")
  78420. if res != nil && res.StatusCode == http.StatusNotModified {
  78421. if res.Body != nil {
  78422. res.Body.Close()
  78423. }
  78424. return nil, &googleapi.Error{
  78425. Code: res.StatusCode,
  78426. Header: res.Header,
  78427. }
  78428. }
  78429. if err != nil {
  78430. return nil, err
  78431. }
  78432. defer googleapi.CloseBody(res)
  78433. if err := googleapi.CheckResponse(res); err != nil {
  78434. return nil, err
  78435. }
  78436. ret := &UrlMapsValidateResponse{
  78437. ServerResponse: googleapi.ServerResponse{
  78438. Header: res.Header,
  78439. HTTPStatusCode: res.StatusCode,
  78440. },
  78441. }
  78442. target := &ret
  78443. if err := gensupport.DecodeResponse(target, res); err != nil {
  78444. return nil, err
  78445. }
  78446. return ret, nil
  78447. // {
  78448. // "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.",
  78449. // "httpMethod": "POST",
  78450. // "id": "compute.urlMaps.validate",
  78451. // "parameterOrder": [
  78452. // "project",
  78453. // "urlMap"
  78454. // ],
  78455. // "parameters": {
  78456. // "project": {
  78457. // "description": "Project ID for this request.",
  78458. // "location": "path",
  78459. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78460. // "required": true,
  78461. // "type": "string"
  78462. // },
  78463. // "urlMap": {
  78464. // "description": "Name of the UrlMap resource to be validated as.",
  78465. // "location": "path",
  78466. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78467. // "required": true,
  78468. // "type": "string"
  78469. // }
  78470. // },
  78471. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  78472. // "request": {
  78473. // "$ref": "UrlMapsValidateRequest"
  78474. // },
  78475. // "response": {
  78476. // "$ref": "UrlMapsValidateResponse"
  78477. // },
  78478. // "scopes": [
  78479. // "https://www.googleapis.com/auth/cloud-platform",
  78480. // "https://www.googleapis.com/auth/compute"
  78481. // ]
  78482. // }
  78483. }
  78484. // method id "compute.vpnTunnels.aggregatedList":
  78485. type VpnTunnelsAggregatedListCall struct {
  78486. s *Service
  78487. project string
  78488. urlParams_ gensupport.URLParams
  78489. ifNoneMatch_ string
  78490. ctx_ context.Context
  78491. header_ http.Header
  78492. }
  78493. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  78494. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  78495. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78496. c.project = project
  78497. return c
  78498. }
  78499. // Filter sets the optional parameter "filter": A filter expression that
  78500. // filters resources listed in the response. The expression must specify
  78501. // the field name, a comparison operator, and the value that you want to
  78502. // use for filtering. The value must be a string, a number, or a
  78503. // boolean. The comparison operator must be either =, !=, >, or <.
  78504. //
  78505. // For example, if you are filtering Compute Engine instances, you can
  78506. // exclude instances named example-instance by specifying name !=
  78507. // example-instance.
  78508. //
  78509. // You can also filter nested fields. For example, you could specify
  78510. // scheduling.automaticRestart = false to include instances only if they
  78511. // are not scheduled for automatic restarts. You can use filtering on
  78512. // nested fields to filter based on resource labels.
  78513. //
  78514. // To filter on multiple expressions, provide each separate expression
  78515. // within parentheses. For example, (scheduling.automaticRestart = true)
  78516. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78517. // AND expression. However, you can include AND and OR expressions
  78518. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78519. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78520. // true).
  78521. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  78522. c.urlParams_.Set("filter", filter)
  78523. return c
  78524. }
  78525. // MaxResults sets the optional parameter "maxResults": The maximum
  78526. // number of results per page that should be returned. If the number of
  78527. // available results is larger than maxResults, Compute Engine returns a
  78528. // nextPageToken that can be used to get the next page of results in
  78529. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78530. // (Default: 500)
  78531. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  78532. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78533. return c
  78534. }
  78535. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78536. // a certain order. By default, results are returned in alphanumerical
  78537. // order based on the resource name.
  78538. //
  78539. // You can also sort results in descending order based on the creation
  78540. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78541. // based on the creationTimestamp field in reverse chronological order
  78542. // (newest result first). Use this to sort resources like operations so
  78543. // that the newest operation is returned first.
  78544. //
  78545. // Currently, only sorting by name or creationTimestamp desc is
  78546. // supported.
  78547. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  78548. c.urlParams_.Set("orderBy", orderBy)
  78549. return c
  78550. }
  78551. // PageToken sets the optional parameter "pageToken": Specifies a page
  78552. // token to use. Set pageToken to the nextPageToken returned by a
  78553. // previous list request to get the next page of results.
  78554. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  78555. c.urlParams_.Set("pageToken", pageToken)
  78556. return c
  78557. }
  78558. // Fields allows partial responses to be retrieved. See
  78559. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78560. // for more information.
  78561. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  78562. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78563. return c
  78564. }
  78565. // IfNoneMatch sets the optional parameter which makes the operation
  78566. // fail if the object's ETag matches the given value. This is useful for
  78567. // getting updates only after the object has changed since the last
  78568. // request. Use googleapi.IsNotModified to check whether the response
  78569. // error from Do is the result of In-None-Match.
  78570. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  78571. c.ifNoneMatch_ = entityTag
  78572. return c
  78573. }
  78574. // Context sets the context to be used in this call's Do method. Any
  78575. // pending HTTP request will be aborted if the provided context is
  78576. // canceled.
  78577. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  78578. c.ctx_ = ctx
  78579. return c
  78580. }
  78581. // Header returns an http.Header that can be modified by the caller to
  78582. // add HTTP headers to the request.
  78583. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  78584. if c.header_ == nil {
  78585. c.header_ = make(http.Header)
  78586. }
  78587. return c.header_
  78588. }
  78589. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  78590. reqHeaders := make(http.Header)
  78591. for k, v := range c.header_ {
  78592. reqHeaders[k] = v
  78593. }
  78594. reqHeaders.Set("User-Agent", c.s.userAgent())
  78595. if c.ifNoneMatch_ != "" {
  78596. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78597. }
  78598. var body io.Reader = nil
  78599. c.urlParams_.Set("alt", alt)
  78600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  78601. urls += "?" + c.urlParams_.Encode()
  78602. req, _ := http.NewRequest("GET", urls, body)
  78603. req.Header = reqHeaders
  78604. googleapi.Expand(req.URL, map[string]string{
  78605. "project": c.project,
  78606. })
  78607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78608. }
  78609. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  78610. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  78611. // non-2xx status code is an error. Response headers are in either
  78612. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  78613. // returned at all) in error.(*googleapi.Error).Header. Use
  78614. // googleapi.IsNotModified to check whether the returned error was
  78615. // because http.StatusNotModified was returned.
  78616. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  78617. gensupport.SetOptions(c.urlParams_, opts...)
  78618. res, err := c.doRequest("json")
  78619. if res != nil && res.StatusCode == http.StatusNotModified {
  78620. if res.Body != nil {
  78621. res.Body.Close()
  78622. }
  78623. return nil, &googleapi.Error{
  78624. Code: res.StatusCode,
  78625. Header: res.Header,
  78626. }
  78627. }
  78628. if err != nil {
  78629. return nil, err
  78630. }
  78631. defer googleapi.CloseBody(res)
  78632. if err := googleapi.CheckResponse(res); err != nil {
  78633. return nil, err
  78634. }
  78635. ret := &VpnTunnelAggregatedList{
  78636. ServerResponse: googleapi.ServerResponse{
  78637. Header: res.Header,
  78638. HTTPStatusCode: res.StatusCode,
  78639. },
  78640. }
  78641. target := &ret
  78642. if err := gensupport.DecodeResponse(target, res); err != nil {
  78643. return nil, err
  78644. }
  78645. return ret, nil
  78646. // {
  78647. // "description": "Retrieves an aggregated list of VPN tunnels.",
  78648. // "httpMethod": "GET",
  78649. // "id": "compute.vpnTunnels.aggregatedList",
  78650. // "parameterOrder": [
  78651. // "project"
  78652. // ],
  78653. // "parameters": {
  78654. // "filter": {
  78655. // "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).",
  78656. // "location": "query",
  78657. // "type": "string"
  78658. // },
  78659. // "maxResults": {
  78660. // "default": "500",
  78661. // "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)",
  78662. // "format": "uint32",
  78663. // "location": "query",
  78664. // "minimum": "0",
  78665. // "type": "integer"
  78666. // },
  78667. // "orderBy": {
  78668. // "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.",
  78669. // "location": "query",
  78670. // "type": "string"
  78671. // },
  78672. // "pageToken": {
  78673. // "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.",
  78674. // "location": "query",
  78675. // "type": "string"
  78676. // },
  78677. // "project": {
  78678. // "description": "Project ID for this request.",
  78679. // "location": "path",
  78680. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78681. // "required": true,
  78682. // "type": "string"
  78683. // }
  78684. // },
  78685. // "path": "{project}/aggregated/vpnTunnels",
  78686. // "response": {
  78687. // "$ref": "VpnTunnelAggregatedList"
  78688. // },
  78689. // "scopes": [
  78690. // "https://www.googleapis.com/auth/cloud-platform",
  78691. // "https://www.googleapis.com/auth/compute",
  78692. // "https://www.googleapis.com/auth/compute.readonly"
  78693. // ]
  78694. // }
  78695. }
  78696. // Pages invokes f for each page of results.
  78697. // A non-nil error returned from f will halt the iteration.
  78698. // The provided context supersedes any context provided to the Context method.
  78699. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  78700. c.ctx_ = ctx
  78701. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78702. for {
  78703. x, err := c.Do()
  78704. if err != nil {
  78705. return err
  78706. }
  78707. if err := f(x); err != nil {
  78708. return err
  78709. }
  78710. if x.NextPageToken == "" {
  78711. return nil
  78712. }
  78713. c.PageToken(x.NextPageToken)
  78714. }
  78715. }
  78716. // method id "compute.vpnTunnels.delete":
  78717. type VpnTunnelsDeleteCall struct {
  78718. s *Service
  78719. project string
  78720. region string
  78721. vpnTunnel string
  78722. urlParams_ gensupport.URLParams
  78723. ctx_ context.Context
  78724. header_ http.Header
  78725. }
  78726. // Delete: Deletes the specified VpnTunnel resource.
  78727. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  78728. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78729. c.project = project
  78730. c.region = region
  78731. c.vpnTunnel = vpnTunnel
  78732. return c
  78733. }
  78734. // RequestId sets the optional parameter "requestId": An optional
  78735. // request ID to identify requests. Specify a unique request ID so that
  78736. // if you must retry your request, the server will know to ignore the
  78737. // request if it has already been completed.
  78738. //
  78739. // For example, consider a situation where you make an initial request
  78740. // and the request times out. If you make the request again with the
  78741. // same request ID, the server can check if original operation with the
  78742. // same request ID was received, and if so, will ignore the second
  78743. // request. This prevents clients from accidentally creating duplicate
  78744. // commitments.
  78745. //
  78746. // The request ID must be a valid UUID with the exception that zero UUID
  78747. // is not supported (00000000-0000-0000-0000-000000000000).
  78748. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  78749. c.urlParams_.Set("requestId", requestId)
  78750. return c
  78751. }
  78752. // Fields allows partial responses to be retrieved. See
  78753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78754. // for more information.
  78755. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  78756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78757. return c
  78758. }
  78759. // Context sets the context to be used in this call's Do method. Any
  78760. // pending HTTP request will be aborted if the provided context is
  78761. // canceled.
  78762. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  78763. c.ctx_ = ctx
  78764. return c
  78765. }
  78766. // Header returns an http.Header that can be modified by the caller to
  78767. // add HTTP headers to the request.
  78768. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  78769. if c.header_ == nil {
  78770. c.header_ = make(http.Header)
  78771. }
  78772. return c.header_
  78773. }
  78774. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  78775. reqHeaders := make(http.Header)
  78776. for k, v := range c.header_ {
  78777. reqHeaders[k] = v
  78778. }
  78779. reqHeaders.Set("User-Agent", c.s.userAgent())
  78780. var body io.Reader = nil
  78781. c.urlParams_.Set("alt", alt)
  78782. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  78783. urls += "?" + c.urlParams_.Encode()
  78784. req, _ := http.NewRequest("DELETE", urls, body)
  78785. req.Header = reqHeaders
  78786. googleapi.Expand(req.URL, map[string]string{
  78787. "project": c.project,
  78788. "region": c.region,
  78789. "vpnTunnel": c.vpnTunnel,
  78790. })
  78791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78792. }
  78793. // Do executes the "compute.vpnTunnels.delete" call.
  78794. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78795. // status code is an error. Response headers are in either
  78796. // *Operation.ServerResponse.Header or (if a response was returned at
  78797. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78798. // to check whether the returned error was because
  78799. // http.StatusNotModified was returned.
  78800. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78801. gensupport.SetOptions(c.urlParams_, opts...)
  78802. res, err := c.doRequest("json")
  78803. if res != nil && res.StatusCode == http.StatusNotModified {
  78804. if res.Body != nil {
  78805. res.Body.Close()
  78806. }
  78807. return nil, &googleapi.Error{
  78808. Code: res.StatusCode,
  78809. Header: res.Header,
  78810. }
  78811. }
  78812. if err != nil {
  78813. return nil, err
  78814. }
  78815. defer googleapi.CloseBody(res)
  78816. if err := googleapi.CheckResponse(res); err != nil {
  78817. return nil, err
  78818. }
  78819. ret := &Operation{
  78820. ServerResponse: googleapi.ServerResponse{
  78821. Header: res.Header,
  78822. HTTPStatusCode: res.StatusCode,
  78823. },
  78824. }
  78825. target := &ret
  78826. if err := gensupport.DecodeResponse(target, res); err != nil {
  78827. return nil, err
  78828. }
  78829. return ret, nil
  78830. // {
  78831. // "description": "Deletes the specified VpnTunnel resource.",
  78832. // "httpMethod": "DELETE",
  78833. // "id": "compute.vpnTunnels.delete",
  78834. // "parameterOrder": [
  78835. // "project",
  78836. // "region",
  78837. // "vpnTunnel"
  78838. // ],
  78839. // "parameters": {
  78840. // "project": {
  78841. // "description": "Project ID for this request.",
  78842. // "location": "path",
  78843. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78844. // "required": true,
  78845. // "type": "string"
  78846. // },
  78847. // "region": {
  78848. // "description": "Name of the region for this request.",
  78849. // "location": "path",
  78850. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78851. // "required": true,
  78852. // "type": "string"
  78853. // },
  78854. // "requestId": {
  78855. // "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).",
  78856. // "location": "query",
  78857. // "type": "string"
  78858. // },
  78859. // "vpnTunnel": {
  78860. // "description": "Name of the VpnTunnel resource to delete.",
  78861. // "location": "path",
  78862. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78863. // "required": true,
  78864. // "type": "string"
  78865. // }
  78866. // },
  78867. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  78868. // "response": {
  78869. // "$ref": "Operation"
  78870. // },
  78871. // "scopes": [
  78872. // "https://www.googleapis.com/auth/cloud-platform",
  78873. // "https://www.googleapis.com/auth/compute"
  78874. // ]
  78875. // }
  78876. }
  78877. // method id "compute.vpnTunnels.get":
  78878. type VpnTunnelsGetCall struct {
  78879. s *Service
  78880. project string
  78881. region string
  78882. vpnTunnel string
  78883. urlParams_ gensupport.URLParams
  78884. ifNoneMatch_ string
  78885. ctx_ context.Context
  78886. header_ http.Header
  78887. }
  78888. // Get: Returns the specified VpnTunnel resource. Gets a list of
  78889. // available VPN tunnels by making a list() request.
  78890. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  78891. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78892. c.project = project
  78893. c.region = region
  78894. c.vpnTunnel = vpnTunnel
  78895. return c
  78896. }
  78897. // Fields allows partial responses to be retrieved. See
  78898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78899. // for more information.
  78900. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  78901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78902. return c
  78903. }
  78904. // IfNoneMatch sets the optional parameter which makes the operation
  78905. // fail if the object's ETag matches the given value. This is useful for
  78906. // getting updates only after the object has changed since the last
  78907. // request. Use googleapi.IsNotModified to check whether the response
  78908. // error from Do is the result of In-None-Match.
  78909. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  78910. c.ifNoneMatch_ = entityTag
  78911. return c
  78912. }
  78913. // Context sets the context to be used in this call's Do method. Any
  78914. // pending HTTP request will be aborted if the provided context is
  78915. // canceled.
  78916. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  78917. c.ctx_ = ctx
  78918. return c
  78919. }
  78920. // Header returns an http.Header that can be modified by the caller to
  78921. // add HTTP headers to the request.
  78922. func (c *VpnTunnelsGetCall) Header() http.Header {
  78923. if c.header_ == nil {
  78924. c.header_ = make(http.Header)
  78925. }
  78926. return c.header_
  78927. }
  78928. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  78929. reqHeaders := make(http.Header)
  78930. for k, v := range c.header_ {
  78931. reqHeaders[k] = v
  78932. }
  78933. reqHeaders.Set("User-Agent", c.s.userAgent())
  78934. if c.ifNoneMatch_ != "" {
  78935. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78936. }
  78937. var body io.Reader = nil
  78938. c.urlParams_.Set("alt", alt)
  78939. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  78940. urls += "?" + c.urlParams_.Encode()
  78941. req, _ := http.NewRequest("GET", urls, body)
  78942. req.Header = reqHeaders
  78943. googleapi.Expand(req.URL, map[string]string{
  78944. "project": c.project,
  78945. "region": c.region,
  78946. "vpnTunnel": c.vpnTunnel,
  78947. })
  78948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78949. }
  78950. // Do executes the "compute.vpnTunnels.get" call.
  78951. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  78952. // status code is an error. Response headers are in either
  78953. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  78954. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78955. // to check whether the returned error was because
  78956. // http.StatusNotModified was returned.
  78957. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  78958. gensupport.SetOptions(c.urlParams_, opts...)
  78959. res, err := c.doRequest("json")
  78960. if res != nil && res.StatusCode == http.StatusNotModified {
  78961. if res.Body != nil {
  78962. res.Body.Close()
  78963. }
  78964. return nil, &googleapi.Error{
  78965. Code: res.StatusCode,
  78966. Header: res.Header,
  78967. }
  78968. }
  78969. if err != nil {
  78970. return nil, err
  78971. }
  78972. defer googleapi.CloseBody(res)
  78973. if err := googleapi.CheckResponse(res); err != nil {
  78974. return nil, err
  78975. }
  78976. ret := &VpnTunnel{
  78977. ServerResponse: googleapi.ServerResponse{
  78978. Header: res.Header,
  78979. HTTPStatusCode: res.StatusCode,
  78980. },
  78981. }
  78982. target := &ret
  78983. if err := gensupport.DecodeResponse(target, res); err != nil {
  78984. return nil, err
  78985. }
  78986. return ret, nil
  78987. // {
  78988. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  78989. // "httpMethod": "GET",
  78990. // "id": "compute.vpnTunnels.get",
  78991. // "parameterOrder": [
  78992. // "project",
  78993. // "region",
  78994. // "vpnTunnel"
  78995. // ],
  78996. // "parameters": {
  78997. // "project": {
  78998. // "description": "Project ID for this request.",
  78999. // "location": "path",
  79000. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79001. // "required": true,
  79002. // "type": "string"
  79003. // },
  79004. // "region": {
  79005. // "description": "Name of the region for this request.",
  79006. // "location": "path",
  79007. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79008. // "required": true,
  79009. // "type": "string"
  79010. // },
  79011. // "vpnTunnel": {
  79012. // "description": "Name of the VpnTunnel resource to return.",
  79013. // "location": "path",
  79014. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79015. // "required": true,
  79016. // "type": "string"
  79017. // }
  79018. // },
  79019. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  79020. // "response": {
  79021. // "$ref": "VpnTunnel"
  79022. // },
  79023. // "scopes": [
  79024. // "https://www.googleapis.com/auth/cloud-platform",
  79025. // "https://www.googleapis.com/auth/compute",
  79026. // "https://www.googleapis.com/auth/compute.readonly"
  79027. // ]
  79028. // }
  79029. }
  79030. // method id "compute.vpnTunnels.insert":
  79031. type VpnTunnelsInsertCall struct {
  79032. s *Service
  79033. project string
  79034. region string
  79035. vpntunnel *VpnTunnel
  79036. urlParams_ gensupport.URLParams
  79037. ctx_ context.Context
  79038. header_ http.Header
  79039. }
  79040. // Insert: Creates a VpnTunnel resource in the specified project and
  79041. // region using the data included in the request.
  79042. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  79043. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79044. c.project = project
  79045. c.region = region
  79046. c.vpntunnel = vpntunnel
  79047. return c
  79048. }
  79049. // RequestId sets the optional parameter "requestId": An optional
  79050. // request ID to identify requests. Specify a unique request ID so that
  79051. // if you must retry your request, the server will know to ignore the
  79052. // request if it has already been completed.
  79053. //
  79054. // For example, consider a situation where you make an initial request
  79055. // and the request times out. If you make the request again with the
  79056. // same request ID, the server can check if original operation with the
  79057. // same request ID was received, and if so, will ignore the second
  79058. // request. This prevents clients from accidentally creating duplicate
  79059. // commitments.
  79060. //
  79061. // The request ID must be a valid UUID with the exception that zero UUID
  79062. // is not supported (00000000-0000-0000-0000-000000000000).
  79063. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  79064. c.urlParams_.Set("requestId", requestId)
  79065. return c
  79066. }
  79067. // Fields allows partial responses to be retrieved. See
  79068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79069. // for more information.
  79070. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  79071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79072. return c
  79073. }
  79074. // Context sets the context to be used in this call's Do method. Any
  79075. // pending HTTP request will be aborted if the provided context is
  79076. // canceled.
  79077. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  79078. c.ctx_ = ctx
  79079. return c
  79080. }
  79081. // Header returns an http.Header that can be modified by the caller to
  79082. // add HTTP headers to the request.
  79083. func (c *VpnTunnelsInsertCall) Header() http.Header {
  79084. if c.header_ == nil {
  79085. c.header_ = make(http.Header)
  79086. }
  79087. return c.header_
  79088. }
  79089. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  79090. reqHeaders := make(http.Header)
  79091. for k, v := range c.header_ {
  79092. reqHeaders[k] = v
  79093. }
  79094. reqHeaders.Set("User-Agent", c.s.userAgent())
  79095. var body io.Reader = nil
  79096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  79097. if err != nil {
  79098. return nil, err
  79099. }
  79100. reqHeaders.Set("Content-Type", "application/json")
  79101. c.urlParams_.Set("alt", alt)
  79102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  79103. urls += "?" + c.urlParams_.Encode()
  79104. req, _ := http.NewRequest("POST", urls, body)
  79105. req.Header = reqHeaders
  79106. googleapi.Expand(req.URL, map[string]string{
  79107. "project": c.project,
  79108. "region": c.region,
  79109. })
  79110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79111. }
  79112. // Do executes the "compute.vpnTunnels.insert" call.
  79113. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79114. // status code is an error. Response headers are in either
  79115. // *Operation.ServerResponse.Header or (if a response was returned at
  79116. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79117. // to check whether the returned error was because
  79118. // http.StatusNotModified was returned.
  79119. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79120. gensupport.SetOptions(c.urlParams_, opts...)
  79121. res, err := c.doRequest("json")
  79122. if res != nil && res.StatusCode == http.StatusNotModified {
  79123. if res.Body != nil {
  79124. res.Body.Close()
  79125. }
  79126. return nil, &googleapi.Error{
  79127. Code: res.StatusCode,
  79128. Header: res.Header,
  79129. }
  79130. }
  79131. if err != nil {
  79132. return nil, err
  79133. }
  79134. defer googleapi.CloseBody(res)
  79135. if err := googleapi.CheckResponse(res); err != nil {
  79136. return nil, err
  79137. }
  79138. ret := &Operation{
  79139. ServerResponse: googleapi.ServerResponse{
  79140. Header: res.Header,
  79141. HTTPStatusCode: res.StatusCode,
  79142. },
  79143. }
  79144. target := &ret
  79145. if err := gensupport.DecodeResponse(target, res); err != nil {
  79146. return nil, err
  79147. }
  79148. return ret, nil
  79149. // {
  79150. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  79151. // "httpMethod": "POST",
  79152. // "id": "compute.vpnTunnels.insert",
  79153. // "parameterOrder": [
  79154. // "project",
  79155. // "region"
  79156. // ],
  79157. // "parameters": {
  79158. // "project": {
  79159. // "description": "Project ID for this request.",
  79160. // "location": "path",
  79161. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79162. // "required": true,
  79163. // "type": "string"
  79164. // },
  79165. // "region": {
  79166. // "description": "Name of the region for this request.",
  79167. // "location": "path",
  79168. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79169. // "required": true,
  79170. // "type": "string"
  79171. // },
  79172. // "requestId": {
  79173. // "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).",
  79174. // "location": "query",
  79175. // "type": "string"
  79176. // }
  79177. // },
  79178. // "path": "{project}/regions/{region}/vpnTunnels",
  79179. // "request": {
  79180. // "$ref": "VpnTunnel"
  79181. // },
  79182. // "response": {
  79183. // "$ref": "Operation"
  79184. // },
  79185. // "scopes": [
  79186. // "https://www.googleapis.com/auth/cloud-platform",
  79187. // "https://www.googleapis.com/auth/compute"
  79188. // ]
  79189. // }
  79190. }
  79191. // method id "compute.vpnTunnels.list":
  79192. type VpnTunnelsListCall struct {
  79193. s *Service
  79194. project string
  79195. region string
  79196. urlParams_ gensupport.URLParams
  79197. ifNoneMatch_ string
  79198. ctx_ context.Context
  79199. header_ http.Header
  79200. }
  79201. // List: Retrieves a list of VpnTunnel resources contained in the
  79202. // specified project and region.
  79203. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  79204. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79205. c.project = project
  79206. c.region = region
  79207. return c
  79208. }
  79209. // Filter sets the optional parameter "filter": A filter expression that
  79210. // filters resources listed in the response. The expression must specify
  79211. // the field name, a comparison operator, and the value that you want to
  79212. // use for filtering. The value must be a string, a number, or a
  79213. // boolean. The comparison operator must be either =, !=, >, or <.
  79214. //
  79215. // For example, if you are filtering Compute Engine instances, you can
  79216. // exclude instances named example-instance by specifying name !=
  79217. // example-instance.
  79218. //
  79219. // You can also filter nested fields. For example, you could specify
  79220. // scheduling.automaticRestart = false to include instances only if they
  79221. // are not scheduled for automatic restarts. You can use filtering on
  79222. // nested fields to filter based on resource labels.
  79223. //
  79224. // To filter on multiple expressions, provide each separate expression
  79225. // within parentheses. For example, (scheduling.automaticRestart = true)
  79226. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79227. // AND expression. However, you can include AND and OR expressions
  79228. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79229. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79230. // true).
  79231. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  79232. c.urlParams_.Set("filter", filter)
  79233. return c
  79234. }
  79235. // MaxResults sets the optional parameter "maxResults": The maximum
  79236. // number of results per page that should be returned. If the number of
  79237. // available results is larger than maxResults, Compute Engine returns a
  79238. // nextPageToken that can be used to get the next page of results in
  79239. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79240. // (Default: 500)
  79241. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  79242. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79243. return c
  79244. }
  79245. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79246. // a certain order. By default, results are returned in alphanumerical
  79247. // order based on the resource name.
  79248. //
  79249. // You can also sort results in descending order based on the creation
  79250. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79251. // based on the creationTimestamp field in reverse chronological order
  79252. // (newest result first). Use this to sort resources like operations so
  79253. // that the newest operation is returned first.
  79254. //
  79255. // Currently, only sorting by name or creationTimestamp desc is
  79256. // supported.
  79257. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  79258. c.urlParams_.Set("orderBy", orderBy)
  79259. return c
  79260. }
  79261. // PageToken sets the optional parameter "pageToken": Specifies a page
  79262. // token to use. Set pageToken to the nextPageToken returned by a
  79263. // previous list request to get the next page of results.
  79264. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  79265. c.urlParams_.Set("pageToken", pageToken)
  79266. return c
  79267. }
  79268. // Fields allows partial responses to be retrieved. See
  79269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79270. // for more information.
  79271. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  79272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79273. return c
  79274. }
  79275. // IfNoneMatch sets the optional parameter which makes the operation
  79276. // fail if the object's ETag matches the given value. This is useful for
  79277. // getting updates only after the object has changed since the last
  79278. // request. Use googleapi.IsNotModified to check whether the response
  79279. // error from Do is the result of In-None-Match.
  79280. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  79281. c.ifNoneMatch_ = entityTag
  79282. return c
  79283. }
  79284. // Context sets the context to be used in this call's Do method. Any
  79285. // pending HTTP request will be aborted if the provided context is
  79286. // canceled.
  79287. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  79288. c.ctx_ = ctx
  79289. return c
  79290. }
  79291. // Header returns an http.Header that can be modified by the caller to
  79292. // add HTTP headers to the request.
  79293. func (c *VpnTunnelsListCall) Header() http.Header {
  79294. if c.header_ == nil {
  79295. c.header_ = make(http.Header)
  79296. }
  79297. return c.header_
  79298. }
  79299. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  79300. reqHeaders := make(http.Header)
  79301. for k, v := range c.header_ {
  79302. reqHeaders[k] = v
  79303. }
  79304. reqHeaders.Set("User-Agent", c.s.userAgent())
  79305. if c.ifNoneMatch_ != "" {
  79306. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79307. }
  79308. var body io.Reader = nil
  79309. c.urlParams_.Set("alt", alt)
  79310. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  79311. urls += "?" + c.urlParams_.Encode()
  79312. req, _ := http.NewRequest("GET", urls, body)
  79313. req.Header = reqHeaders
  79314. googleapi.Expand(req.URL, map[string]string{
  79315. "project": c.project,
  79316. "region": c.region,
  79317. })
  79318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79319. }
  79320. // Do executes the "compute.vpnTunnels.list" call.
  79321. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  79322. // status code is an error. Response headers are in either
  79323. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  79324. // at all) in error.(*googleapi.Error).Header. Use
  79325. // googleapi.IsNotModified to check whether the returned error was
  79326. // because http.StatusNotModified was returned.
  79327. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  79328. gensupport.SetOptions(c.urlParams_, opts...)
  79329. res, err := c.doRequest("json")
  79330. if res != nil && res.StatusCode == http.StatusNotModified {
  79331. if res.Body != nil {
  79332. res.Body.Close()
  79333. }
  79334. return nil, &googleapi.Error{
  79335. Code: res.StatusCode,
  79336. Header: res.Header,
  79337. }
  79338. }
  79339. if err != nil {
  79340. return nil, err
  79341. }
  79342. defer googleapi.CloseBody(res)
  79343. if err := googleapi.CheckResponse(res); err != nil {
  79344. return nil, err
  79345. }
  79346. ret := &VpnTunnelList{
  79347. ServerResponse: googleapi.ServerResponse{
  79348. Header: res.Header,
  79349. HTTPStatusCode: res.StatusCode,
  79350. },
  79351. }
  79352. target := &ret
  79353. if err := gensupport.DecodeResponse(target, res); err != nil {
  79354. return nil, err
  79355. }
  79356. return ret, nil
  79357. // {
  79358. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  79359. // "httpMethod": "GET",
  79360. // "id": "compute.vpnTunnels.list",
  79361. // "parameterOrder": [
  79362. // "project",
  79363. // "region"
  79364. // ],
  79365. // "parameters": {
  79366. // "filter": {
  79367. // "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).",
  79368. // "location": "query",
  79369. // "type": "string"
  79370. // },
  79371. // "maxResults": {
  79372. // "default": "500",
  79373. // "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)",
  79374. // "format": "uint32",
  79375. // "location": "query",
  79376. // "minimum": "0",
  79377. // "type": "integer"
  79378. // },
  79379. // "orderBy": {
  79380. // "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.",
  79381. // "location": "query",
  79382. // "type": "string"
  79383. // },
  79384. // "pageToken": {
  79385. // "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.",
  79386. // "location": "query",
  79387. // "type": "string"
  79388. // },
  79389. // "project": {
  79390. // "description": "Project ID for this request.",
  79391. // "location": "path",
  79392. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79393. // "required": true,
  79394. // "type": "string"
  79395. // },
  79396. // "region": {
  79397. // "description": "Name of the region for this request.",
  79398. // "location": "path",
  79399. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79400. // "required": true,
  79401. // "type": "string"
  79402. // }
  79403. // },
  79404. // "path": "{project}/regions/{region}/vpnTunnels",
  79405. // "response": {
  79406. // "$ref": "VpnTunnelList"
  79407. // },
  79408. // "scopes": [
  79409. // "https://www.googleapis.com/auth/cloud-platform",
  79410. // "https://www.googleapis.com/auth/compute",
  79411. // "https://www.googleapis.com/auth/compute.readonly"
  79412. // ]
  79413. // }
  79414. }
  79415. // Pages invokes f for each page of results.
  79416. // A non-nil error returned from f will halt the iteration.
  79417. // The provided context supersedes any context provided to the Context method.
  79418. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  79419. c.ctx_ = ctx
  79420. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79421. for {
  79422. x, err := c.Do()
  79423. if err != nil {
  79424. return err
  79425. }
  79426. if err := f(x); err != nil {
  79427. return err
  79428. }
  79429. if x.NextPageToken == "" {
  79430. return nil
  79431. }
  79432. c.PageToken(x.NextPageToken)
  79433. }
  79434. }
  79435. // method id "compute.zoneOperations.delete":
  79436. type ZoneOperationsDeleteCall struct {
  79437. s *Service
  79438. project string
  79439. zone string
  79440. operation string
  79441. urlParams_ gensupport.URLParams
  79442. ctx_ context.Context
  79443. header_ http.Header
  79444. }
  79445. // Delete: Deletes the specified zone-specific Operations resource.
  79446. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  79447. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  79448. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79449. c.project = project
  79450. c.zone = zone
  79451. c.operation = operation
  79452. return c
  79453. }
  79454. // Fields allows partial responses to be retrieved. See
  79455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79456. // for more information.
  79457. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  79458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79459. return c
  79460. }
  79461. // Context sets the context to be used in this call's Do method. Any
  79462. // pending HTTP request will be aborted if the provided context is
  79463. // canceled.
  79464. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  79465. c.ctx_ = ctx
  79466. return c
  79467. }
  79468. // Header returns an http.Header that can be modified by the caller to
  79469. // add HTTP headers to the request.
  79470. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  79471. if c.header_ == nil {
  79472. c.header_ = make(http.Header)
  79473. }
  79474. return c.header_
  79475. }
  79476. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  79477. reqHeaders := make(http.Header)
  79478. for k, v := range c.header_ {
  79479. reqHeaders[k] = v
  79480. }
  79481. reqHeaders.Set("User-Agent", c.s.userAgent())
  79482. var body io.Reader = nil
  79483. c.urlParams_.Set("alt", alt)
  79484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  79485. urls += "?" + c.urlParams_.Encode()
  79486. req, _ := http.NewRequest("DELETE", urls, body)
  79487. req.Header = reqHeaders
  79488. googleapi.Expand(req.URL, map[string]string{
  79489. "project": c.project,
  79490. "zone": c.zone,
  79491. "operation": c.operation,
  79492. })
  79493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79494. }
  79495. // Do executes the "compute.zoneOperations.delete" call.
  79496. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  79497. gensupport.SetOptions(c.urlParams_, opts...)
  79498. res, err := c.doRequest("json")
  79499. if err != nil {
  79500. return err
  79501. }
  79502. defer googleapi.CloseBody(res)
  79503. if err := googleapi.CheckResponse(res); err != nil {
  79504. return err
  79505. }
  79506. return nil
  79507. // {
  79508. // "description": "Deletes the specified zone-specific Operations resource.",
  79509. // "httpMethod": "DELETE",
  79510. // "id": "compute.zoneOperations.delete",
  79511. // "parameterOrder": [
  79512. // "project",
  79513. // "zone",
  79514. // "operation"
  79515. // ],
  79516. // "parameters": {
  79517. // "operation": {
  79518. // "description": "Name of the Operations resource to delete.",
  79519. // "location": "path",
  79520. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79521. // "required": true,
  79522. // "type": "string"
  79523. // },
  79524. // "project": {
  79525. // "description": "Project ID for this request.",
  79526. // "location": "path",
  79527. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79528. // "required": true,
  79529. // "type": "string"
  79530. // },
  79531. // "zone": {
  79532. // "description": "Name of the zone for this request.",
  79533. // "location": "path",
  79534. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79535. // "required": true,
  79536. // "type": "string"
  79537. // }
  79538. // },
  79539. // "path": "{project}/zones/{zone}/operations/{operation}",
  79540. // "scopes": [
  79541. // "https://www.googleapis.com/auth/cloud-platform",
  79542. // "https://www.googleapis.com/auth/compute"
  79543. // ]
  79544. // }
  79545. }
  79546. // method id "compute.zoneOperations.get":
  79547. type ZoneOperationsGetCall struct {
  79548. s *Service
  79549. project string
  79550. zone string
  79551. operation string
  79552. urlParams_ gensupport.URLParams
  79553. ifNoneMatch_ string
  79554. ctx_ context.Context
  79555. header_ http.Header
  79556. }
  79557. // Get: Retrieves the specified zone-specific Operations resource.
  79558. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  79559. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  79560. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79561. c.project = project
  79562. c.zone = zone
  79563. c.operation = operation
  79564. return c
  79565. }
  79566. // Fields allows partial responses to be retrieved. See
  79567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79568. // for more information.
  79569. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  79570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79571. return c
  79572. }
  79573. // IfNoneMatch sets the optional parameter which makes the operation
  79574. // fail if the object's ETag matches the given value. This is useful for
  79575. // getting updates only after the object has changed since the last
  79576. // request. Use googleapi.IsNotModified to check whether the response
  79577. // error from Do is the result of In-None-Match.
  79578. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  79579. c.ifNoneMatch_ = entityTag
  79580. return c
  79581. }
  79582. // Context sets the context to be used in this call's Do method. Any
  79583. // pending HTTP request will be aborted if the provided context is
  79584. // canceled.
  79585. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  79586. c.ctx_ = ctx
  79587. return c
  79588. }
  79589. // Header returns an http.Header that can be modified by the caller to
  79590. // add HTTP headers to the request.
  79591. func (c *ZoneOperationsGetCall) Header() http.Header {
  79592. if c.header_ == nil {
  79593. c.header_ = make(http.Header)
  79594. }
  79595. return c.header_
  79596. }
  79597. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  79598. reqHeaders := make(http.Header)
  79599. for k, v := range c.header_ {
  79600. reqHeaders[k] = v
  79601. }
  79602. reqHeaders.Set("User-Agent", c.s.userAgent())
  79603. if c.ifNoneMatch_ != "" {
  79604. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79605. }
  79606. var body io.Reader = nil
  79607. c.urlParams_.Set("alt", alt)
  79608. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  79609. urls += "?" + c.urlParams_.Encode()
  79610. req, _ := http.NewRequest("GET", urls, body)
  79611. req.Header = reqHeaders
  79612. googleapi.Expand(req.URL, map[string]string{
  79613. "project": c.project,
  79614. "zone": c.zone,
  79615. "operation": c.operation,
  79616. })
  79617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79618. }
  79619. // Do executes the "compute.zoneOperations.get" call.
  79620. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79621. // status code is an error. Response headers are in either
  79622. // *Operation.ServerResponse.Header or (if a response was returned at
  79623. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79624. // to check whether the returned error was because
  79625. // http.StatusNotModified was returned.
  79626. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79627. gensupport.SetOptions(c.urlParams_, opts...)
  79628. res, err := c.doRequest("json")
  79629. if res != nil && res.StatusCode == http.StatusNotModified {
  79630. if res.Body != nil {
  79631. res.Body.Close()
  79632. }
  79633. return nil, &googleapi.Error{
  79634. Code: res.StatusCode,
  79635. Header: res.Header,
  79636. }
  79637. }
  79638. if err != nil {
  79639. return nil, err
  79640. }
  79641. defer googleapi.CloseBody(res)
  79642. if err := googleapi.CheckResponse(res); err != nil {
  79643. return nil, err
  79644. }
  79645. ret := &Operation{
  79646. ServerResponse: googleapi.ServerResponse{
  79647. Header: res.Header,
  79648. HTTPStatusCode: res.StatusCode,
  79649. },
  79650. }
  79651. target := &ret
  79652. if err := gensupport.DecodeResponse(target, res); err != nil {
  79653. return nil, err
  79654. }
  79655. return ret, nil
  79656. // {
  79657. // "description": "Retrieves the specified zone-specific Operations resource.",
  79658. // "httpMethod": "GET",
  79659. // "id": "compute.zoneOperations.get",
  79660. // "parameterOrder": [
  79661. // "project",
  79662. // "zone",
  79663. // "operation"
  79664. // ],
  79665. // "parameters": {
  79666. // "operation": {
  79667. // "description": "Name of the Operations resource to return.",
  79668. // "location": "path",
  79669. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79670. // "required": true,
  79671. // "type": "string"
  79672. // },
  79673. // "project": {
  79674. // "description": "Project ID for this request.",
  79675. // "location": "path",
  79676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79677. // "required": true,
  79678. // "type": "string"
  79679. // },
  79680. // "zone": {
  79681. // "description": "Name of the zone for this request.",
  79682. // "location": "path",
  79683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79684. // "required": true,
  79685. // "type": "string"
  79686. // }
  79687. // },
  79688. // "path": "{project}/zones/{zone}/operations/{operation}",
  79689. // "response": {
  79690. // "$ref": "Operation"
  79691. // },
  79692. // "scopes": [
  79693. // "https://www.googleapis.com/auth/cloud-platform",
  79694. // "https://www.googleapis.com/auth/compute",
  79695. // "https://www.googleapis.com/auth/compute.readonly"
  79696. // ]
  79697. // }
  79698. }
  79699. // method id "compute.zoneOperations.list":
  79700. type ZoneOperationsListCall struct {
  79701. s *Service
  79702. project string
  79703. zone string
  79704. urlParams_ gensupport.URLParams
  79705. ifNoneMatch_ string
  79706. ctx_ context.Context
  79707. header_ http.Header
  79708. }
  79709. // List: Retrieves a list of Operation resources contained within the
  79710. // specified zone.
  79711. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  79712. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  79713. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79714. c.project = project
  79715. c.zone = zone
  79716. return c
  79717. }
  79718. // Filter sets the optional parameter "filter": A filter expression that
  79719. // filters resources listed in the response. The expression must specify
  79720. // the field name, a comparison operator, and the value that you want to
  79721. // use for filtering. The value must be a string, a number, or a
  79722. // boolean. The comparison operator must be either =, !=, >, or <.
  79723. //
  79724. // For example, if you are filtering Compute Engine instances, you can
  79725. // exclude instances named example-instance by specifying name !=
  79726. // example-instance.
  79727. //
  79728. // You can also filter nested fields. For example, you could specify
  79729. // scheduling.automaticRestart = false to include instances only if they
  79730. // are not scheduled for automatic restarts. You can use filtering on
  79731. // nested fields to filter based on resource labels.
  79732. //
  79733. // To filter on multiple expressions, provide each separate expression
  79734. // within parentheses. For example, (scheduling.automaticRestart = true)
  79735. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79736. // AND expression. However, you can include AND and OR expressions
  79737. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79738. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79739. // true).
  79740. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  79741. c.urlParams_.Set("filter", filter)
  79742. return c
  79743. }
  79744. // MaxResults sets the optional parameter "maxResults": The maximum
  79745. // number of results per page that should be returned. If the number of
  79746. // available results is larger than maxResults, Compute Engine returns a
  79747. // nextPageToken that can be used to get the next page of results in
  79748. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79749. // (Default: 500)
  79750. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  79751. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79752. return c
  79753. }
  79754. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79755. // a certain order. By default, results are returned in alphanumerical
  79756. // order based on the resource name.
  79757. //
  79758. // You can also sort results in descending order based on the creation
  79759. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79760. // based on the creationTimestamp field in reverse chronological order
  79761. // (newest result first). Use this to sort resources like operations so
  79762. // that the newest operation is returned first.
  79763. //
  79764. // Currently, only sorting by name or creationTimestamp desc is
  79765. // supported.
  79766. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  79767. c.urlParams_.Set("orderBy", orderBy)
  79768. return c
  79769. }
  79770. // PageToken sets the optional parameter "pageToken": Specifies a page
  79771. // token to use. Set pageToken to the nextPageToken returned by a
  79772. // previous list request to get the next page of results.
  79773. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  79774. c.urlParams_.Set("pageToken", pageToken)
  79775. return c
  79776. }
  79777. // Fields allows partial responses to be retrieved. See
  79778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79779. // for more information.
  79780. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  79781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79782. return c
  79783. }
  79784. // IfNoneMatch sets the optional parameter which makes the operation
  79785. // fail if the object's ETag matches the given value. This is useful for
  79786. // getting updates only after the object has changed since the last
  79787. // request. Use googleapi.IsNotModified to check whether the response
  79788. // error from Do is the result of In-None-Match.
  79789. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  79790. c.ifNoneMatch_ = entityTag
  79791. return c
  79792. }
  79793. // Context sets the context to be used in this call's Do method. Any
  79794. // pending HTTP request will be aborted if the provided context is
  79795. // canceled.
  79796. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  79797. c.ctx_ = ctx
  79798. return c
  79799. }
  79800. // Header returns an http.Header that can be modified by the caller to
  79801. // add HTTP headers to the request.
  79802. func (c *ZoneOperationsListCall) Header() http.Header {
  79803. if c.header_ == nil {
  79804. c.header_ = make(http.Header)
  79805. }
  79806. return c.header_
  79807. }
  79808. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  79809. reqHeaders := make(http.Header)
  79810. for k, v := range c.header_ {
  79811. reqHeaders[k] = v
  79812. }
  79813. reqHeaders.Set("User-Agent", c.s.userAgent())
  79814. if c.ifNoneMatch_ != "" {
  79815. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79816. }
  79817. var body io.Reader = nil
  79818. c.urlParams_.Set("alt", alt)
  79819. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  79820. urls += "?" + c.urlParams_.Encode()
  79821. req, _ := http.NewRequest("GET", urls, body)
  79822. req.Header = reqHeaders
  79823. googleapi.Expand(req.URL, map[string]string{
  79824. "project": c.project,
  79825. "zone": c.zone,
  79826. })
  79827. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79828. }
  79829. // Do executes the "compute.zoneOperations.list" call.
  79830. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  79831. // status code is an error. Response headers are in either
  79832. // *OperationList.ServerResponse.Header or (if a response was returned
  79833. // at all) in error.(*googleapi.Error).Header. Use
  79834. // googleapi.IsNotModified to check whether the returned error was
  79835. // because http.StatusNotModified was returned.
  79836. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  79837. gensupport.SetOptions(c.urlParams_, opts...)
  79838. res, err := c.doRequest("json")
  79839. if res != nil && res.StatusCode == http.StatusNotModified {
  79840. if res.Body != nil {
  79841. res.Body.Close()
  79842. }
  79843. return nil, &googleapi.Error{
  79844. Code: res.StatusCode,
  79845. Header: res.Header,
  79846. }
  79847. }
  79848. if err != nil {
  79849. return nil, err
  79850. }
  79851. defer googleapi.CloseBody(res)
  79852. if err := googleapi.CheckResponse(res); err != nil {
  79853. return nil, err
  79854. }
  79855. ret := &OperationList{
  79856. ServerResponse: googleapi.ServerResponse{
  79857. Header: res.Header,
  79858. HTTPStatusCode: res.StatusCode,
  79859. },
  79860. }
  79861. target := &ret
  79862. if err := gensupport.DecodeResponse(target, res); err != nil {
  79863. return nil, err
  79864. }
  79865. return ret, nil
  79866. // {
  79867. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  79868. // "httpMethod": "GET",
  79869. // "id": "compute.zoneOperations.list",
  79870. // "parameterOrder": [
  79871. // "project",
  79872. // "zone"
  79873. // ],
  79874. // "parameters": {
  79875. // "filter": {
  79876. // "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).",
  79877. // "location": "query",
  79878. // "type": "string"
  79879. // },
  79880. // "maxResults": {
  79881. // "default": "500",
  79882. // "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)",
  79883. // "format": "uint32",
  79884. // "location": "query",
  79885. // "minimum": "0",
  79886. // "type": "integer"
  79887. // },
  79888. // "orderBy": {
  79889. // "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.",
  79890. // "location": "query",
  79891. // "type": "string"
  79892. // },
  79893. // "pageToken": {
  79894. // "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.",
  79895. // "location": "query",
  79896. // "type": "string"
  79897. // },
  79898. // "project": {
  79899. // "description": "Project ID for this request.",
  79900. // "location": "path",
  79901. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79902. // "required": true,
  79903. // "type": "string"
  79904. // },
  79905. // "zone": {
  79906. // "description": "Name of the zone for request.",
  79907. // "location": "path",
  79908. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79909. // "required": true,
  79910. // "type": "string"
  79911. // }
  79912. // },
  79913. // "path": "{project}/zones/{zone}/operations",
  79914. // "response": {
  79915. // "$ref": "OperationList"
  79916. // },
  79917. // "scopes": [
  79918. // "https://www.googleapis.com/auth/cloud-platform",
  79919. // "https://www.googleapis.com/auth/compute",
  79920. // "https://www.googleapis.com/auth/compute.readonly"
  79921. // ]
  79922. // }
  79923. }
  79924. // Pages invokes f for each page of results.
  79925. // A non-nil error returned from f will halt the iteration.
  79926. // The provided context supersedes any context provided to the Context method.
  79927. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  79928. c.ctx_ = ctx
  79929. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79930. for {
  79931. x, err := c.Do()
  79932. if err != nil {
  79933. return err
  79934. }
  79935. if err := f(x); err != nil {
  79936. return err
  79937. }
  79938. if x.NextPageToken == "" {
  79939. return nil
  79940. }
  79941. c.PageToken(x.NextPageToken)
  79942. }
  79943. }
  79944. // method id "compute.zones.get":
  79945. type ZonesGetCall struct {
  79946. s *Service
  79947. project string
  79948. zone string
  79949. urlParams_ gensupport.URLParams
  79950. ifNoneMatch_ string
  79951. ctx_ context.Context
  79952. header_ http.Header
  79953. }
  79954. // Get: Returns the specified Zone resource. Gets a list of available
  79955. // zones by making a list() request.
  79956. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  79957. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  79958. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79959. c.project = project
  79960. c.zone = zone
  79961. return c
  79962. }
  79963. // Fields allows partial responses to be retrieved. See
  79964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79965. // for more information.
  79966. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  79967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79968. return c
  79969. }
  79970. // IfNoneMatch sets the optional parameter which makes the operation
  79971. // fail if the object's ETag matches the given value. This is useful for
  79972. // getting updates only after the object has changed since the last
  79973. // request. Use googleapi.IsNotModified to check whether the response
  79974. // error from Do is the result of In-None-Match.
  79975. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  79976. c.ifNoneMatch_ = entityTag
  79977. return c
  79978. }
  79979. // Context sets the context to be used in this call's Do method. Any
  79980. // pending HTTP request will be aborted if the provided context is
  79981. // canceled.
  79982. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  79983. c.ctx_ = ctx
  79984. return c
  79985. }
  79986. // Header returns an http.Header that can be modified by the caller to
  79987. // add HTTP headers to the request.
  79988. func (c *ZonesGetCall) Header() http.Header {
  79989. if c.header_ == nil {
  79990. c.header_ = make(http.Header)
  79991. }
  79992. return c.header_
  79993. }
  79994. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  79995. reqHeaders := make(http.Header)
  79996. for k, v := range c.header_ {
  79997. reqHeaders[k] = v
  79998. }
  79999. reqHeaders.Set("User-Agent", c.s.userAgent())
  80000. if c.ifNoneMatch_ != "" {
  80001. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80002. }
  80003. var body io.Reader = nil
  80004. c.urlParams_.Set("alt", alt)
  80005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  80006. urls += "?" + c.urlParams_.Encode()
  80007. req, _ := http.NewRequest("GET", urls, body)
  80008. req.Header = reqHeaders
  80009. googleapi.Expand(req.URL, map[string]string{
  80010. "project": c.project,
  80011. "zone": c.zone,
  80012. })
  80013. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80014. }
  80015. // Do executes the "compute.zones.get" call.
  80016. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  80017. // code is an error. Response headers are in either
  80018. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  80019. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  80020. // whether the returned error was because http.StatusNotModified was
  80021. // returned.
  80022. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  80023. gensupport.SetOptions(c.urlParams_, opts...)
  80024. res, err := c.doRequest("json")
  80025. if res != nil && res.StatusCode == http.StatusNotModified {
  80026. if res.Body != nil {
  80027. res.Body.Close()
  80028. }
  80029. return nil, &googleapi.Error{
  80030. Code: res.StatusCode,
  80031. Header: res.Header,
  80032. }
  80033. }
  80034. if err != nil {
  80035. return nil, err
  80036. }
  80037. defer googleapi.CloseBody(res)
  80038. if err := googleapi.CheckResponse(res); err != nil {
  80039. return nil, err
  80040. }
  80041. ret := &Zone{
  80042. ServerResponse: googleapi.ServerResponse{
  80043. Header: res.Header,
  80044. HTTPStatusCode: res.StatusCode,
  80045. },
  80046. }
  80047. target := &ret
  80048. if err := gensupport.DecodeResponse(target, res); err != nil {
  80049. return nil, err
  80050. }
  80051. return ret, nil
  80052. // {
  80053. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  80054. // "httpMethod": "GET",
  80055. // "id": "compute.zones.get",
  80056. // "parameterOrder": [
  80057. // "project",
  80058. // "zone"
  80059. // ],
  80060. // "parameters": {
  80061. // "project": {
  80062. // "description": "Project ID for this request.",
  80063. // "location": "path",
  80064. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80065. // "required": true,
  80066. // "type": "string"
  80067. // },
  80068. // "zone": {
  80069. // "description": "Name of the zone resource to return.",
  80070. // "location": "path",
  80071. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80072. // "required": true,
  80073. // "type": "string"
  80074. // }
  80075. // },
  80076. // "path": "{project}/zones/{zone}",
  80077. // "response": {
  80078. // "$ref": "Zone"
  80079. // },
  80080. // "scopes": [
  80081. // "https://www.googleapis.com/auth/cloud-platform",
  80082. // "https://www.googleapis.com/auth/compute",
  80083. // "https://www.googleapis.com/auth/compute.readonly"
  80084. // ]
  80085. // }
  80086. }
  80087. // method id "compute.zones.list":
  80088. type ZonesListCall struct {
  80089. s *Service
  80090. project string
  80091. urlParams_ gensupport.URLParams
  80092. ifNoneMatch_ string
  80093. ctx_ context.Context
  80094. header_ http.Header
  80095. }
  80096. // List: Retrieves the list of Zone resources available to the specified
  80097. // project.
  80098. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  80099. func (r *ZonesService) List(project string) *ZonesListCall {
  80100. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80101. c.project = project
  80102. return c
  80103. }
  80104. // Filter sets the optional parameter "filter": A filter expression that
  80105. // filters resources listed in the response. The expression must specify
  80106. // the field name, a comparison operator, and the value that you want to
  80107. // use for filtering. The value must be a string, a number, or a
  80108. // boolean. The comparison operator must be either =, !=, >, or <.
  80109. //
  80110. // For example, if you are filtering Compute Engine instances, you can
  80111. // exclude instances named example-instance by specifying name !=
  80112. // example-instance.
  80113. //
  80114. // You can also filter nested fields. For example, you could specify
  80115. // scheduling.automaticRestart = false to include instances only if they
  80116. // are not scheduled for automatic restarts. You can use filtering on
  80117. // nested fields to filter based on resource labels.
  80118. //
  80119. // To filter on multiple expressions, provide each separate expression
  80120. // within parentheses. For example, (scheduling.automaticRestart = true)
  80121. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80122. // AND expression. However, you can include AND and OR expressions
  80123. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80124. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80125. // true).
  80126. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  80127. c.urlParams_.Set("filter", filter)
  80128. return c
  80129. }
  80130. // MaxResults sets the optional parameter "maxResults": The maximum
  80131. // number of results per page that should be returned. If the number of
  80132. // available results is larger than maxResults, Compute Engine returns a
  80133. // nextPageToken that can be used to get the next page of results in
  80134. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80135. // (Default: 500)
  80136. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  80137. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80138. return c
  80139. }
  80140. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80141. // a certain order. By default, results are returned in alphanumerical
  80142. // order based on the resource name.
  80143. //
  80144. // You can also sort results in descending order based on the creation
  80145. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80146. // based on the creationTimestamp field in reverse chronological order
  80147. // (newest result first). Use this to sort resources like operations so
  80148. // that the newest operation is returned first.
  80149. //
  80150. // Currently, only sorting by name or creationTimestamp desc is
  80151. // supported.
  80152. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  80153. c.urlParams_.Set("orderBy", orderBy)
  80154. return c
  80155. }
  80156. // PageToken sets the optional parameter "pageToken": Specifies a page
  80157. // token to use. Set pageToken to the nextPageToken returned by a
  80158. // previous list request to get the next page of results.
  80159. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  80160. c.urlParams_.Set("pageToken", pageToken)
  80161. return c
  80162. }
  80163. // Fields allows partial responses to be retrieved. See
  80164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80165. // for more information.
  80166. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  80167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80168. return c
  80169. }
  80170. // IfNoneMatch sets the optional parameter which makes the operation
  80171. // fail if the object's ETag matches the given value. This is useful for
  80172. // getting updates only after the object has changed since the last
  80173. // request. Use googleapi.IsNotModified to check whether the response
  80174. // error from Do is the result of In-None-Match.
  80175. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  80176. c.ifNoneMatch_ = entityTag
  80177. return c
  80178. }
  80179. // Context sets the context to be used in this call's Do method. Any
  80180. // pending HTTP request will be aborted if the provided context is
  80181. // canceled.
  80182. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  80183. c.ctx_ = ctx
  80184. return c
  80185. }
  80186. // Header returns an http.Header that can be modified by the caller to
  80187. // add HTTP headers to the request.
  80188. func (c *ZonesListCall) Header() http.Header {
  80189. if c.header_ == nil {
  80190. c.header_ = make(http.Header)
  80191. }
  80192. return c.header_
  80193. }
  80194. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  80195. reqHeaders := make(http.Header)
  80196. for k, v := range c.header_ {
  80197. reqHeaders[k] = v
  80198. }
  80199. reqHeaders.Set("User-Agent", c.s.userAgent())
  80200. if c.ifNoneMatch_ != "" {
  80201. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80202. }
  80203. var body io.Reader = nil
  80204. c.urlParams_.Set("alt", alt)
  80205. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  80206. urls += "?" + c.urlParams_.Encode()
  80207. req, _ := http.NewRequest("GET", urls, body)
  80208. req.Header = reqHeaders
  80209. googleapi.Expand(req.URL, map[string]string{
  80210. "project": c.project,
  80211. })
  80212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80213. }
  80214. // Do executes the "compute.zones.list" call.
  80215. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  80216. // code is an error. Response headers are in either
  80217. // *ZoneList.ServerResponse.Header or (if a response was returned at
  80218. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80219. // to check whether the returned error was because
  80220. // http.StatusNotModified was returned.
  80221. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  80222. gensupport.SetOptions(c.urlParams_, opts...)
  80223. res, err := c.doRequest("json")
  80224. if res != nil && res.StatusCode == http.StatusNotModified {
  80225. if res.Body != nil {
  80226. res.Body.Close()
  80227. }
  80228. return nil, &googleapi.Error{
  80229. Code: res.StatusCode,
  80230. Header: res.Header,
  80231. }
  80232. }
  80233. if err != nil {
  80234. return nil, err
  80235. }
  80236. defer googleapi.CloseBody(res)
  80237. if err := googleapi.CheckResponse(res); err != nil {
  80238. return nil, err
  80239. }
  80240. ret := &ZoneList{
  80241. ServerResponse: googleapi.ServerResponse{
  80242. Header: res.Header,
  80243. HTTPStatusCode: res.StatusCode,
  80244. },
  80245. }
  80246. target := &ret
  80247. if err := gensupport.DecodeResponse(target, res); err != nil {
  80248. return nil, err
  80249. }
  80250. return ret, nil
  80251. // {
  80252. // "description": "Retrieves the list of Zone resources available to the specified project.",
  80253. // "httpMethod": "GET",
  80254. // "id": "compute.zones.list",
  80255. // "parameterOrder": [
  80256. // "project"
  80257. // ],
  80258. // "parameters": {
  80259. // "filter": {
  80260. // "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).",
  80261. // "location": "query",
  80262. // "type": "string"
  80263. // },
  80264. // "maxResults": {
  80265. // "default": "500",
  80266. // "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)",
  80267. // "format": "uint32",
  80268. // "location": "query",
  80269. // "minimum": "0",
  80270. // "type": "integer"
  80271. // },
  80272. // "orderBy": {
  80273. // "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.",
  80274. // "location": "query",
  80275. // "type": "string"
  80276. // },
  80277. // "pageToken": {
  80278. // "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.",
  80279. // "location": "query",
  80280. // "type": "string"
  80281. // },
  80282. // "project": {
  80283. // "description": "Project ID for this request.",
  80284. // "location": "path",
  80285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80286. // "required": true,
  80287. // "type": "string"
  80288. // }
  80289. // },
  80290. // "path": "{project}/zones",
  80291. // "response": {
  80292. // "$ref": "ZoneList"
  80293. // },
  80294. // "scopes": [
  80295. // "https://www.googleapis.com/auth/cloud-platform",
  80296. // "https://www.googleapis.com/auth/compute",
  80297. // "https://www.googleapis.com/auth/compute.readonly"
  80298. // ]
  80299. // }
  80300. }
  80301. // Pages invokes f for each page of results.
  80302. // A non-nil error returned from f will halt the iteration.
  80303. // The provided context supersedes any context provided to the Context method.
  80304. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  80305. c.ctx_ = ctx
  80306. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80307. for {
  80308. x, err := c.Do()
  80309. if err != nil {
  80310. return err
  80311. }
  80312. if err := f(x); err != nil {
  80313. return err
  80314. }
  80315. if x.NextPageToken == "" {
  80316. return nil
  80317. }
  80318. c.PageToken(x.NextPageToken)
  80319. }
  80320. }