Skip to content

Commit 35cd4e9

Browse files
Add resource for Cluster Director (hypercomputecluster.googleapis.com) Cluster resource (#16274) (#26180)
[upstream:a236770c1538bbe367b6e39f1dcd83f096179dbd] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent a51c215 commit 35cd4e9

17 files changed

+6048
-2
lines changed

.changelog/16274.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_hypercomputecluster_cluster`
3+
```

.teamcity/components/inputs/services_beta.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@ var ServicesListBeta = mapOf(
501501
"displayName" to "Healthcare",
502502
"path" to "./google-beta/services/healthcare"
503503
),
504+
"hypercomputecluster" to mapOf(
505+
"name" to "hypercomputecluster",
506+
"displayName" to "ClusterDirector",
507+
"path" to "./google/services/hypercomputecluster"
508+
),
504509
"iam2" to mapOf(
505510
"name" to "iam2",
506511
"displayName" to "Iam2",

.teamcity/components/inputs/services_ga.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,11 @@ var ServicesListGa = mapOf(
496496
"displayName" to "Healthcare",
497497
"path" to "./google/services/healthcare"
498498
),
499+
"hypercomputecluster" to mapOf(
500+
"name" to "hypercomputecluster",
501+
"displayName" to "ClusterDirector",
502+
"path" to "./google/services/hypercomputecluster"
503+
),
499504
"iam2" to mapOf(
500505
"name" to "iam2",
501506
"displayName" to "Iam2",

google/fwmodels/provider_model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ type ProviderModel struct {
135135
GKEHub2CustomEndpoint types.String `tfsdk:"gke_hub2_custom_endpoint"`
136136
GkeonpremCustomEndpoint types.String `tfsdk:"gkeonprem_custom_endpoint"`
137137
HealthcareCustomEndpoint types.String `tfsdk:"healthcare_custom_endpoint"`
138+
HypercomputeclusterCustomEndpoint types.String `tfsdk:"hypercomputecluster_custom_endpoint"`
138139
IAM2CustomEndpoint types.String `tfsdk:"iam2_custom_endpoint"`
139140
IAM3CustomEndpoint types.String `tfsdk:"iam3_custom_endpoint"`
140141
IAMBetaCustomEndpoint types.String `tfsdk:"iam_beta_custom_endpoint"`

google/fwprovider/framework_provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
676676
transport_tpg.CustomEndpointValidator(),
677677
},
678678
},
679+
"hypercomputecluster_custom_endpoint": &schema.StringAttribute{
680+
Optional: true,
681+
Validators: []validator.String{
682+
transport_tpg.CustomEndpointValidator(),
683+
},
684+
},
679685
"iam2_custom_endpoint": &schema.StringAttribute{
680686
Optional: true,
681687
Validators: []validator.String{

google/provider/provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,11 @@ func Provider() *schema.Provider {
603603
Optional: true,
604604
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
605605
},
606+
"hypercomputecluster_custom_endpoint": {
607+
Type: schema.TypeString,
608+
Optional: true,
609+
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
610+
},
606611
"iam2_custom_endpoint": {
607612
Type: schema.TypeString,
608613
Optional: true,
@@ -1245,6 +1250,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
12451250
config.GKEHub2BasePath = d.Get("gke_hub2_custom_endpoint").(string)
12461251
config.GkeonpremBasePath = d.Get("gkeonprem_custom_endpoint").(string)
12471252
config.HealthcareBasePath = d.Get("healthcare_custom_endpoint").(string)
1253+
config.HypercomputeclusterBasePath = d.Get("hypercomputecluster_custom_endpoint").(string)
12481254
config.IAM2BasePath = d.Get("iam2_custom_endpoint").(string)
12491255
config.IAM3BasePath = d.Get("iam3_custom_endpoint").(string)
12501256
config.IAMBetaBasePath = d.Get("iam_beta_custom_endpoint").(string)

google/provider/provider_mmv1_resources.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ import (
100100
"github.com/hashicorp/terraform-provider-google/google/services/gkehub2"
101101
"github.com/hashicorp/terraform-provider-google/google/services/gkeonprem"
102102
"github.com/hashicorp/terraform-provider-google/google/services/healthcare"
103+
"github.com/hashicorp/terraform-provider-google/google/services/hypercomputecluster"
103104
"github.com/hashicorp/terraform-provider-google/google/services/iam2"
104105
"github.com/hashicorp/terraform-provider-google/google/services/iam3"
105106
"github.com/hashicorp/terraform-provider-google/google/services/iambeta"
@@ -601,9 +602,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{
601602
}
602603

603604
// Resources
604-
// Generated resources: 715
605+
// Generated resources: 716
605606
// Generated IAM resources: 333
606-
// Total generated resources: 1048
607+
// Total generated resources: 1049
607608
var generatedResources = map[string]*schema.Resource{
608609
"google_folder_access_approval_settings": registry.Resource("google_folder_access_approval_settings"),
609610
"google_organization_access_approval_settings": registry.Resource("google_organization_access_approval_settings"),
@@ -1228,6 +1229,7 @@ var generatedResources = map[string]*schema.Resource{
12281229
"google_healthcare_hl7_v2_store": registry.Resource("google_healthcare_hl7_v2_store"),
12291230
"google_healthcare_pipeline_job": registry.Resource("google_healthcare_pipeline_job"),
12301231
"google_healthcare_workspace": registry.Resource("google_healthcare_workspace"),
1232+
"google_hypercomputecluster_cluster": registry.Resource("google_hypercomputecluster_cluster"),
12311233
"google_iam_access_boundary_policy": registry.Resource("google_iam_access_boundary_policy"),
12321234
"google_iam_deny_policy": registry.Resource("google_iam_deny_policy"),
12331235
"google_iam_folders_policy_binding": registry.Resource("google_iam_folders_policy_binding"),
@@ -1868,6 +1870,7 @@ func UseGeneratedProducts() {
18681870
var _ = gkehub2.ProductName
18691871
var _ = gkeonprem.ProductName
18701872
var _ = healthcare.ProductName
1873+
var _ = hypercomputecluster.ProductName
18711874
var _ = iam2.ProductName
18721875
var _ = iam3.ProductName
18731876
var _ = iambeta.ProductName
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
// ----------------------------------------------------------------------------
5+
//
6+
// *** AUTO GENERATED CODE *** Type: MMv1 ***
7+
//
8+
// ----------------------------------------------------------------------------
9+
//
10+
// This file is automatically generated by Magic Modules and manual
11+
// changes will be clobbered when the file is regenerated.
12+
//
13+
// Please read more about how to change this file in
14+
// .github/CONTRIBUTING.md.
15+
//
16+
// ----------------------------------------------------------------------------
17+
18+
package hypercomputecluster
19+
20+
import (
21+
"encoding/json"
22+
"errors"
23+
"fmt"
24+
"log"
25+
"strings"
26+
"time"
27+
28+
"github.com/hashicorp/terraform-provider-google/google/tpgresource"
29+
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport"
30+
31+
"google.golang.org/api/googleapi"
32+
)
33+
34+
var (
35+
_ = json.Marshal
36+
_ = errors.New
37+
_ = fmt.Sprintf
38+
_ = log.Print
39+
_ = strings.Trim
40+
_ = time.Now
41+
_ = tpgresource.SetLabels
42+
_ = transport_tpg.Config{}
43+
_ = googleapi.Error{}
44+
)
45+
46+
type HypercomputeclusterOperationWaiter struct {
47+
Config *transport_tpg.Config
48+
UserAgent string
49+
Project string
50+
tpgresource.CommonOperationWaiter
51+
}
52+
53+
func (w *HypercomputeclusterOperationWaiter) QueryOp() (interface{}, error) {
54+
if w == nil {
55+
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
56+
}
57+
// Returns the proper get.
58+
url := fmt.Sprintf("%s%s", w.Config.HypercomputeclusterBasePath, w.CommonOperationWaiter.Op.Name)
59+
60+
return transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
61+
Config: w.Config,
62+
Method: "GET",
63+
Project: w.Project,
64+
RawURL: url,
65+
UserAgent: w.UserAgent,
66+
})
67+
}
68+
69+
func createHypercomputeclusterWaiter(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string) (*HypercomputeclusterOperationWaiter, error) {
70+
w := &HypercomputeclusterOperationWaiter{
71+
Config: config,
72+
UserAgent: userAgent,
73+
Project: project,
74+
}
75+
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
76+
return nil, err
77+
}
78+
return w, nil
79+
}
80+
81+
// nolint: deadcode,unused
82+
func HypercomputeclusterOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
83+
w, err := createHypercomputeclusterWaiter(config, op, project, activity, userAgent)
84+
if err != nil {
85+
return err
86+
}
87+
if err := tpgresource.OperationWait(w, activity, timeout, config.PollInterval); err != nil {
88+
return err
89+
}
90+
rawResponse := []byte(w.CommonOperationWaiter.Op.Response)
91+
if len(rawResponse) == 0 {
92+
return errors.New("`resource` not set in operation response")
93+
}
94+
return json.Unmarshal(rawResponse, response)
95+
}
96+
97+
func HypercomputeclusterOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
98+
if val, ok := op["name"]; !ok || val == "" {
99+
// This was a synchronous call - there is no operation to wait for.
100+
return nil
101+
}
102+
w, err := createHypercomputeclusterWaiter(config, op, project, activity, userAgent)
103+
if err != nil {
104+
// If w is nil, the op was synchronous.
105+
return err
106+
}
107+
return tpgresource.OperationWait(w, activity, timeout, config.PollInterval)
108+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
// ----------------------------------------------------------------------------
5+
//
6+
// *** AUTO GENERATED CODE *** Type: MMv1 ***
7+
//
8+
// ----------------------------------------------------------------------------
9+
//
10+
// This file is automatically generated by Magic Modules and manual
11+
// changes will be clobbered when the file is regenerated.
12+
//
13+
// Please read more about how to change this file in
14+
// .github/CONTRIBUTING.md.
15+
//
16+
// ----------------------------------------------------------------------------
17+
18+
// Package hypercomputecluster contains resources, datasources, etc. for the cluster director service.
19+
package hypercomputecluster
20+
21+
import (
22+
"github.com/hashicorp/terraform-provider-google/google/registry"
23+
)
24+
25+
const ProductName = "hypercomputecluster"
26+
27+
func init() {
28+
registry.Product{
29+
Name: "hypercomputecluster",
30+
BaseUrl: "https://hypercomputecluster.googleapis.com/v1/",
31+
}.Register()
32+
}

0 commit comments

Comments
 (0)