1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package baremetalsolution provides access to the Bare Metal Solution API. 8// 9// For product documentation, see: https://cloud.google.com/bare-metal 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/baremetalsolution/v1alpha1" 16// ... 17// ctx := context.Background() 18// baremetalsolutionService, err := baremetalsolution.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// baremetalsolutionService, err := baremetalsolution.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// baremetalsolutionService, err := baremetalsolution.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package baremetalsolution // import "google.golang.org/api/baremetalsolution/v1alpha1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "baremetalsolution:v1alpha1" 75const apiName = "baremetalsolution" 76const apiVersion = "v1alpha1" 77const basePath = "https://baremetalsolution.googleapis.com/" 78const mtlsBasePath = "https://baremetalsolution.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See, edit, configure, and delete your Google Cloud Platform data 83 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/cloud-platform", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Projects = NewProjectsService(s) 120 return s, nil 121} 122 123type Service struct { 124 client *http.Client 125 BasePath string // API endpoint base URL 126 UserAgent string // optional additional User-Agent fragment 127 128 Projects *ProjectsService 129} 130 131func (s *Service) userAgent() string { 132 if s.UserAgent == "" { 133 return googleapi.UserAgent 134 } 135 return googleapi.UserAgent + " " + s.UserAgent 136} 137 138func NewProjectsService(s *Service) *ProjectsService { 139 rs := &ProjectsService{s: s} 140 rs.Locations = NewProjectsLocationsService(s) 141 rs.ProvisioningQuotas = NewProjectsProvisioningQuotasService(s) 142 rs.SnapshotSchedulePolicies = NewProjectsSnapshotSchedulePoliciesService(s) 143 rs.SshKeys = NewProjectsSshKeysService(s) 144 return rs 145} 146 147type ProjectsService struct { 148 s *Service 149 150 Locations *ProjectsLocationsService 151 152 ProvisioningQuotas *ProjectsProvisioningQuotasService 153 154 SnapshotSchedulePolicies *ProjectsSnapshotSchedulePoliciesService 155 156 SshKeys *ProjectsSshKeysService 157} 158 159func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 160 rs := &ProjectsLocationsService{s: s} 161 rs.Instances = NewProjectsLocationsInstancesService(s) 162 rs.Luns = NewProjectsLocationsLunsService(s) 163 rs.Volumes = NewProjectsLocationsVolumesService(s) 164 return rs 165} 166 167type ProjectsLocationsService struct { 168 s *Service 169 170 Instances *ProjectsLocationsInstancesService 171 172 Luns *ProjectsLocationsLunsService 173 174 Volumes *ProjectsLocationsVolumesService 175} 176 177func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService { 178 rs := &ProjectsLocationsInstancesService{s: s} 179 return rs 180} 181 182type ProjectsLocationsInstancesService struct { 183 s *Service 184} 185 186func NewProjectsLocationsLunsService(s *Service) *ProjectsLocationsLunsService { 187 rs := &ProjectsLocationsLunsService{s: s} 188 return rs 189} 190 191type ProjectsLocationsLunsService struct { 192 s *Service 193} 194 195func NewProjectsLocationsVolumesService(s *Service) *ProjectsLocationsVolumesService { 196 rs := &ProjectsLocationsVolumesService{s: s} 197 rs.Snapshots = NewProjectsLocationsVolumesSnapshotsService(s) 198 return rs 199} 200 201type ProjectsLocationsVolumesService struct { 202 s *Service 203 204 Snapshots *ProjectsLocationsVolumesSnapshotsService 205} 206 207func NewProjectsLocationsVolumesSnapshotsService(s *Service) *ProjectsLocationsVolumesSnapshotsService { 208 rs := &ProjectsLocationsVolumesSnapshotsService{s: s} 209 return rs 210} 211 212type ProjectsLocationsVolumesSnapshotsService struct { 213 s *Service 214} 215 216func NewProjectsProvisioningQuotasService(s *Service) *ProjectsProvisioningQuotasService { 217 rs := &ProjectsProvisioningQuotasService{s: s} 218 return rs 219} 220 221type ProjectsProvisioningQuotasService struct { 222 s *Service 223} 224 225func NewProjectsSnapshotSchedulePoliciesService(s *Service) *ProjectsSnapshotSchedulePoliciesService { 226 rs := &ProjectsSnapshotSchedulePoliciesService{s: s} 227 return rs 228} 229 230type ProjectsSnapshotSchedulePoliciesService struct { 231 s *Service 232} 233 234func NewProjectsSshKeysService(s *Service) *ProjectsSshKeysService { 235 rs := &ProjectsSshKeysService{s: s} 236 return rs 237} 238 239type ProjectsSshKeysService struct { 240 s *Service 241} 242 243// DisableInteractiveSerialConsoleRequest: Request for 244// DisableInteractiveSerialConsole. 245type DisableInteractiveSerialConsoleRequest struct { 246} 247 248// DisableInteractiveSerialConsoleResponse: Response for 249// DisableInteractiveSerialConsole. 250type DisableInteractiveSerialConsoleResponse struct { 251 // ServerResponse contains the HTTP response code and headers from the 252 // server. 253 googleapi.ServerResponse `json:"-"` 254} 255 256// Empty: A generic empty message that you can re-use to avoid defining 257// duplicated empty messages in your APIs. A typical example is to use 258// it as the request or the response type of an API method. For 259// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 260// (google.protobuf.Empty); } The JSON representation for `Empty` is 261// empty JSON object `{}`. 262type Empty struct { 263 // ServerResponse contains the HTTP response code and headers from the 264 // server. 265 googleapi.ServerResponse `json:"-"` 266} 267 268// EnableInteractiveSerialConsoleRequest: Request for 269// EnableInteractiveSerialConsole. 270type EnableInteractiveSerialConsoleRequest struct { 271} 272 273// EnableInteractiveSerialConsoleResponse: Response for 274// EnableInteractiveSerialConsole. 275type EnableInteractiveSerialConsoleResponse struct { 276 // ServerResponse contains the HTTP response code and headers from the 277 // server. 278 googleapi.ServerResponse `json:"-"` 279} 280 281// Instance: An Instance. 282type Instance struct { 283 // HyperthreadingEnabled: Is hyperthreading enabled for this instance? 284 HyperthreadingEnabled bool `json:"hyperthreadingEnabled,omitempty"` 285 286 // Luns: The Luns attached to this instance 287 Luns []*Lun `json:"luns,omitempty"` 288 289 // Name: Output only. The name of this Instance. 290 Name string `json:"name,omitempty"` 291 292 // ScheduledPowerResetTime: The scheduled power reset time. 293 ScheduledPowerResetTime string `json:"scheduledPowerResetTime,omitempty"` 294 295 // SshEnabled: Is SSH enabled for this instance? 296 SshEnabled bool `json:"sshEnabled,omitempty"` 297 298 // State: The state of this Instance. 299 // 300 // Possible values: 301 // "STATE_UNSPECIFIED" - The unspecified state. 302 // "RESERVED" - The Instance has been reserved. 303 // "PROVISIONING" - The Instance is being provisioned. 304 // "PROVISIONED" - The Instance has been provisioned. 305 // "DEPROVISIONING" - The Instance is being deprovisioned. 306 // "DEPROVISIONED" - The Instance has been deprovisioned. 307 // "UPDATING" - The Instance is being updated. 308 State string `json:"state,omitempty"` 309 310 // ServerResponse contains the HTTP response code and headers from the 311 // server. 312 googleapi.ServerResponse `json:"-"` 313 314 // ForceSendFields is a list of field names (e.g. 315 // "HyperthreadingEnabled") to unconditionally include in API requests. 316 // By default, fields with empty values are omitted from API requests. 317 // However, any non-pointer, non-interface field appearing in 318 // ForceSendFields will be sent to the server regardless of whether the 319 // field is empty or not. This may be used to include empty fields in 320 // Patch requests. 321 ForceSendFields []string `json:"-"` 322 323 // NullFields is a list of field names (e.g. "HyperthreadingEnabled") to 324 // include in API requests with the JSON null value. By default, fields 325 // with empty values are omitted from API requests. However, any field 326 // with an empty value appearing in NullFields will be sent to the 327 // server as null. It is an error if a field in this list has a 328 // non-empty value. This may be used to include null fields in Patch 329 // requests. 330 NullFields []string `json:"-"` 331} 332 333func (s *Instance) MarshalJSON() ([]byte, error) { 334 type NoMethod Instance 335 raw := NoMethod(*s) 336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 337} 338 339// InstanceConfig: Configuration parameters for a new instance. 340type InstanceConfig struct { 341 // ClientNetwork: Client network address. 342 ClientNetwork *NetworkAddress `json:"clientNetwork,omitempty"` 343 344 // Hyperthreading: Whether the instance should be provisioned with 345 // Hyperthreading enabled. 346 Hyperthreading bool `json:"hyperthreading,omitempty"` 347 348 // Id: A transient unique identifier to idenfity an instance within an 349 // ProvisioningConfig request. 350 Id string `json:"id,omitempty"` 351 352 // InstanceType: Instance type. 353 InstanceType string `json:"instanceType,omitempty"` 354 355 // Location: Location where to deploy the instance. 356 Location string `json:"location,omitempty"` 357 358 // OsImage: OS image to initialize the instance. 359 OsImage string `json:"osImage,omitempty"` 360 361 // PrivateNetwork: Private network address, if any. 362 PrivateNetwork *NetworkAddress `json:"privateNetwork,omitempty"` 363 364 // ForceSendFields is a list of field names (e.g. "ClientNetwork") to 365 // unconditionally include in API requests. By default, fields with 366 // empty values are omitted from API requests. However, any non-pointer, 367 // non-interface field appearing in ForceSendFields will be sent to the 368 // server regardless of whether the field is empty or not. This may be 369 // used to include empty fields in Patch requests. 370 ForceSendFields []string `json:"-"` 371 372 // NullFields is a list of field names (e.g. "ClientNetwork") to include 373 // in API requests with the JSON null value. By default, fields with 374 // empty values are omitted from API requests. However, any field with 375 // an empty value appearing in NullFields will be sent to the server as 376 // null. It is an error if a field in this list has a non-empty value. 377 // This may be used to include null fields in Patch requests. 378 NullFields []string `json:"-"` 379} 380 381func (s *InstanceConfig) MarshalJSON() ([]byte, error) { 382 type NoMethod InstanceConfig 383 raw := NoMethod(*s) 384 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 385} 386 387// InstanceQuota: A resource budget. 388type InstanceQuota struct { 389 // AvailableMachineCount: Number of machines than can be created for the 390 // given location and instance_type. 391 AvailableMachineCount int64 `json:"availableMachineCount,omitempty"` 392 393 // InstanceType: Instance type. 394 InstanceType string `json:"instanceType,omitempty"` 395 396 // Location: Location where the quota applies. 397 Location string `json:"location,omitempty"` 398 399 // ForceSendFields is a list of field names (e.g. 400 // "AvailableMachineCount") to unconditionally include in API requests. 401 // By default, fields with empty values are omitted from API requests. 402 // However, any non-pointer, non-interface field appearing in 403 // ForceSendFields will be sent to the server regardless of whether the 404 // field is empty or not. This may be used to include empty fields in 405 // Patch requests. 406 ForceSendFields []string `json:"-"` 407 408 // NullFields is a list of field names (e.g. "AvailableMachineCount") to 409 // include in API requests with the JSON null value. By default, fields 410 // with empty values are omitted from API requests. However, any field 411 // with an empty value appearing in NullFields will be sent to the 412 // server as null. It is an error if a field in this list has a 413 // non-empty value. This may be used to include null fields in Patch 414 // requests. 415 NullFields []string `json:"-"` 416} 417 418func (s *InstanceQuota) MarshalJSON() ([]byte, error) { 419 type NoMethod InstanceQuota 420 raw := NoMethod(*s) 421 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 422} 423 424// ListInstancesResponse: Response for ListInstances. 425type ListInstancesResponse struct { 426 // Instances: The Instances in this project. 427 Instances []*Instance `json:"instances,omitempty"` 428 429 // NextPageToken: Token to retrieve the next page of results, or empty 430 // if there are no more results in the list. 431 NextPageToken string `json:"nextPageToken,omitempty"` 432 433 // ServerResponse contains the HTTP response code and headers from the 434 // server. 435 googleapi.ServerResponse `json:"-"` 436 437 // ForceSendFields is a list of field names (e.g. "Instances") to 438 // unconditionally include in API requests. By default, fields with 439 // empty values are omitted from API requests. However, any non-pointer, 440 // non-interface field appearing in ForceSendFields will be sent to the 441 // server regardless of whether the field is empty or not. This may be 442 // used to include empty fields in Patch requests. 443 ForceSendFields []string `json:"-"` 444 445 // NullFields is a list of field names (e.g. "Instances") to include in 446 // API requests with the JSON null value. By default, fields with empty 447 // values are omitted from API requests. However, any field with an 448 // empty value appearing in NullFields will be sent to the server as 449 // null. It is an error if a field in this list has a non-empty value. 450 // This may be used to include null fields in Patch requests. 451 NullFields []string `json:"-"` 452} 453 454func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) { 455 type NoMethod ListInstancesResponse 456 raw := NoMethod(*s) 457 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 458} 459 460// ListLunsResponse: Response for ListLuns. 461type ListLunsResponse struct { 462 // Luns: The Luns in this project. 463 Luns []*Lun `json:"luns,omitempty"` 464 465 // NextPageToken: Token to retrieve the next page of results, or empty 466 // if there are no more results in the list. 467 NextPageToken string `json:"nextPageToken,omitempty"` 468 469 // ServerResponse contains the HTTP response code and headers from the 470 // server. 471 googleapi.ServerResponse `json:"-"` 472 473 // ForceSendFields is a list of field names (e.g. "Luns") to 474 // unconditionally include in API requests. By default, fields with 475 // empty values are omitted from API requests. However, any non-pointer, 476 // non-interface field appearing in ForceSendFields will be sent to the 477 // server regardless of whether the field is empty or not. This may be 478 // used to include empty fields in Patch requests. 479 ForceSendFields []string `json:"-"` 480 481 // NullFields is a list of field names (e.g. "Luns") to include in API 482 // requests with the JSON null value. By default, fields with empty 483 // values are omitted from API requests. However, any field with an 484 // empty value appearing in NullFields will be sent to the server as 485 // null. It is an error if a field in this list has a non-empty value. 486 // This may be used to include null fields in Patch requests. 487 NullFields []string `json:"-"` 488} 489 490func (s *ListLunsResponse) MarshalJSON() ([]byte, error) { 491 type NoMethod ListLunsResponse 492 raw := NoMethod(*s) 493 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 494} 495 496// ListProvisioningQuotasResponse: Response for ListProvisioningQuotas. 497type ListProvisioningQuotasResponse struct { 498 // NextPageToken: Token to retrieve the next page of results, or empty 499 // if there are no more results in the list. 500 NextPageToken string `json:"nextPageToken,omitempty"` 501 502 // ProvisioningQuotas: The provisioning quotas registered in this 503 // project. 504 ProvisioningQuotas []*ProvisioningQuota `json:"provisioningQuotas,omitempty"` 505 506 // ServerResponse contains the HTTP response code and headers from the 507 // server. 508 googleapi.ServerResponse `json:"-"` 509 510 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 511 // unconditionally include in API requests. By default, fields with 512 // empty values are omitted from API requests. However, any non-pointer, 513 // non-interface field appearing in ForceSendFields will be sent to the 514 // server regardless of whether the field is empty or not. This may be 515 // used to include empty fields in Patch requests. 516 ForceSendFields []string `json:"-"` 517 518 // NullFields is a list of field names (e.g. "NextPageToken") to include 519 // in API requests with the JSON null value. By default, fields with 520 // empty values are omitted from API requests. However, any field with 521 // an empty value appearing in NullFields will be sent to the server as 522 // null. It is an error if a field in this list has a non-empty value. 523 // This may be used to include null fields in Patch requests. 524 NullFields []string `json:"-"` 525} 526 527func (s *ListProvisioningQuotasResponse) MarshalJSON() ([]byte, error) { 528 type NoMethod ListProvisioningQuotasResponse 529 raw := NoMethod(*s) 530 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 531} 532 533// ListSSHKeysResponse: Response for ListSSHKeys. 534type ListSSHKeysResponse struct { 535 // NextPageToken: Token to retrieve the next page of results, or empty 536 // if there are no more results in the list. 537 NextPageToken string `json:"nextPageToken,omitempty"` 538 539 // SshKeys: The SSH keys registered in this project. 540 SshKeys []*SSHKey `json:"sshKeys,omitempty"` 541 542 // ServerResponse contains the HTTP response code and headers from the 543 // server. 544 googleapi.ServerResponse `json:"-"` 545 546 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 547 // unconditionally include in API requests. By default, fields with 548 // empty values are omitted from API requests. However, any non-pointer, 549 // non-interface field appearing in ForceSendFields will be sent to the 550 // server regardless of whether the field is empty or not. This may be 551 // used to include empty fields in Patch requests. 552 ForceSendFields []string `json:"-"` 553 554 // NullFields is a list of field names (e.g. "NextPageToken") to include 555 // in API requests with the JSON null value. By default, fields with 556 // empty values are omitted from API requests. However, any field with 557 // an empty value appearing in NullFields will be sent to the server as 558 // null. It is an error if a field in this list has a non-empty value. 559 // This may be used to include null fields in Patch requests. 560 NullFields []string `json:"-"` 561} 562 563func (s *ListSSHKeysResponse) MarshalJSON() ([]byte, error) { 564 type NoMethod ListSSHKeysResponse 565 raw := NoMethod(*s) 566 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 567} 568 569// ListSnapshotSchedulePoliciesResponse: Response for 570// ListSnapshotSchedulePolicies. 571type ListSnapshotSchedulePoliciesResponse struct { 572 // NextPageToken: Token to retrieve the next page of results, or empty 573 // if there are no more results in the list. 574 NextPageToken string `json:"nextPageToken,omitempty"` 575 576 // SnapshotSchedulePolicies: The snapshot schedule policies registered 577 // in this project. 578 SnapshotSchedulePolicies []*SnapshotSchedulePolicy `json:"snapshotSchedulePolicies,omitempty"` 579 580 // ServerResponse contains the HTTP response code and headers from the 581 // server. 582 googleapi.ServerResponse `json:"-"` 583 584 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 585 // unconditionally include in API requests. By default, fields with 586 // empty values are omitted from API requests. However, any non-pointer, 587 // non-interface field appearing in ForceSendFields will be sent to the 588 // server regardless of whether the field is empty or not. This may be 589 // used to include empty fields in Patch requests. 590 ForceSendFields []string `json:"-"` 591 592 // NullFields is a list of field names (e.g. "NextPageToken") to include 593 // in API requests with the JSON null value. By default, fields with 594 // empty values are omitted from API requests. However, any field with 595 // an empty value appearing in NullFields will be sent to the server as 596 // null. It is an error if a field in this list has a non-empty value. 597 // This may be used to include null fields in Patch requests. 598 NullFields []string `json:"-"` 599} 600 601func (s *ListSnapshotSchedulePoliciesResponse) MarshalJSON() ([]byte, error) { 602 type NoMethod ListSnapshotSchedulePoliciesResponse 603 raw := NoMethod(*s) 604 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 605} 606 607// ListVolumeSnapshotsResponse: Response for ListVolumeSnapshots. 608type ListVolumeSnapshotsResponse struct { 609 // NextPageToken: Token to retrieve the next page of results, or empty 610 // if there are no more results in the list. 611 NextPageToken string `json:"nextPageToken,omitempty"` 612 613 // VolumeSnapshots: The VolumeSnapshots for the volume. 614 VolumeSnapshots []*VolumeSnapshot `json:"volumeSnapshots,omitempty"` 615 616 // ServerResponse contains the HTTP response code and headers from the 617 // server. 618 googleapi.ServerResponse `json:"-"` 619 620 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 621 // unconditionally include in API requests. By default, fields with 622 // empty values are omitted from API requests. However, any non-pointer, 623 // non-interface field appearing in ForceSendFields will be sent to the 624 // server regardless of whether the field is empty or not. This may be 625 // used to include empty fields in Patch requests. 626 ForceSendFields []string `json:"-"` 627 628 // NullFields is a list of field names (e.g. "NextPageToken") to include 629 // in API requests with the JSON null value. By default, fields with 630 // empty values are omitted from API requests. However, any field with 631 // an empty value appearing in NullFields will be sent to the server as 632 // null. It is an error if a field in this list has a non-empty value. 633 // This may be used to include null fields in Patch requests. 634 NullFields []string `json:"-"` 635} 636 637func (s *ListVolumeSnapshotsResponse) MarshalJSON() ([]byte, error) { 638 type NoMethod ListVolumeSnapshotsResponse 639 raw := NoMethod(*s) 640 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 641} 642 643// ListVolumesResponse: Response for ListVolumes. 644type ListVolumesResponse struct { 645 // NextPageToken: Token to retrieve the next page of results, or empty 646 // if there are no more results in the list. 647 NextPageToken string `json:"nextPageToken,omitempty"` 648 649 // Volumes: The volumes registered in this project. 650 Volumes []*Volume `json:"volumes,omitempty"` 651 652 // ServerResponse contains the HTTP response code and headers from the 653 // server. 654 googleapi.ServerResponse `json:"-"` 655 656 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 657 // unconditionally include in API requests. By default, fields with 658 // empty values are omitted from API requests. However, any non-pointer, 659 // non-interface field appearing in ForceSendFields will be sent to the 660 // server regardless of whether the field is empty or not. This may be 661 // used to include empty fields in Patch requests. 662 ForceSendFields []string `json:"-"` 663 664 // NullFields is a list of field names (e.g. "NextPageToken") to include 665 // in API requests with the JSON null value. By default, fields with 666 // empty values are omitted from API requests. However, any field with 667 // an empty value appearing in NullFields will be sent to the server as 668 // null. It is an error if a field in this list has a non-empty value. 669 // This may be used to include null fields in Patch requests. 670 NullFields []string `json:"-"` 671} 672 673func (s *ListVolumesResponse) MarshalJSON() ([]byte, error) { 674 type NoMethod ListVolumesResponse 675 raw := NoMethod(*s) 676 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 677} 678 679// Lun: A storage Lun. 680type Lun struct { 681 // IsBoot: Whether this Lun is a boot Lun. 682 IsBoot bool `json:"isBoot,omitempty"` 683 684 // MultiprotocolType: The multiprotocol type of this Lun. 685 MultiprotocolType string `json:"multiprotocolType,omitempty"` 686 687 // Name: Output only. The name of this Lun. 688 Name string `json:"name,omitempty"` 689 690 // RemoteVolume: The storage volume that this Lun is attached to. 691 RemoteVolume *Volume `json:"remoteVolume,omitempty"` 692 693 // Shareable: Whether this Lun is allowed to be shared between multiple 694 // physical servers. 695 Shareable bool `json:"shareable,omitempty"` 696 697 // SizeGb: The size of this Lun, in gigabytes. 698 SizeGb int64 `json:"sizeGb,omitempty,string"` 699 700 // State: The state of this Lun. 701 // 702 // Possible values: 703 // "STATE_UNSPECIFIED" - The unspecified state. 704 // "RESERVED" - The Lun has been reserved. 705 // "PROVISIONING" - The Lun is being provisioned. 706 // "PROVISIONED" - The Lun has been provisioned. 707 // "DEPROVISIONING" - The Lun is being deprovisioned. 708 // "DEPROVISIONED" - The Lun has been deprovisioned. 709 // "UPDATING" - The Lun is being updated. 710 State string `json:"state,omitempty"` 711 712 // ServerResponse contains the HTTP response code and headers from the 713 // server. 714 googleapi.ServerResponse `json:"-"` 715 716 // ForceSendFields is a list of field names (e.g. "IsBoot") to 717 // unconditionally include in API requests. By default, fields with 718 // empty values are omitted from API requests. However, any non-pointer, 719 // non-interface field appearing in ForceSendFields will be sent to the 720 // server regardless of whether the field is empty or not. This may be 721 // used to include empty fields in Patch requests. 722 ForceSendFields []string `json:"-"` 723 724 // NullFields is a list of field names (e.g. "IsBoot") to include in API 725 // requests with the JSON null value. By default, fields with empty 726 // values are omitted from API requests. However, any field with an 727 // empty value appearing in NullFields will be sent to the server as 728 // null. It is an error if a field in this list has a non-empty value. 729 // This may be used to include null fields in Patch requests. 730 NullFields []string `json:"-"` 731} 732 733func (s *Lun) MarshalJSON() ([]byte, error) { 734 type NoMethod Lun 735 raw := NoMethod(*s) 736 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 737} 738 739// LunRange: A LUN range. 740type LunRange struct { 741 // Quantity: Number of LUNs to create. 742 Quantity int64 `json:"quantity,omitempty"` 743 744 // SizeGb: The requested size of each LUN, in GB. 745 SizeGb int64 `json:"sizeGb,omitempty"` 746 747 // ForceSendFields is a list of field names (e.g. "Quantity") to 748 // unconditionally include in API requests. By default, fields with 749 // empty values are omitted from API requests. However, any non-pointer, 750 // non-interface field appearing in ForceSendFields will be sent to the 751 // server regardless of whether the field is empty or not. This may be 752 // used to include empty fields in Patch requests. 753 ForceSendFields []string `json:"-"` 754 755 // NullFields is a list of field names (e.g. "Quantity") to include in 756 // API requests with the JSON null value. By default, fields with empty 757 // values are omitted from API requests. However, any field with an 758 // empty value appearing in NullFields will be sent to the server as 759 // null. It is an error if a field in this list has a non-empty value. 760 // This may be used to include null fields in Patch requests. 761 NullFields []string `json:"-"` 762} 763 764func (s *LunRange) MarshalJSON() ([]byte, error) { 765 type NoMethod LunRange 766 raw := NoMethod(*s) 767 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 768} 769 770// NetworkAddress: A network. 771type NetworkAddress struct { 772 // Address: IP address to be assigned to the server. 773 Address string `json:"address,omitempty"` 774 775 // NetworkId: Id of the network to use, within the same 776 // ProvisioningConfig request. 777 NetworkId string `json:"networkId,omitempty"` 778 779 // ForceSendFields is a list of field names (e.g. "Address") to 780 // unconditionally include in API requests. By default, fields with 781 // empty values are omitted from API requests. However, any non-pointer, 782 // non-interface field appearing in ForceSendFields will be sent to the 783 // server regardless of whether the field is empty or not. This may be 784 // used to include empty fields in Patch requests. 785 ForceSendFields []string `json:"-"` 786 787 // NullFields is a list of field names (e.g. "Address") to include in 788 // API requests with the JSON null value. By default, fields with empty 789 // values are omitted from API requests. However, any field with an 790 // empty value appearing in NullFields will be sent to the server as 791 // null. It is an error if a field in this list has a non-empty value. 792 // This may be used to include null fields in Patch requests. 793 NullFields []string `json:"-"` 794} 795 796func (s *NetworkAddress) MarshalJSON() ([]byte, error) { 797 type NoMethod NetworkAddress 798 raw := NoMethod(*s) 799 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 800} 801 802// NetworkConfig: Configuration parameters for a new network. 803type NetworkConfig struct { 804 // Bandwidth: Interconnect bandwidth. Set only when type is CLIENT. 805 // 806 // Possible values: 807 // "BANDWIDTH_UNSPECIFIED" - Unspecified value. 808 // "BW_1_GBPS" - 1 Gbps. 809 // "BW_2_GBPS" - 2 Gbps. 810 // "BW_5_GBPS" - 5 Gbps. 811 // "BW_10_GBPS" - 10 Gbps. 812 Bandwidth string `json:"bandwidth,omitempty"` 813 814 // Cidr: CIDR range of the network. 815 Cidr string `json:"cidr,omitempty"` 816 817 // Id: A transient unique identifier to identify a volume within an 818 // ProvisioningConfig request. 819 Id string `json:"id,omitempty"` 820 821 // Location: Location where to deploy the network. 822 Location string `json:"location,omitempty"` 823 824 // ServiceCidr: Service CIDR, if any. 825 // 826 // Possible values: 827 // "SERVICE_CIDR_UNSPECIFIED" - Unspecified value. 828 // "DISABLED" - Services are disabled for the given network. 829 // "HIGH_26" - Use the highest /26 block of the network to host 830 // services. 831 // "HIGH_27" - Use the highest /27 block of the network to host 832 // services. 833 // "HIGH_28" - Use the highest /28 block of the network to host 834 // services. 835 ServiceCidr string `json:"serviceCidr,omitempty"` 836 837 // Type: The type of this network. 838 // 839 // Possible values: 840 // "TYPE_UNSPECIFIED" - Unspecified value. 841 // "CLIENT" - Client network, that is a network peered to a GCP VPC. 842 // "PRIVATE" - Private network, that is a network local to the BMS 843 // POD. 844 Type string `json:"type,omitempty"` 845 846 // VlanAttachments: List of VLAN attachments. As of now there are always 847 // 2 attachments, but it is going to change in the future (multi vlan). 848 VlanAttachments []*VlanAttachment `json:"vlanAttachments,omitempty"` 849 850 // ForceSendFields is a list of field names (e.g. "Bandwidth") to 851 // unconditionally include in API requests. By default, fields with 852 // empty values are omitted from API requests. However, any non-pointer, 853 // non-interface field appearing in ForceSendFields will be sent to the 854 // server regardless of whether the field is empty or not. This may be 855 // used to include empty fields in Patch requests. 856 ForceSendFields []string `json:"-"` 857 858 // NullFields is a list of field names (e.g. "Bandwidth") to include in 859 // API requests with the JSON null value. By default, fields with empty 860 // values are omitted from API requests. However, any field with an 861 // empty value appearing in NullFields will be sent to the server as 862 // null. It is an error if a field in this list has a non-empty value. 863 // This may be used to include null fields in Patch requests. 864 NullFields []string `json:"-"` 865} 866 867func (s *NetworkConfig) MarshalJSON() ([]byte, error) { 868 type NoMethod NetworkConfig 869 raw := NoMethod(*s) 870 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 871} 872 873// NfsExport: A NFS export entry. 874type NfsExport struct { 875 // AllowDev: Allow dev. 876 AllowDev bool `json:"allowDev,omitempty"` 877 878 // AllowSuid: Allow the setuid flag. 879 AllowSuid bool `json:"allowSuid,omitempty"` 880 881 // Cidr: A CIDR range. 882 Cidr string `json:"cidr,omitempty"` 883 884 // MachineId: A single machine, identified by an ID. 885 MachineId string `json:"machineId,omitempty"` 886 887 // NetworkId: Network to use to publish the export. 888 NetworkId string `json:"networkId,omitempty"` 889 890 // NoRootSquash: Disable root squashing. 891 NoRootSquash bool `json:"noRootSquash,omitempty"` 892 893 // Permissions: Export permissions. 894 // 895 // Possible values: 896 // "PERMISSIONS_UNSPECIFIED" - Unspecified value. 897 // "READ_ONLY" - Read-only permission. 898 // "READ_WRITE" - Read-write permission. 899 Permissions string `json:"permissions,omitempty"` 900 901 // ForceSendFields is a list of field names (e.g. "AllowDev") to 902 // unconditionally include in API requests. By default, fields with 903 // empty values are omitted from API requests. However, any non-pointer, 904 // non-interface field appearing in ForceSendFields will be sent to the 905 // server regardless of whether the field is empty or not. This may be 906 // used to include empty fields in Patch requests. 907 ForceSendFields []string `json:"-"` 908 909 // NullFields is a list of field names (e.g. "AllowDev") to include in 910 // API requests with the JSON null value. By default, fields with empty 911 // values are omitted from API requests. However, any field with an 912 // empty value appearing in NullFields will be sent to the server as 913 // null. It is an error if a field in this list has a non-empty value. 914 // This may be used to include null fields in Patch requests. 915 NullFields []string `json:"-"` 916} 917 918func (s *NfsExport) MarshalJSON() ([]byte, error) { 919 type NoMethod NfsExport 920 raw := NoMethod(*s) 921 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 922} 923 924// ProvisioningConfig: An provisioning configuration. 925type ProvisioningConfig struct { 926 // Instances: Instances to be created. 927 Instances []*InstanceConfig `json:"instances,omitempty"` 928 929 // Networks: Networks to be created. 930 Networks []*NetworkConfig `json:"networks,omitempty"` 931 932 // TicketId: A reference to track the request. 933 TicketId string `json:"ticketId,omitempty"` 934 935 // Volumes: Volumes to be created. 936 Volumes []*VolumeConfig `json:"volumes,omitempty"` 937 938 // ServerResponse contains the HTTP response code and headers from the 939 // server. 940 googleapi.ServerResponse `json:"-"` 941 942 // ForceSendFields is a list of field names (e.g. "Instances") to 943 // unconditionally include in API requests. By default, fields with 944 // empty values are omitted from API requests. However, any non-pointer, 945 // non-interface field appearing in ForceSendFields will be sent to the 946 // server regardless of whether the field is empty or not. This may be 947 // used to include empty fields in Patch requests. 948 ForceSendFields []string `json:"-"` 949 950 // NullFields is a list of field names (e.g. "Instances") to include in 951 // API requests with the JSON null value. By default, fields with empty 952 // values are omitted from API requests. However, any field with an 953 // empty value appearing in NullFields will be sent to the server as 954 // null. It is an error if a field in this list has a non-empty value. 955 // This may be used to include null fields in Patch requests. 956 NullFields []string `json:"-"` 957} 958 959func (s *ProvisioningConfig) MarshalJSON() ([]byte, error) { 960 type NoMethod ProvisioningConfig 961 raw := NoMethod(*s) 962 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 963} 964 965// ProvisioningQuota: A provisioning quota for a given project. 966type ProvisioningQuota struct { 967 // InstanceQuota: Instance quota. 968 InstanceQuota *InstanceQuota `json:"instanceQuota,omitempty"` 969 970 // ForceSendFields is a list of field names (e.g. "InstanceQuota") to 971 // unconditionally include in API requests. By default, fields with 972 // empty values are omitted from API requests. However, any non-pointer, 973 // non-interface field appearing in ForceSendFields will be sent to the 974 // server regardless of whether the field is empty or not. This may be 975 // used to include empty fields in Patch requests. 976 ForceSendFields []string `json:"-"` 977 978 // NullFields is a list of field names (e.g. "InstanceQuota") to include 979 // in API requests with the JSON null value. By default, fields with 980 // empty values are omitted from API requests. However, any field with 981 // an empty value appearing in NullFields will be sent to the server as 982 // null. It is an error if a field in this list has a non-empty value. 983 // This may be used to include null fields in Patch requests. 984 NullFields []string `json:"-"` 985} 986 987func (s *ProvisioningQuota) MarshalJSON() ([]byte, error) { 988 type NoMethod ProvisioningQuota 989 raw := NoMethod(*s) 990 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 991} 992 993// ResetInstanceRequest: Request for ResetInstance. 994type ResetInstanceRequest struct { 995} 996 997// ResetInstanceResponse: Response for ResetInstance. 998type ResetInstanceResponse struct { 999 // ServerResponse contains the HTTP response code and headers from the 1000 // server. 1001 googleapi.ServerResponse `json:"-"` 1002} 1003 1004// RestoreVolumeSnapshotRequest: Request for RestoreVolumeSnapshot. 1005type RestoreVolumeSnapshotRequest struct { 1006} 1007 1008// SSHKey: A public SSH key registered in the project. Used primarily 1009// for the interactive serial console feature. 1010type SSHKey struct { 1011 // Name: Output only. The name of this SSH key. 1012 Name string `json:"name,omitempty"` 1013 1014 // PublicKey: The public SSH key. 1015 PublicKey string `json:"publicKey,omitempty"` 1016 1017 // ServerResponse contains the HTTP response code and headers from the 1018 // server. 1019 googleapi.ServerResponse `json:"-"` 1020 1021 // ForceSendFields is a list of field names (e.g. "Name") to 1022 // unconditionally include in API requests. By default, fields with 1023 // empty values are omitted from API requests. However, any non-pointer, 1024 // non-interface field appearing in ForceSendFields will be sent to the 1025 // server regardless of whether the field is empty or not. This may be 1026 // used to include empty fields in Patch requests. 1027 ForceSendFields []string `json:"-"` 1028 1029 // NullFields is a list of field names (e.g. "Name") to include in API 1030 // requests with the JSON null value. By default, fields with empty 1031 // values are omitted from API requests. However, any field with an 1032 // empty value appearing in NullFields will be sent to the server as 1033 // null. It is an error if a field in this list has a non-empty value. 1034 // This may be used to include null fields in Patch requests. 1035 NullFields []string `json:"-"` 1036} 1037 1038func (s *SSHKey) MarshalJSON() ([]byte, error) { 1039 type NoMethod SSHKey 1040 raw := NoMethod(*s) 1041 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1042} 1043 1044// Schedule: A snapshot schedule. 1045type Schedule struct { 1046 // CrontabSpec: The crontab-like specification that this Schedule will 1047 // use to take snapshots. 1048 CrontabSpec string `json:"crontabSpec,omitempty"` 1049 1050 // Prefix: A string to prefix names of snapshots created under this 1051 // Schedule. 1052 Prefix string `json:"prefix,omitempty"` 1053 1054 // RetentionCount: The maximum number of snapshots to retain under this 1055 // Schedule. 1056 RetentionCount int64 `json:"retentionCount,omitempty"` 1057 1058 // ForceSendFields is a list of field names (e.g. "CrontabSpec") to 1059 // unconditionally include in API requests. By default, fields with 1060 // empty values are omitted from API requests. However, any non-pointer, 1061 // non-interface field appearing in ForceSendFields will be sent to the 1062 // server regardless of whether the field is empty or not. This may be 1063 // used to include empty fields in Patch requests. 1064 ForceSendFields []string `json:"-"` 1065 1066 // NullFields is a list of field names (e.g. "CrontabSpec") to include 1067 // in API requests with the JSON null value. By default, fields with 1068 // empty values are omitted from API requests. However, any field with 1069 // an empty value appearing in NullFields will be sent to the server as 1070 // null. It is an error if a field in this list has a non-empty value. 1071 // This may be used to include null fields in Patch requests. 1072 NullFields []string `json:"-"` 1073} 1074 1075func (s *Schedule) MarshalJSON() ([]byte, error) { 1076 type NoMethod Schedule 1077 raw := NoMethod(*s) 1078 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1079} 1080 1081// SerialPortOutput: Response for ReadSerialPortOutput. 1082type SerialPortOutput struct { 1083 // Contents: The serial port output. 1084 Contents string `json:"contents,omitempty"` 1085 1086 // NextStartByte: The byte index to use in a subsequent call to 1087 // ReadSerialPortOutput to get more output. 1088 NextStartByte int64 `json:"nextStartByte,omitempty,string"` 1089 1090 // Start: The start byte index of the included contents. 1091 Start int64 `json:"start,omitempty,string"` 1092 1093 // ServerResponse contains the HTTP response code and headers from the 1094 // server. 1095 googleapi.ServerResponse `json:"-"` 1096 1097 // ForceSendFields is a list of field names (e.g. "Contents") to 1098 // unconditionally include in API requests. By default, fields with 1099 // empty values are omitted from API requests. However, any non-pointer, 1100 // non-interface field appearing in ForceSendFields will be sent to the 1101 // server regardless of whether the field is empty or not. This may be 1102 // used to include empty fields in Patch requests. 1103 ForceSendFields []string `json:"-"` 1104 1105 // NullFields is a list of field names (e.g. "Contents") to include in 1106 // API requests with the JSON null value. By default, fields with empty 1107 // values are omitted from API requests. However, any field with an 1108 // empty value appearing in NullFields will be sent to the server as 1109 // null. It is an error if a field in this list has a non-empty value. 1110 // This may be used to include null fields in Patch requests. 1111 NullFields []string `json:"-"` 1112} 1113 1114func (s *SerialPortOutput) MarshalJSON() ([]byte, error) { 1115 type NoMethod SerialPortOutput 1116 raw := NoMethod(*s) 1117 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1118} 1119 1120// SetVolumeSnapshotSchedulePolicyRequest: Request for 1121// SetVolumeSnapshotSchedulePolicy. 1122type SetVolumeSnapshotSchedulePolicyRequest struct { 1123 // SnapshotSchedulePolicy: Required. The name of the policy to set on 1124 // the volume. 1125 SnapshotSchedulePolicy string `json:"snapshotSchedulePolicy,omitempty"` 1126 1127 // ForceSendFields is a list of field names (e.g. 1128 // "SnapshotSchedulePolicy") to unconditionally include in API requests. 1129 // By default, fields with empty values are omitted from API requests. 1130 // However, any non-pointer, non-interface field appearing in 1131 // ForceSendFields will be sent to the server regardless of whether the 1132 // field is empty or not. This may be used to include empty fields in 1133 // Patch requests. 1134 ForceSendFields []string `json:"-"` 1135 1136 // NullFields is a list of field names (e.g. "SnapshotSchedulePolicy") 1137 // to include in API requests with the JSON null value. By default, 1138 // fields with empty values are omitted from API requests. However, any 1139 // field with an empty value appearing in NullFields will be sent to the 1140 // server as null. It is an error if a field in this list has a 1141 // non-empty value. This may be used to include null fields in Patch 1142 // requests. 1143 NullFields []string `json:"-"` 1144} 1145 1146func (s *SetVolumeSnapshotSchedulePolicyRequest) MarshalJSON() ([]byte, error) { 1147 type NoMethod SetVolumeSnapshotSchedulePolicyRequest 1148 raw := NoMethod(*s) 1149 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1150} 1151 1152// SetVolumeSnapshotSchedulePolicyResponse: Response for 1153// SetVolumeSnapshotSchedulePolicy. 1154type SetVolumeSnapshotSchedulePolicyResponse struct { 1155 // ServerResponse contains the HTTP response code and headers from the 1156 // server. 1157 googleapi.ServerResponse `json:"-"` 1158} 1159 1160// SnapshotSchedulePolicy: A snapshot schedule policy. 1161type SnapshotSchedulePolicy struct { 1162 // Description: The description of this SnapshotSchedulePolicy. 1163 Description string `json:"description,omitempty"` 1164 1165 // Name: Output only. The name of this SnapshotSchedulePolicy. 1166 Name string `json:"name,omitempty"` 1167 1168 // Schedules: The snapshot Schedules contained in this Policy. At most 5 1169 // Schedules may be specified. 1170 Schedules []*Schedule `json:"schedules,omitempty"` 1171 1172 // Volumes: The names of the Volumes this policy is associated with. 1173 Volumes []string `json:"volumes,omitempty"` 1174 1175 // ServerResponse contains the HTTP response code and headers from the 1176 // server. 1177 googleapi.ServerResponse `json:"-"` 1178 1179 // ForceSendFields is a list of field names (e.g. "Description") to 1180 // unconditionally include in API requests. By default, fields with 1181 // empty values are omitted from API requests. However, any non-pointer, 1182 // non-interface field appearing in ForceSendFields will be sent to the 1183 // server regardless of whether the field is empty or not. This may be 1184 // used to include empty fields in Patch requests. 1185 ForceSendFields []string `json:"-"` 1186 1187 // NullFields is a list of field names (e.g. "Description") to include 1188 // in API requests with the JSON null value. By default, fields with 1189 // empty values are omitted from API requests. However, any field with 1190 // an empty value appearing in NullFields will be sent to the server as 1191 // null. It is an error if a field in this list has a non-empty value. 1192 // This may be used to include null fields in Patch requests. 1193 NullFields []string `json:"-"` 1194} 1195 1196func (s *SnapshotSchedulePolicy) MarshalJSON() ([]byte, error) { 1197 type NoMethod SnapshotSchedulePolicy 1198 raw := NoMethod(*s) 1199 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1200} 1201 1202// SubmitProvisioningConfigRequest: Request for 1203// SubmitProvisioningConfig. 1204type SubmitProvisioningConfigRequest struct { 1205 // ProvisioningConfig: Required. The ProvisioningConfig to submit. 1206 ProvisioningConfig *ProvisioningConfig `json:"provisioningConfig,omitempty"` 1207 1208 // ForceSendFields is a list of field names (e.g. "ProvisioningConfig") 1209 // to unconditionally include in API requests. By default, fields with 1210 // empty values are omitted from API requests. However, any non-pointer, 1211 // non-interface field appearing in ForceSendFields will be sent to the 1212 // server regardless of whether the field is empty or not. This may be 1213 // used to include empty fields in Patch requests. 1214 ForceSendFields []string `json:"-"` 1215 1216 // NullFields is a list of field names (e.g. "ProvisioningConfig") to 1217 // include in API requests with the JSON null value. By default, fields 1218 // with empty values are omitted from API requests. However, any field 1219 // with an empty value appearing in NullFields will be sent to the 1220 // server as null. It is an error if a field in this list has a 1221 // non-empty value. This may be used to include null fields in Patch 1222 // requests. 1223 NullFields []string `json:"-"` 1224} 1225 1226func (s *SubmitProvisioningConfigRequest) MarshalJSON() ([]byte, error) { 1227 type NoMethod SubmitProvisioningConfigRequest 1228 raw := NoMethod(*s) 1229 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1230} 1231 1232// VlanAttachment: A GCP vlan attachment. 1233type VlanAttachment struct { 1234 // Id: Identifier of the VLAN attachment. 1235 Id string `json:"id,omitempty"` 1236 1237 // PairingKey: Attachment pairing key. 1238 PairingKey string `json:"pairingKey,omitempty"` 1239 1240 // ForceSendFields is a list of field names (e.g. "Id") to 1241 // unconditionally include in API requests. By default, fields with 1242 // empty values are omitted from API requests. However, any non-pointer, 1243 // non-interface field appearing in ForceSendFields will be sent to the 1244 // server regardless of whether the field is empty or not. This may be 1245 // used to include empty fields in Patch requests. 1246 ForceSendFields []string `json:"-"` 1247 1248 // NullFields is a list of field names (e.g. "Id") to include in API 1249 // requests with the JSON null value. By default, fields with empty 1250 // values are omitted from API requests. However, any field with an 1251 // empty value appearing in NullFields will be sent to the server as 1252 // null. It is an error if a field in this list has a non-empty value. 1253 // This may be used to include null fields in Patch requests. 1254 NullFields []string `json:"-"` 1255} 1256 1257func (s *VlanAttachment) MarshalJSON() ([]byte, error) { 1258 type NoMethod VlanAttachment 1259 raw := NoMethod(*s) 1260 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1261} 1262 1263// Volume: Volume registered in the project. 1264type Volume struct { 1265 // AutoGrownSizeGb: The size, in GB, that this Volume has expanded as a 1266 // result of an auto grow policy. 1267 AutoGrownSizeGb int64 `json:"autoGrownSizeGb,omitempty,string"` 1268 1269 // CurrentSizeGb: The current size of this Volume, in GB, including 1270 // space reserved for snapshots. This size may be different than the 1271 // requested size if the Volume has been configured with auto grow or 1272 // auto shrink. 1273 CurrentSizeGb int64 `json:"currentSizeGb,omitempty,string"` 1274 1275 // Name: Output only. The name of this Volume. 1276 Name string `json:"name,omitempty"` 1277 1278 // RemainingSpaceGb: The space remaining in the Volume for new LUNs, in 1279 // GB, excluding space reserved for snapshots. 1280 RemainingSpaceGb int64 `json:"remainingSpaceGb,omitempty,string"` 1281 1282 // RequestedSizeGb: The requested size of this Volume, in GB. 1283 RequestedSizeGb int64 `json:"requestedSizeGb,omitempty,string"` 1284 1285 // SnapshotReservedSpacePercent: The percent of space on this Volume 1286 // reserved for snapshots. 1287 SnapshotReservedSpacePercent int64 `json:"snapshotReservedSpacePercent,omitempty"` 1288 1289 // SnapshotReservedSpaceRemainingGb: The amount, in GB, of space 1290 // available in this Volume's reserved snapshot space. 1291 SnapshotReservedSpaceRemainingGb int64 `json:"snapshotReservedSpaceRemainingGb,omitempty,string"` 1292 1293 // SnapshotReservedSpaceUsedPercent: The percent of reserved snapshot 1294 // space on this Volume that is actually used by snapshot copies. This 1295 // may be higher than 100% if snapshot copies are occupying more space 1296 // than has been reserved on the Volume. 1297 SnapshotReservedSpaceUsedPercent int64 `json:"snapshotReservedSpaceUsedPercent,omitempty"` 1298 1299 // State: The state of this Volume. 1300 // 1301 // Possible values: 1302 // "STATE_UNSPECIFIED" - The unspecified state. 1303 // "PROVISIONED" - The Volume has been provisioned. 1304 // "DEPROVISIONING_REQUESTED" - The Volume has been requested to be 1305 // deprovisioned. 1306 // "DEPROVISIONING_COOLOFF" - The Volume is in deprovisioning cooloff: 1307 // a deprovisioning has been requested, but data has not yet been 1308 // deleted. 1309 State string `json:"state,omitempty"` 1310 1311 // Type: The type of this Volume. 1312 // 1313 // Possible values: 1314 // "TYPE_UNSPECIFIED" - The unspecified type. 1315 // "FLASH" - This Volume is on flash. 1316 // "DISK" - This Volume is on disk. 1317 Type string `json:"type,omitempty"` 1318 1319 // ServerResponse contains the HTTP response code and headers from the 1320 // server. 1321 googleapi.ServerResponse `json:"-"` 1322 1323 // ForceSendFields is a list of field names (e.g. "AutoGrownSizeGb") to 1324 // unconditionally include in API requests. By default, fields with 1325 // empty values are omitted from API requests. However, any non-pointer, 1326 // non-interface field appearing in ForceSendFields will be sent to the 1327 // server regardless of whether the field is empty or not. This may be 1328 // used to include empty fields in Patch requests. 1329 ForceSendFields []string `json:"-"` 1330 1331 // NullFields is a list of field names (e.g. "AutoGrownSizeGb") to 1332 // include in API requests with the JSON null value. By default, fields 1333 // with empty values are omitted from API requests. However, any field 1334 // with an empty value appearing in NullFields will be sent to the 1335 // server as null. It is an error if a field in this list has a 1336 // non-empty value. This may be used to include null fields in Patch 1337 // requests. 1338 NullFields []string `json:"-"` 1339} 1340 1341func (s *Volume) MarshalJSON() ([]byte, error) { 1342 type NoMethod Volume 1343 raw := NoMethod(*s) 1344 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1345} 1346 1347// VolumeConfig: Configuration parameters for a new volume. 1348type VolumeConfig struct { 1349 // Id: A transient unique identifier to identify a volume within an 1350 // ProvisioningConfig request. 1351 Id string `json:"id,omitempty"` 1352 1353 // Location: Location where to deploy the volume. 1354 Location string `json:"location,omitempty"` 1355 1356 // LunRanges: LUN ranges to be configured. Set only when protocol is 1357 // PROTOCOL_FC. 1358 LunRanges []*LunRange `json:"lunRanges,omitempty"` 1359 1360 // MachineIds: Machine ids connected to this volume. Set only when 1361 // protocol is PROTOCOL_FC. 1362 MachineIds []string `json:"machineIds,omitempty"` 1363 1364 // NfsExports: NFS exports. Set only when protocol is PROTOCOL_NFS. 1365 NfsExports []*NfsExport `json:"nfsExports,omitempty"` 1366 1367 // Protocol: Volume protocol. 1368 // 1369 // Possible values: 1370 // "PROTOCOL_UNSPECIFIED" - Unspecified value. 1371 // "PROTOCOL_FC" - Fibre channel. 1372 // "PROTOCOL_NFS" - Network file system. 1373 Protocol string `json:"protocol,omitempty"` 1374 1375 // SizeGb: The requested size of this volume, in GB. This will be 1376 // updated in a later iteration with a generic size field. 1377 SizeGb int64 `json:"sizeGb,omitempty"` 1378 1379 // SnapshotsEnabled: Whether snapshots should be enabled. 1380 SnapshotsEnabled bool `json:"snapshotsEnabled,omitempty"` 1381 1382 // Type: The type of this Volume. 1383 // 1384 // Possible values: 1385 // "TYPE_UNSPECIFIED" - The unspecified type. 1386 // "FLASH" - This Volume is on flash. 1387 // "DISK" - This Volume is on disk. 1388 Type string `json:"type,omitempty"` 1389 1390 // ForceSendFields is a list of field names (e.g. "Id") to 1391 // unconditionally include in API requests. By default, fields with 1392 // empty values are omitted from API requests. However, any non-pointer, 1393 // non-interface field appearing in ForceSendFields will be sent to the 1394 // server regardless of whether the field is empty or not. This may be 1395 // used to include empty fields in Patch requests. 1396 ForceSendFields []string `json:"-"` 1397 1398 // NullFields is a list of field names (e.g. "Id") to include in API 1399 // requests with the JSON null value. By default, fields with empty 1400 // values are omitted from API requests. However, any field with an 1401 // empty value appearing in NullFields will be sent to the server as 1402 // null. It is an error if a field in this list has a non-empty value. 1403 // This may be used to include null fields in Patch requests. 1404 NullFields []string `json:"-"` 1405} 1406 1407func (s *VolumeConfig) MarshalJSON() ([]byte, error) { 1408 type NoMethod VolumeConfig 1409 raw := NoMethod(*s) 1410 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1411} 1412 1413// VolumeSnapshot: VolumeSnapshot registered for given Volume 1414type VolumeSnapshot struct { 1415 // Description: The description of this Snapshot. 1416 Description string `json:"description,omitempty"` 1417 1418 // Name: Output only. The name of this Snapshot. 1419 Name string `json:"name,omitempty"` 1420 1421 // SizeBytes: The real size of this Snapshot, in bytes. 1422 SizeBytes int64 `json:"sizeBytes,omitempty,string"` 1423 1424 // State: The state of this Snapshot. 1425 // 1426 // Possible values: 1427 // "STATE_UNSPECIFIED" - The unspecified state. 1428 // "CREATING" - The Snapshot is currently being created. 1429 // "ACTIVE" - The Snapshot has been created, and can be used to 1430 // restore. 1431 State string `json:"state,omitempty"` 1432 1433 // ServerResponse contains the HTTP response code and headers from the 1434 // server. 1435 googleapi.ServerResponse `json:"-"` 1436 1437 // ForceSendFields is a list of field names (e.g. "Description") to 1438 // unconditionally include in API requests. By default, fields with 1439 // empty values are omitted from API requests. However, any non-pointer, 1440 // non-interface field appearing in ForceSendFields will be sent to the 1441 // server regardless of whether the field is empty or not. This may be 1442 // used to include empty fields in Patch requests. 1443 ForceSendFields []string `json:"-"` 1444 1445 // NullFields is a list of field names (e.g. "Description") to include 1446 // in API requests with the JSON null value. By default, fields with 1447 // empty values are omitted from API requests. However, any field with 1448 // an empty value appearing in NullFields will be sent to the server as 1449 // null. It is an error if a field in this list has a non-empty value. 1450 // This may be used to include null fields in Patch requests. 1451 NullFields []string `json:"-"` 1452} 1453 1454func (s *VolumeSnapshot) MarshalJSON() ([]byte, error) { 1455 type NoMethod VolumeSnapshot 1456 raw := NoMethod(*s) 1457 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1458} 1459 1460// method id "baremetalsolution.projects.locations.submitProvisioningConfig": 1461 1462type ProjectsLocationsSubmitProvisioningConfigCall struct { 1463 s *Service 1464 project string 1465 location string 1466 submitprovisioningconfigrequest *SubmitProvisioningConfigRequest 1467 urlParams_ gensupport.URLParams 1468 ctx_ context.Context 1469 header_ http.Header 1470} 1471 1472// SubmitProvisioningConfig: Submit a provisiong configuration for a 1473// given project. 1474// 1475// - location: The target location of the provisioning request. 1476// - project: The target project of the provisioning request. 1477func (r *ProjectsLocationsService) SubmitProvisioningConfig(project string, location string, submitprovisioningconfigrequest *SubmitProvisioningConfigRequest) *ProjectsLocationsSubmitProvisioningConfigCall { 1478 c := &ProjectsLocationsSubmitProvisioningConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1479 c.project = project 1480 c.location = location 1481 c.submitprovisioningconfigrequest = submitprovisioningconfigrequest 1482 return c 1483} 1484 1485// Fields allows partial responses to be retrieved. See 1486// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1487// for more information. 1488func (c *ProjectsLocationsSubmitProvisioningConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubmitProvisioningConfigCall { 1489 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1490 return c 1491} 1492 1493// Context sets the context to be used in this call's Do method. Any 1494// pending HTTP request will be aborted if the provided context is 1495// canceled. 1496func (c *ProjectsLocationsSubmitProvisioningConfigCall) Context(ctx context.Context) *ProjectsLocationsSubmitProvisioningConfigCall { 1497 c.ctx_ = ctx 1498 return c 1499} 1500 1501// Header returns an http.Header that can be modified by the caller to 1502// add HTTP headers to the request. 1503func (c *ProjectsLocationsSubmitProvisioningConfigCall) Header() http.Header { 1504 if c.header_ == nil { 1505 c.header_ = make(http.Header) 1506 } 1507 return c.header_ 1508} 1509 1510func (c *ProjectsLocationsSubmitProvisioningConfigCall) doRequest(alt string) (*http.Response, error) { 1511 reqHeaders := make(http.Header) 1512 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 1513 for k, v := range c.header_ { 1514 reqHeaders[k] = v 1515 } 1516 reqHeaders.Set("User-Agent", c.s.userAgent()) 1517 var body io.Reader = nil 1518 body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitprovisioningconfigrequest) 1519 if err != nil { 1520 return nil, err 1521 } 1522 reqHeaders.Set("Content-Type", "application/json") 1523 c.urlParams_.Set("alt", alt) 1524 c.urlParams_.Set("prettyPrint", "false") 1525 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+project}/{+location}:submitProvisioningConfig") 1526 urls += "?" + c.urlParams_.Encode() 1527 req, err := http.NewRequest("POST", urls, body) 1528 if err != nil { 1529 return nil, err 1530 } 1531 req.Header = reqHeaders 1532 googleapi.Expand(req.URL, map[string]string{ 1533 "project": c.project, 1534 "location": c.location, 1535 }) 1536 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1537} 1538 1539// Do executes the "baremetalsolution.projects.locations.submitProvisioningConfig" call. 1540// Exactly one of *ProvisioningConfig or error will be non-nil. Any 1541// non-2xx status code is an error. Response headers are in either 1542// *ProvisioningConfig.ServerResponse.Header or (if a response was 1543// returned at all) in error.(*googleapi.Error).Header. Use 1544// googleapi.IsNotModified to check whether the returned error was 1545// because http.StatusNotModified was returned. 1546func (c *ProjectsLocationsSubmitProvisioningConfigCall) Do(opts ...googleapi.CallOption) (*ProvisioningConfig, error) { 1547 gensupport.SetOptions(c.urlParams_, opts...) 1548 res, err := c.doRequest("json") 1549 if res != nil && res.StatusCode == http.StatusNotModified { 1550 if res.Body != nil { 1551 res.Body.Close() 1552 } 1553 return nil, &googleapi.Error{ 1554 Code: res.StatusCode, 1555 Header: res.Header, 1556 } 1557 } 1558 if err != nil { 1559 return nil, err 1560 } 1561 defer googleapi.CloseBody(res) 1562 if err := googleapi.CheckResponse(res); err != nil { 1563 return nil, err 1564 } 1565 ret := &ProvisioningConfig{ 1566 ServerResponse: googleapi.ServerResponse{ 1567 Header: res.Header, 1568 HTTPStatusCode: res.StatusCode, 1569 }, 1570 } 1571 target := &ret 1572 if err := gensupport.DecodeResponse(target, res); err != nil { 1573 return nil, err 1574 } 1575 return ret, nil 1576 // { 1577 // "description": "Submit a provisiong configuration for a given project.", 1578 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}:submitProvisioningConfig", 1579 // "httpMethod": "POST", 1580 // "id": "baremetalsolution.projects.locations.submitProvisioningConfig", 1581 // "parameterOrder": [ 1582 // "project", 1583 // "location" 1584 // ], 1585 // "parameters": { 1586 // "location": { 1587 // "description": "Required. The target location of the provisioning request.", 1588 // "location": "path", 1589 // "pattern": "^locations/[^/]+$", 1590 // "required": true, 1591 // "type": "string" 1592 // }, 1593 // "project": { 1594 // "description": "Required. The target project of the provisioning request.", 1595 // "location": "path", 1596 // "pattern": "^projects/[^/]+$", 1597 // "required": true, 1598 // "type": "string" 1599 // } 1600 // }, 1601 // "path": "v1alpha1/{+project}/{+location}:submitProvisioningConfig", 1602 // "request": { 1603 // "$ref": "SubmitProvisioningConfigRequest" 1604 // }, 1605 // "response": { 1606 // "$ref": "ProvisioningConfig" 1607 // }, 1608 // "scopes": [ 1609 // "https://www.googleapis.com/auth/cloud-platform" 1610 // ] 1611 // } 1612 1613} 1614 1615// method id "baremetalsolution.projects.locations.instances.disableInteractiveSerialConsole": 1616 1617type ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall struct { 1618 s *Service 1619 instance string 1620 disableinteractiveserialconsolerequest *DisableInteractiveSerialConsoleRequest 1621 urlParams_ gensupport.URLParams 1622 ctx_ context.Context 1623 header_ http.Header 1624} 1625 1626// DisableInteractiveSerialConsole: Disable the interactive serial 1627// console feature on a specific machine. 1628// 1629// - instance: Name of the instance to disable the interactive serial 1630// console feature on. 1631func (r *ProjectsLocationsInstancesService) DisableInteractiveSerialConsole(instance string, disableinteractiveserialconsolerequest *DisableInteractiveSerialConsoleRequest) *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall { 1632 c := &ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1633 c.instance = instance 1634 c.disableinteractiveserialconsolerequest = disableinteractiveserialconsolerequest 1635 return c 1636} 1637 1638// Fields allows partial responses to be retrieved. See 1639// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1640// for more information. 1641func (c *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall { 1642 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1643 return c 1644} 1645 1646// Context sets the context to be used in this call's Do method. Any 1647// pending HTTP request will be aborted if the provided context is 1648// canceled. 1649func (c *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall) Context(ctx context.Context) *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall { 1650 c.ctx_ = ctx 1651 return c 1652} 1653 1654// Header returns an http.Header that can be modified by the caller to 1655// add HTTP headers to the request. 1656func (c *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall) Header() http.Header { 1657 if c.header_ == nil { 1658 c.header_ = make(http.Header) 1659 } 1660 return c.header_ 1661} 1662 1663func (c *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall) doRequest(alt string) (*http.Response, error) { 1664 reqHeaders := make(http.Header) 1665 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 1666 for k, v := range c.header_ { 1667 reqHeaders[k] = v 1668 } 1669 reqHeaders.Set("User-Agent", c.s.userAgent()) 1670 var body io.Reader = nil 1671 body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableinteractiveserialconsolerequest) 1672 if err != nil { 1673 return nil, err 1674 } 1675 reqHeaders.Set("Content-Type", "application/json") 1676 c.urlParams_.Set("alt", alt) 1677 c.urlParams_.Set("prettyPrint", "false") 1678 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+instance}:disableInteractiveSerialConsole") 1679 urls += "?" + c.urlParams_.Encode() 1680 req, err := http.NewRequest("POST", urls, body) 1681 if err != nil { 1682 return nil, err 1683 } 1684 req.Header = reqHeaders 1685 googleapi.Expand(req.URL, map[string]string{ 1686 "instance": c.instance, 1687 }) 1688 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1689} 1690 1691// Do executes the "baremetalsolution.projects.locations.instances.disableInteractiveSerialConsole" call. 1692// Exactly one of *DisableInteractiveSerialConsoleResponse or error will 1693// be non-nil. Any non-2xx status code is an error. Response headers are 1694// in either 1695// *DisableInteractiveSerialConsoleResponse.ServerResponse.Header or (if 1696// a response was returned at all) in error.(*googleapi.Error).Header. 1697// Use googleapi.IsNotModified to check whether the returned error was 1698// because http.StatusNotModified was returned. 1699func (c *ProjectsLocationsInstancesDisableInteractiveSerialConsoleCall) Do(opts ...googleapi.CallOption) (*DisableInteractiveSerialConsoleResponse, error) { 1700 gensupport.SetOptions(c.urlParams_, opts...) 1701 res, err := c.doRequest("json") 1702 if res != nil && res.StatusCode == http.StatusNotModified { 1703 if res.Body != nil { 1704 res.Body.Close() 1705 } 1706 return nil, &googleapi.Error{ 1707 Code: res.StatusCode, 1708 Header: res.Header, 1709 } 1710 } 1711 if err != nil { 1712 return nil, err 1713 } 1714 defer googleapi.CloseBody(res) 1715 if err := googleapi.CheckResponse(res); err != nil { 1716 return nil, err 1717 } 1718 ret := &DisableInteractiveSerialConsoleResponse{ 1719 ServerResponse: googleapi.ServerResponse{ 1720 Header: res.Header, 1721 HTTPStatusCode: res.StatusCode, 1722 }, 1723 } 1724 target := &ret 1725 if err := gensupport.DecodeResponse(target, res); err != nil { 1726 return nil, err 1727 } 1728 return ret, nil 1729 // { 1730 // "description": "Disable the interactive serial console feature on a specific machine.", 1731 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:disableInteractiveSerialConsole", 1732 // "httpMethod": "POST", 1733 // "id": "baremetalsolution.projects.locations.instances.disableInteractiveSerialConsole", 1734 // "parameterOrder": [ 1735 // "instance" 1736 // ], 1737 // "parameters": { 1738 // "instance": { 1739 // "description": "Required. Name of the instance to disable the interactive serial console feature on.", 1740 // "location": "path", 1741 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 1742 // "required": true, 1743 // "type": "string" 1744 // } 1745 // }, 1746 // "path": "v1alpha1/{+instance}:disableInteractiveSerialConsole", 1747 // "request": { 1748 // "$ref": "DisableInteractiveSerialConsoleRequest" 1749 // }, 1750 // "response": { 1751 // "$ref": "DisableInteractiveSerialConsoleResponse" 1752 // }, 1753 // "scopes": [ 1754 // "https://www.googleapis.com/auth/cloud-platform" 1755 // ] 1756 // } 1757 1758} 1759 1760// method id "baremetalsolution.projects.locations.instances.enableInteractiveSerialConsole": 1761 1762type ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall struct { 1763 s *Service 1764 instance string 1765 enableinteractiveserialconsolerequest *EnableInteractiveSerialConsoleRequest 1766 urlParams_ gensupport.URLParams 1767 ctx_ context.Context 1768 header_ http.Header 1769} 1770 1771// EnableInteractiveSerialConsole: Enable the interactive serial console 1772// feature on a specific machine. 1773// 1774// - instance: Name of the instance to enable the interactive serial 1775// console feature on. 1776func (r *ProjectsLocationsInstancesService) EnableInteractiveSerialConsole(instance string, enableinteractiveserialconsolerequest *EnableInteractiveSerialConsoleRequest) *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall { 1777 c := &ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1778 c.instance = instance 1779 c.enableinteractiveserialconsolerequest = enableinteractiveserialconsolerequest 1780 return c 1781} 1782 1783// Fields allows partial responses to be retrieved. See 1784// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1785// for more information. 1786func (c *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall { 1787 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1788 return c 1789} 1790 1791// Context sets the context to be used in this call's Do method. Any 1792// pending HTTP request will be aborted if the provided context is 1793// canceled. 1794func (c *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall) Context(ctx context.Context) *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall { 1795 c.ctx_ = ctx 1796 return c 1797} 1798 1799// Header returns an http.Header that can be modified by the caller to 1800// add HTTP headers to the request. 1801func (c *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall) Header() http.Header { 1802 if c.header_ == nil { 1803 c.header_ = make(http.Header) 1804 } 1805 return c.header_ 1806} 1807 1808func (c *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall) doRequest(alt string) (*http.Response, error) { 1809 reqHeaders := make(http.Header) 1810 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 1811 for k, v := range c.header_ { 1812 reqHeaders[k] = v 1813 } 1814 reqHeaders.Set("User-Agent", c.s.userAgent()) 1815 var body io.Reader = nil 1816 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableinteractiveserialconsolerequest) 1817 if err != nil { 1818 return nil, err 1819 } 1820 reqHeaders.Set("Content-Type", "application/json") 1821 c.urlParams_.Set("alt", alt) 1822 c.urlParams_.Set("prettyPrint", "false") 1823 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+instance}:enableInteractiveSerialConsole") 1824 urls += "?" + c.urlParams_.Encode() 1825 req, err := http.NewRequest("POST", urls, body) 1826 if err != nil { 1827 return nil, err 1828 } 1829 req.Header = reqHeaders 1830 googleapi.Expand(req.URL, map[string]string{ 1831 "instance": c.instance, 1832 }) 1833 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1834} 1835 1836// Do executes the "baremetalsolution.projects.locations.instances.enableInteractiveSerialConsole" call. 1837// Exactly one of *EnableInteractiveSerialConsoleResponse or error will 1838// be non-nil. Any non-2xx status code is an error. Response headers are 1839// in either 1840// *EnableInteractiveSerialConsoleResponse.ServerResponse.Header or (if 1841// a response was returned at all) in error.(*googleapi.Error).Header. 1842// Use googleapi.IsNotModified to check whether the returned error was 1843// because http.StatusNotModified was returned. 1844func (c *ProjectsLocationsInstancesEnableInteractiveSerialConsoleCall) Do(opts ...googleapi.CallOption) (*EnableInteractiveSerialConsoleResponse, error) { 1845 gensupport.SetOptions(c.urlParams_, opts...) 1846 res, err := c.doRequest("json") 1847 if res != nil && res.StatusCode == http.StatusNotModified { 1848 if res.Body != nil { 1849 res.Body.Close() 1850 } 1851 return nil, &googleapi.Error{ 1852 Code: res.StatusCode, 1853 Header: res.Header, 1854 } 1855 } 1856 if err != nil { 1857 return nil, err 1858 } 1859 defer googleapi.CloseBody(res) 1860 if err := googleapi.CheckResponse(res); err != nil { 1861 return nil, err 1862 } 1863 ret := &EnableInteractiveSerialConsoleResponse{ 1864 ServerResponse: googleapi.ServerResponse{ 1865 Header: res.Header, 1866 HTTPStatusCode: res.StatusCode, 1867 }, 1868 } 1869 target := &ret 1870 if err := gensupport.DecodeResponse(target, res); err != nil { 1871 return nil, err 1872 } 1873 return ret, nil 1874 // { 1875 // "description": "Enable the interactive serial console feature on a specific machine.", 1876 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:enableInteractiveSerialConsole", 1877 // "httpMethod": "POST", 1878 // "id": "baremetalsolution.projects.locations.instances.enableInteractiveSerialConsole", 1879 // "parameterOrder": [ 1880 // "instance" 1881 // ], 1882 // "parameters": { 1883 // "instance": { 1884 // "description": "Required. Name of the instance to enable the interactive serial console feature on.", 1885 // "location": "path", 1886 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 1887 // "required": true, 1888 // "type": "string" 1889 // } 1890 // }, 1891 // "path": "v1alpha1/{+instance}:enableInteractiveSerialConsole", 1892 // "request": { 1893 // "$ref": "EnableInteractiveSerialConsoleRequest" 1894 // }, 1895 // "response": { 1896 // "$ref": "EnableInteractiveSerialConsoleResponse" 1897 // }, 1898 // "scopes": [ 1899 // "https://www.googleapis.com/auth/cloud-platform" 1900 // ] 1901 // } 1902 1903} 1904 1905// method id "baremetalsolution.projects.locations.instances.get": 1906 1907type ProjectsLocationsInstancesGetCall struct { 1908 s *Service 1909 name string 1910 urlParams_ gensupport.URLParams 1911 ifNoneMatch_ string 1912 ctx_ context.Context 1913 header_ http.Header 1914} 1915 1916// Get: Get details for a specific named Instance. 1917// 1918// - name: The name of the Instance to retrieve. 1919func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall { 1920 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1921 c.name = name 1922 return c 1923} 1924 1925// Fields allows partial responses to be retrieved. See 1926// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1927// for more information. 1928func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall { 1929 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1930 return c 1931} 1932 1933// IfNoneMatch sets the optional parameter which makes the operation 1934// fail if the object's ETag matches the given value. This is useful for 1935// getting updates only after the object has changed since the last 1936// request. Use googleapi.IsNotModified to check whether the response 1937// error from Do is the result of In-None-Match. 1938func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall { 1939 c.ifNoneMatch_ = entityTag 1940 return c 1941} 1942 1943// Context sets the context to be used in this call's Do method. Any 1944// pending HTTP request will be aborted if the provided context is 1945// canceled. 1946func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall { 1947 c.ctx_ = ctx 1948 return c 1949} 1950 1951// Header returns an http.Header that can be modified by the caller to 1952// add HTTP headers to the request. 1953func (c *ProjectsLocationsInstancesGetCall) Header() http.Header { 1954 if c.header_ == nil { 1955 c.header_ = make(http.Header) 1956 } 1957 return c.header_ 1958} 1959 1960func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) { 1961 reqHeaders := make(http.Header) 1962 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 1963 for k, v := range c.header_ { 1964 reqHeaders[k] = v 1965 } 1966 reqHeaders.Set("User-Agent", c.s.userAgent()) 1967 if c.ifNoneMatch_ != "" { 1968 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1969 } 1970 var body io.Reader = nil 1971 c.urlParams_.Set("alt", alt) 1972 c.urlParams_.Set("prettyPrint", "false") 1973 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 1974 urls += "?" + c.urlParams_.Encode() 1975 req, err := http.NewRequest("GET", urls, body) 1976 if err != nil { 1977 return nil, err 1978 } 1979 req.Header = reqHeaders 1980 googleapi.Expand(req.URL, map[string]string{ 1981 "name": c.name, 1982 }) 1983 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1984} 1985 1986// Do executes the "baremetalsolution.projects.locations.instances.get" call. 1987// Exactly one of *Instance or error will be non-nil. Any non-2xx status 1988// code is an error. Response headers are in either 1989// *Instance.ServerResponse.Header or (if a response was returned at 1990// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1991// to check whether the returned error was because 1992// http.StatusNotModified was returned. 1993func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { 1994 gensupport.SetOptions(c.urlParams_, opts...) 1995 res, err := c.doRequest("json") 1996 if res != nil && res.StatusCode == http.StatusNotModified { 1997 if res.Body != nil { 1998 res.Body.Close() 1999 } 2000 return nil, &googleapi.Error{ 2001 Code: res.StatusCode, 2002 Header: res.Header, 2003 } 2004 } 2005 if err != nil { 2006 return nil, err 2007 } 2008 defer googleapi.CloseBody(res) 2009 if err := googleapi.CheckResponse(res); err != nil { 2010 return nil, err 2011 } 2012 ret := &Instance{ 2013 ServerResponse: googleapi.ServerResponse{ 2014 Header: res.Header, 2015 HTTPStatusCode: res.StatusCode, 2016 }, 2017 } 2018 target := &ret 2019 if err := gensupport.DecodeResponse(target, res); err != nil { 2020 return nil, err 2021 } 2022 return ret, nil 2023 // { 2024 // "description": "Get details for a specific named Instance.", 2025 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}", 2026 // "httpMethod": "GET", 2027 // "id": "baremetalsolution.projects.locations.instances.get", 2028 // "parameterOrder": [ 2029 // "name" 2030 // ], 2031 // "parameters": { 2032 // "name": { 2033 // "description": "Required. The name of the Instance to retrieve.", 2034 // "location": "path", 2035 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2036 // "required": true, 2037 // "type": "string" 2038 // } 2039 // }, 2040 // "path": "v1alpha1/{+name}", 2041 // "response": { 2042 // "$ref": "Instance" 2043 // }, 2044 // "scopes": [ 2045 // "https://www.googleapis.com/auth/cloud-platform" 2046 // ] 2047 // } 2048 2049} 2050 2051// method id "baremetalsolution.projects.locations.instances.list": 2052 2053type ProjectsLocationsInstancesListCall struct { 2054 s *Service 2055 parent string 2056 urlParams_ gensupport.URLParams 2057 ifNoneMatch_ string 2058 ctx_ context.Context 2059 header_ http.Header 2060} 2061 2062// List: List Instances (physical servers). 2063// 2064// - parent: The location to list Instances in. 2065func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall { 2066 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2067 c.parent = parent 2068 return c 2069} 2070 2071// PageSize sets the optional parameter "pageSize": The maximum number 2072// of items to return. 2073func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall { 2074 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2075 return c 2076} 2077 2078// PageToken sets the optional parameter "pageToken": The 2079// next_page_token value returned from a previous List request, if any. 2080func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall { 2081 c.urlParams_.Set("pageToken", pageToken) 2082 return c 2083} 2084 2085// Fields allows partial responses to be retrieved. See 2086// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2087// for more information. 2088func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall { 2089 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2090 return c 2091} 2092 2093// IfNoneMatch sets the optional parameter which makes the operation 2094// fail if the object's ETag matches the given value. This is useful for 2095// getting updates only after the object has changed since the last 2096// request. Use googleapi.IsNotModified to check whether the response 2097// error from Do is the result of In-None-Match. 2098func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall { 2099 c.ifNoneMatch_ = entityTag 2100 return c 2101} 2102 2103// Context sets the context to be used in this call's Do method. Any 2104// pending HTTP request will be aborted if the provided context is 2105// canceled. 2106func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall { 2107 c.ctx_ = ctx 2108 return c 2109} 2110 2111// Header returns an http.Header that can be modified by the caller to 2112// add HTTP headers to the request. 2113func (c *ProjectsLocationsInstancesListCall) Header() http.Header { 2114 if c.header_ == nil { 2115 c.header_ = make(http.Header) 2116 } 2117 return c.header_ 2118} 2119 2120func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) { 2121 reqHeaders := make(http.Header) 2122 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 2123 for k, v := range c.header_ { 2124 reqHeaders[k] = v 2125 } 2126 reqHeaders.Set("User-Agent", c.s.userAgent()) 2127 if c.ifNoneMatch_ != "" { 2128 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2129 } 2130 var body io.Reader = nil 2131 c.urlParams_.Set("alt", alt) 2132 c.urlParams_.Set("prettyPrint", "false") 2133 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/instances") 2134 urls += "?" + c.urlParams_.Encode() 2135 req, err := http.NewRequest("GET", urls, body) 2136 if err != nil { 2137 return nil, err 2138 } 2139 req.Header = reqHeaders 2140 googleapi.Expand(req.URL, map[string]string{ 2141 "parent": c.parent, 2142 }) 2143 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2144} 2145 2146// Do executes the "baremetalsolution.projects.locations.instances.list" call. 2147// Exactly one of *ListInstancesResponse or error will be non-nil. Any 2148// non-2xx status code is an error. Response headers are in either 2149// *ListInstancesResponse.ServerResponse.Header or (if a response was 2150// returned at all) in error.(*googleapi.Error).Header. Use 2151// googleapi.IsNotModified to check whether the returned error was 2152// because http.StatusNotModified was returned. 2153func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) { 2154 gensupport.SetOptions(c.urlParams_, opts...) 2155 res, err := c.doRequest("json") 2156 if res != nil && res.StatusCode == http.StatusNotModified { 2157 if res.Body != nil { 2158 res.Body.Close() 2159 } 2160 return nil, &googleapi.Error{ 2161 Code: res.StatusCode, 2162 Header: res.Header, 2163 } 2164 } 2165 if err != nil { 2166 return nil, err 2167 } 2168 defer googleapi.CloseBody(res) 2169 if err := googleapi.CheckResponse(res); err != nil { 2170 return nil, err 2171 } 2172 ret := &ListInstancesResponse{ 2173 ServerResponse: googleapi.ServerResponse{ 2174 Header: res.Header, 2175 HTTPStatusCode: res.StatusCode, 2176 }, 2177 } 2178 target := &ret 2179 if err := gensupport.DecodeResponse(target, res); err != nil { 2180 return nil, err 2181 } 2182 return ret, nil 2183 // { 2184 // "description": "List Instances (physical servers).", 2185 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/instances", 2186 // "httpMethod": "GET", 2187 // "id": "baremetalsolution.projects.locations.instances.list", 2188 // "parameterOrder": [ 2189 // "parent" 2190 // ], 2191 // "parameters": { 2192 // "pageSize": { 2193 // "description": "The maximum number of items to return.", 2194 // "format": "int32", 2195 // "location": "query", 2196 // "type": "integer" 2197 // }, 2198 // "pageToken": { 2199 // "description": "The next_page_token value returned from a previous List request, if any.", 2200 // "location": "query", 2201 // "type": "string" 2202 // }, 2203 // "parent": { 2204 // "description": "Required. The location to list Instances in.", 2205 // "location": "path", 2206 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2207 // "required": true, 2208 // "type": "string" 2209 // } 2210 // }, 2211 // "path": "v1alpha1/{+parent}/instances", 2212 // "response": { 2213 // "$ref": "ListInstancesResponse" 2214 // }, 2215 // "scopes": [ 2216 // "https://www.googleapis.com/auth/cloud-platform" 2217 // ] 2218 // } 2219 2220} 2221 2222// Pages invokes f for each page of results. 2223// A non-nil error returned from f will halt the iteration. 2224// The provided context supersedes any context provided to the Context method. 2225func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error { 2226 c.ctx_ = ctx 2227 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2228 for { 2229 x, err := c.Do() 2230 if err != nil { 2231 return err 2232 } 2233 if err := f(x); err != nil { 2234 return err 2235 } 2236 if x.NextPageToken == "" { 2237 return nil 2238 } 2239 c.PageToken(x.NextPageToken) 2240 } 2241} 2242 2243// method id "baremetalsolution.projects.locations.instances.readSerialPortOutput": 2244 2245type ProjectsLocationsInstancesReadSerialPortOutputCall struct { 2246 s *Service 2247 instance string 2248 urlParams_ gensupport.URLParams 2249 ifNoneMatch_ string 2250 ctx_ context.Context 2251 header_ http.Header 2252} 2253 2254// ReadSerialPortOutput: Read the most recent serial port output from a 2255// machine. 2256// 2257// - instance: Name of the instance to get serial port output of. 2258func (r *ProjectsLocationsInstancesService) ReadSerialPortOutput(instance string) *ProjectsLocationsInstancesReadSerialPortOutputCall { 2259 c := &ProjectsLocationsInstancesReadSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2260 c.instance = instance 2261 return c 2262} 2263 2264// StartByte sets the optional parameter "startByte": The start byte of 2265// the serial port output to return. 2266func (c *ProjectsLocationsInstancesReadSerialPortOutputCall) StartByte(startByte int64) *ProjectsLocationsInstancesReadSerialPortOutputCall { 2267 c.urlParams_.Set("startByte", fmt.Sprint(startByte)) 2268 return c 2269} 2270 2271// Fields allows partial responses to be retrieved. See 2272// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2273// for more information. 2274func (c *ProjectsLocationsInstancesReadSerialPortOutputCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesReadSerialPortOutputCall { 2275 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2276 return c 2277} 2278 2279// IfNoneMatch sets the optional parameter which makes the operation 2280// fail if the object's ETag matches the given value. This is useful for 2281// getting updates only after the object has changed since the last 2282// request. Use googleapi.IsNotModified to check whether the response 2283// error from Do is the result of In-None-Match. 2284func (c *ProjectsLocationsInstancesReadSerialPortOutputCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesReadSerialPortOutputCall { 2285 c.ifNoneMatch_ = entityTag 2286 return c 2287} 2288 2289// Context sets the context to be used in this call's Do method. Any 2290// pending HTTP request will be aborted if the provided context is 2291// canceled. 2292func (c *ProjectsLocationsInstancesReadSerialPortOutputCall) Context(ctx context.Context) *ProjectsLocationsInstancesReadSerialPortOutputCall { 2293 c.ctx_ = ctx 2294 return c 2295} 2296 2297// Header returns an http.Header that can be modified by the caller to 2298// add HTTP headers to the request. 2299func (c *ProjectsLocationsInstancesReadSerialPortOutputCall) Header() http.Header { 2300 if c.header_ == nil { 2301 c.header_ = make(http.Header) 2302 } 2303 return c.header_ 2304} 2305 2306func (c *ProjectsLocationsInstancesReadSerialPortOutputCall) doRequest(alt string) (*http.Response, error) { 2307 reqHeaders := make(http.Header) 2308 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 2309 for k, v := range c.header_ { 2310 reqHeaders[k] = v 2311 } 2312 reqHeaders.Set("User-Agent", c.s.userAgent()) 2313 if c.ifNoneMatch_ != "" { 2314 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2315 } 2316 var body io.Reader = nil 2317 c.urlParams_.Set("alt", alt) 2318 c.urlParams_.Set("prettyPrint", "false") 2319 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+instance}:readSerialPortOutput") 2320 urls += "?" + c.urlParams_.Encode() 2321 req, err := http.NewRequest("GET", urls, body) 2322 if err != nil { 2323 return nil, err 2324 } 2325 req.Header = reqHeaders 2326 googleapi.Expand(req.URL, map[string]string{ 2327 "instance": c.instance, 2328 }) 2329 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2330} 2331 2332// Do executes the "baremetalsolution.projects.locations.instances.readSerialPortOutput" call. 2333// Exactly one of *SerialPortOutput or error will be non-nil. Any 2334// non-2xx status code is an error. Response headers are in either 2335// *SerialPortOutput.ServerResponse.Header or (if a response was 2336// returned at all) in error.(*googleapi.Error).Header. Use 2337// googleapi.IsNotModified to check whether the returned error was 2338// because http.StatusNotModified was returned. 2339func (c *ProjectsLocationsInstancesReadSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) { 2340 gensupport.SetOptions(c.urlParams_, opts...) 2341 res, err := c.doRequest("json") 2342 if res != nil && res.StatusCode == http.StatusNotModified { 2343 if res.Body != nil { 2344 res.Body.Close() 2345 } 2346 return nil, &googleapi.Error{ 2347 Code: res.StatusCode, 2348 Header: res.Header, 2349 } 2350 } 2351 if err != nil { 2352 return nil, err 2353 } 2354 defer googleapi.CloseBody(res) 2355 if err := googleapi.CheckResponse(res); err != nil { 2356 return nil, err 2357 } 2358 ret := &SerialPortOutput{ 2359 ServerResponse: googleapi.ServerResponse{ 2360 Header: res.Header, 2361 HTTPStatusCode: res.StatusCode, 2362 }, 2363 } 2364 target := &ret 2365 if err := gensupport.DecodeResponse(target, res); err != nil { 2366 return nil, err 2367 } 2368 return ret, nil 2369 // { 2370 // "description": "Read the most recent serial port output from a machine.", 2371 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:readSerialPortOutput", 2372 // "httpMethod": "GET", 2373 // "id": "baremetalsolution.projects.locations.instances.readSerialPortOutput", 2374 // "parameterOrder": [ 2375 // "instance" 2376 // ], 2377 // "parameters": { 2378 // "instance": { 2379 // "description": "Required. Name of the instance to get serial port output of.", 2380 // "location": "path", 2381 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2382 // "required": true, 2383 // "type": "string" 2384 // }, 2385 // "startByte": { 2386 // "description": "Optional. The start byte of the serial port output to return.", 2387 // "format": "int64", 2388 // "location": "query", 2389 // "type": "string" 2390 // } 2391 // }, 2392 // "path": "v1alpha1/{+instance}:readSerialPortOutput", 2393 // "response": { 2394 // "$ref": "SerialPortOutput" 2395 // }, 2396 // "scopes": [ 2397 // "https://www.googleapis.com/auth/cloud-platform" 2398 // ] 2399 // } 2400 2401} 2402 2403// method id "baremetalsolution.projects.locations.instances.resetInstance": 2404 2405type ProjectsLocationsInstancesResetInstanceCall struct { 2406 s *Service 2407 instance string 2408 resetinstancerequest *ResetInstanceRequest 2409 urlParams_ gensupport.URLParams 2410 ctx_ context.Context 2411 header_ http.Header 2412} 2413 2414// ResetInstance: Perform an ungraceful, hard reset on a machine 2415// (equivalent to physically turning power off and then back on). 2416// 2417// - instance: Name of the instance to reset. 2418func (r *ProjectsLocationsInstancesService) ResetInstance(instance string, resetinstancerequest *ResetInstanceRequest) *ProjectsLocationsInstancesResetInstanceCall { 2419 c := &ProjectsLocationsInstancesResetInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2420 c.instance = instance 2421 c.resetinstancerequest = resetinstancerequest 2422 return c 2423} 2424 2425// Fields allows partial responses to be retrieved. See 2426// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2427// for more information. 2428func (c *ProjectsLocationsInstancesResetInstanceCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesResetInstanceCall { 2429 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2430 return c 2431} 2432 2433// Context sets the context to be used in this call's Do method. Any 2434// pending HTTP request will be aborted if the provided context is 2435// canceled. 2436func (c *ProjectsLocationsInstancesResetInstanceCall) Context(ctx context.Context) *ProjectsLocationsInstancesResetInstanceCall { 2437 c.ctx_ = ctx 2438 return c 2439} 2440 2441// Header returns an http.Header that can be modified by the caller to 2442// add HTTP headers to the request. 2443func (c *ProjectsLocationsInstancesResetInstanceCall) Header() http.Header { 2444 if c.header_ == nil { 2445 c.header_ = make(http.Header) 2446 } 2447 return c.header_ 2448} 2449 2450func (c *ProjectsLocationsInstancesResetInstanceCall) doRequest(alt string) (*http.Response, error) { 2451 reqHeaders := make(http.Header) 2452 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 2453 for k, v := range c.header_ { 2454 reqHeaders[k] = v 2455 } 2456 reqHeaders.Set("User-Agent", c.s.userAgent()) 2457 var body io.Reader = nil 2458 body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetinstancerequest) 2459 if err != nil { 2460 return nil, err 2461 } 2462 reqHeaders.Set("Content-Type", "application/json") 2463 c.urlParams_.Set("alt", alt) 2464 c.urlParams_.Set("prettyPrint", "false") 2465 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+instance}:resetInstance") 2466 urls += "?" + c.urlParams_.Encode() 2467 req, err := http.NewRequest("POST", urls, body) 2468 if err != nil { 2469 return nil, err 2470 } 2471 req.Header = reqHeaders 2472 googleapi.Expand(req.URL, map[string]string{ 2473 "instance": c.instance, 2474 }) 2475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2476} 2477 2478// Do executes the "baremetalsolution.projects.locations.instances.resetInstance" call. 2479// Exactly one of *ResetInstanceResponse or error will be non-nil. Any 2480// non-2xx status code is an error. Response headers are in either 2481// *ResetInstanceResponse.ServerResponse.Header or (if a response was 2482// returned at all) in error.(*googleapi.Error).Header. Use 2483// googleapi.IsNotModified to check whether the returned error was 2484// because http.StatusNotModified was returned. 2485func (c *ProjectsLocationsInstancesResetInstanceCall) Do(opts ...googleapi.CallOption) (*ResetInstanceResponse, error) { 2486 gensupport.SetOptions(c.urlParams_, opts...) 2487 res, err := c.doRequest("json") 2488 if res != nil && res.StatusCode == http.StatusNotModified { 2489 if res.Body != nil { 2490 res.Body.Close() 2491 } 2492 return nil, &googleapi.Error{ 2493 Code: res.StatusCode, 2494 Header: res.Header, 2495 } 2496 } 2497 if err != nil { 2498 return nil, err 2499 } 2500 defer googleapi.CloseBody(res) 2501 if err := googleapi.CheckResponse(res); err != nil { 2502 return nil, err 2503 } 2504 ret := &ResetInstanceResponse{ 2505 ServerResponse: googleapi.ServerResponse{ 2506 Header: res.Header, 2507 HTTPStatusCode: res.StatusCode, 2508 }, 2509 } 2510 target := &ret 2511 if err := gensupport.DecodeResponse(target, res); err != nil { 2512 return nil, err 2513 } 2514 return ret, nil 2515 // { 2516 // "description": "Perform an ungraceful, hard reset on a machine (equivalent to physically turning power off and then back on).", 2517 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:resetInstance", 2518 // "httpMethod": "POST", 2519 // "id": "baremetalsolution.projects.locations.instances.resetInstance", 2520 // "parameterOrder": [ 2521 // "instance" 2522 // ], 2523 // "parameters": { 2524 // "instance": { 2525 // "description": "Required. Name of the instance to reset.", 2526 // "location": "path", 2527 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2528 // "required": true, 2529 // "type": "string" 2530 // } 2531 // }, 2532 // "path": "v1alpha1/{+instance}:resetInstance", 2533 // "request": { 2534 // "$ref": "ResetInstanceRequest" 2535 // }, 2536 // "response": { 2537 // "$ref": "ResetInstanceResponse" 2538 // }, 2539 // "scopes": [ 2540 // "https://www.googleapis.com/auth/cloud-platform" 2541 // ] 2542 // } 2543 2544} 2545 2546// method id "baremetalsolution.projects.locations.luns.get": 2547 2548type ProjectsLocationsLunsGetCall struct { 2549 s *Service 2550 name string 2551 urlParams_ gensupport.URLParams 2552 ifNoneMatch_ string 2553 ctx_ context.Context 2554 header_ http.Header 2555} 2556 2557// Get: Get details for a specific named Lun. 2558// 2559// - name: The name of the Lun to retrieve. 2560func (r *ProjectsLocationsLunsService) Get(name string) *ProjectsLocationsLunsGetCall { 2561 c := &ProjectsLocationsLunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2562 c.name = name 2563 return c 2564} 2565 2566// Fields allows partial responses to be retrieved. See 2567// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2568// for more information. 2569func (c *ProjectsLocationsLunsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsLunsGetCall { 2570 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2571 return c 2572} 2573 2574// IfNoneMatch sets the optional parameter which makes the operation 2575// fail if the object's ETag matches the given value. This is useful for 2576// getting updates only after the object has changed since the last 2577// request. Use googleapi.IsNotModified to check whether the response 2578// error from Do is the result of In-None-Match. 2579func (c *ProjectsLocationsLunsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsLunsGetCall { 2580 c.ifNoneMatch_ = entityTag 2581 return c 2582} 2583 2584// Context sets the context to be used in this call's Do method. Any 2585// pending HTTP request will be aborted if the provided context is 2586// canceled. 2587func (c *ProjectsLocationsLunsGetCall) Context(ctx context.Context) *ProjectsLocationsLunsGetCall { 2588 c.ctx_ = ctx 2589 return c 2590} 2591 2592// Header returns an http.Header that can be modified by the caller to 2593// add HTTP headers to the request. 2594func (c *ProjectsLocationsLunsGetCall) Header() http.Header { 2595 if c.header_ == nil { 2596 c.header_ = make(http.Header) 2597 } 2598 return c.header_ 2599} 2600 2601func (c *ProjectsLocationsLunsGetCall) doRequest(alt string) (*http.Response, error) { 2602 reqHeaders := make(http.Header) 2603 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 2604 for k, v := range c.header_ { 2605 reqHeaders[k] = v 2606 } 2607 reqHeaders.Set("User-Agent", c.s.userAgent()) 2608 if c.ifNoneMatch_ != "" { 2609 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2610 } 2611 var body io.Reader = nil 2612 c.urlParams_.Set("alt", alt) 2613 c.urlParams_.Set("prettyPrint", "false") 2614 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 2615 urls += "?" + c.urlParams_.Encode() 2616 req, err := http.NewRequest("GET", urls, body) 2617 if err != nil { 2618 return nil, err 2619 } 2620 req.Header = reqHeaders 2621 googleapi.Expand(req.URL, map[string]string{ 2622 "name": c.name, 2623 }) 2624 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2625} 2626 2627// Do executes the "baremetalsolution.projects.locations.luns.get" call. 2628// Exactly one of *Lun or error will be non-nil. Any non-2xx status code 2629// is an error. Response headers are in either 2630// *Lun.ServerResponse.Header or (if a response was returned at all) in 2631// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2632// whether the returned error was because http.StatusNotModified was 2633// returned. 2634func (c *ProjectsLocationsLunsGetCall) Do(opts ...googleapi.CallOption) (*Lun, error) { 2635 gensupport.SetOptions(c.urlParams_, opts...) 2636 res, err := c.doRequest("json") 2637 if res != nil && res.StatusCode == http.StatusNotModified { 2638 if res.Body != nil { 2639 res.Body.Close() 2640 } 2641 return nil, &googleapi.Error{ 2642 Code: res.StatusCode, 2643 Header: res.Header, 2644 } 2645 } 2646 if err != nil { 2647 return nil, err 2648 } 2649 defer googleapi.CloseBody(res) 2650 if err := googleapi.CheckResponse(res); err != nil { 2651 return nil, err 2652 } 2653 ret := &Lun{ 2654 ServerResponse: googleapi.ServerResponse{ 2655 Header: res.Header, 2656 HTTPStatusCode: res.StatusCode, 2657 }, 2658 } 2659 target := &ret 2660 if err := gensupport.DecodeResponse(target, res); err != nil { 2661 return nil, err 2662 } 2663 return ret, nil 2664 // { 2665 // "description": "Get details for a specific named Lun.", 2666 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/luns/{lunsId}", 2667 // "httpMethod": "GET", 2668 // "id": "baremetalsolution.projects.locations.luns.get", 2669 // "parameterOrder": [ 2670 // "name" 2671 // ], 2672 // "parameters": { 2673 // "name": { 2674 // "description": "Required. The name of the Lun to retrieve.", 2675 // "location": "path", 2676 // "pattern": "^projects/[^/]+/locations/[^/]+/luns/[^/]+$", 2677 // "required": true, 2678 // "type": "string" 2679 // } 2680 // }, 2681 // "path": "v1alpha1/{+name}", 2682 // "response": { 2683 // "$ref": "Lun" 2684 // }, 2685 // "scopes": [ 2686 // "https://www.googleapis.com/auth/cloud-platform" 2687 // ] 2688 // } 2689 2690} 2691 2692// method id "baremetalsolution.projects.locations.luns.list": 2693 2694type ProjectsLocationsLunsListCall struct { 2695 s *Service 2696 parent string 2697 urlParams_ gensupport.URLParams 2698 ifNoneMatch_ string 2699 ctx_ context.Context 2700 header_ http.Header 2701} 2702 2703// List: List Luns. 2704// 2705// - parent: The location to list Luns in. 2706func (r *ProjectsLocationsLunsService) List(parent string) *ProjectsLocationsLunsListCall { 2707 c := &ProjectsLocationsLunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2708 c.parent = parent 2709 return c 2710} 2711 2712// PageSize sets the optional parameter "pageSize": The maximum number 2713// of items to return. 2714func (c *ProjectsLocationsLunsListCall) PageSize(pageSize int64) *ProjectsLocationsLunsListCall { 2715 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2716 return c 2717} 2718 2719// PageToken sets the optional parameter "pageToken": The 2720// next_page_token value returned from a previous List request, if any. 2721func (c *ProjectsLocationsLunsListCall) PageToken(pageToken string) *ProjectsLocationsLunsListCall { 2722 c.urlParams_.Set("pageToken", pageToken) 2723 return c 2724} 2725 2726// Fields allows partial responses to be retrieved. See 2727// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2728// for more information. 2729func (c *ProjectsLocationsLunsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsLunsListCall { 2730 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2731 return c 2732} 2733 2734// IfNoneMatch sets the optional parameter which makes the operation 2735// fail if the object's ETag matches the given value. This is useful for 2736// getting updates only after the object has changed since the last 2737// request. Use googleapi.IsNotModified to check whether the response 2738// error from Do is the result of In-None-Match. 2739func (c *ProjectsLocationsLunsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsLunsListCall { 2740 c.ifNoneMatch_ = entityTag 2741 return c 2742} 2743 2744// Context sets the context to be used in this call's Do method. Any 2745// pending HTTP request will be aborted if the provided context is 2746// canceled. 2747func (c *ProjectsLocationsLunsListCall) Context(ctx context.Context) *ProjectsLocationsLunsListCall { 2748 c.ctx_ = ctx 2749 return c 2750} 2751 2752// Header returns an http.Header that can be modified by the caller to 2753// add HTTP headers to the request. 2754func (c *ProjectsLocationsLunsListCall) Header() http.Header { 2755 if c.header_ == nil { 2756 c.header_ = make(http.Header) 2757 } 2758 return c.header_ 2759} 2760 2761func (c *ProjectsLocationsLunsListCall) doRequest(alt string) (*http.Response, error) { 2762 reqHeaders := make(http.Header) 2763 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 2764 for k, v := range c.header_ { 2765 reqHeaders[k] = v 2766 } 2767 reqHeaders.Set("User-Agent", c.s.userAgent()) 2768 if c.ifNoneMatch_ != "" { 2769 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2770 } 2771 var body io.Reader = nil 2772 c.urlParams_.Set("alt", alt) 2773 c.urlParams_.Set("prettyPrint", "false") 2774 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/luns") 2775 urls += "?" + c.urlParams_.Encode() 2776 req, err := http.NewRequest("GET", urls, body) 2777 if err != nil { 2778 return nil, err 2779 } 2780 req.Header = reqHeaders 2781 googleapi.Expand(req.URL, map[string]string{ 2782 "parent": c.parent, 2783 }) 2784 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2785} 2786 2787// Do executes the "baremetalsolution.projects.locations.luns.list" call. 2788// Exactly one of *ListLunsResponse or error will be non-nil. Any 2789// non-2xx status code is an error. Response headers are in either 2790// *ListLunsResponse.ServerResponse.Header or (if a response was 2791// returned at all) in error.(*googleapi.Error).Header. Use 2792// googleapi.IsNotModified to check whether the returned error was 2793// because http.StatusNotModified was returned. 2794func (c *ProjectsLocationsLunsListCall) Do(opts ...googleapi.CallOption) (*ListLunsResponse, error) { 2795 gensupport.SetOptions(c.urlParams_, opts...) 2796 res, err := c.doRequest("json") 2797 if res != nil && res.StatusCode == http.StatusNotModified { 2798 if res.Body != nil { 2799 res.Body.Close() 2800 } 2801 return nil, &googleapi.Error{ 2802 Code: res.StatusCode, 2803 Header: res.Header, 2804 } 2805 } 2806 if err != nil { 2807 return nil, err 2808 } 2809 defer googleapi.CloseBody(res) 2810 if err := googleapi.CheckResponse(res); err != nil { 2811 return nil, err 2812 } 2813 ret := &ListLunsResponse{ 2814 ServerResponse: googleapi.ServerResponse{ 2815 Header: res.Header, 2816 HTTPStatusCode: res.StatusCode, 2817 }, 2818 } 2819 target := &ret 2820 if err := gensupport.DecodeResponse(target, res); err != nil { 2821 return nil, err 2822 } 2823 return ret, nil 2824 // { 2825 // "description": "List Luns.", 2826 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/luns", 2827 // "httpMethod": "GET", 2828 // "id": "baremetalsolution.projects.locations.luns.list", 2829 // "parameterOrder": [ 2830 // "parent" 2831 // ], 2832 // "parameters": { 2833 // "pageSize": { 2834 // "description": "The maximum number of items to return.", 2835 // "format": "int32", 2836 // "location": "query", 2837 // "type": "integer" 2838 // }, 2839 // "pageToken": { 2840 // "description": "The next_page_token value returned from a previous List request, if any.", 2841 // "location": "query", 2842 // "type": "string" 2843 // }, 2844 // "parent": { 2845 // "description": "Required. The location to list Luns in.", 2846 // "location": "path", 2847 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2848 // "required": true, 2849 // "type": "string" 2850 // } 2851 // }, 2852 // "path": "v1alpha1/{+parent}/luns", 2853 // "response": { 2854 // "$ref": "ListLunsResponse" 2855 // }, 2856 // "scopes": [ 2857 // "https://www.googleapis.com/auth/cloud-platform" 2858 // ] 2859 // } 2860 2861} 2862 2863// Pages invokes f for each page of results. 2864// A non-nil error returned from f will halt the iteration. 2865// The provided context supersedes any context provided to the Context method. 2866func (c *ProjectsLocationsLunsListCall) Pages(ctx context.Context, f func(*ListLunsResponse) error) error { 2867 c.ctx_ = ctx 2868 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2869 for { 2870 x, err := c.Do() 2871 if err != nil { 2872 return err 2873 } 2874 if err := f(x); err != nil { 2875 return err 2876 } 2877 if x.NextPageToken == "" { 2878 return nil 2879 } 2880 c.PageToken(x.NextPageToken) 2881 } 2882} 2883 2884// method id "baremetalsolution.projects.locations.volumes.get": 2885 2886type ProjectsLocationsVolumesGetCall struct { 2887 s *Service 2888 name string 2889 urlParams_ gensupport.URLParams 2890 ifNoneMatch_ string 2891 ctx_ context.Context 2892 header_ http.Header 2893} 2894 2895// Get: Get details for a specific named Volume. 2896// 2897// - name: The name of the Volume to retrieve. 2898func (r *ProjectsLocationsVolumesService) Get(name string) *ProjectsLocationsVolumesGetCall { 2899 c := &ProjectsLocationsVolumesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2900 c.name = name 2901 return c 2902} 2903 2904// Fields allows partial responses to be retrieved. See 2905// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2906// for more information. 2907func (c *ProjectsLocationsVolumesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesGetCall { 2908 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2909 return c 2910} 2911 2912// IfNoneMatch sets the optional parameter which makes the operation 2913// fail if the object's ETag matches the given value. This is useful for 2914// getting updates only after the object has changed since the last 2915// request. Use googleapi.IsNotModified to check whether the response 2916// error from Do is the result of In-None-Match. 2917func (c *ProjectsLocationsVolumesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsVolumesGetCall { 2918 c.ifNoneMatch_ = entityTag 2919 return c 2920} 2921 2922// Context sets the context to be used in this call's Do method. Any 2923// pending HTTP request will be aborted if the provided context is 2924// canceled. 2925func (c *ProjectsLocationsVolumesGetCall) Context(ctx context.Context) *ProjectsLocationsVolumesGetCall { 2926 c.ctx_ = ctx 2927 return c 2928} 2929 2930// Header returns an http.Header that can be modified by the caller to 2931// add HTTP headers to the request. 2932func (c *ProjectsLocationsVolumesGetCall) Header() http.Header { 2933 if c.header_ == nil { 2934 c.header_ = make(http.Header) 2935 } 2936 return c.header_ 2937} 2938 2939func (c *ProjectsLocationsVolumesGetCall) doRequest(alt string) (*http.Response, error) { 2940 reqHeaders := make(http.Header) 2941 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 2942 for k, v := range c.header_ { 2943 reqHeaders[k] = v 2944 } 2945 reqHeaders.Set("User-Agent", c.s.userAgent()) 2946 if c.ifNoneMatch_ != "" { 2947 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2948 } 2949 var body io.Reader = nil 2950 c.urlParams_.Set("alt", alt) 2951 c.urlParams_.Set("prettyPrint", "false") 2952 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 2953 urls += "?" + c.urlParams_.Encode() 2954 req, err := http.NewRequest("GET", urls, body) 2955 if err != nil { 2956 return nil, err 2957 } 2958 req.Header = reqHeaders 2959 googleapi.Expand(req.URL, map[string]string{ 2960 "name": c.name, 2961 }) 2962 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2963} 2964 2965// Do executes the "baremetalsolution.projects.locations.volumes.get" call. 2966// Exactly one of *Volume or error will be non-nil. Any non-2xx status 2967// code is an error. Response headers are in either 2968// *Volume.ServerResponse.Header or (if a response was returned at all) 2969// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2970// check whether the returned error was because http.StatusNotModified 2971// was returned. 2972func (c *ProjectsLocationsVolumesGetCall) Do(opts ...googleapi.CallOption) (*Volume, error) { 2973 gensupport.SetOptions(c.urlParams_, opts...) 2974 res, err := c.doRequest("json") 2975 if res != nil && res.StatusCode == http.StatusNotModified { 2976 if res.Body != nil { 2977 res.Body.Close() 2978 } 2979 return nil, &googleapi.Error{ 2980 Code: res.StatusCode, 2981 Header: res.Header, 2982 } 2983 } 2984 if err != nil { 2985 return nil, err 2986 } 2987 defer googleapi.CloseBody(res) 2988 if err := googleapi.CheckResponse(res); err != nil { 2989 return nil, err 2990 } 2991 ret := &Volume{ 2992 ServerResponse: googleapi.ServerResponse{ 2993 Header: res.Header, 2994 HTTPStatusCode: res.StatusCode, 2995 }, 2996 } 2997 target := &ret 2998 if err := gensupport.DecodeResponse(target, res); err != nil { 2999 return nil, err 3000 } 3001 return ret, nil 3002 // { 3003 // "description": "Get details for a specific named Volume.", 3004 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes/{volumesId}", 3005 // "httpMethod": "GET", 3006 // "id": "baremetalsolution.projects.locations.volumes.get", 3007 // "parameterOrder": [ 3008 // "name" 3009 // ], 3010 // "parameters": { 3011 // "name": { 3012 // "description": "Required. The name of the Volume to retrieve.", 3013 // "location": "path", 3014 // "pattern": "^projects/[^/]+/locations/[^/]+/volumes/[^/]+$", 3015 // "required": true, 3016 // "type": "string" 3017 // } 3018 // }, 3019 // "path": "v1alpha1/{+name}", 3020 // "response": { 3021 // "$ref": "Volume" 3022 // }, 3023 // "scopes": [ 3024 // "https://www.googleapis.com/auth/cloud-platform" 3025 // ] 3026 // } 3027 3028} 3029 3030// method id "baremetalsolution.projects.locations.volumes.list": 3031 3032type ProjectsLocationsVolumesListCall struct { 3033 s *Service 3034 parent string 3035 urlParams_ gensupport.URLParams 3036 ifNoneMatch_ string 3037 ctx_ context.Context 3038 header_ http.Header 3039} 3040 3041// List: List the volumes for the specified project 3042// 3043// - parent: The location to list Volumes in. 3044func (r *ProjectsLocationsVolumesService) List(parent string) *ProjectsLocationsVolumesListCall { 3045 c := &ProjectsLocationsVolumesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3046 c.parent = parent 3047 return c 3048} 3049 3050// PageSize sets the optional parameter "pageSize": The maximum number 3051// of items to return. 3052func (c *ProjectsLocationsVolumesListCall) PageSize(pageSize int64) *ProjectsLocationsVolumesListCall { 3053 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3054 return c 3055} 3056 3057// PageToken sets the optional parameter "pageToken": The 3058// next_page_token value returned from a previous List request, if any. 3059func (c *ProjectsLocationsVolumesListCall) PageToken(pageToken string) *ProjectsLocationsVolumesListCall { 3060 c.urlParams_.Set("pageToken", pageToken) 3061 return c 3062} 3063 3064// Fields allows partial responses to be retrieved. See 3065// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3066// for more information. 3067func (c *ProjectsLocationsVolumesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesListCall { 3068 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3069 return c 3070} 3071 3072// IfNoneMatch sets the optional parameter which makes the operation 3073// fail if the object's ETag matches the given value. This is useful for 3074// getting updates only after the object has changed since the last 3075// request. Use googleapi.IsNotModified to check whether the response 3076// error from Do is the result of In-None-Match. 3077func (c *ProjectsLocationsVolumesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsVolumesListCall { 3078 c.ifNoneMatch_ = entityTag 3079 return c 3080} 3081 3082// Context sets the context to be used in this call's Do method. Any 3083// pending HTTP request will be aborted if the provided context is 3084// canceled. 3085func (c *ProjectsLocationsVolumesListCall) Context(ctx context.Context) *ProjectsLocationsVolumesListCall { 3086 c.ctx_ = ctx 3087 return c 3088} 3089 3090// Header returns an http.Header that can be modified by the caller to 3091// add HTTP headers to the request. 3092func (c *ProjectsLocationsVolumesListCall) Header() http.Header { 3093 if c.header_ == nil { 3094 c.header_ = make(http.Header) 3095 } 3096 return c.header_ 3097} 3098 3099func (c *ProjectsLocationsVolumesListCall) doRequest(alt string) (*http.Response, error) { 3100 reqHeaders := make(http.Header) 3101 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 3102 for k, v := range c.header_ { 3103 reqHeaders[k] = v 3104 } 3105 reqHeaders.Set("User-Agent", c.s.userAgent()) 3106 if c.ifNoneMatch_ != "" { 3107 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3108 } 3109 var body io.Reader = nil 3110 c.urlParams_.Set("alt", alt) 3111 c.urlParams_.Set("prettyPrint", "false") 3112 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/volumes") 3113 urls += "?" + c.urlParams_.Encode() 3114 req, err := http.NewRequest("GET", urls, body) 3115 if err != nil { 3116 return nil, err 3117 } 3118 req.Header = reqHeaders 3119 googleapi.Expand(req.URL, map[string]string{ 3120 "parent": c.parent, 3121 }) 3122 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3123} 3124 3125// Do executes the "baremetalsolution.projects.locations.volumes.list" call. 3126// Exactly one of *ListVolumesResponse or error will be non-nil. Any 3127// non-2xx status code is an error. Response headers are in either 3128// *ListVolumesResponse.ServerResponse.Header or (if a response was 3129// returned at all) in error.(*googleapi.Error).Header. Use 3130// googleapi.IsNotModified to check whether the returned error was 3131// because http.StatusNotModified was returned. 3132func (c *ProjectsLocationsVolumesListCall) Do(opts ...googleapi.CallOption) (*ListVolumesResponse, error) { 3133 gensupport.SetOptions(c.urlParams_, opts...) 3134 res, err := c.doRequest("json") 3135 if res != nil && res.StatusCode == http.StatusNotModified { 3136 if res.Body != nil { 3137 res.Body.Close() 3138 } 3139 return nil, &googleapi.Error{ 3140 Code: res.StatusCode, 3141 Header: res.Header, 3142 } 3143 } 3144 if err != nil { 3145 return nil, err 3146 } 3147 defer googleapi.CloseBody(res) 3148 if err := googleapi.CheckResponse(res); err != nil { 3149 return nil, err 3150 } 3151 ret := &ListVolumesResponse{ 3152 ServerResponse: googleapi.ServerResponse{ 3153 Header: res.Header, 3154 HTTPStatusCode: res.StatusCode, 3155 }, 3156 } 3157 target := &ret 3158 if err := gensupport.DecodeResponse(target, res); err != nil { 3159 return nil, err 3160 } 3161 return ret, nil 3162 // { 3163 // "description": "List the volumes for the specified project", 3164 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes", 3165 // "httpMethod": "GET", 3166 // "id": "baremetalsolution.projects.locations.volumes.list", 3167 // "parameterOrder": [ 3168 // "parent" 3169 // ], 3170 // "parameters": { 3171 // "pageSize": { 3172 // "description": "The maximum number of items to return.", 3173 // "format": "int32", 3174 // "location": "query", 3175 // "type": "integer" 3176 // }, 3177 // "pageToken": { 3178 // "description": "The next_page_token value returned from a previous List request, if any.", 3179 // "location": "query", 3180 // "type": "string" 3181 // }, 3182 // "parent": { 3183 // "description": "Required. The location to list Volumes in.", 3184 // "location": "path", 3185 // "pattern": "^projects/[^/]+/locations/[^/]+$", 3186 // "required": true, 3187 // "type": "string" 3188 // } 3189 // }, 3190 // "path": "v1alpha1/{+parent}/volumes", 3191 // "response": { 3192 // "$ref": "ListVolumesResponse" 3193 // }, 3194 // "scopes": [ 3195 // "https://www.googleapis.com/auth/cloud-platform" 3196 // ] 3197 // } 3198 3199} 3200 3201// Pages invokes f for each page of results. 3202// A non-nil error returned from f will halt the iteration. 3203// The provided context supersedes any context provided to the Context method. 3204func (c *ProjectsLocationsVolumesListCall) Pages(ctx context.Context, f func(*ListVolumesResponse) error) error { 3205 c.ctx_ = ctx 3206 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3207 for { 3208 x, err := c.Do() 3209 if err != nil { 3210 return err 3211 } 3212 if err := f(x); err != nil { 3213 return err 3214 } 3215 if x.NextPageToken == "" { 3216 return nil 3217 } 3218 c.PageToken(x.NextPageToken) 3219 } 3220} 3221 3222// method id "baremetalsolution.projects.locations.volumes.patch": 3223 3224type ProjectsLocationsVolumesPatchCall struct { 3225 s *Service 3226 name string 3227 volume *Volume 3228 urlParams_ gensupport.URLParams 3229 ctx_ context.Context 3230 header_ http.Header 3231} 3232 3233// Patch: Update certain parameters on a Volume. 3234// 3235// - name: Output only. The name of this Volume. 3236func (r *ProjectsLocationsVolumesService) Patch(name string, volume *Volume) *ProjectsLocationsVolumesPatchCall { 3237 c := &ProjectsLocationsVolumesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3238 c.name = name 3239 c.volume = volume 3240 return c 3241} 3242 3243// UpdateMask sets the optional parameter "updateMask": The list of 3244// fields to update. The only currently supported field is 3245// `snapshot_reserved_space_percent`. 3246func (c *ProjectsLocationsVolumesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsVolumesPatchCall { 3247 c.urlParams_.Set("updateMask", updateMask) 3248 return c 3249} 3250 3251// Fields allows partial responses to be retrieved. See 3252// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3253// for more information. 3254func (c *ProjectsLocationsVolumesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesPatchCall { 3255 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3256 return c 3257} 3258 3259// Context sets the context to be used in this call's Do method. Any 3260// pending HTTP request will be aborted if the provided context is 3261// canceled. 3262func (c *ProjectsLocationsVolumesPatchCall) Context(ctx context.Context) *ProjectsLocationsVolumesPatchCall { 3263 c.ctx_ = ctx 3264 return c 3265} 3266 3267// Header returns an http.Header that can be modified by the caller to 3268// add HTTP headers to the request. 3269func (c *ProjectsLocationsVolumesPatchCall) Header() http.Header { 3270 if c.header_ == nil { 3271 c.header_ = make(http.Header) 3272 } 3273 return c.header_ 3274} 3275 3276func (c *ProjectsLocationsVolumesPatchCall) doRequest(alt string) (*http.Response, error) { 3277 reqHeaders := make(http.Header) 3278 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 3279 for k, v := range c.header_ { 3280 reqHeaders[k] = v 3281 } 3282 reqHeaders.Set("User-Agent", c.s.userAgent()) 3283 var body io.Reader = nil 3284 body, err := googleapi.WithoutDataWrapper.JSONReader(c.volume) 3285 if err != nil { 3286 return nil, err 3287 } 3288 reqHeaders.Set("Content-Type", "application/json") 3289 c.urlParams_.Set("alt", alt) 3290 c.urlParams_.Set("prettyPrint", "false") 3291 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 3292 urls += "?" + c.urlParams_.Encode() 3293 req, err := http.NewRequest("PATCH", urls, body) 3294 if err != nil { 3295 return nil, err 3296 } 3297 req.Header = reqHeaders 3298 googleapi.Expand(req.URL, map[string]string{ 3299 "name": c.name, 3300 }) 3301 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3302} 3303 3304// Do executes the "baremetalsolution.projects.locations.volumes.patch" call. 3305// Exactly one of *Volume or error will be non-nil. Any non-2xx status 3306// code is an error. Response headers are in either 3307// *Volume.ServerResponse.Header or (if a response was returned at all) 3308// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3309// check whether the returned error was because http.StatusNotModified 3310// was returned. 3311func (c *ProjectsLocationsVolumesPatchCall) Do(opts ...googleapi.CallOption) (*Volume, error) { 3312 gensupport.SetOptions(c.urlParams_, opts...) 3313 res, err := c.doRequest("json") 3314 if res != nil && res.StatusCode == http.StatusNotModified { 3315 if res.Body != nil { 3316 res.Body.Close() 3317 } 3318 return nil, &googleapi.Error{ 3319 Code: res.StatusCode, 3320 Header: res.Header, 3321 } 3322 } 3323 if err != nil { 3324 return nil, err 3325 } 3326 defer googleapi.CloseBody(res) 3327 if err := googleapi.CheckResponse(res); err != nil { 3328 return nil, err 3329 } 3330 ret := &Volume{ 3331 ServerResponse: googleapi.ServerResponse{ 3332 Header: res.Header, 3333 HTTPStatusCode: res.StatusCode, 3334 }, 3335 } 3336 target := &ret 3337 if err := gensupport.DecodeResponse(target, res); err != nil { 3338 return nil, err 3339 } 3340 return ret, nil 3341 // { 3342 // "description": "Update certain parameters on a Volume.", 3343 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes/{volumesId}", 3344 // "httpMethod": "PATCH", 3345 // "id": "baremetalsolution.projects.locations.volumes.patch", 3346 // "parameterOrder": [ 3347 // "name" 3348 // ], 3349 // "parameters": { 3350 // "name": { 3351 // "description": "Output only. The name of this Volume.", 3352 // "location": "path", 3353 // "pattern": "^projects/[^/]+/locations/[^/]+/volumes/[^/]+$", 3354 // "required": true, 3355 // "type": "string" 3356 // }, 3357 // "updateMask": { 3358 // "description": "The list of fields to update. The only currently supported field is `snapshot_reserved_space_percent`.", 3359 // "format": "google-fieldmask", 3360 // "location": "query", 3361 // "type": "string" 3362 // } 3363 // }, 3364 // "path": "v1alpha1/{+name}", 3365 // "request": { 3366 // "$ref": "Volume" 3367 // }, 3368 // "response": { 3369 // "$ref": "Volume" 3370 // }, 3371 // "scopes": [ 3372 // "https://www.googleapis.com/auth/cloud-platform" 3373 // ] 3374 // } 3375 3376} 3377 3378// method id "baremetalsolution.projects.locations.volumes.setVolumeSnapshotSchedulePolicy": 3379 3380type ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall struct { 3381 s *Service 3382 volume string 3383 setvolumesnapshotschedulepolicyrequest *SetVolumeSnapshotSchedulePolicyRequest 3384 urlParams_ gensupport.URLParams 3385 ctx_ context.Context 3386 header_ http.Header 3387} 3388 3389// SetVolumeSnapshotSchedulePolicy: Sets the specified snapshot schedule 3390// policy on the specified volume. 3391// 3392// - volume: Name of the volume to set snapshot schedule policy on. 3393func (r *ProjectsLocationsVolumesService) SetVolumeSnapshotSchedulePolicy(volume string, setvolumesnapshotschedulepolicyrequest *SetVolumeSnapshotSchedulePolicyRequest) *ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall { 3394 c := &ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3395 c.volume = volume 3396 c.setvolumesnapshotschedulepolicyrequest = setvolumesnapshotschedulepolicyrequest 3397 return c 3398} 3399 3400// Fields allows partial responses to be retrieved. See 3401// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3402// for more information. 3403func (c *ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall { 3404 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3405 return c 3406} 3407 3408// Context sets the context to be used in this call's Do method. Any 3409// pending HTTP request will be aborted if the provided context is 3410// canceled. 3411func (c *ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall) Context(ctx context.Context) *ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall { 3412 c.ctx_ = ctx 3413 return c 3414} 3415 3416// Header returns an http.Header that can be modified by the caller to 3417// add HTTP headers to the request. 3418func (c *ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall) Header() http.Header { 3419 if c.header_ == nil { 3420 c.header_ = make(http.Header) 3421 } 3422 return c.header_ 3423} 3424 3425func (c *ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall) doRequest(alt string) (*http.Response, error) { 3426 reqHeaders := make(http.Header) 3427 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 3428 for k, v := range c.header_ { 3429 reqHeaders[k] = v 3430 } 3431 reqHeaders.Set("User-Agent", c.s.userAgent()) 3432 var body io.Reader = nil 3433 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setvolumesnapshotschedulepolicyrequest) 3434 if err != nil { 3435 return nil, err 3436 } 3437 reqHeaders.Set("Content-Type", "application/json") 3438 c.urlParams_.Set("alt", alt) 3439 c.urlParams_.Set("prettyPrint", "false") 3440 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+volume}:setVolumeSnapshotSchedulePolicy") 3441 urls += "?" + c.urlParams_.Encode() 3442 req, err := http.NewRequest("POST", urls, body) 3443 if err != nil { 3444 return nil, err 3445 } 3446 req.Header = reqHeaders 3447 googleapi.Expand(req.URL, map[string]string{ 3448 "volume": c.volume, 3449 }) 3450 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3451} 3452 3453// Do executes the "baremetalsolution.projects.locations.volumes.setVolumeSnapshotSchedulePolicy" call. 3454// Exactly one of *SetVolumeSnapshotSchedulePolicyResponse or error will 3455// be non-nil. Any non-2xx status code is an error. Response headers are 3456// in either 3457// *SetVolumeSnapshotSchedulePolicyResponse.ServerResponse.Header or (if 3458// a response was returned at all) in error.(*googleapi.Error).Header. 3459// Use googleapi.IsNotModified to check whether the returned error was 3460// because http.StatusNotModified was returned. 3461func (c *ProjectsLocationsVolumesSetVolumeSnapshotSchedulePolicyCall) Do(opts ...googleapi.CallOption) (*SetVolumeSnapshotSchedulePolicyResponse, error) { 3462 gensupport.SetOptions(c.urlParams_, opts...) 3463 res, err := c.doRequest("json") 3464 if res != nil && res.StatusCode == http.StatusNotModified { 3465 if res.Body != nil { 3466 res.Body.Close() 3467 } 3468 return nil, &googleapi.Error{ 3469 Code: res.StatusCode, 3470 Header: res.Header, 3471 } 3472 } 3473 if err != nil { 3474 return nil, err 3475 } 3476 defer googleapi.CloseBody(res) 3477 if err := googleapi.CheckResponse(res); err != nil { 3478 return nil, err 3479 } 3480 ret := &SetVolumeSnapshotSchedulePolicyResponse{ 3481 ServerResponse: googleapi.ServerResponse{ 3482 Header: res.Header, 3483 HTTPStatusCode: res.StatusCode, 3484 }, 3485 } 3486 target := &ret 3487 if err := gensupport.DecodeResponse(target, res); err != nil { 3488 return nil, err 3489 } 3490 return ret, nil 3491 // { 3492 // "description": "Sets the specified snapshot schedule policy on the specified volume.", 3493 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes/{volumesId}:setVolumeSnapshotSchedulePolicy", 3494 // "httpMethod": "POST", 3495 // "id": "baremetalsolution.projects.locations.volumes.setVolumeSnapshotSchedulePolicy", 3496 // "parameterOrder": [ 3497 // "volume" 3498 // ], 3499 // "parameters": { 3500 // "volume": { 3501 // "description": "Required. Name of the volume to set snapshot schedule policy on.", 3502 // "location": "path", 3503 // "pattern": "^projects/[^/]+/locations/[^/]+/volumes/[^/]+$", 3504 // "required": true, 3505 // "type": "string" 3506 // } 3507 // }, 3508 // "path": "v1alpha1/{+volume}:setVolumeSnapshotSchedulePolicy", 3509 // "request": { 3510 // "$ref": "SetVolumeSnapshotSchedulePolicyRequest" 3511 // }, 3512 // "response": { 3513 // "$ref": "SetVolumeSnapshotSchedulePolicyResponse" 3514 // }, 3515 // "scopes": [ 3516 // "https://www.googleapis.com/auth/cloud-platform" 3517 // ] 3518 // } 3519 3520} 3521 3522// method id "baremetalsolution.projects.locations.volumes.snapshots.create": 3523 3524type ProjectsLocationsVolumesSnapshotsCreateCall struct { 3525 s *Service 3526 parent string 3527 volumesnapshot *VolumeSnapshot 3528 urlParams_ gensupport.URLParams 3529 ctx_ context.Context 3530 header_ http.Header 3531} 3532 3533// Create: Create snapshot of the specified Volume 3534// 3535// - parent: The Volume containing the VolumeSnapshots. 3536func (r *ProjectsLocationsVolumesSnapshotsService) Create(parent string, volumesnapshot *VolumeSnapshot) *ProjectsLocationsVolumesSnapshotsCreateCall { 3537 c := &ProjectsLocationsVolumesSnapshotsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3538 c.parent = parent 3539 c.volumesnapshot = volumesnapshot 3540 return c 3541} 3542 3543// Fields allows partial responses to be retrieved. See 3544// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3545// for more information. 3546func (c *ProjectsLocationsVolumesSnapshotsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesSnapshotsCreateCall { 3547 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3548 return c 3549} 3550 3551// Context sets the context to be used in this call's Do method. Any 3552// pending HTTP request will be aborted if the provided context is 3553// canceled. 3554func (c *ProjectsLocationsVolumesSnapshotsCreateCall) Context(ctx context.Context) *ProjectsLocationsVolumesSnapshotsCreateCall { 3555 c.ctx_ = ctx 3556 return c 3557} 3558 3559// Header returns an http.Header that can be modified by the caller to 3560// add HTTP headers to the request. 3561func (c *ProjectsLocationsVolumesSnapshotsCreateCall) Header() http.Header { 3562 if c.header_ == nil { 3563 c.header_ = make(http.Header) 3564 } 3565 return c.header_ 3566} 3567 3568func (c *ProjectsLocationsVolumesSnapshotsCreateCall) doRequest(alt string) (*http.Response, error) { 3569 reqHeaders := make(http.Header) 3570 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 3571 for k, v := range c.header_ { 3572 reqHeaders[k] = v 3573 } 3574 reqHeaders.Set("User-Agent", c.s.userAgent()) 3575 var body io.Reader = nil 3576 body, err := googleapi.WithoutDataWrapper.JSONReader(c.volumesnapshot) 3577 if err != nil { 3578 return nil, err 3579 } 3580 reqHeaders.Set("Content-Type", "application/json") 3581 c.urlParams_.Set("alt", alt) 3582 c.urlParams_.Set("prettyPrint", "false") 3583 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/snapshots") 3584 urls += "?" + c.urlParams_.Encode() 3585 req, err := http.NewRequest("POST", urls, body) 3586 if err != nil { 3587 return nil, err 3588 } 3589 req.Header = reqHeaders 3590 googleapi.Expand(req.URL, map[string]string{ 3591 "parent": c.parent, 3592 }) 3593 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3594} 3595 3596// Do executes the "baremetalsolution.projects.locations.volumes.snapshots.create" call. 3597// Exactly one of *VolumeSnapshot or error will be non-nil. Any non-2xx 3598// status code is an error. Response headers are in either 3599// *VolumeSnapshot.ServerResponse.Header or (if a response was returned 3600// at all) in error.(*googleapi.Error).Header. Use 3601// googleapi.IsNotModified to check whether the returned error was 3602// because http.StatusNotModified was returned. 3603func (c *ProjectsLocationsVolumesSnapshotsCreateCall) Do(opts ...googleapi.CallOption) (*VolumeSnapshot, error) { 3604 gensupport.SetOptions(c.urlParams_, opts...) 3605 res, err := c.doRequest("json") 3606 if res != nil && res.StatusCode == http.StatusNotModified { 3607 if res.Body != nil { 3608 res.Body.Close() 3609 } 3610 return nil, &googleapi.Error{ 3611 Code: res.StatusCode, 3612 Header: res.Header, 3613 } 3614 } 3615 if err != nil { 3616 return nil, err 3617 } 3618 defer googleapi.CloseBody(res) 3619 if err := googleapi.CheckResponse(res); err != nil { 3620 return nil, err 3621 } 3622 ret := &VolumeSnapshot{ 3623 ServerResponse: googleapi.ServerResponse{ 3624 Header: res.Header, 3625 HTTPStatusCode: res.StatusCode, 3626 }, 3627 } 3628 target := &ret 3629 if err := gensupport.DecodeResponse(target, res); err != nil { 3630 return nil, err 3631 } 3632 return ret, nil 3633 // { 3634 // "description": "Create snapshot of the specified Volume", 3635 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes/{volumesId}/snapshots", 3636 // "httpMethod": "POST", 3637 // "id": "baremetalsolution.projects.locations.volumes.snapshots.create", 3638 // "parameterOrder": [ 3639 // "parent" 3640 // ], 3641 // "parameters": { 3642 // "parent": { 3643 // "description": "Required. The Volume containing the VolumeSnapshots.", 3644 // "location": "path", 3645 // "pattern": "^projects/[^/]+/locations/[^/]+/volumes/[^/]+$", 3646 // "required": true, 3647 // "type": "string" 3648 // } 3649 // }, 3650 // "path": "v1alpha1/{+parent}/snapshots", 3651 // "request": { 3652 // "$ref": "VolumeSnapshot" 3653 // }, 3654 // "response": { 3655 // "$ref": "VolumeSnapshot" 3656 // }, 3657 // "scopes": [ 3658 // "https://www.googleapis.com/auth/cloud-platform" 3659 // ] 3660 // } 3661 3662} 3663 3664// method id "baremetalsolution.projects.locations.volumes.snapshots.delete": 3665 3666type ProjectsLocationsVolumesSnapshotsDeleteCall struct { 3667 s *Service 3668 name string 3669 urlParams_ gensupport.URLParams 3670 ctx_ context.Context 3671 header_ http.Header 3672} 3673 3674// Delete: Delete specific named snapshot. 3675// 3676// - name: The name of the snapshot to delete. 3677func (r *ProjectsLocationsVolumesSnapshotsService) Delete(name string) *ProjectsLocationsVolumesSnapshotsDeleteCall { 3678 c := &ProjectsLocationsVolumesSnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3679 c.name = name 3680 return c 3681} 3682 3683// Fields allows partial responses to be retrieved. See 3684// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3685// for more information. 3686func (c *ProjectsLocationsVolumesSnapshotsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesSnapshotsDeleteCall { 3687 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3688 return c 3689} 3690 3691// Context sets the context to be used in this call's Do method. Any 3692// pending HTTP request will be aborted if the provided context is 3693// canceled. 3694func (c *ProjectsLocationsVolumesSnapshotsDeleteCall) Context(ctx context.Context) *ProjectsLocationsVolumesSnapshotsDeleteCall { 3695 c.ctx_ = ctx 3696 return c 3697} 3698 3699// Header returns an http.Header that can be modified by the caller to 3700// add HTTP headers to the request. 3701func (c *ProjectsLocationsVolumesSnapshotsDeleteCall) Header() http.Header { 3702 if c.header_ == nil { 3703 c.header_ = make(http.Header) 3704 } 3705 return c.header_ 3706} 3707 3708func (c *ProjectsLocationsVolumesSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { 3709 reqHeaders := make(http.Header) 3710 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 3711 for k, v := range c.header_ { 3712 reqHeaders[k] = v 3713 } 3714 reqHeaders.Set("User-Agent", c.s.userAgent()) 3715 var body io.Reader = nil 3716 c.urlParams_.Set("alt", alt) 3717 c.urlParams_.Set("prettyPrint", "false") 3718 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 3719 urls += "?" + c.urlParams_.Encode() 3720 req, err := http.NewRequest("DELETE", urls, body) 3721 if err != nil { 3722 return nil, err 3723 } 3724 req.Header = reqHeaders 3725 googleapi.Expand(req.URL, map[string]string{ 3726 "name": c.name, 3727 }) 3728 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3729} 3730 3731// Do executes the "baremetalsolution.projects.locations.volumes.snapshots.delete" call. 3732// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3733// code is an error. Response headers are in either 3734// *Empty.ServerResponse.Header or (if a response was returned at all) 3735// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3736// check whether the returned error was because http.StatusNotModified 3737// was returned. 3738func (c *ProjectsLocationsVolumesSnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3739 gensupport.SetOptions(c.urlParams_, opts...) 3740 res, err := c.doRequest("json") 3741 if res != nil && res.StatusCode == http.StatusNotModified { 3742 if res.Body != nil { 3743 res.Body.Close() 3744 } 3745 return nil, &googleapi.Error{ 3746 Code: res.StatusCode, 3747 Header: res.Header, 3748 } 3749 } 3750 if err != nil { 3751 return nil, err 3752 } 3753 defer googleapi.CloseBody(res) 3754 if err := googleapi.CheckResponse(res); err != nil { 3755 return nil, err 3756 } 3757 ret := &Empty{ 3758 ServerResponse: googleapi.ServerResponse{ 3759 Header: res.Header, 3760 HTTPStatusCode: res.StatusCode, 3761 }, 3762 } 3763 target := &ret 3764 if err := gensupport.DecodeResponse(target, res); err != nil { 3765 return nil, err 3766 } 3767 return ret, nil 3768 // { 3769 // "description": "Delete specific named snapshot.", 3770 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes/{volumesId}/snapshots/{snapshotsId}", 3771 // "httpMethod": "DELETE", 3772 // "id": "baremetalsolution.projects.locations.volumes.snapshots.delete", 3773 // "parameterOrder": [ 3774 // "name" 3775 // ], 3776 // "parameters": { 3777 // "name": { 3778 // "description": "Required. The name of the snapshot to delete.", 3779 // "location": "path", 3780 // "pattern": "^projects/[^/]+/locations/[^/]+/volumes/[^/]+/snapshots/[^/]+$", 3781 // "required": true, 3782 // "type": "string" 3783 // } 3784 // }, 3785 // "path": "v1alpha1/{+name}", 3786 // "response": { 3787 // "$ref": "Empty" 3788 // }, 3789 // "scopes": [ 3790 // "https://www.googleapis.com/auth/cloud-platform" 3791 // ] 3792 // } 3793 3794} 3795 3796// method id "baremetalsolution.projects.locations.volumes.snapshots.get": 3797 3798type ProjectsLocationsVolumesSnapshotsGetCall struct { 3799 s *Service 3800 name string 3801 urlParams_ gensupport.URLParams 3802 ifNoneMatch_ string 3803 ctx_ context.Context 3804 header_ http.Header 3805} 3806 3807// Get: Get details for a specific named snapshot. 3808// 3809// - name: The name of the snapshot to retrieve. 3810func (r *ProjectsLocationsVolumesSnapshotsService) Get(name string) *ProjectsLocationsVolumesSnapshotsGetCall { 3811 c := &ProjectsLocationsVolumesSnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3812 c.name = name 3813 return c 3814} 3815 3816// Fields allows partial responses to be retrieved. See 3817// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3818// for more information. 3819func (c *ProjectsLocationsVolumesSnapshotsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesSnapshotsGetCall { 3820 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3821 return c 3822} 3823 3824// IfNoneMatch sets the optional parameter which makes the operation 3825// fail if the object's ETag matches the given value. This is useful for 3826// getting updates only after the object has changed since the last 3827// request. Use googleapi.IsNotModified to check whether the response 3828// error from Do is the result of In-None-Match. 3829func (c *ProjectsLocationsVolumesSnapshotsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsVolumesSnapshotsGetCall { 3830 c.ifNoneMatch_ = entityTag 3831 return c 3832} 3833 3834// Context sets the context to be used in this call's Do method. Any 3835// pending HTTP request will be aborted if the provided context is 3836// canceled. 3837func (c *ProjectsLocationsVolumesSnapshotsGetCall) Context(ctx context.Context) *ProjectsLocationsVolumesSnapshotsGetCall { 3838 c.ctx_ = ctx 3839 return c 3840} 3841 3842// Header returns an http.Header that can be modified by the caller to 3843// add HTTP headers to the request. 3844func (c *ProjectsLocationsVolumesSnapshotsGetCall) Header() http.Header { 3845 if c.header_ == nil { 3846 c.header_ = make(http.Header) 3847 } 3848 return c.header_ 3849} 3850 3851func (c *ProjectsLocationsVolumesSnapshotsGetCall) doRequest(alt string) (*http.Response, error) { 3852 reqHeaders := make(http.Header) 3853 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 3854 for k, v := range c.header_ { 3855 reqHeaders[k] = v 3856 } 3857 reqHeaders.Set("User-Agent", c.s.userAgent()) 3858 if c.ifNoneMatch_ != "" { 3859 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3860 } 3861 var body io.Reader = nil 3862 c.urlParams_.Set("alt", alt) 3863 c.urlParams_.Set("prettyPrint", "false") 3864 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 3865 urls += "?" + c.urlParams_.Encode() 3866 req, err := http.NewRequest("GET", urls, body) 3867 if err != nil { 3868 return nil, err 3869 } 3870 req.Header = reqHeaders 3871 googleapi.Expand(req.URL, map[string]string{ 3872 "name": c.name, 3873 }) 3874 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3875} 3876 3877// Do executes the "baremetalsolution.projects.locations.volumes.snapshots.get" call. 3878// Exactly one of *VolumeSnapshot or error will be non-nil. Any non-2xx 3879// status code is an error. Response headers are in either 3880// *VolumeSnapshot.ServerResponse.Header or (if a response was returned 3881// at all) in error.(*googleapi.Error).Header. Use 3882// googleapi.IsNotModified to check whether the returned error was 3883// because http.StatusNotModified was returned. 3884func (c *ProjectsLocationsVolumesSnapshotsGetCall) Do(opts ...googleapi.CallOption) (*VolumeSnapshot, error) { 3885 gensupport.SetOptions(c.urlParams_, opts...) 3886 res, err := c.doRequest("json") 3887 if res != nil && res.StatusCode == http.StatusNotModified { 3888 if res.Body != nil { 3889 res.Body.Close() 3890 } 3891 return nil, &googleapi.Error{ 3892 Code: res.StatusCode, 3893 Header: res.Header, 3894 } 3895 } 3896 if err != nil { 3897 return nil, err 3898 } 3899 defer googleapi.CloseBody(res) 3900 if err := googleapi.CheckResponse(res); err != nil { 3901 return nil, err 3902 } 3903 ret := &VolumeSnapshot{ 3904 ServerResponse: googleapi.ServerResponse{ 3905 Header: res.Header, 3906 HTTPStatusCode: res.StatusCode, 3907 }, 3908 } 3909 target := &ret 3910 if err := gensupport.DecodeResponse(target, res); err != nil { 3911 return nil, err 3912 } 3913 return ret, nil 3914 // { 3915 // "description": "Get details for a specific named snapshot.", 3916 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes/{volumesId}/snapshots/{snapshotsId}", 3917 // "httpMethod": "GET", 3918 // "id": "baremetalsolution.projects.locations.volumes.snapshots.get", 3919 // "parameterOrder": [ 3920 // "name" 3921 // ], 3922 // "parameters": { 3923 // "name": { 3924 // "description": "Required. The name of the snapshot to retrieve.", 3925 // "location": "path", 3926 // "pattern": "^projects/[^/]+/locations/[^/]+/volumes/[^/]+/snapshots/[^/]+$", 3927 // "required": true, 3928 // "type": "string" 3929 // } 3930 // }, 3931 // "path": "v1alpha1/{+name}", 3932 // "response": { 3933 // "$ref": "VolumeSnapshot" 3934 // }, 3935 // "scopes": [ 3936 // "https://www.googleapis.com/auth/cloud-platform" 3937 // ] 3938 // } 3939 3940} 3941 3942// method id "baremetalsolution.projects.locations.volumes.snapshots.list": 3943 3944type ProjectsLocationsVolumesSnapshotsListCall struct { 3945 s *Service 3946 parent string 3947 urlParams_ gensupport.URLParams 3948 ifNoneMatch_ string 3949 ctx_ context.Context 3950 header_ http.Header 3951} 3952 3953// List: List the Snapshots for the specified Volume 3954// 3955// - parent: The Volume containing the VolumeSnapshots. 3956func (r *ProjectsLocationsVolumesSnapshotsService) List(parent string) *ProjectsLocationsVolumesSnapshotsListCall { 3957 c := &ProjectsLocationsVolumesSnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3958 c.parent = parent 3959 return c 3960} 3961 3962// PageSize sets the optional parameter "pageSize": The maximum number 3963// of items to return. 3964func (c *ProjectsLocationsVolumesSnapshotsListCall) PageSize(pageSize int64) *ProjectsLocationsVolumesSnapshotsListCall { 3965 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3966 return c 3967} 3968 3969// PageToken sets the optional parameter "pageToken": The 3970// next_page_token value returned from a previous List request, if any. 3971func (c *ProjectsLocationsVolumesSnapshotsListCall) PageToken(pageToken string) *ProjectsLocationsVolumesSnapshotsListCall { 3972 c.urlParams_.Set("pageToken", pageToken) 3973 return c 3974} 3975 3976// Fields allows partial responses to be retrieved. See 3977// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3978// for more information. 3979func (c *ProjectsLocationsVolumesSnapshotsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesSnapshotsListCall { 3980 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3981 return c 3982} 3983 3984// IfNoneMatch sets the optional parameter which makes the operation 3985// fail if the object's ETag matches the given value. This is useful for 3986// getting updates only after the object has changed since the last 3987// request. Use googleapi.IsNotModified to check whether the response 3988// error from Do is the result of In-None-Match. 3989func (c *ProjectsLocationsVolumesSnapshotsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsVolumesSnapshotsListCall { 3990 c.ifNoneMatch_ = entityTag 3991 return c 3992} 3993 3994// Context sets the context to be used in this call's Do method. Any 3995// pending HTTP request will be aborted if the provided context is 3996// canceled. 3997func (c *ProjectsLocationsVolumesSnapshotsListCall) Context(ctx context.Context) *ProjectsLocationsVolumesSnapshotsListCall { 3998 c.ctx_ = ctx 3999 return c 4000} 4001 4002// Header returns an http.Header that can be modified by the caller to 4003// add HTTP headers to the request. 4004func (c *ProjectsLocationsVolumesSnapshotsListCall) Header() http.Header { 4005 if c.header_ == nil { 4006 c.header_ = make(http.Header) 4007 } 4008 return c.header_ 4009} 4010 4011func (c *ProjectsLocationsVolumesSnapshotsListCall) doRequest(alt string) (*http.Response, error) { 4012 reqHeaders := make(http.Header) 4013 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 4014 for k, v := range c.header_ { 4015 reqHeaders[k] = v 4016 } 4017 reqHeaders.Set("User-Agent", c.s.userAgent()) 4018 if c.ifNoneMatch_ != "" { 4019 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4020 } 4021 var body io.Reader = nil 4022 c.urlParams_.Set("alt", alt) 4023 c.urlParams_.Set("prettyPrint", "false") 4024 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/snapshots") 4025 urls += "?" + c.urlParams_.Encode() 4026 req, err := http.NewRequest("GET", urls, body) 4027 if err != nil { 4028 return nil, err 4029 } 4030 req.Header = reqHeaders 4031 googleapi.Expand(req.URL, map[string]string{ 4032 "parent": c.parent, 4033 }) 4034 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4035} 4036 4037// Do executes the "baremetalsolution.projects.locations.volumes.snapshots.list" call. 4038// Exactly one of *ListVolumeSnapshotsResponse or error will be non-nil. 4039// Any non-2xx status code is an error. Response headers are in either 4040// *ListVolumeSnapshotsResponse.ServerResponse.Header or (if a response 4041// was returned at all) in error.(*googleapi.Error).Header. Use 4042// googleapi.IsNotModified to check whether the returned error was 4043// because http.StatusNotModified was returned. 4044func (c *ProjectsLocationsVolumesSnapshotsListCall) Do(opts ...googleapi.CallOption) (*ListVolumeSnapshotsResponse, error) { 4045 gensupport.SetOptions(c.urlParams_, opts...) 4046 res, err := c.doRequest("json") 4047 if res != nil && res.StatusCode == http.StatusNotModified { 4048 if res.Body != nil { 4049 res.Body.Close() 4050 } 4051 return nil, &googleapi.Error{ 4052 Code: res.StatusCode, 4053 Header: res.Header, 4054 } 4055 } 4056 if err != nil { 4057 return nil, err 4058 } 4059 defer googleapi.CloseBody(res) 4060 if err := googleapi.CheckResponse(res); err != nil { 4061 return nil, err 4062 } 4063 ret := &ListVolumeSnapshotsResponse{ 4064 ServerResponse: googleapi.ServerResponse{ 4065 Header: res.Header, 4066 HTTPStatusCode: res.StatusCode, 4067 }, 4068 } 4069 target := &ret 4070 if err := gensupport.DecodeResponse(target, res); err != nil { 4071 return nil, err 4072 } 4073 return ret, nil 4074 // { 4075 // "description": "List the Snapshots for the specified Volume", 4076 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes/{volumesId}/snapshots", 4077 // "httpMethod": "GET", 4078 // "id": "baremetalsolution.projects.locations.volumes.snapshots.list", 4079 // "parameterOrder": [ 4080 // "parent" 4081 // ], 4082 // "parameters": { 4083 // "pageSize": { 4084 // "description": "The maximum number of items to return.", 4085 // "format": "int32", 4086 // "location": "query", 4087 // "type": "integer" 4088 // }, 4089 // "pageToken": { 4090 // "description": "The next_page_token value returned from a previous List request, if any.", 4091 // "location": "query", 4092 // "type": "string" 4093 // }, 4094 // "parent": { 4095 // "description": "Required. The Volume containing the VolumeSnapshots.", 4096 // "location": "path", 4097 // "pattern": "^projects/[^/]+/locations/[^/]+/volumes/[^/]+$", 4098 // "required": true, 4099 // "type": "string" 4100 // } 4101 // }, 4102 // "path": "v1alpha1/{+parent}/snapshots", 4103 // "response": { 4104 // "$ref": "ListVolumeSnapshotsResponse" 4105 // }, 4106 // "scopes": [ 4107 // "https://www.googleapis.com/auth/cloud-platform" 4108 // ] 4109 // } 4110 4111} 4112 4113// Pages invokes f for each page of results. 4114// A non-nil error returned from f will halt the iteration. 4115// The provided context supersedes any context provided to the Context method. 4116func (c *ProjectsLocationsVolumesSnapshotsListCall) Pages(ctx context.Context, f func(*ListVolumeSnapshotsResponse) error) error { 4117 c.ctx_ = ctx 4118 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4119 for { 4120 x, err := c.Do() 4121 if err != nil { 4122 return err 4123 } 4124 if err := f(x); err != nil { 4125 return err 4126 } 4127 if x.NextPageToken == "" { 4128 return nil 4129 } 4130 c.PageToken(x.NextPageToken) 4131 } 4132} 4133 4134// method id "baremetalsolution.projects.locations.volumes.snapshots.restore": 4135 4136type ProjectsLocationsVolumesSnapshotsRestoreCall struct { 4137 s *Service 4138 name string 4139 restorevolumesnapshotrequest *RestoreVolumeSnapshotRequest 4140 urlParams_ gensupport.URLParams 4141 ctx_ context.Context 4142 header_ http.Header 4143} 4144 4145// Restore: Restore a VolumeSnapshot. 4146// 4147// - name: Name of the VolumeSnapshot to restore. 4148func (r *ProjectsLocationsVolumesSnapshotsService) Restore(name string, restorevolumesnapshotrequest *RestoreVolumeSnapshotRequest) *ProjectsLocationsVolumesSnapshotsRestoreCall { 4149 c := &ProjectsLocationsVolumesSnapshotsRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4150 c.name = name 4151 c.restorevolumesnapshotrequest = restorevolumesnapshotrequest 4152 return c 4153} 4154 4155// Fields allows partial responses to be retrieved. See 4156// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4157// for more information. 4158func (c *ProjectsLocationsVolumesSnapshotsRestoreCall) Fields(s ...googleapi.Field) *ProjectsLocationsVolumesSnapshotsRestoreCall { 4159 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4160 return c 4161} 4162 4163// Context sets the context to be used in this call's Do method. Any 4164// pending HTTP request will be aborted if the provided context is 4165// canceled. 4166func (c *ProjectsLocationsVolumesSnapshotsRestoreCall) Context(ctx context.Context) *ProjectsLocationsVolumesSnapshotsRestoreCall { 4167 c.ctx_ = ctx 4168 return c 4169} 4170 4171// Header returns an http.Header that can be modified by the caller to 4172// add HTTP headers to the request. 4173func (c *ProjectsLocationsVolumesSnapshotsRestoreCall) Header() http.Header { 4174 if c.header_ == nil { 4175 c.header_ = make(http.Header) 4176 } 4177 return c.header_ 4178} 4179 4180func (c *ProjectsLocationsVolumesSnapshotsRestoreCall) doRequest(alt string) (*http.Response, error) { 4181 reqHeaders := make(http.Header) 4182 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 4183 for k, v := range c.header_ { 4184 reqHeaders[k] = v 4185 } 4186 reqHeaders.Set("User-Agent", c.s.userAgent()) 4187 var body io.Reader = nil 4188 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restorevolumesnapshotrequest) 4189 if err != nil { 4190 return nil, err 4191 } 4192 reqHeaders.Set("Content-Type", "application/json") 4193 c.urlParams_.Set("alt", alt) 4194 c.urlParams_.Set("prettyPrint", "false") 4195 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:restore") 4196 urls += "?" + c.urlParams_.Encode() 4197 req, err := http.NewRequest("POST", urls, body) 4198 if err != nil { 4199 return nil, err 4200 } 4201 req.Header = reqHeaders 4202 googleapi.Expand(req.URL, map[string]string{ 4203 "name": c.name, 4204 }) 4205 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4206} 4207 4208// Do executes the "baremetalsolution.projects.locations.volumes.snapshots.restore" call. 4209// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4210// code is an error. Response headers are in either 4211// *Empty.ServerResponse.Header or (if a response was returned at all) 4212// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4213// check whether the returned error was because http.StatusNotModified 4214// was returned. 4215func (c *ProjectsLocationsVolumesSnapshotsRestoreCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4216 gensupport.SetOptions(c.urlParams_, opts...) 4217 res, err := c.doRequest("json") 4218 if res != nil && res.StatusCode == http.StatusNotModified { 4219 if res.Body != nil { 4220 res.Body.Close() 4221 } 4222 return nil, &googleapi.Error{ 4223 Code: res.StatusCode, 4224 Header: res.Header, 4225 } 4226 } 4227 if err != nil { 4228 return nil, err 4229 } 4230 defer googleapi.CloseBody(res) 4231 if err := googleapi.CheckResponse(res); err != nil { 4232 return nil, err 4233 } 4234 ret := &Empty{ 4235 ServerResponse: googleapi.ServerResponse{ 4236 Header: res.Header, 4237 HTTPStatusCode: res.StatusCode, 4238 }, 4239 } 4240 target := &ret 4241 if err := gensupport.DecodeResponse(target, res); err != nil { 4242 return nil, err 4243 } 4244 return ret, nil 4245 // { 4246 // "description": "Restore a VolumeSnapshot.", 4247 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/volumes/{volumesId}/snapshots/{snapshotsId}:restore", 4248 // "httpMethod": "POST", 4249 // "id": "baremetalsolution.projects.locations.volumes.snapshots.restore", 4250 // "parameterOrder": [ 4251 // "name" 4252 // ], 4253 // "parameters": { 4254 // "name": { 4255 // "description": "Required. Name of the VolumeSnapshot to restore.", 4256 // "location": "path", 4257 // "pattern": "^projects/[^/]+/locations/[^/]+/volumes/[^/]+/snapshots/[^/]+$", 4258 // "required": true, 4259 // "type": "string" 4260 // } 4261 // }, 4262 // "path": "v1alpha1/{+name}:restore", 4263 // "request": { 4264 // "$ref": "RestoreVolumeSnapshotRequest" 4265 // }, 4266 // "response": { 4267 // "$ref": "Empty" 4268 // }, 4269 // "scopes": [ 4270 // "https://www.googleapis.com/auth/cloud-platform" 4271 // ] 4272 // } 4273 4274} 4275 4276// method id "baremetalsolution.projects.provisioningQuotas.list": 4277 4278type ProjectsProvisioningQuotasListCall struct { 4279 s *Service 4280 parent string 4281 urlParams_ gensupport.URLParams 4282 ifNoneMatch_ string 4283 ctx_ context.Context 4284 header_ http.Header 4285} 4286 4287// List: List the budget details to provision resources on a given 4288// project. 4289// 4290// - parent: The parent project containing the provisioning quotas. 4291func (r *ProjectsProvisioningQuotasService) List(parent string) *ProjectsProvisioningQuotasListCall { 4292 c := &ProjectsProvisioningQuotasListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4293 c.parent = parent 4294 return c 4295} 4296 4297// PageSize sets the optional parameter "pageSize": The maximum number 4298// of items to return. 4299func (c *ProjectsProvisioningQuotasListCall) PageSize(pageSize int64) *ProjectsProvisioningQuotasListCall { 4300 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4301 return c 4302} 4303 4304// PageToken sets the optional parameter "pageToken": The 4305// next_page_token value returned from a previous List request, if any. 4306func (c *ProjectsProvisioningQuotasListCall) PageToken(pageToken string) *ProjectsProvisioningQuotasListCall { 4307 c.urlParams_.Set("pageToken", pageToken) 4308 return c 4309} 4310 4311// Fields allows partial responses to be retrieved. See 4312// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4313// for more information. 4314func (c *ProjectsProvisioningQuotasListCall) Fields(s ...googleapi.Field) *ProjectsProvisioningQuotasListCall { 4315 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4316 return c 4317} 4318 4319// IfNoneMatch sets the optional parameter which makes the operation 4320// fail if the object's ETag matches the given value. This is useful for 4321// getting updates only after the object has changed since the last 4322// request. Use googleapi.IsNotModified to check whether the response 4323// error from Do is the result of In-None-Match. 4324func (c *ProjectsProvisioningQuotasListCall) IfNoneMatch(entityTag string) *ProjectsProvisioningQuotasListCall { 4325 c.ifNoneMatch_ = entityTag 4326 return c 4327} 4328 4329// Context sets the context to be used in this call's Do method. Any 4330// pending HTTP request will be aborted if the provided context is 4331// canceled. 4332func (c *ProjectsProvisioningQuotasListCall) Context(ctx context.Context) *ProjectsProvisioningQuotasListCall { 4333 c.ctx_ = ctx 4334 return c 4335} 4336 4337// Header returns an http.Header that can be modified by the caller to 4338// add HTTP headers to the request. 4339func (c *ProjectsProvisioningQuotasListCall) Header() http.Header { 4340 if c.header_ == nil { 4341 c.header_ = make(http.Header) 4342 } 4343 return c.header_ 4344} 4345 4346func (c *ProjectsProvisioningQuotasListCall) doRequest(alt string) (*http.Response, error) { 4347 reqHeaders := make(http.Header) 4348 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 4349 for k, v := range c.header_ { 4350 reqHeaders[k] = v 4351 } 4352 reqHeaders.Set("User-Agent", c.s.userAgent()) 4353 if c.ifNoneMatch_ != "" { 4354 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4355 } 4356 var body io.Reader = nil 4357 c.urlParams_.Set("alt", alt) 4358 c.urlParams_.Set("prettyPrint", "false") 4359 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/provisioningQuotas") 4360 urls += "?" + c.urlParams_.Encode() 4361 req, err := http.NewRequest("GET", urls, body) 4362 if err != nil { 4363 return nil, err 4364 } 4365 req.Header = reqHeaders 4366 googleapi.Expand(req.URL, map[string]string{ 4367 "parent": c.parent, 4368 }) 4369 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4370} 4371 4372// Do executes the "baremetalsolution.projects.provisioningQuotas.list" call. 4373// Exactly one of *ListProvisioningQuotasResponse or error will be 4374// non-nil. Any non-2xx status code is an error. Response headers are in 4375// either *ListProvisioningQuotasResponse.ServerResponse.Header or (if a 4376// response was returned at all) in error.(*googleapi.Error).Header. Use 4377// googleapi.IsNotModified to check whether the returned error was 4378// because http.StatusNotModified was returned. 4379func (c *ProjectsProvisioningQuotasListCall) Do(opts ...googleapi.CallOption) (*ListProvisioningQuotasResponse, error) { 4380 gensupport.SetOptions(c.urlParams_, opts...) 4381 res, err := c.doRequest("json") 4382 if res != nil && res.StatusCode == http.StatusNotModified { 4383 if res.Body != nil { 4384 res.Body.Close() 4385 } 4386 return nil, &googleapi.Error{ 4387 Code: res.StatusCode, 4388 Header: res.Header, 4389 } 4390 } 4391 if err != nil { 4392 return nil, err 4393 } 4394 defer googleapi.CloseBody(res) 4395 if err := googleapi.CheckResponse(res); err != nil { 4396 return nil, err 4397 } 4398 ret := &ListProvisioningQuotasResponse{ 4399 ServerResponse: googleapi.ServerResponse{ 4400 Header: res.Header, 4401 HTTPStatusCode: res.StatusCode, 4402 }, 4403 } 4404 target := &ret 4405 if err := gensupport.DecodeResponse(target, res); err != nil { 4406 return nil, err 4407 } 4408 return ret, nil 4409 // { 4410 // "description": "List the budget details to provision resources on a given project.", 4411 // "flatPath": "v1alpha1/projects/{projectsId}/provisioningQuotas", 4412 // "httpMethod": "GET", 4413 // "id": "baremetalsolution.projects.provisioningQuotas.list", 4414 // "parameterOrder": [ 4415 // "parent" 4416 // ], 4417 // "parameters": { 4418 // "pageSize": { 4419 // "description": "The maximum number of items to return.", 4420 // "format": "int32", 4421 // "location": "query", 4422 // "type": "integer" 4423 // }, 4424 // "pageToken": { 4425 // "description": "The next_page_token value returned from a previous List request, if any.", 4426 // "location": "query", 4427 // "type": "string" 4428 // }, 4429 // "parent": { 4430 // "description": "Required. The parent project containing the provisioning quotas.", 4431 // "location": "path", 4432 // "pattern": "^projects/[^/]+$", 4433 // "required": true, 4434 // "type": "string" 4435 // } 4436 // }, 4437 // "path": "v1alpha1/{+parent}/provisioningQuotas", 4438 // "response": { 4439 // "$ref": "ListProvisioningQuotasResponse" 4440 // }, 4441 // "scopes": [ 4442 // "https://www.googleapis.com/auth/cloud-platform" 4443 // ] 4444 // } 4445 4446} 4447 4448// Pages invokes f for each page of results. 4449// A non-nil error returned from f will halt the iteration. 4450// The provided context supersedes any context provided to the Context method. 4451func (c *ProjectsProvisioningQuotasListCall) Pages(ctx context.Context, f func(*ListProvisioningQuotasResponse) error) error { 4452 c.ctx_ = ctx 4453 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4454 for { 4455 x, err := c.Do() 4456 if err != nil { 4457 return err 4458 } 4459 if err := f(x); err != nil { 4460 return err 4461 } 4462 if x.NextPageToken == "" { 4463 return nil 4464 } 4465 c.PageToken(x.NextPageToken) 4466 } 4467} 4468 4469// method id "baremetalsolution.projects.snapshotSchedulePolicies.create": 4470 4471type ProjectsSnapshotSchedulePoliciesCreateCall struct { 4472 s *Service 4473 parent string 4474 snapshotschedulepolicy *SnapshotSchedulePolicy 4475 urlParams_ gensupport.URLParams 4476 ctx_ context.Context 4477 header_ http.Header 4478} 4479 4480// Create: Create a SnapshotSchedulePolicy. 4481// 4482// - parent: The parent project containing the SnapshotSchedulePolicy. 4483func (r *ProjectsSnapshotSchedulePoliciesService) Create(parent string, snapshotschedulepolicy *SnapshotSchedulePolicy) *ProjectsSnapshotSchedulePoliciesCreateCall { 4484 c := &ProjectsSnapshotSchedulePoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4485 c.parent = parent 4486 c.snapshotschedulepolicy = snapshotschedulepolicy 4487 return c 4488} 4489 4490// Fields allows partial responses to be retrieved. See 4491// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4492// for more information. 4493func (c *ProjectsSnapshotSchedulePoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsSnapshotSchedulePoliciesCreateCall { 4494 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4495 return c 4496} 4497 4498// Context sets the context to be used in this call's Do method. Any 4499// pending HTTP request will be aborted if the provided context is 4500// canceled. 4501func (c *ProjectsSnapshotSchedulePoliciesCreateCall) Context(ctx context.Context) *ProjectsSnapshotSchedulePoliciesCreateCall { 4502 c.ctx_ = ctx 4503 return c 4504} 4505 4506// Header returns an http.Header that can be modified by the caller to 4507// add HTTP headers to the request. 4508func (c *ProjectsSnapshotSchedulePoliciesCreateCall) Header() http.Header { 4509 if c.header_ == nil { 4510 c.header_ = make(http.Header) 4511 } 4512 return c.header_ 4513} 4514 4515func (c *ProjectsSnapshotSchedulePoliciesCreateCall) doRequest(alt string) (*http.Response, error) { 4516 reqHeaders := make(http.Header) 4517 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 4518 for k, v := range c.header_ { 4519 reqHeaders[k] = v 4520 } 4521 reqHeaders.Set("User-Agent", c.s.userAgent()) 4522 var body io.Reader = nil 4523 body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotschedulepolicy) 4524 if err != nil { 4525 return nil, err 4526 } 4527 reqHeaders.Set("Content-Type", "application/json") 4528 c.urlParams_.Set("alt", alt) 4529 c.urlParams_.Set("prettyPrint", "false") 4530 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/snapshotSchedulePolicies") 4531 urls += "?" + c.urlParams_.Encode() 4532 req, err := http.NewRequest("POST", urls, body) 4533 if err != nil { 4534 return nil, err 4535 } 4536 req.Header = reqHeaders 4537 googleapi.Expand(req.URL, map[string]string{ 4538 "parent": c.parent, 4539 }) 4540 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4541} 4542 4543// Do executes the "baremetalsolution.projects.snapshotSchedulePolicies.create" call. 4544// Exactly one of *SnapshotSchedulePolicy or error will be non-nil. Any 4545// non-2xx status code is an error. Response headers are in either 4546// *SnapshotSchedulePolicy.ServerResponse.Header or (if a response was 4547// returned at all) in error.(*googleapi.Error).Header. Use 4548// googleapi.IsNotModified to check whether the returned error was 4549// because http.StatusNotModified was returned. 4550func (c *ProjectsSnapshotSchedulePoliciesCreateCall) Do(opts ...googleapi.CallOption) (*SnapshotSchedulePolicy, error) { 4551 gensupport.SetOptions(c.urlParams_, opts...) 4552 res, err := c.doRequest("json") 4553 if res != nil && res.StatusCode == http.StatusNotModified { 4554 if res.Body != nil { 4555 res.Body.Close() 4556 } 4557 return nil, &googleapi.Error{ 4558 Code: res.StatusCode, 4559 Header: res.Header, 4560 } 4561 } 4562 if err != nil { 4563 return nil, err 4564 } 4565 defer googleapi.CloseBody(res) 4566 if err := googleapi.CheckResponse(res); err != nil { 4567 return nil, err 4568 } 4569 ret := &SnapshotSchedulePolicy{ 4570 ServerResponse: googleapi.ServerResponse{ 4571 Header: res.Header, 4572 HTTPStatusCode: res.StatusCode, 4573 }, 4574 } 4575 target := &ret 4576 if err := gensupport.DecodeResponse(target, res); err != nil { 4577 return nil, err 4578 } 4579 return ret, nil 4580 // { 4581 // "description": "Create a SnapshotSchedulePolicy.", 4582 // "flatPath": "v1alpha1/projects/{projectsId}/snapshotSchedulePolicies", 4583 // "httpMethod": "POST", 4584 // "id": "baremetalsolution.projects.snapshotSchedulePolicies.create", 4585 // "parameterOrder": [ 4586 // "parent" 4587 // ], 4588 // "parameters": { 4589 // "parent": { 4590 // "description": "Required. The parent project containing the SnapshotSchedulePolicy.", 4591 // "location": "path", 4592 // "pattern": "^projects/[^/]+$", 4593 // "required": true, 4594 // "type": "string" 4595 // } 4596 // }, 4597 // "path": "v1alpha1/{+parent}/snapshotSchedulePolicies", 4598 // "request": { 4599 // "$ref": "SnapshotSchedulePolicy" 4600 // }, 4601 // "response": { 4602 // "$ref": "SnapshotSchedulePolicy" 4603 // }, 4604 // "scopes": [ 4605 // "https://www.googleapis.com/auth/cloud-platform" 4606 // ] 4607 // } 4608 4609} 4610 4611// method id "baremetalsolution.projects.snapshotSchedulePolicies.delete": 4612 4613type ProjectsSnapshotSchedulePoliciesDeleteCall struct { 4614 s *Service 4615 name string 4616 urlParams_ gensupport.URLParams 4617 ctx_ context.Context 4618 header_ http.Header 4619} 4620 4621// Delete: Delete removes named snapshot schedule policy 4622// 4623// - name: The name of the snapshot to delete. 4624func (r *ProjectsSnapshotSchedulePoliciesService) Delete(name string) *ProjectsSnapshotSchedulePoliciesDeleteCall { 4625 c := &ProjectsSnapshotSchedulePoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4626 c.name = name 4627 return c 4628} 4629 4630// Fields allows partial responses to be retrieved. See 4631// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4632// for more information. 4633func (c *ProjectsSnapshotSchedulePoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsSnapshotSchedulePoliciesDeleteCall { 4634 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4635 return c 4636} 4637 4638// Context sets the context to be used in this call's Do method. Any 4639// pending HTTP request will be aborted if the provided context is 4640// canceled. 4641func (c *ProjectsSnapshotSchedulePoliciesDeleteCall) Context(ctx context.Context) *ProjectsSnapshotSchedulePoliciesDeleteCall { 4642 c.ctx_ = ctx 4643 return c 4644} 4645 4646// Header returns an http.Header that can be modified by the caller to 4647// add HTTP headers to the request. 4648func (c *ProjectsSnapshotSchedulePoliciesDeleteCall) Header() http.Header { 4649 if c.header_ == nil { 4650 c.header_ = make(http.Header) 4651 } 4652 return c.header_ 4653} 4654 4655func (c *ProjectsSnapshotSchedulePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 4656 reqHeaders := make(http.Header) 4657 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 4658 for k, v := range c.header_ { 4659 reqHeaders[k] = v 4660 } 4661 reqHeaders.Set("User-Agent", c.s.userAgent()) 4662 var body io.Reader = nil 4663 c.urlParams_.Set("alt", alt) 4664 c.urlParams_.Set("prettyPrint", "false") 4665 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 4666 urls += "?" + c.urlParams_.Encode() 4667 req, err := http.NewRequest("DELETE", urls, body) 4668 if err != nil { 4669 return nil, err 4670 } 4671 req.Header = reqHeaders 4672 googleapi.Expand(req.URL, map[string]string{ 4673 "name": c.name, 4674 }) 4675 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4676} 4677 4678// Do executes the "baremetalsolution.projects.snapshotSchedulePolicies.delete" call. 4679// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4680// code is an error. Response headers are in either 4681// *Empty.ServerResponse.Header or (if a response was returned at all) 4682// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4683// check whether the returned error was because http.StatusNotModified 4684// was returned. 4685func (c *ProjectsSnapshotSchedulePoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4686 gensupport.SetOptions(c.urlParams_, opts...) 4687 res, err := c.doRequest("json") 4688 if res != nil && res.StatusCode == http.StatusNotModified { 4689 if res.Body != nil { 4690 res.Body.Close() 4691 } 4692 return nil, &googleapi.Error{ 4693 Code: res.StatusCode, 4694 Header: res.Header, 4695 } 4696 } 4697 if err != nil { 4698 return nil, err 4699 } 4700 defer googleapi.CloseBody(res) 4701 if err := googleapi.CheckResponse(res); err != nil { 4702 return nil, err 4703 } 4704 ret := &Empty{ 4705 ServerResponse: googleapi.ServerResponse{ 4706 Header: res.Header, 4707 HTTPStatusCode: res.StatusCode, 4708 }, 4709 } 4710 target := &ret 4711 if err := gensupport.DecodeResponse(target, res); err != nil { 4712 return nil, err 4713 } 4714 return ret, nil 4715 // { 4716 // "description": "Delete removes named snapshot schedule policy", 4717 // "flatPath": "v1alpha1/projects/{projectsId}/snapshotSchedulePolicies/{snapshotSchedulePoliciesId}", 4718 // "httpMethod": "DELETE", 4719 // "id": "baremetalsolution.projects.snapshotSchedulePolicies.delete", 4720 // "parameterOrder": [ 4721 // "name" 4722 // ], 4723 // "parameters": { 4724 // "name": { 4725 // "description": "Required. The name of the snapshot to delete.", 4726 // "location": "path", 4727 // "pattern": "^projects/[^/]+/snapshotSchedulePolicies/[^/]+$", 4728 // "required": true, 4729 // "type": "string" 4730 // } 4731 // }, 4732 // "path": "v1alpha1/{+name}", 4733 // "response": { 4734 // "$ref": "Empty" 4735 // }, 4736 // "scopes": [ 4737 // "https://www.googleapis.com/auth/cloud-platform" 4738 // ] 4739 // } 4740 4741} 4742 4743// method id "baremetalsolution.projects.snapshotSchedulePolicies.get": 4744 4745type ProjectsSnapshotSchedulePoliciesGetCall struct { 4746 s *Service 4747 name string 4748 urlParams_ gensupport.URLParams 4749 ifNoneMatch_ string 4750 ctx_ context.Context 4751 header_ http.Header 4752} 4753 4754// Get: Get details for a specific snapshot schedule policy 4755// 4756// - name: The name of the policy to retrieve. 4757func (r *ProjectsSnapshotSchedulePoliciesService) Get(name string) *ProjectsSnapshotSchedulePoliciesGetCall { 4758 c := &ProjectsSnapshotSchedulePoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4759 c.name = name 4760 return c 4761} 4762 4763// Fields allows partial responses to be retrieved. See 4764// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4765// for more information. 4766func (c *ProjectsSnapshotSchedulePoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsSnapshotSchedulePoliciesGetCall { 4767 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4768 return c 4769} 4770 4771// IfNoneMatch sets the optional parameter which makes the operation 4772// fail if the object's ETag matches the given value. This is useful for 4773// getting updates only after the object has changed since the last 4774// request. Use googleapi.IsNotModified to check whether the response 4775// error from Do is the result of In-None-Match. 4776func (c *ProjectsSnapshotSchedulePoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsSnapshotSchedulePoliciesGetCall { 4777 c.ifNoneMatch_ = entityTag 4778 return c 4779} 4780 4781// Context sets the context to be used in this call's Do method. Any 4782// pending HTTP request will be aborted if the provided context is 4783// canceled. 4784func (c *ProjectsSnapshotSchedulePoliciesGetCall) Context(ctx context.Context) *ProjectsSnapshotSchedulePoliciesGetCall { 4785 c.ctx_ = ctx 4786 return c 4787} 4788 4789// Header returns an http.Header that can be modified by the caller to 4790// add HTTP headers to the request. 4791func (c *ProjectsSnapshotSchedulePoliciesGetCall) Header() http.Header { 4792 if c.header_ == nil { 4793 c.header_ = make(http.Header) 4794 } 4795 return c.header_ 4796} 4797 4798func (c *ProjectsSnapshotSchedulePoliciesGetCall) doRequest(alt string) (*http.Response, error) { 4799 reqHeaders := make(http.Header) 4800 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 4801 for k, v := range c.header_ { 4802 reqHeaders[k] = v 4803 } 4804 reqHeaders.Set("User-Agent", c.s.userAgent()) 4805 if c.ifNoneMatch_ != "" { 4806 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4807 } 4808 var body io.Reader = nil 4809 c.urlParams_.Set("alt", alt) 4810 c.urlParams_.Set("prettyPrint", "false") 4811 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 4812 urls += "?" + c.urlParams_.Encode() 4813 req, err := http.NewRequest("GET", urls, body) 4814 if err != nil { 4815 return nil, err 4816 } 4817 req.Header = reqHeaders 4818 googleapi.Expand(req.URL, map[string]string{ 4819 "name": c.name, 4820 }) 4821 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4822} 4823 4824// Do executes the "baremetalsolution.projects.snapshotSchedulePolicies.get" call. 4825// Exactly one of *SnapshotSchedulePolicy or error will be non-nil. Any 4826// non-2xx status code is an error. Response headers are in either 4827// *SnapshotSchedulePolicy.ServerResponse.Header or (if a response was 4828// returned at all) in error.(*googleapi.Error).Header. Use 4829// googleapi.IsNotModified to check whether the returned error was 4830// because http.StatusNotModified was returned. 4831func (c *ProjectsSnapshotSchedulePoliciesGetCall) Do(opts ...googleapi.CallOption) (*SnapshotSchedulePolicy, error) { 4832 gensupport.SetOptions(c.urlParams_, opts...) 4833 res, err := c.doRequest("json") 4834 if res != nil && res.StatusCode == http.StatusNotModified { 4835 if res.Body != nil { 4836 res.Body.Close() 4837 } 4838 return nil, &googleapi.Error{ 4839 Code: res.StatusCode, 4840 Header: res.Header, 4841 } 4842 } 4843 if err != nil { 4844 return nil, err 4845 } 4846 defer googleapi.CloseBody(res) 4847 if err := googleapi.CheckResponse(res); err != nil { 4848 return nil, err 4849 } 4850 ret := &SnapshotSchedulePolicy{ 4851 ServerResponse: googleapi.ServerResponse{ 4852 Header: res.Header, 4853 HTTPStatusCode: res.StatusCode, 4854 }, 4855 } 4856 target := &ret 4857 if err := gensupport.DecodeResponse(target, res); err != nil { 4858 return nil, err 4859 } 4860 return ret, nil 4861 // { 4862 // "description": "Get details for a specific snapshot schedule policy", 4863 // "flatPath": "v1alpha1/projects/{projectsId}/snapshotSchedulePolicies/{snapshotSchedulePoliciesId}", 4864 // "httpMethod": "GET", 4865 // "id": "baremetalsolution.projects.snapshotSchedulePolicies.get", 4866 // "parameterOrder": [ 4867 // "name" 4868 // ], 4869 // "parameters": { 4870 // "name": { 4871 // "description": "Required. The name of the policy to retrieve.", 4872 // "location": "path", 4873 // "pattern": "^projects/[^/]+/snapshotSchedulePolicies/[^/]+$", 4874 // "required": true, 4875 // "type": "string" 4876 // } 4877 // }, 4878 // "path": "v1alpha1/{+name}", 4879 // "response": { 4880 // "$ref": "SnapshotSchedulePolicy" 4881 // }, 4882 // "scopes": [ 4883 // "https://www.googleapis.com/auth/cloud-platform" 4884 // ] 4885 // } 4886 4887} 4888 4889// method id "baremetalsolution.projects.snapshotSchedulePolicies.list": 4890 4891type ProjectsSnapshotSchedulePoliciesListCall struct { 4892 s *Service 4893 parent string 4894 urlParams_ gensupport.URLParams 4895 ifNoneMatch_ string 4896 ctx_ context.Context 4897 header_ http.Header 4898} 4899 4900// List: List the snapshot schedule policies for the specified project 4901// 4902// - parent: The parent project containing the Snapshot Schedule 4903// Policies. 4904func (r *ProjectsSnapshotSchedulePoliciesService) List(parent string) *ProjectsSnapshotSchedulePoliciesListCall { 4905 c := &ProjectsSnapshotSchedulePoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4906 c.parent = parent 4907 return c 4908} 4909 4910// PageSize sets the optional parameter "pageSize": The maximum number 4911// of items to return. 4912func (c *ProjectsSnapshotSchedulePoliciesListCall) PageSize(pageSize int64) *ProjectsSnapshotSchedulePoliciesListCall { 4913 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4914 return c 4915} 4916 4917// PageToken sets the optional parameter "pageToken": The 4918// next_page_token value returned from a previous List request, if any. 4919func (c *ProjectsSnapshotSchedulePoliciesListCall) PageToken(pageToken string) *ProjectsSnapshotSchedulePoliciesListCall { 4920 c.urlParams_.Set("pageToken", pageToken) 4921 return c 4922} 4923 4924// Fields allows partial responses to be retrieved. See 4925// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4926// for more information. 4927func (c *ProjectsSnapshotSchedulePoliciesListCall) Fields(s ...googleapi.Field) *ProjectsSnapshotSchedulePoliciesListCall { 4928 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4929 return c 4930} 4931 4932// IfNoneMatch sets the optional parameter which makes the operation 4933// fail if the object's ETag matches the given value. This is useful for 4934// getting updates only after the object has changed since the last 4935// request. Use googleapi.IsNotModified to check whether the response 4936// error from Do is the result of In-None-Match. 4937func (c *ProjectsSnapshotSchedulePoliciesListCall) IfNoneMatch(entityTag string) *ProjectsSnapshotSchedulePoliciesListCall { 4938 c.ifNoneMatch_ = entityTag 4939 return c 4940} 4941 4942// Context sets the context to be used in this call's Do method. Any 4943// pending HTTP request will be aborted if the provided context is 4944// canceled. 4945func (c *ProjectsSnapshotSchedulePoliciesListCall) Context(ctx context.Context) *ProjectsSnapshotSchedulePoliciesListCall { 4946 c.ctx_ = ctx 4947 return c 4948} 4949 4950// Header returns an http.Header that can be modified by the caller to 4951// add HTTP headers to the request. 4952func (c *ProjectsSnapshotSchedulePoliciesListCall) Header() http.Header { 4953 if c.header_ == nil { 4954 c.header_ = make(http.Header) 4955 } 4956 return c.header_ 4957} 4958 4959func (c *ProjectsSnapshotSchedulePoliciesListCall) doRequest(alt string) (*http.Response, error) { 4960 reqHeaders := make(http.Header) 4961 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 4962 for k, v := range c.header_ { 4963 reqHeaders[k] = v 4964 } 4965 reqHeaders.Set("User-Agent", c.s.userAgent()) 4966 if c.ifNoneMatch_ != "" { 4967 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4968 } 4969 var body io.Reader = nil 4970 c.urlParams_.Set("alt", alt) 4971 c.urlParams_.Set("prettyPrint", "false") 4972 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/snapshotSchedulePolicies") 4973 urls += "?" + c.urlParams_.Encode() 4974 req, err := http.NewRequest("GET", urls, body) 4975 if err != nil { 4976 return nil, err 4977 } 4978 req.Header = reqHeaders 4979 googleapi.Expand(req.URL, map[string]string{ 4980 "parent": c.parent, 4981 }) 4982 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4983} 4984 4985// Do executes the "baremetalsolution.projects.snapshotSchedulePolicies.list" call. 4986// Exactly one of *ListSnapshotSchedulePoliciesResponse or error will be 4987// non-nil. Any non-2xx status code is an error. Response headers are in 4988// either *ListSnapshotSchedulePoliciesResponse.ServerResponse.Header or 4989// (if a response was returned at all) in 4990// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4991// whether the returned error was because http.StatusNotModified was 4992// returned. 4993func (c *ProjectsSnapshotSchedulePoliciesListCall) Do(opts ...googleapi.CallOption) (*ListSnapshotSchedulePoliciesResponse, error) { 4994 gensupport.SetOptions(c.urlParams_, opts...) 4995 res, err := c.doRequest("json") 4996 if res != nil && res.StatusCode == http.StatusNotModified { 4997 if res.Body != nil { 4998 res.Body.Close() 4999 } 5000 return nil, &googleapi.Error{ 5001 Code: res.StatusCode, 5002 Header: res.Header, 5003 } 5004 } 5005 if err != nil { 5006 return nil, err 5007 } 5008 defer googleapi.CloseBody(res) 5009 if err := googleapi.CheckResponse(res); err != nil { 5010 return nil, err 5011 } 5012 ret := &ListSnapshotSchedulePoliciesResponse{ 5013 ServerResponse: googleapi.ServerResponse{ 5014 Header: res.Header, 5015 HTTPStatusCode: res.StatusCode, 5016 }, 5017 } 5018 target := &ret 5019 if err := gensupport.DecodeResponse(target, res); err != nil { 5020 return nil, err 5021 } 5022 return ret, nil 5023 // { 5024 // "description": "List the snapshot schedule policies for the specified project", 5025 // "flatPath": "v1alpha1/projects/{projectsId}/snapshotSchedulePolicies", 5026 // "httpMethod": "GET", 5027 // "id": "baremetalsolution.projects.snapshotSchedulePolicies.list", 5028 // "parameterOrder": [ 5029 // "parent" 5030 // ], 5031 // "parameters": { 5032 // "pageSize": { 5033 // "description": "The maximum number of items to return.", 5034 // "format": "int32", 5035 // "location": "query", 5036 // "type": "integer" 5037 // }, 5038 // "pageToken": { 5039 // "description": "The next_page_token value returned from a previous List request, if any.", 5040 // "location": "query", 5041 // "type": "string" 5042 // }, 5043 // "parent": { 5044 // "description": "Required. The parent project containing the Snapshot Schedule Policies.", 5045 // "location": "path", 5046 // "pattern": "^projects/[^/]+$", 5047 // "required": true, 5048 // "type": "string" 5049 // } 5050 // }, 5051 // "path": "v1alpha1/{+parent}/snapshotSchedulePolicies", 5052 // "response": { 5053 // "$ref": "ListSnapshotSchedulePoliciesResponse" 5054 // }, 5055 // "scopes": [ 5056 // "https://www.googleapis.com/auth/cloud-platform" 5057 // ] 5058 // } 5059 5060} 5061 5062// Pages invokes f for each page of results. 5063// A non-nil error returned from f will halt the iteration. 5064// The provided context supersedes any context provided to the Context method. 5065func (c *ProjectsSnapshotSchedulePoliciesListCall) Pages(ctx context.Context, f func(*ListSnapshotSchedulePoliciesResponse) error) error { 5066 c.ctx_ = ctx 5067 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5068 for { 5069 x, err := c.Do() 5070 if err != nil { 5071 return err 5072 } 5073 if err := f(x); err != nil { 5074 return err 5075 } 5076 if x.NextPageToken == "" { 5077 return nil 5078 } 5079 c.PageToken(x.NextPageToken) 5080 } 5081} 5082 5083// method id "baremetalsolution.projects.snapshotSchedulePolicies.patch": 5084 5085type ProjectsSnapshotSchedulePoliciesPatchCall struct { 5086 s *Service 5087 name string 5088 snapshotschedulepolicy *SnapshotSchedulePolicy 5089 urlParams_ gensupport.URLParams 5090 ctx_ context.Context 5091 header_ http.Header 5092} 5093 5094// Patch: Update a SnapshotSchedulePolicy. 5095// 5096// - name: Output only. The name of this SnapshotSchedulePolicy. 5097func (r *ProjectsSnapshotSchedulePoliciesService) Patch(name string, snapshotschedulepolicy *SnapshotSchedulePolicy) *ProjectsSnapshotSchedulePoliciesPatchCall { 5098 c := &ProjectsSnapshotSchedulePoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5099 c.name = name 5100 c.snapshotschedulepolicy = snapshotschedulepolicy 5101 return c 5102} 5103 5104// UpdateMask sets the optional parameter "updateMask": The list of 5105// fields to update. 5106func (c *ProjectsSnapshotSchedulePoliciesPatchCall) UpdateMask(updateMask string) *ProjectsSnapshotSchedulePoliciesPatchCall { 5107 c.urlParams_.Set("updateMask", updateMask) 5108 return c 5109} 5110 5111// Fields allows partial responses to be retrieved. See 5112// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5113// for more information. 5114func (c *ProjectsSnapshotSchedulePoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsSnapshotSchedulePoliciesPatchCall { 5115 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5116 return c 5117} 5118 5119// Context sets the context to be used in this call's Do method. Any 5120// pending HTTP request will be aborted if the provided context is 5121// canceled. 5122func (c *ProjectsSnapshotSchedulePoliciesPatchCall) Context(ctx context.Context) *ProjectsSnapshotSchedulePoliciesPatchCall { 5123 c.ctx_ = ctx 5124 return c 5125} 5126 5127// Header returns an http.Header that can be modified by the caller to 5128// add HTTP headers to the request. 5129func (c *ProjectsSnapshotSchedulePoliciesPatchCall) Header() http.Header { 5130 if c.header_ == nil { 5131 c.header_ = make(http.Header) 5132 } 5133 return c.header_ 5134} 5135 5136func (c *ProjectsSnapshotSchedulePoliciesPatchCall) doRequest(alt string) (*http.Response, error) { 5137 reqHeaders := make(http.Header) 5138 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 5139 for k, v := range c.header_ { 5140 reqHeaders[k] = v 5141 } 5142 reqHeaders.Set("User-Agent", c.s.userAgent()) 5143 var body io.Reader = nil 5144 body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotschedulepolicy) 5145 if err != nil { 5146 return nil, err 5147 } 5148 reqHeaders.Set("Content-Type", "application/json") 5149 c.urlParams_.Set("alt", alt) 5150 c.urlParams_.Set("prettyPrint", "false") 5151 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 5152 urls += "?" + c.urlParams_.Encode() 5153 req, err := http.NewRequest("PATCH", urls, body) 5154 if err != nil { 5155 return nil, err 5156 } 5157 req.Header = reqHeaders 5158 googleapi.Expand(req.URL, map[string]string{ 5159 "name": c.name, 5160 }) 5161 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5162} 5163 5164// Do executes the "baremetalsolution.projects.snapshotSchedulePolicies.patch" call. 5165// Exactly one of *SnapshotSchedulePolicy or error will be non-nil. Any 5166// non-2xx status code is an error. Response headers are in either 5167// *SnapshotSchedulePolicy.ServerResponse.Header or (if a response was 5168// returned at all) in error.(*googleapi.Error).Header. Use 5169// googleapi.IsNotModified to check whether the returned error was 5170// because http.StatusNotModified was returned. 5171func (c *ProjectsSnapshotSchedulePoliciesPatchCall) Do(opts ...googleapi.CallOption) (*SnapshotSchedulePolicy, error) { 5172 gensupport.SetOptions(c.urlParams_, opts...) 5173 res, err := c.doRequest("json") 5174 if res != nil && res.StatusCode == http.StatusNotModified { 5175 if res.Body != nil { 5176 res.Body.Close() 5177 } 5178 return nil, &googleapi.Error{ 5179 Code: res.StatusCode, 5180 Header: res.Header, 5181 } 5182 } 5183 if err != nil { 5184 return nil, err 5185 } 5186 defer googleapi.CloseBody(res) 5187 if err := googleapi.CheckResponse(res); err != nil { 5188 return nil, err 5189 } 5190 ret := &SnapshotSchedulePolicy{ 5191 ServerResponse: googleapi.ServerResponse{ 5192 Header: res.Header, 5193 HTTPStatusCode: res.StatusCode, 5194 }, 5195 } 5196 target := &ret 5197 if err := gensupport.DecodeResponse(target, res); err != nil { 5198 return nil, err 5199 } 5200 return ret, nil 5201 // { 5202 // "description": "Update a SnapshotSchedulePolicy.", 5203 // "flatPath": "v1alpha1/projects/{projectsId}/snapshotSchedulePolicies/{snapshotSchedulePoliciesId}", 5204 // "httpMethod": "PATCH", 5205 // "id": "baremetalsolution.projects.snapshotSchedulePolicies.patch", 5206 // "parameterOrder": [ 5207 // "name" 5208 // ], 5209 // "parameters": { 5210 // "name": { 5211 // "description": "Output only. The name of this SnapshotSchedulePolicy.", 5212 // "location": "path", 5213 // "pattern": "^projects/[^/]+/snapshotSchedulePolicies/[^/]+$", 5214 // "required": true, 5215 // "type": "string" 5216 // }, 5217 // "updateMask": { 5218 // "description": "The list of fields to update.", 5219 // "format": "google-fieldmask", 5220 // "location": "query", 5221 // "type": "string" 5222 // } 5223 // }, 5224 // "path": "v1alpha1/{+name}", 5225 // "request": { 5226 // "$ref": "SnapshotSchedulePolicy" 5227 // }, 5228 // "response": { 5229 // "$ref": "SnapshotSchedulePolicy" 5230 // }, 5231 // "scopes": [ 5232 // "https://www.googleapis.com/auth/cloud-platform" 5233 // ] 5234 // } 5235 5236} 5237 5238// method id "baremetalsolution.projects.sshKeys.create": 5239 5240type ProjectsSshKeysCreateCall struct { 5241 s *Service 5242 parent string 5243 sshkey *SSHKey 5244 urlParams_ gensupport.URLParams 5245 ctx_ context.Context 5246 header_ http.Header 5247} 5248 5249// Create: Create a new SSH key registration in the specified project. 5250// 5251// - parent: The parent project containing the SSH keys. 5252func (r *ProjectsSshKeysService) Create(parent string, sshkey *SSHKey) *ProjectsSshKeysCreateCall { 5253 c := &ProjectsSshKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5254 c.parent = parent 5255 c.sshkey = sshkey 5256 return c 5257} 5258 5259// SshKeyId sets the optional parameter "sshKeyId": Required. The ID to 5260// use for the key, which will become the final component of the key's 5261// resource name. This value should be match the regex: 5262// [a-zA-Z0-9@.\-_]{1,64} 5263func (c *ProjectsSshKeysCreateCall) SshKeyId(sshKeyId string) *ProjectsSshKeysCreateCall { 5264 c.urlParams_.Set("sshKeyId", sshKeyId) 5265 return c 5266} 5267 5268// Fields allows partial responses to be retrieved. See 5269// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5270// for more information. 5271func (c *ProjectsSshKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsSshKeysCreateCall { 5272 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5273 return c 5274} 5275 5276// Context sets the context to be used in this call's Do method. Any 5277// pending HTTP request will be aborted if the provided context is 5278// canceled. 5279func (c *ProjectsSshKeysCreateCall) Context(ctx context.Context) *ProjectsSshKeysCreateCall { 5280 c.ctx_ = ctx 5281 return c 5282} 5283 5284// Header returns an http.Header that can be modified by the caller to 5285// add HTTP headers to the request. 5286func (c *ProjectsSshKeysCreateCall) Header() http.Header { 5287 if c.header_ == nil { 5288 c.header_ = make(http.Header) 5289 } 5290 return c.header_ 5291} 5292 5293func (c *ProjectsSshKeysCreateCall) doRequest(alt string) (*http.Response, error) { 5294 reqHeaders := make(http.Header) 5295 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 5296 for k, v := range c.header_ { 5297 reqHeaders[k] = v 5298 } 5299 reqHeaders.Set("User-Agent", c.s.userAgent()) 5300 var body io.Reader = nil 5301 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshkey) 5302 if err != nil { 5303 return nil, err 5304 } 5305 reqHeaders.Set("Content-Type", "application/json") 5306 c.urlParams_.Set("alt", alt) 5307 c.urlParams_.Set("prettyPrint", "false") 5308 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/sshKeys") 5309 urls += "?" + c.urlParams_.Encode() 5310 req, err := http.NewRequest("POST", urls, body) 5311 if err != nil { 5312 return nil, err 5313 } 5314 req.Header = reqHeaders 5315 googleapi.Expand(req.URL, map[string]string{ 5316 "parent": c.parent, 5317 }) 5318 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5319} 5320 5321// Do executes the "baremetalsolution.projects.sshKeys.create" call. 5322// Exactly one of *SSHKey or error will be non-nil. Any non-2xx status 5323// code is an error. Response headers are in either 5324// *SSHKey.ServerResponse.Header or (if a response was returned at all) 5325// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5326// check whether the returned error was because http.StatusNotModified 5327// was returned. 5328func (c *ProjectsSshKeysCreateCall) Do(opts ...googleapi.CallOption) (*SSHKey, error) { 5329 gensupport.SetOptions(c.urlParams_, opts...) 5330 res, err := c.doRequest("json") 5331 if res != nil && res.StatusCode == http.StatusNotModified { 5332 if res.Body != nil { 5333 res.Body.Close() 5334 } 5335 return nil, &googleapi.Error{ 5336 Code: res.StatusCode, 5337 Header: res.Header, 5338 } 5339 } 5340 if err != nil { 5341 return nil, err 5342 } 5343 defer googleapi.CloseBody(res) 5344 if err := googleapi.CheckResponse(res); err != nil { 5345 return nil, err 5346 } 5347 ret := &SSHKey{ 5348 ServerResponse: googleapi.ServerResponse{ 5349 Header: res.Header, 5350 HTTPStatusCode: res.StatusCode, 5351 }, 5352 } 5353 target := &ret 5354 if err := gensupport.DecodeResponse(target, res); err != nil { 5355 return nil, err 5356 } 5357 return ret, nil 5358 // { 5359 // "description": "Create a new SSH key registration in the specified project.", 5360 // "flatPath": "v1alpha1/projects/{projectsId}/sshKeys", 5361 // "httpMethod": "POST", 5362 // "id": "baremetalsolution.projects.sshKeys.create", 5363 // "parameterOrder": [ 5364 // "parent" 5365 // ], 5366 // "parameters": { 5367 // "parent": { 5368 // "description": "Required. The parent project containing the SSH keys.", 5369 // "location": "path", 5370 // "pattern": "^projects/[^/]+$", 5371 // "required": true, 5372 // "type": "string" 5373 // }, 5374 // "sshKeyId": { 5375 // "description": "Required. The ID to use for the key, which will become the final component of the key's resource name. This value should be match the regex: [a-zA-Z0-9@.\\-_]{1,64}", 5376 // "location": "query", 5377 // "type": "string" 5378 // } 5379 // }, 5380 // "path": "v1alpha1/{+parent}/sshKeys", 5381 // "request": { 5382 // "$ref": "SSHKey" 5383 // }, 5384 // "response": { 5385 // "$ref": "SSHKey" 5386 // }, 5387 // "scopes": [ 5388 // "https://www.googleapis.com/auth/cloud-platform" 5389 // ] 5390 // } 5391 5392} 5393 5394// method id "baremetalsolution.projects.sshKeys.delete": 5395 5396type ProjectsSshKeysDeleteCall struct { 5397 s *Service 5398 name string 5399 urlParams_ gensupport.URLParams 5400 ctx_ context.Context 5401 header_ http.Header 5402} 5403 5404// Delete: Delete an SSH key registration in the specified project. 5405// 5406// - name: The name of the SSH key to delete. 5407func (r *ProjectsSshKeysService) Delete(name string) *ProjectsSshKeysDeleteCall { 5408 c := &ProjectsSshKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5409 c.name = name 5410 return c 5411} 5412 5413// Fields allows partial responses to be retrieved. See 5414// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5415// for more information. 5416func (c *ProjectsSshKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsSshKeysDeleteCall { 5417 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5418 return c 5419} 5420 5421// Context sets the context to be used in this call's Do method. Any 5422// pending HTTP request will be aborted if the provided context is 5423// canceled. 5424func (c *ProjectsSshKeysDeleteCall) Context(ctx context.Context) *ProjectsSshKeysDeleteCall { 5425 c.ctx_ = ctx 5426 return c 5427} 5428 5429// Header returns an http.Header that can be modified by the caller to 5430// add HTTP headers to the request. 5431func (c *ProjectsSshKeysDeleteCall) Header() http.Header { 5432 if c.header_ == nil { 5433 c.header_ = make(http.Header) 5434 } 5435 return c.header_ 5436} 5437 5438func (c *ProjectsSshKeysDeleteCall) doRequest(alt string) (*http.Response, error) { 5439 reqHeaders := make(http.Header) 5440 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 5441 for k, v := range c.header_ { 5442 reqHeaders[k] = v 5443 } 5444 reqHeaders.Set("User-Agent", c.s.userAgent()) 5445 var body io.Reader = nil 5446 c.urlParams_.Set("alt", alt) 5447 c.urlParams_.Set("prettyPrint", "false") 5448 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 5449 urls += "?" + c.urlParams_.Encode() 5450 req, err := http.NewRequest("DELETE", urls, body) 5451 if err != nil { 5452 return nil, err 5453 } 5454 req.Header = reqHeaders 5455 googleapi.Expand(req.URL, map[string]string{ 5456 "name": c.name, 5457 }) 5458 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5459} 5460 5461// Do executes the "baremetalsolution.projects.sshKeys.delete" call. 5462// Exactly one of *Empty or error will be non-nil. Any non-2xx status 5463// code is an error. Response headers are in either 5464// *Empty.ServerResponse.Header or (if a response was returned at all) 5465// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5466// check whether the returned error was because http.StatusNotModified 5467// was returned. 5468func (c *ProjectsSshKeysDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5469 gensupport.SetOptions(c.urlParams_, opts...) 5470 res, err := c.doRequest("json") 5471 if res != nil && res.StatusCode == http.StatusNotModified { 5472 if res.Body != nil { 5473 res.Body.Close() 5474 } 5475 return nil, &googleapi.Error{ 5476 Code: res.StatusCode, 5477 Header: res.Header, 5478 } 5479 } 5480 if err != nil { 5481 return nil, err 5482 } 5483 defer googleapi.CloseBody(res) 5484 if err := googleapi.CheckResponse(res); err != nil { 5485 return nil, err 5486 } 5487 ret := &Empty{ 5488 ServerResponse: googleapi.ServerResponse{ 5489 Header: res.Header, 5490 HTTPStatusCode: res.StatusCode, 5491 }, 5492 } 5493 target := &ret 5494 if err := gensupport.DecodeResponse(target, res); err != nil { 5495 return nil, err 5496 } 5497 return ret, nil 5498 // { 5499 // "description": "Delete an SSH key registration in the specified project.", 5500 // "flatPath": "v1alpha1/projects/{projectsId}/sshKeys/{sshKeysId}", 5501 // "httpMethod": "DELETE", 5502 // "id": "baremetalsolution.projects.sshKeys.delete", 5503 // "parameterOrder": [ 5504 // "name" 5505 // ], 5506 // "parameters": { 5507 // "name": { 5508 // "description": "Required. The name of the SSH key to delete.", 5509 // "location": "path", 5510 // "pattern": "^projects/[^/]+/sshKeys/[^/]+$", 5511 // "required": true, 5512 // "type": "string" 5513 // } 5514 // }, 5515 // "path": "v1alpha1/{+name}", 5516 // "response": { 5517 // "$ref": "Empty" 5518 // }, 5519 // "scopes": [ 5520 // "https://www.googleapis.com/auth/cloud-platform" 5521 // ] 5522 // } 5523 5524} 5525 5526// method id "baremetalsolution.projects.sshKeys.list": 5527 5528type ProjectsSshKeysListCall struct { 5529 s *Service 5530 parent string 5531 urlParams_ gensupport.URLParams 5532 ifNoneMatch_ string 5533 ctx_ context.Context 5534 header_ http.Header 5535} 5536 5537// List: List the public SSH keys registered for the specified project. 5538// 5539// - parent: The parent project containing the SSH keys. 5540func (r *ProjectsSshKeysService) List(parent string) *ProjectsSshKeysListCall { 5541 c := &ProjectsSshKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5542 c.parent = parent 5543 return c 5544} 5545 5546// PageSize sets the optional parameter "pageSize": The maximum number 5547// of items to return. 5548func (c *ProjectsSshKeysListCall) PageSize(pageSize int64) *ProjectsSshKeysListCall { 5549 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5550 return c 5551} 5552 5553// PageToken sets the optional parameter "pageToken": The 5554// next_page_token value returned from a previous List request, if any. 5555func (c *ProjectsSshKeysListCall) PageToken(pageToken string) *ProjectsSshKeysListCall { 5556 c.urlParams_.Set("pageToken", pageToken) 5557 return c 5558} 5559 5560// Fields allows partial responses to be retrieved. See 5561// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5562// for more information. 5563func (c *ProjectsSshKeysListCall) Fields(s ...googleapi.Field) *ProjectsSshKeysListCall { 5564 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5565 return c 5566} 5567 5568// IfNoneMatch sets the optional parameter which makes the operation 5569// fail if the object's ETag matches the given value. This is useful for 5570// getting updates only after the object has changed since the last 5571// request. Use googleapi.IsNotModified to check whether the response 5572// error from Do is the result of In-None-Match. 5573func (c *ProjectsSshKeysListCall) IfNoneMatch(entityTag string) *ProjectsSshKeysListCall { 5574 c.ifNoneMatch_ = entityTag 5575 return c 5576} 5577 5578// Context sets the context to be used in this call's Do method. Any 5579// pending HTTP request will be aborted if the provided context is 5580// canceled. 5581func (c *ProjectsSshKeysListCall) Context(ctx context.Context) *ProjectsSshKeysListCall { 5582 c.ctx_ = ctx 5583 return c 5584} 5585 5586// Header returns an http.Header that can be modified by the caller to 5587// add HTTP headers to the request. 5588func (c *ProjectsSshKeysListCall) Header() http.Header { 5589 if c.header_ == nil { 5590 c.header_ = make(http.Header) 5591 } 5592 return c.header_ 5593} 5594 5595func (c *ProjectsSshKeysListCall) doRequest(alt string) (*http.Response, error) { 5596 reqHeaders := make(http.Header) 5597 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210801") 5598 for k, v := range c.header_ { 5599 reqHeaders[k] = v 5600 } 5601 reqHeaders.Set("User-Agent", c.s.userAgent()) 5602 if c.ifNoneMatch_ != "" { 5603 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5604 } 5605 var body io.Reader = nil 5606 c.urlParams_.Set("alt", alt) 5607 c.urlParams_.Set("prettyPrint", "false") 5608 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/sshKeys") 5609 urls += "?" + c.urlParams_.Encode() 5610 req, err := http.NewRequest("GET", urls, body) 5611 if err != nil { 5612 return nil, err 5613 } 5614 req.Header = reqHeaders 5615 googleapi.Expand(req.URL, map[string]string{ 5616 "parent": c.parent, 5617 }) 5618 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5619} 5620 5621// Do executes the "baremetalsolution.projects.sshKeys.list" call. 5622// Exactly one of *ListSSHKeysResponse or error will be non-nil. Any 5623// non-2xx status code is an error. Response headers are in either 5624// *ListSSHKeysResponse.ServerResponse.Header or (if a response was 5625// returned at all) in error.(*googleapi.Error).Header. Use 5626// googleapi.IsNotModified to check whether the returned error was 5627// because http.StatusNotModified was returned. 5628func (c *ProjectsSshKeysListCall) Do(opts ...googleapi.CallOption) (*ListSSHKeysResponse, error) { 5629 gensupport.SetOptions(c.urlParams_, opts...) 5630 res, err := c.doRequest("json") 5631 if res != nil && res.StatusCode == http.StatusNotModified { 5632 if res.Body != nil { 5633 res.Body.Close() 5634 } 5635 return nil, &googleapi.Error{ 5636 Code: res.StatusCode, 5637 Header: res.Header, 5638 } 5639 } 5640 if err != nil { 5641 return nil, err 5642 } 5643 defer googleapi.CloseBody(res) 5644 if err := googleapi.CheckResponse(res); err != nil { 5645 return nil, err 5646 } 5647 ret := &ListSSHKeysResponse{ 5648 ServerResponse: googleapi.ServerResponse{ 5649 Header: res.Header, 5650 HTTPStatusCode: res.StatusCode, 5651 }, 5652 } 5653 target := &ret 5654 if err := gensupport.DecodeResponse(target, res); err != nil { 5655 return nil, err 5656 } 5657 return ret, nil 5658 // { 5659 // "description": "List the public SSH keys registered for the specified project.", 5660 // "flatPath": "v1alpha1/projects/{projectsId}/sshKeys", 5661 // "httpMethod": "GET", 5662 // "id": "baremetalsolution.projects.sshKeys.list", 5663 // "parameterOrder": [ 5664 // "parent" 5665 // ], 5666 // "parameters": { 5667 // "pageSize": { 5668 // "description": "The maximum number of items to return.", 5669 // "format": "int32", 5670 // "location": "query", 5671 // "type": "integer" 5672 // }, 5673 // "pageToken": { 5674 // "description": "The next_page_token value returned from a previous List request, if any.", 5675 // "location": "query", 5676 // "type": "string" 5677 // }, 5678 // "parent": { 5679 // "description": "Required. The parent project containing the SSH keys.", 5680 // "location": "path", 5681 // "pattern": "^projects/[^/]+$", 5682 // "required": true, 5683 // "type": "string" 5684 // } 5685 // }, 5686 // "path": "v1alpha1/{+parent}/sshKeys", 5687 // "response": { 5688 // "$ref": "ListSSHKeysResponse" 5689 // }, 5690 // "scopes": [ 5691 // "https://www.googleapis.com/auth/cloud-platform" 5692 // ] 5693 // } 5694 5695} 5696 5697// Pages invokes f for each page of results. 5698// A non-nil error returned from f will halt the iteration. 5699// The provided context supersedes any context provided to the Context method. 5700func (c *ProjectsSshKeysListCall) Pages(ctx context.Context, f func(*ListSSHKeysResponse) error) error { 5701 c.ctx_ = ctx 5702 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5703 for { 5704 x, err := c.Do() 5705 if err != nil { 5706 return err 5707 } 5708 if err := f(x); err != nil { 5709 return err 5710 } 5711 if x.NextPageToken == "" { 5712 return nil 5713 } 5714 c.PageToken(x.NextPageToken) 5715 } 5716} 5717