diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/CHANGELOG.md b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/CHANGELOG.md index 0f94d86fa4af..53af7dafac11 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/CHANGELOG.md +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/CHANGELOG.md @@ -1,5 +1,44 @@ # Release History +## 0.5.0 (2022-04-27) +### Breaking Changes + +- Type of `WorkerProfile.VMSize` has been changed from `*VMSize` to `*string` +- Type of `MasterProfile.VMSize` has been changed from `*VMSize` to `*string` +- Const `VMSizeStandardD8SV3` has been removed +- Const `VMSizeStandardD2SV3` has been removed +- Const `VMSizeStandardD4SV3` has been removed +- Function `PossibleVMSizeValues` has been removed + +### Features Added + +- New const `EncryptionAtHostEnabled` +- New const `CreatedByTypeKey` +- New const `FipsValidatedModulesDisabled` +- New const `CreatedByTypeApplication` +- New const `EncryptionAtHostDisabled` +- New const `CreatedByTypeManagedIdentity` +- New const `FipsValidatedModulesEnabled` +- New const `CreatedByTypeUser` +- New function `SystemData.MarshalJSON() ([]byte, error)` +- New function `PossibleCreatedByTypeValues() []CreatedByType` +- New function `PossibleEncryptionAtHostValues() []EncryptionAtHost` +- New function `*OpenShiftClustersClient.ListAdminCredentials(context.Context, string, string, *OpenShiftClustersClientListAdminCredentialsOptions) (OpenShiftClustersClientListAdminCredentialsResponse, error)` +- New function `*SystemData.UnmarshalJSON([]byte) error` +- New function `PossibleFipsValidatedModulesValues() []FipsValidatedModules` +- New struct `OpenShiftClusterAdminKubeconfig` +- New struct `OpenShiftClustersClientListAdminCredentialsOptions` +- New struct `OpenShiftClustersClientListAdminCredentialsResponse` +- New struct `SystemData` +- New field `SystemData` in struct `OpenShiftCluster` +- New field `FipsValidatedModules` in struct `ClusterProfile` +- New field `SystemData` in struct `OpenShiftClusterUpdate` +- New field `EncryptionAtHost` in struct `WorkerProfile` +- New field `DiskEncryptionSetID` in struct `WorkerProfile` +- New field `DiskEncryptionSetID` in struct `MasterProfile` +- New field `EncryptionAtHost` in struct `MasterProfile` + + ## 0.4.0 (2022-04-18) ### Breaking Changes diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/autorest.md b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/autorest.md index b5ba6084bbfa..400bbd228666 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/autorest.md +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/redhatopenshift/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/redhatopenshift/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/redhatopenshift/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/redhatopenshift/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 0.5.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/go.mod b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/go.mod index dbdfd4ea0aed..d7a313736db2 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/go.mod +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redhatopenshift/arm go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/go.sum b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/go.sum index 56d1c32628ae..a7eaa30576c1 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/go.sum +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/go.sum @@ -1,26 +1,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -28,26 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/ze_generated_example_openshiftclusters_client_test.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/ze_generated_example_openshiftclusters_client_test.go deleted file mode 100644 index d1afef4d3e23..000000000000 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/ze_generated_example_openshiftclusters_client_test.go +++ /dev/null @@ -1,274 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armredhatopenshift_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redhatopenshift/armredhatopenshift" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_List.json -func ExampleOpenShiftClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armredhatopenshift.NewOpenShiftClustersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_ListByResourceGroup.json -func ExampleOpenShiftClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armredhatopenshift.NewOpenShiftClustersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Get.json -func ExampleOpenShiftClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armredhatopenshift.NewOpenShiftClustersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_CreateOrUpdate.json -func ExampleOpenShiftClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armredhatopenshift.NewOpenShiftClustersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armredhatopenshift.OpenShiftCluster{ - Location: to.Ptr(""), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armredhatopenshift.OpenShiftClusterProperties{ - ApiserverProfile: &armredhatopenshift.APIServerProfile{ - Visibility: to.Ptr(armredhatopenshift.VisibilityPublic), - }, - ClusterProfile: &armredhatopenshift.ClusterProfile{ - Domain: to.Ptr(""), - PullSecret: to.Ptr(""), - ResourceGroupID: to.Ptr(""), - }, - ConsoleProfile: &armredhatopenshift.ConsoleProfile{}, - IngressProfiles: []*armredhatopenshift.IngressProfile{ - { - Name: to.Ptr(""), - Visibility: to.Ptr(armredhatopenshift.VisibilityPublic), - }}, - MasterProfile: &armredhatopenshift.MasterProfile{ - SubnetID: to.Ptr(""), - VMSize: to.Ptr(armredhatopenshift.VMSizeStandardD8SV3), - }, - NetworkProfile: &armredhatopenshift.NetworkProfile{ - PodCidr: to.Ptr(""), - ServiceCidr: to.Ptr(""), - }, - ServicePrincipalProfile: &armredhatopenshift.ServicePrincipalProfile{ - ClientID: to.Ptr(""), - ClientSecret: to.Ptr(""), - }, - WorkerProfiles: []*armredhatopenshift.WorkerProfile{ - { - Name: to.Ptr(""), - Count: to.Ptr[int32](3), - DiskSizeGB: to.Ptr[int32](128), - SubnetID: to.Ptr(""), - VMSize: to.Ptr(armredhatopenshift.VMSizeStandardD2SV3), - }}, - }, - }, - &armredhatopenshift.OpenShiftClustersClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Delete.json -func ExampleOpenShiftClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armredhatopenshift.NewOpenShiftClustersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - "", - &armredhatopenshift.OpenShiftClustersClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_Update.json -func ExampleOpenShiftClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armredhatopenshift.NewOpenShiftClustersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "", - "", - armredhatopenshift.OpenShiftClusterUpdate{ - Properties: &armredhatopenshift.OpenShiftClusterProperties{ - ApiserverProfile: &armredhatopenshift.APIServerProfile{ - Visibility: to.Ptr(armredhatopenshift.VisibilityPublic), - }, - ClusterProfile: &armredhatopenshift.ClusterProfile{ - Domain: to.Ptr(""), - PullSecret: to.Ptr(""), - ResourceGroupID: to.Ptr(""), - }, - ConsoleProfile: &armredhatopenshift.ConsoleProfile{}, - IngressProfiles: []*armredhatopenshift.IngressProfile{ - { - Name: to.Ptr(""), - Visibility: to.Ptr(armredhatopenshift.VisibilityPublic), - }}, - MasterProfile: &armredhatopenshift.MasterProfile{ - SubnetID: to.Ptr(""), - VMSize: to.Ptr(armredhatopenshift.VMSizeStandardD8SV3), - }, - NetworkProfile: &armredhatopenshift.NetworkProfile{ - PodCidr: to.Ptr(""), - ServiceCidr: to.Ptr(""), - }, - ServicePrincipalProfile: &armredhatopenshift.ServicePrincipalProfile{ - ClientID: to.Ptr(""), - ClientSecret: to.Ptr(""), - }, - WorkerProfiles: []*armredhatopenshift.WorkerProfile{ - { - Name: to.Ptr(""), - Count: to.Ptr[int32](3), - DiskSizeGB: to.Ptr[int32](128), - SubnetID: to.Ptr(""), - VMSize: to.Ptr(armredhatopenshift.VMSizeStandardD2SV3), - }}, - }, - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, - &armredhatopenshift.OpenShiftClustersClientBeginUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/OpenShiftClusters_ListCredentials.json -func ExampleOpenShiftClustersClient_ListCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armredhatopenshift.NewOpenShiftClustersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListCredentials(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/ze_generated_example_operations_client_test.go deleted file mode 100644 index b0f8a69b7b92..000000000000 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armredhatopenshift_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redhatopenshift/armredhatopenshift" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2020-04-30/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armredhatopenshift.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_constants.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_constants.go index 7fe8e436195e..610a631a0aad 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_constants.go +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_constants.go @@ -10,9 +10,61 @@ package armredhatopenshift const ( moduleName = "armredhatopenshift" - moduleVersion = "v0.4.0" + moduleVersion = "v0.5.0" ) +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// EncryptionAtHost - EncryptionAtHost represents encryption at host state +type EncryptionAtHost string + +const ( + EncryptionAtHostDisabled EncryptionAtHost = "Disabled" + EncryptionAtHostEnabled EncryptionAtHost = "Enabled" +) + +// PossibleEncryptionAtHostValues returns the possible values for the EncryptionAtHost const type. +func PossibleEncryptionAtHostValues() []EncryptionAtHost { + return []EncryptionAtHost{ + EncryptionAtHostDisabled, + EncryptionAtHostEnabled, + } +} + +// FipsValidatedModules - FipsValidatedModules determines if FIPS is used. +type FipsValidatedModules string + +const ( + FipsValidatedModulesDisabled FipsValidatedModules = "Disabled" + FipsValidatedModulesEnabled FipsValidatedModules = "Enabled" +) + +// PossibleFipsValidatedModulesValues returns the possible values for the FipsValidatedModules const type. +func PossibleFipsValidatedModulesValues() []FipsValidatedModules { + return []FipsValidatedModules{ + FipsValidatedModulesDisabled, + FipsValidatedModulesEnabled, + } +} + // ProvisioningState - ProvisioningState represents a provisioning state. type ProvisioningState string @@ -37,24 +89,6 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } -// VMSize - VMSize represents a VM size. -type VMSize string - -const ( - VMSizeStandardD2SV3 VMSize = "Standard_D2s_v3" - VMSizeStandardD4SV3 VMSize = "Standard_D4s_v3" - VMSizeStandardD8SV3 VMSize = "Standard_D8s_v3" -) - -// PossibleVMSizeValues returns the possible values for the VMSize const type. -func PossibleVMSizeValues() []VMSize { - return []VMSize{ - VMSizeStandardD2SV3, - VMSizeStandardD4SV3, - VMSizeStandardD8SV3, - } -} - // Visibility - Visibility represents visibility. type Visibility string diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_models.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_models.go index fb31c47ed29a..a2295a59df46 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_models.go +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_models.go @@ -8,15 +8,17 @@ package armredhatopenshift +import "time" + // APIServerProfile represents an API server profile. type APIServerProfile struct { - // The IP of the cluster API server (immutable). + // The IP of the cluster API server. IP *string `json:"ip,omitempty"` - // The URL to access the cluster API server (immutable). + // The URL to access the cluster API server. URL *string `json:"url,omitempty"` - // API server visibility (immutable). + // API server visibility. Visibility *Visibility `json:"visibility,omitempty"` } @@ -43,22 +45,25 @@ type CloudErrorBody struct { // ClusterProfile represents a cluster profile. type ClusterProfile struct { - // The domain for the cluster (immutable). + // The domain for the cluster. Domain *string `json:"domain,omitempty"` - // The pull secret for the cluster (immutable). + // If FIPS validated crypto modules are used + FipsValidatedModules *FipsValidatedModules `json:"fipsValidatedModules,omitempty"` + + // The pull secret for the cluster. PullSecret *string `json:"pullSecret,omitempty"` - // The ID of the cluster resource group (immutable). + // The ID of the cluster resource group. ResourceGroupID *string `json:"resourceGroupId,omitempty"` - // The version of the cluster (immutable). + // The version of the cluster. Version *string `json:"version,omitempty"` } // ConsoleProfile represents a console profile. type ConsoleProfile struct { - // The URL to access the cluster console (immutable). + // The URL to access the cluster console. URL *string `json:"url,omitempty"` } @@ -79,31 +84,37 @@ type Display struct { // IngressProfile represents an ingress profile. type IngressProfile struct { - // The IP of the ingress (immutable). + // The IP of the ingress. IP *string `json:"ip,omitempty"` - // The ingress profile name. Must be "default" (immutable). + // The ingress profile name. Name *string `json:"name,omitempty"` - // Ingress visibility (immutable). + // Ingress visibility. Visibility *Visibility `json:"visibility,omitempty"` } // MasterProfile represents a master profile. type MasterProfile struct { - // The Azure resource ID of the master subnet (immutable). + // The resource ID of an associated DiskEncryptionSet, if applicable. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + + // Whether master virtual machines are encrypted at host. + EncryptionAtHost *EncryptionAtHost `json:"encryptionAtHost,omitempty"` + + // The Azure resource ID of the master subnet. SubnetID *string `json:"subnetId,omitempty"` - // The size of the master VMs (immutable). - VMSize *VMSize `json:"vmSize,omitempty"` + // The size of the master VMs. + VMSize *string `json:"vmSize,omitempty"` } // NetworkProfile represents a network profile. type NetworkProfile struct { - // The CIDR used for OpenShift/Kubernetes Pods (immutable). + // The CIDR used for OpenShift/Kubernetes Pods. PodCidr *string `json:"podCidr,omitempty"` - // The CIDR used for OpenShift/Kubernetes Services (immutable). + // The CIDR used for OpenShift/Kubernetes Services. ServiceCidr *string `json:"serviceCidr,omitempty"` } @@ -124,16 +135,25 @@ type OpenShiftCluster struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } -// OpenShiftClusterCredentials represents an OpenShift cluster's credentials +// OpenShiftClusterAdminKubeconfig represents an OpenShift cluster's admin kubeconfig. +type OpenShiftClusterAdminKubeconfig struct { + // The base64-encoded kubeconfig file. + Kubeconfig *string `json:"kubeconfig,omitempty"` +} + +// OpenShiftClusterCredentials represents an OpenShift cluster's credentials. type OpenShiftClusterCredentials struct { - // The password for the kubeadmin user + // The password for the kubeadmin user. KubeadminPassword *string `json:"kubeadminPassword,omitempty"` - // The username for the kubeadmin user + // The username for the kubeadmin user. KubeadminUsername *string `json:"kubeadminUsername,omitempty"` } @@ -166,7 +186,7 @@ type OpenShiftClusterProperties struct { // The cluster network profile. NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // The cluster provisioning state (immutable). + // The cluster provisioning state. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` // The cluster service principal profile. @@ -183,6 +203,9 @@ type OpenShiftClusterUpdate struct { // The resource tags. Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` } // OpenShiftClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the OpenShiftClustersClient.BeginCreateOrUpdate @@ -211,6 +234,12 @@ type OpenShiftClustersClientGetOptions struct { // placeholder for future optional parameters } +// OpenShiftClustersClientListAdminCredentialsOptions contains the optional parameters for the OpenShiftClustersClient.ListAdminCredentials +// method. +type OpenShiftClustersClientListAdminCredentialsOptions struct { + // placeholder for future optional parameters +} + // OpenShiftClustersClientListByResourceGroupOptions contains the optional parameters for the OpenShiftClustersClient.ListByResourceGroup // method. type OpenShiftClustersClientListByResourceGroupOptions struct { @@ -268,13 +297,34 @@ type Resource struct { // ServicePrincipalProfile represents a service principal profile. type ServicePrincipalProfile struct { - // The client ID used for the cluster (immutable). + // The client ID used for the cluster. ClientID *string `json:"clientId,omitempty"` - // The client secret used for the cluster (immutable). + // The client secret used for the cluster. ClientSecret *string `json:"clientSecret,omitempty"` } +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} + // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { @@ -296,18 +346,24 @@ type TrackedResource struct { // WorkerProfile represents a worker profile. type WorkerProfile struct { - // The number of worker VMs. Must be between 3 and 20 (immutable). + // The number of worker VMs. Count *int32 `json:"count,omitempty"` - // The disk size of the worker VMs. Must be 128 or greater (immutable). + // The resource ID of an associated DiskEncryptionSet, if applicable. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + + // The disk size of the worker VMs. DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // The worker profile name. Must be "worker" (immutable). + // Whether master virtual machines are encrypted at host. + EncryptionAtHost *EncryptionAtHost `json:"encryptionAtHost,omitempty"` + + // The worker profile name. Name *string `json:"name,omitempty"` - // The Azure resource ID of the worker subnet (immutable). + // The Azure resource ID of the worker subnet. SubnetID *string `json:"subnetId,omitempty"` - // The size of the worker VMs (immutable). - VMSize *VMSize `json:"vmSize,omitempty"` + // The size of the worker VMs. + VMSize *string `json:"vmSize,omitempty"` } diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_models_serde.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_models_serde.go index 706891cc66ed..2c2760e8d1a3 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_models_serde.go +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_models_serde.go @@ -31,6 +31,7 @@ func (o OpenShiftCluster) MarshalJSON() ([]byte, error) { populate(objectMap, "location", o.Location) populate(objectMap, "name", o.Name) populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) populate(objectMap, "tags", o.Tags) populate(objectMap, "type", o.Type) return json.Marshal(objectMap) @@ -63,6 +64,7 @@ func (o OpenShiftClusterProperties) MarshalJSON() ([]byte, error) { func (o OpenShiftClusterUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) populate(objectMap, "tags", o.Tags) return json.Marshal(objectMap) } @@ -75,6 +77,53 @@ func (o OperationList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -95,3 +144,10 @@ func populate(m map[string]interface{}, k string, v interface{}) { m[k] = v } } + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_openshiftclusters_client.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_openshiftclusters_client.go index 846c8e402a8e..0aa3fd6613ac 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_openshiftclusters_client.go +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_openshiftclusters_client.go @@ -110,7 +110,7 @@ func (client *OpenShiftClustersClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-30") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -171,7 +171,7 @@ func (client *OpenShiftClustersClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-30") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -217,7 +217,7 @@ func (client *OpenShiftClustersClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-30") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -275,7 +275,7 @@ func (client *OpenShiftClustersClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-30") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -290,6 +290,62 @@ func (client *OpenShiftClustersClient) listHandleResponse(resp *http.Response) ( return result, nil } +// ListAdminCredentials - The operation returns the admin kubeconfig. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the OpenShift cluster resource. +// options - OpenShiftClustersClientListAdminCredentialsOptions contains the optional parameters for the OpenShiftClustersClient.ListAdminCredentials +// method. +func (client *OpenShiftClustersClient) ListAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *OpenShiftClustersClientListAdminCredentialsOptions) (OpenShiftClustersClientListAdminCredentialsResponse, error) { + req, err := client.listAdminCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return OpenShiftClustersClientListAdminCredentialsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OpenShiftClustersClientListAdminCredentialsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OpenShiftClustersClientListAdminCredentialsResponse{}, runtime.NewResponseError(resp) + } + return client.listAdminCredentialsHandleResponse(resp) +} + +// listAdminCredentialsCreateRequest creates the ListAdminCredentials request. +func (client *OpenShiftClustersClient) listAdminCredentialsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *OpenShiftClustersClientListAdminCredentialsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}/listAdminCredentials" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listAdminCredentialsHandleResponse handles the ListAdminCredentials response. +func (client *OpenShiftClustersClient) listAdminCredentialsHandleResponse(resp *http.Response) (OpenShiftClustersClientListAdminCredentialsResponse, error) { + result := OpenShiftClustersClientListAdminCredentialsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OpenShiftClusterAdminKubeconfig); err != nil { + return OpenShiftClustersClientListAdminCredentialsResponse{}, err + } + return result, nil +} + // NewListByResourceGroupPager - The operation returns properties of each OpenShift cluster. // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. The name is case insensitive. @@ -339,7 +395,7 @@ func (client *OpenShiftClustersClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-30") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -395,7 +451,7 @@ func (client *OpenShiftClustersClient) listCredentialsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-30") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -466,7 +522,7 @@ func (client *OpenShiftClustersClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-30") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_operations_client.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_operations_client.go index 7281cdb6e10a..66087d2101ff 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_operations_client.go +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_operations_client.go @@ -87,7 +87,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-30") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_response_types.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_response_types.go index a86774908cbb..594ecb4ad4e9 100644 --- a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_response_types.go +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_response_types.go @@ -23,6 +23,11 @@ type OpenShiftClustersClientGetResponse struct { OpenShiftCluster } +// OpenShiftClustersClientListAdminCredentialsResponse contains the response from method OpenShiftClustersClient.ListAdminCredentials. +type OpenShiftClustersClientListAdminCredentialsResponse struct { + OpenShiftClusterAdminKubeconfig +} + // OpenShiftClustersClientListByResourceGroupResponse contains the response from method OpenShiftClustersClient.ListByResourceGroup. type OpenShiftClustersClientListByResourceGroupResponse struct { OpenShiftClusterList diff --git a/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_time_rfc3339.go b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_time_rfc3339.go new file mode 100644 index 000000000000..7e504267d671 --- /dev/null +++ b/sdk/resourcemanager/redhatopenshift/armredhatopenshift/zz_generated_time_rfc3339.go @@ -0,0 +1,85 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armredhatopenshift + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +const ( + utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` + utcLayout = "2006-01-02T15:04:05.999999999" + rfc3339JSON = `"` + time.RFC3339Nano + `"` +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) + +type timeRFC3339 time.Time + +func (t timeRFC3339) MarshalJSON() (json []byte, err error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t timeRFC3339) MarshalText() (text []byte, err error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *timeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcLayoutJSON + if tzOffsetRegex.Match(data) { + layout = rfc3339JSON + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { + layout := utcLayout + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = timeRFC3339(p) + return err +} + +func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*timeRFC3339)(t) +} + +func unpopulateTimeRFC3339(data json.RawMessage, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux timeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + *t = (*time.Time)(&aux) + return nil +}