diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/CHANGELOG.md b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/CHANGELOG.md index 1225309d536f..131443f2512c 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/CHANGELOG.md +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 2.1.0 (2023-08-29) +### Features Added + +- New struct `PostBuildDefinition` +- New struct `SubstituteFromDefinition` +- New field `ReconciliationWaitDuration`, `WaitForReconciliation` in struct `FluxConfigurationProperties` +- New field `PostBuild`, `Wait` in struct `KustomizationDefinition` +- New field `PostBuild`, `Wait` in struct `KustomizationPatchDefinition` + + ## 2.0.0 (2023-05-26) ### Breaking Changes diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/autorest.md b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/autorest.md index e5598e03ebd6..5c5c312c1469 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/autorest.md +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/kubernetesconfiguration/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/kubernetesconfiguration/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0 -tag: package-2022-11 +module-version: 2.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/client_factory.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/client_factory.go index 92ff3a1d66d3..8fa4c191d513 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/client_factory.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -43,8 +42,8 @@ func (c *ClientFactory) NewExtensionsClient() *ExtensionsClient { return subClient } -func (c *ClientFactory) NewOperationStatusClient() *OperationStatusClient { - subClient, _ := NewOperationStatusClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewFluxConfigOperationStatusClient() *FluxConfigOperationStatusClient { + subClient, _ := NewFluxConfigOperationStatusClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -53,17 +52,17 @@ func (c *ClientFactory) NewFluxConfigurationsClient() *FluxConfigurationsClient return subClient } -func (c *ClientFactory) NewFluxConfigOperationStatusClient() *FluxConfigOperationStatusClient { - subClient, _ := NewFluxConfigOperationStatusClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationStatusClient() *OperationStatusClient { + subClient, _ := NewOperationStatusClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSourceControlConfigurationsClient() *SourceControlConfigurationsClient { - subClient, _ := NewSourceControlConfigurationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewSourceControlConfigurationsClient() *SourceControlConfigurationsClient { + subClient, _ := NewSourceControlConfigurationsClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/constants.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/constants.go index 8410dde33c7c..86977825462d 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/constants.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration const ( moduleName = "armkubernetesconfiguration" - moduleVersion = "v2.0.0" + moduleVersion = "v2.1.0" ) // AKSIdentityType - The identity type. diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client.go index 10ddabecfa93..26264f16c2a1 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -48,7 +47,7 @@ func NewExtensionsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Create a new Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -62,9 +61,10 @@ func (client *ExtensionsClient) BeginCreate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +73,22 @@ func (client *ExtensionsClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Create a new Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *ExtensionsClient) create(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, extension Extension, options *ExtensionsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, extension, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -121,16 +123,19 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extension) + if err := runtime.MarshalAsJSON(req, extension); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -143,9 +148,10 @@ func (client *ExtensionsClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -154,20 +160,22 @@ func (client *ExtensionsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *ExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, options *ExtensionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -202,7 +210,7 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.ForceDelete != nil { reqQP.Set("forceDelete", strconv.FormatBool(*options.ForceDelete)) } @@ -214,7 +222,7 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -222,18 +230,21 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc // - extensionName - Name of the Extension. // - options - ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. func (client *ExtensionsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, options *ExtensionsClientGetOptions) (ExtensionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, options) if err != nil { return ExtensionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtensionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtensionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtensionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -268,7 +279,7 @@ func (client *ExtensionsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +296,7 @@ func (client *ExtensionsClient) getHandleResponse(resp *http.Response) (Extensio // NewListPager - List all Extensions in the cluster. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -347,7 +358,7 @@ func (client *ExtensionsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +376,7 @@ func (client *ExtensionsClient) listHandleResponse(resp *http.Response) (Extensi // BeginUpdate - Patch an existing Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -379,9 +390,10 @@ func (client *ExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -390,20 +402,22 @@ func (client *ExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Patch an existing Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *ExtensionsClient) update(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, patchExtension PatchExtension, options *ExtensionsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, patchExtension, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -438,8 +452,11 @@ func (client *ExtensionsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, patchExtension) + if err := runtime.MarshalAsJSON(req, patchExtension); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client_example_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client_example_test.go deleted file mode 100644 index ba38014b1c0b..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client_example_test.go +++ /dev/null @@ -1,480 +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. -// DO NOT EDIT. - -package armkubernetesconfiguration_test - -import ( - "context" - "log" - - "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/kubernetesconfiguration/armkubernetesconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/CreateExtension.json -func ExampleExtensionsClient_BeginCreate_createExtension() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginCreate(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "ClusterMonitor", armkubernetesconfiguration.Extension{ - Properties: &armkubernetesconfiguration.ExtensionProperties{ - AutoUpgradeMinorVersion: to.Ptr(true), - ConfigurationProtectedSettings: map[string]*string{ - "omsagent.secret.key": to.Ptr("secretKeyValue01"), - }, - ConfigurationSettings: map[string]*string{ - "omsagent.env.clusterName": to.Ptr("clusterName1"), - "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - }, - ExtensionType: to.Ptr("azuremonitor-containers"), - ReleaseTrain: to.Ptr("Preview"), - Scope: &armkubernetesconfiguration.Scope{ - Cluster: &armkubernetesconfiguration.ScopeCluster{ - ReleaseNamespace: to.Ptr("kube-system"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Extension = armkubernetesconfiguration.Extension{ - // Name: to.Ptr("ClusterMonitor"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/extensions"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/ClusterMonitor"), - // Properties: &armkubernetesconfiguration.ExtensionProperties{ - // AutoUpgradeMinorVersion: to.Ptr(false), - // ConfigurationSettings: map[string]*string{ - // "omsagent.env.clusterName": to.Ptr("clusterName1"), - // "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - // }, - // CurrentVersion: to.Ptr("0.1.4"), - // ExtensionType: to.Ptr("azuremonitor-containers"), - // IsSystemExtension: to.Ptr(false), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // ReleaseTrain: to.Ptr("Preview"), - // Scope: &armkubernetesconfiguration.Scope{ - // Cluster: &armkubernetesconfiguration.ScopeCluster{ - // ReleaseNamespace: to.Ptr("kube-system"), - // }, - // }, - // Statuses: []*armkubernetesconfiguration.ExtensionStatus{ - // }, - // Version: to.Ptr("0.1.4"), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/CreateExtensionWithPlan.json -func ExampleExtensionsClient_BeginCreate_createExtensionWithPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginCreate(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "azureVote", armkubernetesconfiguration.Extension{ - Plan: &armkubernetesconfiguration.Plan{ - Name: to.Ptr("azure-vote-standard"), - Product: to.Ptr("azure-vote-standard-offer-id"), - Publisher: to.Ptr("Microsoft"), - }, - Properties: &armkubernetesconfiguration.ExtensionProperties{ - AutoUpgradeMinorVersion: to.Ptr(true), - ExtensionType: to.Ptr("azure-vote"), - ReleaseTrain: to.Ptr("Preview"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Extension = armkubernetesconfiguration.Extension{ - // Name: to.Ptr("azureVote"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/extensions"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/azureVote"), - // Plan: &armkubernetesconfiguration.Plan{ - // Name: to.Ptr("azure-vote-standard"), - // Product: to.Ptr("azure-vote-standard-offer-id"), - // Publisher: to.Ptr("Microsoft"), - // }, - // Properties: &armkubernetesconfiguration.ExtensionProperties{ - // AutoUpgradeMinorVersion: to.Ptr(true), - // CurrentVersion: to.Ptr("0.1.4"), - // ExtensionType: to.Ptr("azure-vote"), - // IsSystemExtension: to.Ptr(false), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // ReleaseTrain: to.Ptr("Preview"), - // Scope: &armkubernetesconfiguration.Scope{ - // Cluster: &armkubernetesconfiguration.ScopeCluster{ - // ReleaseNamespace: to.Ptr("kube-system"), - // }, - // }, - // Statuses: []*armkubernetesconfiguration.ExtensionStatus{ - // }, - // Version: to.Ptr("0.1.4"), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/GetExtension.json -func ExampleExtensionsClient_Get_getExtension() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionsClient().Get(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "ClusterMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Extension = armkubernetesconfiguration.Extension{ - // Name: to.Ptr("ClusterMonitor"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/extensions"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/ClusterMonitor"), - // Properties: &armkubernetesconfiguration.ExtensionProperties{ - // AutoUpgradeMinorVersion: to.Ptr(false), - // ConfigurationSettings: map[string]*string{ - // "omsagent.env.clusterName": to.Ptr("clusterName1"), - // "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - // }, - // CurrentVersion: to.Ptr("0.1.4"), - // ExtensionType: to.Ptr("azuremonitor-containers"), - // IsSystemExtension: to.Ptr(false), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // ReleaseTrain: to.Ptr("Preview"), - // Scope: &armkubernetesconfiguration.Scope{ - // Cluster: &armkubernetesconfiguration.ScopeCluster{ - // ReleaseNamespace: to.Ptr("kube-system"), - // }, - // }, - // Statuses: []*armkubernetesconfiguration.ExtensionStatus{ - // }, - // Version: to.Ptr("0.1.4"), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/GetExtensionWithPlan.json -func ExampleExtensionsClient_Get_getExtensionWithPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionsClient().Get(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "azureVote", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Extension = armkubernetesconfiguration.Extension{ - // Name: to.Ptr("azureVote"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/extensions"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/azureVote"), - // Plan: &armkubernetesconfiguration.Plan{ - // Name: to.Ptr("azure-vote-standard"), - // Product: to.Ptr("azure-vote-standard-offer-id"), - // Publisher: to.Ptr("Microsoft"), - // }, - // Properties: &armkubernetesconfiguration.ExtensionProperties{ - // AutoUpgradeMinorVersion: to.Ptr(false), - // ConfigurationSettings: map[string]*string{ - // "omsagent.env.clusterName": to.Ptr("clusterName1"), - // "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - // }, - // CurrentVersion: to.Ptr("0.1.4"), - // ExtensionType: to.Ptr("azure-vote"), - // IsSystemExtension: to.Ptr(false), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // ReleaseTrain: to.Ptr("Preview"), - // Scope: &armkubernetesconfiguration.Scope{ - // Cluster: &armkubernetesconfiguration.ScopeCluster{ - // ReleaseNamespace: to.Ptr("kube-system"), - // }, - // }, - // Statuses: []*armkubernetesconfiguration.ExtensionStatus{ - // }, - // Version: to.Ptr("0.1.4"), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/DeleteExtension.json -func ExampleExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginDelete(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "ClusterMonitor", &armkubernetesconfiguration.ExtensionsClientBeginDeleteOptions{ForceDelete: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/PatchExtension.json -func ExampleExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginUpdate(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "ClusterMonitor", armkubernetesconfiguration.PatchExtension{ - Properties: &armkubernetesconfiguration.PatchExtensionProperties{ - AutoUpgradeMinorVersion: to.Ptr(true), - ConfigurationProtectedSettings: map[string]*string{ - "omsagent.secret.key": to.Ptr("secretKeyValue01"), - }, - ConfigurationSettings: map[string]*string{ - "omsagent.env.clusterName": to.Ptr("clusterName1"), - "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - }, - ReleaseTrain: to.Ptr("Preview"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Extension = armkubernetesconfiguration.Extension{ - // Properties: &armkubernetesconfiguration.ExtensionProperties{ - // AutoUpgradeMinorVersion: to.Ptr(true), - // ConfigurationSettings: map[string]*string{ - // "omsagent.env.clusterName": to.Ptr("clusterName1"), - // "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - // }, - // ExtensionType: to.Ptr("azuremonitor-containers"), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // ReleaseTrain: to.Ptr("Preview"), - // Scope: &armkubernetesconfiguration.Scope{ - // Cluster: &armkubernetesconfiguration.ScopeCluster{ - // ReleaseNamespace: to.Ptr("kube-system"), - // }, - // }, - // Statuses: []*armkubernetesconfiguration.ExtensionStatus{ - // }, - // Version: to.Ptr("0.1.4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/ListExtensions.json -func ExampleExtensionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExtensionsClient().NewListPager("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExtensionsList = armkubernetesconfiguration.ExtensionsList{ - // Value: []*armkubernetesconfiguration.Extension{ - // { - // Name: to.Ptr("ClusterMonitor"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/extensions"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/ClusterMonitor"), - // Properties: &armkubernetesconfiguration.ExtensionProperties{ - // AutoUpgradeMinorVersion: to.Ptr(false), - // ConfigurationSettings: map[string]*string{ - // "omsagent.env.clusterName": to.Ptr("clusterName1"), - // "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - // }, - // CurrentVersion: to.Ptr("0.1.4"), - // ExtensionType: to.Ptr("azuremonitor-containers"), - // IsSystemExtension: to.Ptr(false), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // ReleaseTrain: to.Ptr("Preview"), - // Scope: &armkubernetesconfiguration.Scope{ - // Cluster: &armkubernetesconfiguration.ScopeCluster{ - // ReleaseNamespace: to.Ptr("kube-system"), - // }, - // }, - // Statuses: []*armkubernetesconfiguration.ExtensionStatus{ - // }, - // Version: to.Ptr("0.1.4"), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // }, - // { - // Name: to.Ptr("App1Monitor"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/extensions"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/BackupVault01"), - // Properties: &armkubernetesconfiguration.ExtensionProperties{ - // AutoUpgradeMinorVersion: to.Ptr(true), - // ConfigurationSettings: map[string]*string{ - // }, - // CurrentVersion: to.Ptr("1.0.1"), - // ExtensionType: to.Ptr("Microsoft.RecoveryServices/recoveryVault"), - // IsSystemExtension: to.Ptr(false), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // ReleaseTrain: to.Ptr("Stable"), - // Scope: &armkubernetesconfiguration.Scope{ - // Cluster: &armkubernetesconfiguration.ScopeCluster{ - // ReleaseNamespace: to.Ptr("myKVNamespace"), - // }, - // }, - // Statuses: []*armkubernetesconfiguration.ExtensionStatus{ - // }, - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T04:09:23.011Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T04:09:23.011Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // }, - // { - // Name: to.Ptr("azureVote"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/extensions"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/azureVote"), - // Plan: &armkubernetesconfiguration.Plan{ - // Name: to.Ptr("azure-vote-standard"), - // Product: to.Ptr("azure-vote-standard-offer-id"), - // Publisher: to.Ptr("Microsoft"), - // }, - // Properties: &armkubernetesconfiguration.ExtensionProperties{ - // AutoUpgradeMinorVersion: to.Ptr(false), - // ConfigurationSettings: map[string]*string{ - // "omsagent.env.clusterName": to.Ptr("clusterName1"), - // "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - // }, - // CurrentVersion: to.Ptr("0.1.4"), - // ExtensionType: to.Ptr("azure-vote"), - // IsSystemExtension: to.Ptr(false), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // ReleaseTrain: to.Ptr("Preview"), - // Scope: &armkubernetesconfiguration.Scope{ - // Cluster: &armkubernetesconfiguration.ScopeCluster{ - // ReleaseNamespace: to.Ptr("kube-system"), - // }, - // }, - // Statuses: []*armkubernetesconfiguration.ExtensionStatus{ - // }, - // Version: to.Ptr("0.1.4"), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client.go index c7a50ca2b77b..8656b56f46d4 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -47,7 +46,7 @@ func NewFluxConfigOperationStatusClient(subscriptionID string, credential azcore // Get - Get Async Operation status // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -57,18 +56,21 @@ func NewFluxConfigOperationStatusClient(subscriptionID string, credential azcore // - options - FluxConfigOperationStatusClientGetOptions contains the optional parameters for the FluxConfigOperationStatusClient.Get // method. func (client *FluxConfigOperationStatusClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, operationID string, options *FluxConfigOperationStatusClientGetOptions) (FluxConfigOperationStatusClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, operationID, options) if err != nil { return FluxConfigOperationStatusClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FluxConfigOperationStatusClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FluxConfigOperationStatusClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FluxConfigOperationStatusClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -107,7 +109,7 @@ func (client *FluxConfigOperationStatusClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client_example_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client_example_test.go deleted file mode 100644 index c52c15da7f23..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client_example_test.go +++ /dev/null @@ -1,45 +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. -// DO NOT EDIT. - -package armkubernetesconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/GetFluxConfigurationAsyncOperationStatus.json -func ExampleFluxConfigOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFluxConfigOperationStatusClient().Get(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", "99999999-9999-9999-9999-999999999999", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armkubernetesconfiguration.OperationStatusResult{ - // Name: to.Ptr("99999999-9999-9999-9999-999999999999"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/srs-fluxconfig/operations/99999999-9999-9999-9999-999999999999"), - // Properties: map[string]*string{ - // }, - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client.go index f8fb48196131..297326505616 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -48,7 +47,7 @@ func NewFluxConfigurationsClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Create a new Kubernetes Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -63,9 +62,10 @@ func (client *FluxConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FluxConfigurationsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FluxConfigurationsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FluxConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,20 +74,22 @@ func (client *FluxConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create a new Kubernetes Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *FluxConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfiguration FluxConfiguration, options *FluxConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, fluxConfiguration, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -122,17 +124,20 @@ func (client *FluxConfigurationsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, fluxConfiguration) + if err := runtime.MarshalAsJSON(req, fluxConfiguration); err != nil { + return nil, err + } + return req, nil } // BeginDelete - This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the // source repo. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -146,9 +151,10 @@ func (client *FluxConfigurationsClient) BeginDelete(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FluxConfigurationsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FluxConfigurationsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FluxConfigurationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -158,20 +164,22 @@ func (client *FluxConfigurationsClient) BeginDelete(ctx context.Context, resourc // repo. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *FluxConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, options *FluxConfigurationsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -206,7 +214,7 @@ func (client *FluxConfigurationsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.ForceDelete != nil { reqQP.Set("forceDelete", strconv.FormatBool(*options.ForceDelete)) } @@ -218,7 +226,7 @@ func (client *FluxConfigurationsClient) deleteCreateRequest(ctx context.Context, // Get - Gets details of the Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -226,18 +234,21 @@ func (client *FluxConfigurationsClient) deleteCreateRequest(ctx context.Context, // - fluxConfigurationName - Name of the Flux Configuration. // - options - FluxConfigurationsClientGetOptions contains the optional parameters for the FluxConfigurationsClient.Get method. func (client *FluxConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, options *FluxConfigurationsClientGetOptions) (FluxConfigurationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, options) if err != nil { return FluxConfigurationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FluxConfigurationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FluxConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FluxConfigurationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -272,7 +283,7 @@ func (client *FluxConfigurationsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -289,7 +300,7 @@ func (client *FluxConfigurationsClient) getHandleResponse(resp *http.Response) ( // NewListPager - List all Flux Configurations. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -352,7 +363,7 @@ func (client *FluxConfigurationsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,7 +381,7 @@ func (client *FluxConfigurationsClient) listHandleResponse(resp *http.Response) // BeginUpdate - Update an existing Kubernetes Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -385,9 +396,10 @@ func (client *FluxConfigurationsClient) BeginUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FluxConfigurationsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FluxConfigurationsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FluxConfigurationsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -396,20 +408,22 @@ func (client *FluxConfigurationsClient) BeginUpdate(ctx context.Context, resourc // Update - Update an existing Kubernetes Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *FluxConfigurationsClient) update(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfigurationPatch FluxConfigurationPatch, options *FluxConfigurationsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, fluxConfigurationPatch, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -444,8 +458,11 @@ func (client *FluxConfigurationsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, fluxConfigurationPatch) + if err := runtime.MarshalAsJSON(req, fluxConfigurationPatch); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client_example_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client_example_test.go deleted file mode 100644 index 21953749c357..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client_example_test.go +++ /dev/null @@ -1,802 +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. -// DO NOT EDIT. - -package armkubernetesconfiguration_test - -import ( - "context" - "log" - - "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/kubernetesconfiguration/armkubernetesconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/GetFluxConfiguration.json -func ExampleFluxConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFluxConfigurationsClient().Get(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FluxConfiguration = armkubernetesconfiguration.FluxConfiguration{ - // Name: to.Ptr("srs-fluxconfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/srs-fluxconfig"), - // Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // ErrorMessage: to.Ptr(""), - // GitRepository: &armkubernetesconfiguration.GitRepositoryDefinition{ - // RepositoryRef: &armkubernetesconfiguration.RepositoryRefDefinition{ - // Branch: to.Ptr("master"), - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // URL: to.Ptr("https://github.com/Azure/arc-k8s-demo"), - // }, - // Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - // "srs-kustomization1": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization1"), - // Path: to.Ptr("./test/path"), - // DependsOn: []*string{ - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // "srs-kustomization2": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization2"), - // Path: to.Ptr("./other/test/path"), - // DependsOn: []*string{ - // to.Ptr("srs-kustomization1")}, - // Prune: to.Ptr(false), - // RetryIntervalInSeconds: to.Ptr[int64](600), - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // }, - // Namespace: to.Ptr("srs-namespace"), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // RepositoryPublicKey: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDiNkrANrhtRy+02Xc7b5bwvgOKvQMbqUQaXeB6FCDkbLaavw/zO/vIhIBEQu+vbBt6IlI/Pui0rMFr5JjA8Vwwd85oabzU07TPzbFvKSU9eCXqWRKWf0DHNQj/kxPJNtyPYFv3lGoiZZ6QzejOxlW/lPPokUePN0oI10daWwqznm2q0Cmh1EgPUYveq3J5KCWncZXCdwY36zWYulCWFaqazoaGy4kxcqlVy+mPjE/UJthaoLm3mq+23uhlmmfCc1j7W6+H6fcOwTyOtcbimxz2Ug8HlTzSTXBPtEe7qyllMyk62EPNUUq4bVoVsex9sKBK6/hW0Cn2P5i5jslUPCQF"), - // Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - // SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeGitRepository), - // SourceSyncedCommitID: to.Ptr("master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590"), - // SourceUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // StatusUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // Statuses: []*armkubernetesconfiguration.ObjectStatusDefinition{ - // { - // Name: to.Ptr("srs-fluxconfig"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("GitRepository"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Fetched revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("GitOperationSucceed"), - // Status: to.Ptr("True"), - // }}, - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization1"), - // AppliedBy: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("my-name"), - // Namespace: to.Ptr("my-namespace"), - // }, - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // HelmReleaseProperties: &armkubernetesconfiguration.HelmReleasePropertiesDefinition{ - // HelmChartRef: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("myname"), - // Namespace: to.Ptr("mynamespace"), - // }, - // LastRevisionApplied: to.Ptr[int64](1), - // }, - // Kind: to.Ptr("Kustomization"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Applied revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("ReconciliationSucceeded"), - // Status: to.Ptr("True"), - // }}, - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization2"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // HelmReleaseProperties: &armkubernetesconfiguration.HelmReleasePropertiesDefinition{ - // HelmChartRef: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("myname"), - // Namespace: to.Ptr("mynamespace"), - // }, - // LastRevisionApplied: to.Ptr[int64](1), - // }, - // Kind: to.Ptr("Kustomization"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Applied revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("ReconciliationSucceeded"), - // Status: to.Ptr("True"), - // }}, - // }}, - // Suspend: to.Ptr(false), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-19T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/CreateFluxConfiguration.json -func ExampleFluxConfigurationsClient_BeginCreateOrUpdate_createFluxConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFluxConfigurationsClient().BeginCreateOrUpdate(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", armkubernetesconfiguration.FluxConfiguration{ - Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - GitRepository: &armkubernetesconfiguration.GitRepositoryDefinition{ - HTTPSCACert: to.Ptr("ZXhhbXBsZWNlcnRpZmljYXRl"), - RepositoryRef: &armkubernetesconfiguration.RepositoryRefDefinition{ - Branch: to.Ptr("master"), - }, - SyncIntervalInSeconds: to.Ptr[int64](600), - TimeoutInSeconds: to.Ptr[int64](600), - URL: to.Ptr("https://github.com/Azure/arc-k8s-demo"), - }, - Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - "srs-kustomization1": { - Path: to.Ptr("./test/path"), - DependsOn: []*string{}, - SyncIntervalInSeconds: to.Ptr[int64](600), - TimeoutInSeconds: to.Ptr[int64](600), - }, - "srs-kustomization2": { - Path: to.Ptr("./other/test/path"), - DependsOn: []*string{ - to.Ptr("srs-kustomization1")}, - Prune: to.Ptr(false), - RetryIntervalInSeconds: to.Ptr[int64](600), - SyncIntervalInSeconds: to.Ptr[int64](600), - TimeoutInSeconds: to.Ptr[int64](600), - }, - }, - Namespace: to.Ptr("srs-namespace"), - Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeGitRepository), - Suspend: to.Ptr(false), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FluxConfiguration = armkubernetesconfiguration.FluxConfiguration{ - // Name: to.Ptr("srs-fluxconfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/srs-fluxconfig"), - // Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // ErrorMessage: to.Ptr(""), - // GitRepository: &armkubernetesconfiguration.GitRepositoryDefinition{ - // HTTPSCACert: to.Ptr("ZXhhbXBsZWNlcnRpZmljYXRl"), - // RepositoryRef: &armkubernetesconfiguration.RepositoryRefDefinition{ - // Branch: to.Ptr("master"), - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // URL: to.Ptr("https://github.com/Azure/arc-k8s-demo"), - // }, - // Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - // "srs-kustomization1": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization1"), - // Path: to.Ptr("./test/path"), - // DependsOn: []*string{ - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // "srs-kustomization2": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization2"), - // Path: to.Ptr("./other/test/path"), - // DependsOn: []*string{ - // to.Ptr("srs-kustomization1")}, - // Prune: to.Ptr(false), - // RetryIntervalInSeconds: to.Ptr[int64](600), - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // }, - // Namespace: to.Ptr("srs-namespace"), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // RepositoryPublicKey: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDiNkrANrhtRy+02Xc7b5bwvgOKvQMbqUQaXeB6FCDkbLaavw/zO/vIhIBEQu+vbBt6IlI/Pui0rMFr5JjA8Vwwd85oabzU07TPzbFvKSU9eCXqWRKWf0DHNQj/kxPJNtyPYFv3lGoiZZ6QzejOxlW/lPPokUePN0oI10daWwqznm2q0Cmh1EgPUYveq3J5KCWncZXCdwY36zWYulCWFaqazoaGy4kxcqlVy+mPjE/UJthaoLm3mq+23uhlmmfCc1j7W6+H6fcOwTyOtcbimxz2Ug8HlTzSTXBPtEe7qyllMyk62EPNUUq4bVoVsex9sKBK6/hW0Cn2P5i5jslUPCQF"), - // Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - // SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeGitRepository), - // SourceSyncedCommitID: to.Ptr("master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590"), - // SourceUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // StatusUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // Statuses: []*armkubernetesconfiguration.ObjectStatusDefinition{ - // { - // Name: to.Ptr("srs-fluxconfig"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("GitRepository"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Fetched revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("GitOperationSucceed"), - // Status: to.Ptr("True"), - // }}, - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization1"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // HelmReleaseProperties: &armkubernetesconfiguration.HelmReleasePropertiesDefinition{ - // HelmChartRef: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("myname"), - // Namespace: to.Ptr("mynamespace"), - // }, - // LastRevisionApplied: to.Ptr[int64](1), - // }, - // Kind: to.Ptr("Kustomization"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Applied revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("ReconciliationSucceeded"), - // Status: to.Ptr("True"), - // }}, - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization2"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // HelmReleaseProperties: &armkubernetesconfiguration.HelmReleasePropertiesDefinition{ - // HelmChartRef: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("myname"), - // Namespace: to.Ptr("mynamespace"), - // }, - // LastRevisionApplied: to.Ptr[int64](1), - // }, - // Kind: to.Ptr("Kustomization"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Applied revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("ReconciliationSucceeded"), - // Status: to.Ptr("True"), - // }}, - // }}, - // Suspend: to.Ptr(false), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-19T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/CreateFluxConfigurationWithBucket.json -func ExampleFluxConfigurationsClient_BeginCreateOrUpdate_createFluxConfigurationWithBucketSourceKind() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFluxConfigurationsClient().BeginCreateOrUpdate(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", armkubernetesconfiguration.FluxConfiguration{ - Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - Bucket: &armkubernetesconfiguration.BucketDefinition{ - AccessKey: to.Ptr("fluxminiotest"), - BucketName: to.Ptr("flux"), - SyncIntervalInSeconds: to.Ptr[int64](1000), - TimeoutInSeconds: to.Ptr[int64](1000), - URL: to.Ptr("https://fluxminiotest.az.minio.io"), - }, - Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - "srs-kustomization1": { - Path: to.Ptr("./test/path"), - DependsOn: []*string{}, - SyncIntervalInSeconds: to.Ptr[int64](600), - TimeoutInSeconds: to.Ptr[int64](600), - }, - "srs-kustomization2": { - Path: to.Ptr("./other/test/path"), - DependsOn: []*string{ - to.Ptr("srs-kustomization1")}, - Prune: to.Ptr(false), - RetryIntervalInSeconds: to.Ptr[int64](600), - SyncIntervalInSeconds: to.Ptr[int64](600), - TimeoutInSeconds: to.Ptr[int64](600), - }, - }, - Namespace: to.Ptr("srs-namespace"), - Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeBucket), - Suspend: to.Ptr(false), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FluxConfiguration = armkubernetesconfiguration.FluxConfiguration{ - // Name: to.Ptr("srs-fluxconfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/srs-fluxconfig"), - // Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - // Bucket: &armkubernetesconfiguration.BucketDefinition{ - // AccessKey: to.Ptr("fluxminiotest"), - // BucketName: to.Ptr("flux"), - // SyncIntervalInSeconds: to.Ptr[int64](1000), - // TimeoutInSeconds: to.Ptr[int64](1000), - // URL: to.Ptr("https://fluxminiotest.az.minio.io"), - // }, - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // ErrorMessage: to.Ptr(""), - // Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - // "srs-kustomization1": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization1"), - // Path: to.Ptr("./test/path"), - // DependsOn: []*string{ - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // "srs-kustomization2": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization2"), - // Path: to.Ptr("./other/test/path"), - // DependsOn: []*string{ - // to.Ptr("srs-kustomization1")}, - // Prune: to.Ptr(false), - // RetryIntervalInSeconds: to.Ptr[int64](600), - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // }, - // Namespace: to.Ptr("srs-namespace"), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // RepositoryPublicKey: to.Ptr(""), - // Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - // SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeBucket), - // SourceSyncedCommitID: to.Ptr("0ba6f0d30760d567de0bac86c8c4eec13ce1a590"), - // SourceUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // StatusUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // Statuses: []*armkubernetesconfiguration.ObjectStatusDefinition{ - // { - // Name: to.Ptr("srs-fluxconfig"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("Bucket"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T07:17:30+00:00"); return t}()), - // Message: to.Ptr("stored artifact for revision '55396be14f18fa2b977c1f22becef26a94d1d9a7ccb1e19d12f9cac52d757a84'"), - // Reason: to.Ptr("Succeeded"), - // Status: to.Ptr("True"), - // }}, - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization1"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // HelmReleaseProperties: &armkubernetesconfiguration.HelmReleasePropertiesDefinition{ - // HelmChartRef: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("myname"), - // Namespace: to.Ptr("mynamespace"), - // }, - // LastRevisionApplied: to.Ptr[int64](1), - // }, - // Kind: to.Ptr("Kustomization"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Applied revision: 0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("ReconciliationSucceeded"), - // Status: to.Ptr("True"), - // }}, - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization2"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // HelmReleaseProperties: &armkubernetesconfiguration.HelmReleasePropertiesDefinition{ - // HelmChartRef: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("myname"), - // Namespace: to.Ptr("mynamespace"), - // }, - // LastRevisionApplied: to.Ptr[int64](1), - // }, - // Kind: to.Ptr("Kustomization"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Applied revision: 0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("ReconciliationSucceeded"), - // Status: to.Ptr("True"), - // }}, - // }}, - // Suspend: to.Ptr(false), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-19T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/PatchFluxConfiguration.json -func ExampleFluxConfigurationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFluxConfigurationsClient().BeginUpdate(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", armkubernetesconfiguration.FluxConfigurationPatch{ - Properties: &armkubernetesconfiguration.FluxConfigurationPatchProperties{ - GitRepository: &armkubernetesconfiguration.GitRepositoryPatchDefinition{ - URL: to.Ptr("https://github.com/jonathan-innis/flux2-kustomize-helm-example.git"), - }, - Kustomizations: map[string]*armkubernetesconfiguration.KustomizationPatchDefinition{ - "srs-kustomization1": nil, - "srs-kustomization2": { - Path: to.Ptr("./test/alt-path"), - SyncIntervalInSeconds: to.Ptr[int64](300), - }, - "srs-kustomization3": { - Path: to.Ptr("./test/another-path"), - SyncIntervalInSeconds: to.Ptr[int64](300), - }, - }, - Suspend: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FluxConfiguration = armkubernetesconfiguration.FluxConfiguration{ - // Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // ErrorMessage: to.Ptr(""), - // GitRepository: &armkubernetesconfiguration.GitRepositoryDefinition{ - // RepositoryRef: &armkubernetesconfiguration.RepositoryRefDefinition{ - // Branch: to.Ptr("master"), - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // URL: to.Ptr("https://github.com/jonathan-innis/flux2-kustomize-helm-example.git"), - // }, - // Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - // "srs-kustomization2": &armkubernetesconfiguration.KustomizationDefinition{ - // Path: to.Ptr("./test/alt-path"), - // Prune: to.Ptr(false), - // RetryIntervalInSeconds: to.Ptr[int64](600), - // SyncIntervalInSeconds: to.Ptr[int64](300), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // "srs-kustomization3": &armkubernetesconfiguration.KustomizationDefinition{ - // Path: to.Ptr("./test/another-path"), - // Prune: to.Ptr(false), - // SyncIntervalInSeconds: to.Ptr[int64](300), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // }, - // Namespace: to.Ptr("srs-namespace"), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // RepositoryPublicKey: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDiNkrANrhtRy+02Xc7b5bwvgOKvQMbqUQaXeB6FCDkbLaavw/zO/vIhIBEQu+vbBt6IlI/Pui0rMFr5JjA8Vwwd85oabzU07TPzbFvKSU9eCXqWRKWf0DHNQj/kxPJNtyPYFv3lGoiZZ6QzejOxlW/lPPokUePN0oI10daWwqznm2q0Cmh1EgPUYveq3J5KCWncZXCdwY36zWYulCWFaqazoaGy4kxcqlVy+mPjE/UJthaoLm3mq+23uhlmmfCc1j7W6+H6fcOwTyOtcbimxz2Ug8HlTzSTXBPtEe7qyllMyk62EPNUUq4bVoVsex9sKBK6/hW0Cn2P5i5jslUPCQF"), - // Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - // SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeGitRepository), - // SourceSyncedCommitID: to.Ptr("master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590"), - // SourceUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // StatusUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // Statuses: []*armkubernetesconfiguration.ObjectStatusDefinition{ - // { - // Name: to.Ptr("srs-fluxconfig"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("GitRepository"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Fetched revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("GitOperationSucceed"), - // Status: to.Ptr("True"), - // }}, - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization1"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // HelmReleaseProperties: &armkubernetesconfiguration.HelmReleasePropertiesDefinition{ - // HelmChartRef: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("myname"), - // Namespace: to.Ptr("mynamespace"), - // }, - // LastRevisionApplied: to.Ptr[int64](1), - // }, - // Kind: to.Ptr("Kustomization"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Applied revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("ReconciliationSucceeded"), - // Status: to.Ptr("True"), - // }}, - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization2"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // HelmReleaseProperties: &armkubernetesconfiguration.HelmReleasePropertiesDefinition{ - // HelmChartRef: &armkubernetesconfiguration.ObjectReferenceDefinition{ - // Name: to.Ptr("myname"), - // Namespace: to.Ptr("mynamespace"), - // }, - // LastRevisionApplied: to.Ptr[int64](1), - // }, - // Kind: to.Ptr("Kustomization"), - // StatusConditions: []*armkubernetesconfiguration.ObjectStatusConditionDefinition{ - // { - // Type: to.Ptr("Ready"), - // LastTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:12:40Z"); return t}()), - // Message: to.Ptr("'Applied revision: master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590'"), - // Reason: to.Ptr("ReconciliationSucceeded"), - // Status: to.Ptr("True"), - // }}, - // }}, - // Suspend: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/DeleteFluxConfiguration.json -func ExampleFluxConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFluxConfigurationsClient().BeginDelete(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "srs-fluxconfig", &armkubernetesconfiguration.FluxConfigurationsClientBeginDeleteOptions{ForceDelete: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/ListFluxConfigurations.json -func ExampleFluxConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFluxConfigurationsClient().NewListPager("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FluxConfigurationsList = armkubernetesconfiguration.FluxConfigurationsList{ - // Value: []*armkubernetesconfiguration.FluxConfiguration{ - // { - // Name: to.Ptr("srs-fluxconfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/srs-fluxconfig"), - // Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // ErrorMessage: to.Ptr(""), - // GitRepository: &armkubernetesconfiguration.GitRepositoryDefinition{ - // RepositoryRef: &armkubernetesconfiguration.RepositoryRefDefinition{ - // Branch: to.Ptr("master"), - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // URL: to.Ptr("https://github.com/Azure/arc-k8s-demo"), - // }, - // Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - // "srs-kustomization1": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization1"), - // Path: to.Ptr("./test/path"), - // DependsOn: []*string{ - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // "srs-kustomization2": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization2"), - // Path: to.Ptr("./other/test/path"), - // DependsOn: []*string{ - // to.Ptr("srs-kustomization1")}, - // Prune: to.Ptr(false), - // RetryIntervalInSeconds: to.Ptr[int64](600), - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // }, - // Namespace: to.Ptr("srs-namespace"), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // RepositoryPublicKey: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDiNkrANrhtRy+02Xc7b5bwvgOKvQMbqUQaXeB6FCDkbLaavw/zO/vIhIBEQu+vbBt6IlI/Pui0rMFr5JjA8Vwwd85oabzU07TPzbFvKSU9eCXqWRKWf0DHNQj/kxPJNtyPYFv3lGoiZZ6QzejOxlW/lPPokUePN0oI10daWwqznm2q0Cmh1EgPUYveq3J5KCWncZXCdwY36zWYulCWFaqazoaGy4kxcqlVy+mPjE/UJthaoLm3mq+23uhlmmfCc1j7W6+H6fcOwTyOtcbimxz2Ug8HlTzSTXBPtEe7qyllMyk62EPNUUq4bVoVsex9sKBK6/hW0Cn2P5i5jslUPCQF"), - // Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - // SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeGitRepository), - // SourceSyncedCommitID: to.Ptr("master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590"), - // SourceUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // StatusUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // Statuses: []*armkubernetesconfiguration.ObjectStatusDefinition{ - // { - // Name: to.Ptr("srs-fluxconfig"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("GitRepository"), - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization1"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("Kustomization"), - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization2"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("Kustomization"), - // }}, - // Suspend: to.Ptr(false), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-19T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // }, - // { - // Name: to.Ptr("srs-fluxconfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/srs-fluxconfig"), - // Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // ErrorMessage: to.Ptr(""), - // GitRepository: &armkubernetesconfiguration.GitRepositoryDefinition{ - // RepositoryRef: &armkubernetesconfiguration.RepositoryRefDefinition{ - // Branch: to.Ptr("master"), - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // URL: to.Ptr("https://github.com/Azure/arc-k8s-demo"), - // }, - // Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - // "srs-kustomization1": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization1"), - // Path: to.Ptr("./test/path"), - // DependsOn: []*string{ - // }, - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // "srs-kustomization2": &armkubernetesconfiguration.KustomizationDefinition{ - // Name: to.Ptr("srs-kustomization2"), - // Path: to.Ptr("./other/test/path"), - // DependsOn: []*string{ - // to.Ptr("srs-kustomization1")}, - // Prune: to.Ptr(false), - // RetryIntervalInSeconds: to.Ptr[int64](600), - // SyncIntervalInSeconds: to.Ptr[int64](600), - // TimeoutInSeconds: to.Ptr[int64](600), - // }, - // }, - // Namespace: to.Ptr("srs-namespace"), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateSucceeded), - // RepositoryPublicKey: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDiNkrANrhtRy+02Xc7b5bwvgOKvQMbqUQaXeB6FCDkbLaavw/zO/vIhIBEQu+vbBt6IlI/Pui0rMFr5JjA8Vwwd85oabzU07TPzbFvKSU9eCXqWRKWf0DHNQj/kxPJNtyPYFv3lGoiZZ6QzejOxlW/lPPokUePN0oI10daWwqznm2q0Cmh1EgPUYveq3J5KCWncZXCdwY36zWYulCWFaqazoaGy4kxcqlVy+mPjE/UJthaoLm3mq+23uhlmmfCc1j7W6+H6fcOwTyOtcbimxz2Ug8HlTzSTXBPtEe7qyllMyk62EPNUUq4bVoVsex9sKBK6/hW0Cn2P5i5jslUPCQF"), - // Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - // SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeGitRepository), - // SourceSyncedCommitID: to.Ptr("master/0ba6f0d30760d567de0bac86c8c4eec13ce1a590"), - // SourceUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // StatusUpdatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T18:17:12Z"); return t}()), - // Statuses: []*armkubernetesconfiguration.ObjectStatusDefinition{ - // { - // Name: to.Ptr("srs-fluxconfig"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("GitRepository"), - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization1"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("Kustomization"), - // }, - // { - // Name: to.Ptr("srs-fluxconfig-srs-kustomization2"), - // ComplianceState: to.Ptr(armkubernetesconfiguration.FluxComplianceStateCompliant), - // Kind: to.Ptr("Kustomization"), - // }}, - // Suspend: to.Ptr(false), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-19T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-19T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.mod b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.mod index 8ae1095ba3b1..c1cf353d46cc 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.mod +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfigura go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.sum b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.sum +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= 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/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/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/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models.go index 5ae66d67ab94..9aa96ca5d5fc 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -277,36 +276,6 @@ type ExtensionStatus struct { Time *string } -// ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. -type ExtensionsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. -type ExtensionsClientBeginDeleteOptions struct { - // Delete the extension resource in Azure - not the normal asynchronous delete. - ForceDelete *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientBeginUpdateOptions contains the optional parameters for the ExtensionsClient.BeginUpdate method. -type ExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. -type ExtensionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExtensionsClientListOptions contains the optional parameters for the ExtensionsClient.NewListPager method. -type ExtensionsClientListOptions struct { - // placeholder for future optional parameters -} - // ExtensionsList - Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get // the next set of results. type ExtensionsList struct { @@ -317,12 +286,6 @@ type ExtensionsList struct { Value []*Extension } -// FluxConfigOperationStatusClientGetOptions contains the optional parameters for the FluxConfigOperationStatusClient.Get -// method. -type FluxConfigOperationStatusClientGetOptions struct { - // placeholder for future optional parameters -} - // FluxConfiguration - The Flux Configuration object returned in Get & Put response. type FluxConfiguration struct { // Properties to create a Flux Configuration resource @@ -392,6 +355,9 @@ type FluxConfigurationProperties struct { // period only. Namespace *string + // Maximum duration to wait for flux configuration reconciliation. E.g PT1H, PT5M, P1D + ReconciliationWaitDuration *string + // Scope at which the operator will be installed. Scope *ScopeType @@ -401,6 +367,9 @@ type FluxConfigurationProperties struct { // Whether this configuration should suspend its reconciliation of its kustomizations and sources. Suspend *bool + // Whether flux configuration deployment should wait for cluster to reconcile the kustomizations. + WaitForReconciliation *bool + // READ-ONLY; Combined status of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed // objects. ComplianceState *FluxComplianceState @@ -428,39 +397,6 @@ type FluxConfigurationProperties struct { Statuses []*ObjectStatusDefinition } -// FluxConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the FluxConfigurationsClient.BeginCreateOrUpdate -// method. -type FluxConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FluxConfigurationsClientBeginDeleteOptions contains the optional parameters for the FluxConfigurationsClient.BeginDelete -// method. -type FluxConfigurationsClientBeginDeleteOptions struct { - // Delete the extension resource in Azure - not the normal asynchronous delete. - ForceDelete *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FluxConfigurationsClientBeginUpdateOptions contains the optional parameters for the FluxConfigurationsClient.BeginUpdate -// method. -type FluxConfigurationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FluxConfigurationsClientGetOptions contains the optional parameters for the FluxConfigurationsClient.Get method. -type FluxConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// FluxConfigurationsClientListOptions contains the optional parameters for the FluxConfigurationsClient.NewListPager method. -type FluxConfigurationsClientListOptions struct { - // placeholder for future optional parameters -} - // FluxConfigurationsList - Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects // and a URL link to get the next set of results. type FluxConfigurationsList struct { @@ -578,6 +514,9 @@ type KustomizationDefinition struct { // The path in the source reference to reconcile on the cluster. Path *string + // Used for variable substitution for this Kustomization after kustomize build. + PostBuild *PostBuildDefinition + // Enable/disable garbage collections of Kubernetes objects created by this Kustomization. Prune *bool @@ -590,6 +529,9 @@ type KustomizationDefinition struct { // The maximum time to attempt to reconcile the Kustomization on the cluster. TimeoutInSeconds *int64 + // Enable/disable health check for all Kubernetes objects created by this Kustomization. + Wait *bool + // READ-ONLY; Name of the Kustomization, matching the key in the Kustomizations object map. Name *string } @@ -607,6 +549,9 @@ type KustomizationPatchDefinition struct { // The path in the source reference to reconcile on the cluster. Path *string + // Used for variable substitution for this Kustomization after kustomize build. + PostBuild *PostBuildDefinition + // Enable/disable garbage collections of Kubernetes objects created by this Kustomization. Prune *bool @@ -618,6 +563,9 @@ type KustomizationPatchDefinition struct { // The maximum time to attempt to reconcile the Kustomization on the cluster. TimeoutInSeconds *int64 + + // Enable/disable health check for all Kubernetes objects created by this Kustomization. + Wait *bool } // ManagedIdentityDefinition - Parameters to authenticate using a Managed Identity. @@ -683,16 +631,6 @@ type ObjectStatusDefinition struct { StatusConditions []*ObjectStatusConditionDefinition } -// OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method. -type OperationStatusClientGetOptions struct { - // placeholder for future optional parameters -} - -// OperationStatusClientListOptions contains the optional parameters for the OperationStatusClient.NewListPager method. -type OperationStatusClientListOptions struct { - // placeholder for future optional parameters -} - // OperationStatusList - The async operations in progress, in the cluster. type OperationStatusList struct { // READ-ONLY; URL to get the next set of Operation Result objects, if any. @@ -720,11 +658,6 @@ type OperationStatusResult struct { Error *ErrorDetail } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // PatchExtension - The Extension Patch Request object. type PatchExtension struct { // Updatable properties of an Extension Patch Request @@ -769,6 +702,16 @@ type Plan struct { Version *string } +// PostBuildDefinition - The postBuild definitions defining variable substitutions for this Kustomization after kustomize +// build. +type PostBuildDefinition struct { + // Key/value pairs holding the variables to be substituted in this Kustomization. + Substitute map[string]*string + + // Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. + SubstituteFrom []*SubstituteFromDefinition +} + // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -987,29 +930,16 @@ type SourceControlConfigurationProperties struct { RepositoryPublicKey *string } -// SourceControlConfigurationsClientBeginDeleteOptions contains the optional parameters for the SourceControlConfigurationsClient.BeginDelete -// method. -type SourceControlConfigurationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SourceControlConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SourceControlConfigurationsClient.CreateOrUpdate -// method. -type SourceControlConfigurationsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} +// SubstituteFromDefinition - Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization. +type SubstituteFromDefinition struct { + // Define whether it is ConfigMap or Secret that holds the variables to be used in substitution. + Kind *string -// SourceControlConfigurationsClientGetOptions contains the optional parameters for the SourceControlConfigurationsClient.Get -// method. -type SourceControlConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} + // Name of the ConfigMap/Secret that holds the variables to be used in substitution. + Name *string -// SourceControlConfigurationsClientListOptions contains the optional parameters for the SourceControlConfigurationsClient.NewListPager -// method. -type SourceControlConfigurationsClientListOptions struct { - // placeholder for future optional parameters + // Set to True to proceed without ConfigMap/Secret, if it is not present. + Optional *bool } // SystemData - Metadata pertaining to creation and last modification of the resource. diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models_serde.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models_serde.go index 1e8e728c457c..1a3ed4516db7 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models_serde.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -752,6 +751,7 @@ func (f FluxConfigurationProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "kustomizations", f.Kustomizations) populate(objectMap, "namespace", f.Namespace) populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "reconciliationWaitDuration", f.ReconciliationWaitDuration) populate(objectMap, "repositoryPublicKey", f.RepositoryPublicKey) populate(objectMap, "scope", f.Scope) populate(objectMap, "sourceKind", f.SourceKind) @@ -760,6 +760,7 @@ func (f FluxConfigurationProperties) MarshalJSON() ([]byte, error) { populateTimeRFC3339(objectMap, "statusUpdatedAt", f.StatusUpdatedAt) populate(objectMap, "statuses", f.Statuses) populate(objectMap, "suspend", f.Suspend) + populate(objectMap, "waitForReconciliation", f.WaitForReconciliation) return json.Marshal(objectMap) } @@ -799,6 +800,9 @@ func (f *FluxConfigurationProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) delete(rawMsg, key) + case "reconciliationWaitDuration": + err = unpopulate(val, "ReconciliationWaitDuration", &f.ReconciliationWaitDuration) + delete(rawMsg, key) case "repositoryPublicKey": err = unpopulate(val, "RepositoryPublicKey", &f.RepositoryPublicKey) delete(rawMsg, key) @@ -823,6 +827,9 @@ func (f *FluxConfigurationProperties) UnmarshalJSON(data []byte) error { case "suspend": err = unpopulate(val, "Suspend", &f.Suspend) delete(rawMsg, key) + case "waitForReconciliation": + err = unpopulate(val, "WaitForReconciliation", &f.WaitForReconciliation) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) @@ -1088,10 +1095,12 @@ func (k KustomizationDefinition) MarshalJSON() ([]byte, error) { populate(objectMap, "force", k.Force) populate(objectMap, "name", k.Name) populate(objectMap, "path", k.Path) + populate(objectMap, "postBuild", k.PostBuild) populate(objectMap, "prune", k.Prune) populate(objectMap, "retryIntervalInSeconds", k.RetryIntervalInSeconds) populate(objectMap, "syncIntervalInSeconds", k.SyncIntervalInSeconds) populate(objectMap, "timeoutInSeconds", k.TimeoutInSeconds) + populate(objectMap, "wait", k.Wait) return json.Marshal(objectMap) } @@ -1116,6 +1125,9 @@ func (k *KustomizationDefinition) UnmarshalJSON(data []byte) error { case "path": err = unpopulate(val, "Path", &k.Path) delete(rawMsg, key) + case "postBuild": + err = unpopulate(val, "PostBuild", &k.PostBuild) + delete(rawMsg, key) case "prune": err = unpopulate(val, "Prune", &k.Prune) delete(rawMsg, key) @@ -1128,6 +1140,9 @@ func (k *KustomizationDefinition) UnmarshalJSON(data []byte) error { case "timeoutInSeconds": err = unpopulate(val, "TimeoutInSeconds", &k.TimeoutInSeconds) delete(rawMsg, key) + case "wait": + err = unpopulate(val, "Wait", &k.Wait) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", k, err) @@ -1142,10 +1157,12 @@ func (k KustomizationPatchDefinition) MarshalJSON() ([]byte, error) { populate(objectMap, "dependsOn", k.DependsOn) populate(objectMap, "force", k.Force) populate(objectMap, "path", k.Path) + populate(objectMap, "postBuild", k.PostBuild) populate(objectMap, "prune", k.Prune) populate(objectMap, "retryIntervalInSeconds", k.RetryIntervalInSeconds) populate(objectMap, "syncIntervalInSeconds", k.SyncIntervalInSeconds) populate(objectMap, "timeoutInSeconds", k.TimeoutInSeconds) + populate(objectMap, "wait", k.Wait) return json.Marshal(objectMap) } @@ -1167,6 +1184,9 @@ func (k *KustomizationPatchDefinition) UnmarshalJSON(data []byte) error { case "path": err = unpopulate(val, "Path", &k.Path) delete(rawMsg, key) + case "postBuild": + err = unpopulate(val, "PostBuild", &k.PostBuild) + delete(rawMsg, key) case "prune": err = unpopulate(val, "Prune", &k.Prune) delete(rawMsg, key) @@ -1179,6 +1199,9 @@ func (k *KustomizationPatchDefinition) UnmarshalJSON(data []byte) error { case "timeoutInSeconds": err = unpopulate(val, "TimeoutInSeconds", &k.TimeoutInSeconds) delete(rawMsg, key) + case "wait": + err = unpopulate(val, "Wait", &k.Wait) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", k, err) @@ -1553,6 +1576,37 @@ func (p *Plan) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PostBuildDefinition. +func (p PostBuildDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "substitute", p.Substitute) + populate(objectMap, "substituteFrom", p.SubstituteFrom) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PostBuildDefinition. +func (p *PostBuildDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "substitute": + err = unpopulate(val, "Substitute", &p.Substitute) + delete(rawMsg, key) + case "substituteFrom": + err = unpopulate(val, "SubstituteFrom", &p.SubstituteFrom) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2099,6 +2153,41 @@ func (s *SourceControlConfigurationProperties) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type SubstituteFromDefinition. +func (s SubstituteFromDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "name", s.Name) + populate(objectMap, "optional", s.Optional) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubstituteFromDefinition. +func (s *SubstituteFromDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "optional": + err = unpopulate(val, "Optional", &s.Optional) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client.go index bcc0311ef7d2..a9c3cfdb7ad6 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List all the available operations the KubernetesConfiguration resource provider supports. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client_example_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client_example_test.go deleted file mode 100644 index 4d97d6f254e3..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client_example_test.go +++ /dev/null @@ -1,189 +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. -// DO NOT EDIT. - -package armkubernetesconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceProviderOperationList = armkubernetesconfiguration.ResourceProviderOperationList{ - // Value: []*armkubernetesconfiguration.ResourceProviderOperation{ - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations/write"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Creates or updates source control configuration."), - // Operation: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations/write"), - // Provider: to.Ptr("Microsoft Kubernetes Configuration"), - // Resource: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations/read"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Gets source control configuration."), - // Operation: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations/read"), - // Provider: to.Ptr("Microsoft Kubernetes Configuration"), - // Resource: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations/delete"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Deletes source control configuration."), - // Operation: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations/delete"), - // Provider: to.Ptr("Microsoft Kubernetes Configuration"), - // Resource: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/extensions/read"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Get the specified Extension."), - // Operation: to.Ptr("Get extension"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("extensions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/extensions/write"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Create the Extension specified."), - // Operation: to.Ptr("Create a Extension"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("extensions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/extensions/delete"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Delete the specified Extension."), - // Operation: to.Ptr("Delete Extension"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("extensions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/extensions/operations/read"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Get the Status of the Extension Async Operation."), - // Operation: to.Ptr("Get Extension Async Operation Status"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("extensions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations/read"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Get the specified Flux Configuration."), - // Operation: to.Ptr("Get fluxConfiguration"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("fluxConfigurations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations/write"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Create the Flux Configuration specified."), - // Operation: to.Ptr("Create a fluxConfiguration"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("fluxConfigurations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations/delete"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Delete the specified Flux Configuration."), - // Operation: to.Ptr("Delete Flux Configuration"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("fluxConfigurations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/fluxConfigurations/operations/read"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Get the Status of the Flux Configuration Async Operation."), - // Operation: to.Ptr("Get Flux Configuration Async Operation Status"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("fluxConfigurations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/register/action"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Registers subscription to Microsoft.KubernetesConfiguration resource provider."), - // Operation: to.Ptr("Microsoft.KubernetesConfiguration/register/action"), - // Provider: to.Ptr("Microsoft Kubernetes Configuration"), - // Resource: to.Ptr("Register"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.KubernetesConfiguration/extensionTypes/read"), - // Display: &armkubernetesconfiguration.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Get Kubernetes Configuration Available Extensions"), - // Operation: to.Ptr("Microsoft.KubernetesConfiguration/extensionTypes/read"), - // Provider: to.Ptr("Microsoft KubernetesConfiguration"), - // Resource: to.Ptr("extensionTypes"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client.go index b5d6c7fd7f32..630c887fc3aa 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -47,7 +46,7 @@ func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCred // Get - Get Async Operation status // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -56,18 +55,21 @@ func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCred // - operationID - operation Id // - options - OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method. func (client *OperationStatusClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, operationID string, options *OperationStatusClientGetOptions) (OperationStatusClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationID, options) if err != nil { return OperationStatusClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationStatusClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationStatusClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperationStatusClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -106,7 +108,7 @@ func (client *OperationStatusClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +125,7 @@ func (client *OperationStatusClient) getHandleResponse(resp *http.Response) (Ope // NewListPager - List Async Operations, currently in progress, in a cluster // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -186,7 +188,7 @@ func (client *OperationStatusClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client_example_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client_example_test.go deleted file mode 100644 index 07a4381919d3..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client_example_test.go +++ /dev/null @@ -1,87 +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. -// DO NOT EDIT. - -package armkubernetesconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/GetExtensionAsyncOperationStatus.json -func ExampleOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationStatusClient().Get(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "ClusterMonitor", "99999999-9999-9999-9999-999999999999", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armkubernetesconfiguration.OperationStatusResult{ - // Name: to.Ptr("99999999-9999-9999-9999-999999999999"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/ClusterMonitor/operations/99999999-9999-9999-9999-999999999999"), - // Properties: map[string]*string{ - // }, - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/ListAsyncOperationStatus.json -func ExampleOperationStatusClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationStatusClient().NewListPager("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationStatusList = armkubernetesconfiguration.OperationStatusList{ - // Value: []*armkubernetesconfiguration.OperationStatusResult{ - // { - // Name: to.Ptr("99999999-9999-9999-9999-999999999999"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/ClusterMonitor/operations/99999999-9999-9999-9999-999999999999"), - // Properties: map[string]*string{ - // }, - // Status: to.Ptr("Deleting"), - // }, - // { - // Name: to.Ptr("88888888-8888-8888-8888-888888888888"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/extensions/cassandraExtension1/operations/88888888-8888-8888-8888-888888888888"), - // Properties: map[string]*string{ - // }, - // Status: to.Ptr("Creating"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/options.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/options.go new file mode 100644 index 000000000000..bc68c8fd6ecf --- /dev/null +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/options.go @@ -0,0 +1,120 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armkubernetesconfiguration + +// ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. +type ExtensionsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. +type ExtensionsClientBeginDeleteOptions struct { + // Delete the extension resource in Azure - not the normal asynchronous delete. + ForceDelete *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginUpdateOptions contains the optional parameters for the ExtensionsClient.BeginUpdate method. +type ExtensionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. +type ExtensionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExtensionsClientListOptions contains the optional parameters for the ExtensionsClient.NewListPager method. +type ExtensionsClientListOptions struct { + // placeholder for future optional parameters +} + +// FluxConfigOperationStatusClientGetOptions contains the optional parameters for the FluxConfigOperationStatusClient.Get +// method. +type FluxConfigOperationStatusClientGetOptions struct { + // placeholder for future optional parameters +} + +// FluxConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the FluxConfigurationsClient.BeginCreateOrUpdate +// method. +type FluxConfigurationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FluxConfigurationsClientBeginDeleteOptions contains the optional parameters for the FluxConfigurationsClient.BeginDelete +// method. +type FluxConfigurationsClientBeginDeleteOptions struct { + // Delete the extension resource in Azure - not the normal asynchronous delete. + ForceDelete *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FluxConfigurationsClientBeginUpdateOptions contains the optional parameters for the FluxConfigurationsClient.BeginUpdate +// method. +type FluxConfigurationsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FluxConfigurationsClientGetOptions contains the optional parameters for the FluxConfigurationsClient.Get method. +type FluxConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FluxConfigurationsClientListOptions contains the optional parameters for the FluxConfigurationsClient.NewListPager method. +type FluxConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method. +type OperationStatusClientGetOptions struct { + // placeholder for future optional parameters +} + +// OperationStatusClientListOptions contains the optional parameters for the OperationStatusClient.NewListPager method. +type OperationStatusClientListOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// SourceControlConfigurationsClientBeginDeleteOptions contains the optional parameters for the SourceControlConfigurationsClient.BeginDelete +// method. +type SourceControlConfigurationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SourceControlConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SourceControlConfigurationsClient.CreateOrUpdate +// method. +type SourceControlConfigurationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SourceControlConfigurationsClientGetOptions contains the optional parameters for the SourceControlConfigurationsClient.Get +// method. +type SourceControlConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SourceControlConfigurationsClientListOptions contains the optional parameters for the SourceControlConfigurationsClient.NewListPager +// method. +type SourceControlConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/response_types.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/response_types.go index cc8bd5059921..18d487438aba 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/response_types.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/response_types.go @@ -3,14 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration // ExtensionsClientCreateResponse contains the response from method ExtensionsClient.BeginCreate. type ExtensionsClientCreateResponse struct { + // The Extension object. Extension } @@ -21,26 +21,32 @@ type ExtensionsClientDeleteResponse struct { // ExtensionsClientGetResponse contains the response from method ExtensionsClient.Get. type ExtensionsClientGetResponse struct { + // The Extension object. Extension } // ExtensionsClientListResponse contains the response from method ExtensionsClient.NewListPager. type ExtensionsClientListResponse struct { + // Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of + // results. ExtensionsList } // ExtensionsClientUpdateResponse contains the response from method ExtensionsClient.BeginUpdate. type ExtensionsClientUpdateResponse struct { + // The Extension object. Extension } // FluxConfigOperationStatusClientGetResponse contains the response from method FluxConfigOperationStatusClient.Get. type FluxConfigOperationStatusClientGetResponse struct { + // The current status of an async operation. OperationStatusResult } // FluxConfigurationsClientCreateOrUpdateResponse contains the response from method FluxConfigurationsClient.BeginCreateOrUpdate. type FluxConfigurationsClientCreateOrUpdateResponse struct { + // The Flux Configuration object returned in Get & Put response. FluxConfiguration } @@ -51,36 +57,44 @@ type FluxConfigurationsClientDeleteResponse struct { // FluxConfigurationsClientGetResponse contains the response from method FluxConfigurationsClient.Get. type FluxConfigurationsClientGetResponse struct { + // The Flux Configuration object returned in Get & Put response. FluxConfiguration } // FluxConfigurationsClientListResponse contains the response from method FluxConfigurationsClient.NewListPager. type FluxConfigurationsClientListResponse struct { + // Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to get + // the next set of results. FluxConfigurationsList } // FluxConfigurationsClientUpdateResponse contains the response from method FluxConfigurationsClient.BeginUpdate. type FluxConfigurationsClientUpdateResponse struct { + // The Flux Configuration object returned in Get & Put response. FluxConfiguration } // OperationStatusClientGetResponse contains the response from method OperationStatusClient.Get. type OperationStatusClientGetResponse struct { + // The current status of an async operation. OperationStatusResult } // OperationStatusClientListResponse contains the response from method OperationStatusClient.NewListPager. type OperationStatusClientListResponse struct { + // The async operations in progress, in the cluster. OperationStatusList } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Result of the request to list operations. ResourceProviderOperationList } // SourceControlConfigurationsClientCreateOrUpdateResponse contains the response from method SourceControlConfigurationsClient.CreateOrUpdate. type SourceControlConfigurationsClientCreateOrUpdateResponse struct { + // The SourceControl Configuration object returned in Get & Put response. SourceControlConfiguration } @@ -91,10 +105,13 @@ type SourceControlConfigurationsClientDeleteResponse struct { // SourceControlConfigurationsClientGetResponse contains the response from method SourceControlConfigurationsClient.Get. type SourceControlConfigurationsClientGetResponse struct { + // The SourceControl Configuration object returned in Get & Put response. SourceControlConfiguration } // SourceControlConfigurationsClientListResponse contains the response from method SourceControlConfigurationsClient.NewListPager. type SourceControlConfigurationsClientListResponse struct { + // Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and + // a URL link to get the next set of results. SourceControlConfigurationList } diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client.go index e12b9fce112e..eacd1dda7d0b 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration @@ -47,7 +46,7 @@ func NewSourceControlConfigurationsClient(subscriptionID string, credential azco // CreateOrUpdate - Create a new Kubernetes Source Control Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -57,18 +56,21 @@ func NewSourceControlConfigurationsClient(subscriptionID string, credential azco // - options - SourceControlConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SourceControlConfigurationsClient.CreateOrUpdate // method. func (client *SourceControlConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, sourceControlConfiguration SourceControlConfiguration, options *SourceControlConfigurationsClientCreateOrUpdateOptions) (SourceControlConfigurationsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, sourceControlConfiguration, options) if err != nil { return SourceControlConfigurationsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SourceControlConfigurationsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SourceControlConfigurationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SourceControlConfigurationsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,10 +105,13 @@ func (client *SourceControlConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, sourceControlConfiguration) + if err := runtime.MarshalAsJSON(req, sourceControlConfiguration); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -122,7 +127,7 @@ func (client *SourceControlConfigurationsClient) createOrUpdateHandleResponse(re // from the source repo. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -136,7 +141,8 @@ func (client *SourceControlConfigurationsClient) BeginDelete(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[SourceControlConfigurationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[SourceControlConfigurationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[SourceControlConfigurationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -146,20 +152,22 @@ func (client *SourceControlConfigurationsClient) BeginDelete(ctx context.Context // the source repo. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SourceControlConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, options *SourceControlConfigurationsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -194,7 +202,7 @@ func (client *SourceControlConfigurationsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +211,7 @@ func (client *SourceControlConfigurationsClient) deleteCreateRequest(ctx context // Get - Gets details of the Source Control Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -212,18 +220,21 @@ func (client *SourceControlConfigurationsClient) deleteCreateRequest(ctx context // - options - SourceControlConfigurationsClientGetOptions contains the optional parameters for the SourceControlConfigurationsClient.Get // method. func (client *SourceControlConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, options *SourceControlConfigurationsClientGetOptions) (SourceControlConfigurationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, options) if err != nil { return SourceControlConfigurationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SourceControlConfigurationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SourceControlConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SourceControlConfigurationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -258,7 +269,7 @@ func (client *SourceControlConfigurationsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,7 +286,7 @@ func (client *SourceControlConfigurationsClient) getHandleResponse(resp *http.Re // NewListPager - List all Source Control Configurations. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. // - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. @@ -338,7 +349,7 @@ func (client *SourceControlConfigurationsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client_example_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client_example_test.go deleted file mode 100644 index da0b7275c42d..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client_example_test.go +++ /dev/null @@ -1,245 +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. -// DO NOT EDIT. - -package armkubernetesconfiguration_test - -import ( - "context" - "log" - - "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/kubernetesconfiguration/armkubernetesconfiguration/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/GetSourceControlConfiguration.json -func ExampleSourceControlConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSourceControlConfigurationsClient().Get(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "SRS_GitHubConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SourceControlConfiguration = armkubernetesconfiguration.SourceControlConfiguration{ - // Name: to.Ptr("SRS_GitHubConfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/SRS_GitHubConfig"), - // Properties: &armkubernetesconfiguration.SourceControlConfigurationProperties{ - // ComplianceStatus: &armkubernetesconfiguration.ComplianceStatus{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.ComplianceStateTypePending), - // LastConfigApplied: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:25:32.122Z"); return t}()), - // Message: to.Ptr("Configuration successfully created"), - // MessageLevel: to.Ptr(armkubernetesconfiguration.MessageLevelType("Info")), - // }, - // HelmOperatorProperties: &armkubernetesconfiguration.HelmOperatorProperties{ - // ChartValues: to.Ptr("--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"), - // ChartVersion: to.Ptr("0.3.0"), - // }, - // OperatorInstanceName: to.Ptr("SRSGitHubFluxOp-01"), - // OperatorNamespace: to.Ptr("SRS_Namespace"), - // OperatorParams: to.Ptr("--git-email=xyzgituser@users.srs.github.com"), - // OperatorScope: to.Ptr(armkubernetesconfiguration.OperatorScopeTypeNamespace), - // OperatorType: to.Ptr(armkubernetesconfiguration.OperatorTypeFlux), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateTypeSucceeded), - // RepositoryPublicKey: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAqvTzeL+BWgcHnC1CTBRMg2ZfCh9khlrvb2avFHiGG24rRvjLHlKqtfiiw+cZNCKskUyVKqamD2RHrhyn/wXvJ9fFRt0LhYLKn4hJhJaPx4IawdWnW1MUv4U+Mr8o3Cxps4EmiZemqri3fOrhzEIlPL272whKpzlDLV7L4W1XQIGmVPwQ93HTzKEd5uHuEuw6JyFftDDLlCnd3Q1kQ7HOabFEfcSSr9cMx2MU4j/Pjuf3Rd/CzeksvKtU009KSXSnWKm8LL1fihSc1H1WDTi8iuZtT63hsNYH1yxrPRpMVScs3ufLViAGO9NEHQSgDdl/OERQQqKisUn2Qm6adgmftw== rsa-key-20190909"), - // RepositoryURL: to.Ptr("git@github.com:k8sdeveloper425/flux-get-started"), - // SSHKnownHostsContents: to.Ptr("c3NoLmRldi5henVyZS5jb20gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0hyMW9UV3FOcU9sekdKT2ZHSjROYWtWeUl6ZjFyWFlkNGQ3d282akJsa0x2Q0E0b2RCbEwwbURVeVowL1FVZlRUcWV1K3RtMjJnT3N2K1ZyVlRNazZ2d1JVNzVnWS95OXV0NU1iM2JSNUJWNThkS1h5cTlBOVVlQjVDYWtlaG41WmdtNngxbUtvVnlmK0ZGbjI2aVlxWEpSZ3pJWlpjWjVWNmhyRTBRZzM5a1ptNGF6NDhvMEFVYmY2U3A0U0xkdm51TWEyc1ZOd0hCYm9TN0VKa201N1hRUFZVMy9RcHlOTEhiV0Rkend0cmxTK2V6MzBTM0FkWWhMS0VPeEFHOHdlT255cnRMSkFVZW45bVRrb2w4b0lJMWVkZjdtV1diV1ZmMG5CbWx5MjErblpjbUNUSVNRQnRkY3lQYUVubzdmRlFNREQyNi9zMGxmS29iNEt3OEg="), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/CreateSourceControlConfiguration.json -func ExampleSourceControlConfigurationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSourceControlConfigurationsClient().CreateOrUpdate(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "SRS_GitHubConfig", armkubernetesconfiguration.SourceControlConfiguration{ - Properties: &armkubernetesconfiguration.SourceControlConfigurationProperties{ - ConfigurationProtectedSettings: map[string]*string{ - "protectedSetting1Key": to.Ptr("protectedSetting1Value"), - }, - EnableHelmOperator: to.Ptr(true), - HelmOperatorProperties: &armkubernetesconfiguration.HelmOperatorProperties{ - ChartValues: to.Ptr("--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"), - ChartVersion: to.Ptr("0.3.0"), - }, - OperatorInstanceName: to.Ptr("SRSGitHubFluxOp-01"), - OperatorNamespace: to.Ptr("SRS_Namespace"), - OperatorParams: to.Ptr("--git-email=xyzgituser@users.srs.github.com"), - OperatorScope: to.Ptr(armkubernetesconfiguration.OperatorScopeTypeNamespace), - OperatorType: to.Ptr(armkubernetesconfiguration.OperatorTypeFlux), - RepositoryURL: to.Ptr("git@github.com:k8sdeveloper425/flux-get-started"), - SSHKnownHostsContents: to.Ptr("c3NoLmRldi5henVyZS5jb20gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0hyMW9UV3FOcU9sekdKT2ZHSjROYWtWeUl6ZjFyWFlkNGQ3d282akJsa0x2Q0E0b2RCbEwwbURVeVowL1FVZlRUcWV1K3RtMjJnT3N2K1ZyVlRNazZ2d1JVNzVnWS95OXV0NU1iM2JSNUJWNThkS1h5cTlBOVVlQjVDYWtlaG41WmdtNngxbUtvVnlmK0ZGbjI2aVlxWEpSZ3pJWlpjWjVWNmhyRTBRZzM5a1ptNGF6NDhvMEFVYmY2U3A0U0xkdm51TWEyc1ZOd0hCYm9TN0VKa201N1hRUFZVMy9RcHlOTEhiV0Rkend0cmxTK2V6MzBTM0FkWWhMS0VPeEFHOHdlT255cnRMSkFVZW45bVRrb2w4b0lJMWVkZjdtV1diV1ZmMG5CbWx5MjErblpjbUNUSVNRQnRkY3lQYUVubzdmRlFNREQyNi9zMGxmS29iNEt3OEg="), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SourceControlConfiguration = armkubernetesconfiguration.SourceControlConfiguration{ - // Name: to.Ptr("SRS_GitHubConfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/SRS_GitHubConfig"), - // Properties: &armkubernetesconfiguration.SourceControlConfigurationProperties{ - // ComplianceStatus: &armkubernetesconfiguration.ComplianceStatus{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.ComplianceStateTypePending), - // LastConfigApplied: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:25:32.122Z"); return t}()), - // Message: to.Ptr("Configuration successfully created"), - // MessageLevel: to.Ptr(armkubernetesconfiguration.MessageLevelType("Info")), - // }, - // EnableHelmOperator: to.Ptr(true), - // HelmOperatorProperties: &armkubernetesconfiguration.HelmOperatorProperties{ - // ChartValues: to.Ptr("--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"), - // ChartVersion: to.Ptr("0.3.0"), - // }, - // OperatorInstanceName: to.Ptr("SRSGitHubFluxOp-01"), - // OperatorNamespace: to.Ptr("SRS_Namespace"), - // OperatorParams: to.Ptr("--git-email=xyzgituser@users.srs.github.com"), - // OperatorScope: to.Ptr(armkubernetesconfiguration.OperatorScopeTypeNamespace), - // OperatorType: to.Ptr(armkubernetesconfiguration.OperatorTypeFlux), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateTypeSucceeded), - // RepositoryPublicKey: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAqvTzeL+BWgcHnC1CTBRMg2ZfCh9khlrvb2avFHiGG24rRvjLHlKqtfiiw+cZNCKskUyVKqamD2RHrhyn/wXvJ9fFRt0LhYLKn4hJhJaPx4IawdWnW1MUv4U+Mr8o3Cxps4EmiZemqri3fOrhzEIlPL272whKpzlDLV7L4W1XQIGmVPwQ93HTzKEd5uHuEuw6JyFftDDLlCnd3Q1kQ7HOabFEfcSSr9cMx2MU4j/Pjuf3Rd/CzeksvKtU009KSXSnWKm8LL1fihSc1H1WDTi8iuZtT63hsNYH1yxrPRpMVScs3ufLViAGO9NEHQSgDdl/OERQQqKisUn2Qm6adgmftw== rsa-key-20190909"), - // RepositoryURL: to.Ptr("git@github.com:k8sdeveloper425/flux-get-started"), - // SSHKnownHostsContents: to.Ptr("c3NoLmRldi5henVyZS5jb20gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0hyMW9UV3FOcU9sekdKT2ZHSjROYWtWeUl6ZjFyWFlkNGQ3d282akJsa0x2Q0E0b2RCbEwwbURVeVowL1FVZlRUcWV1K3RtMjJnT3N2K1ZyVlRNazZ2d1JVNzVnWS95OXV0NU1iM2JSNUJWNThkS1h5cTlBOVVlQjVDYWtlaG41WmdtNngxbUtvVnlmK0ZGbjI2aVlxWEpSZ3pJWlpjWjVWNmhyRTBRZzM5a1ptNGF6NDhvMEFVYmY2U3A0U0xkdm51TWEyc1ZOd0hCYm9TN0VKa201N1hRUFZVMy9RcHlOTEhiV0Rkend0cmxTK2V6MzBTM0FkWWhMS0VPeEFHOHdlT255cnRMSkFVZW45bVRrb2w4b0lJMWVkZjdtV1diV1ZmMG5CbWx5MjErblpjbUNUSVNRQnRkY3lQYUVubzdmRlFNREQyNi9zMGxmS29iNEt3OEg="), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/DeleteSourceControlConfiguration.json -func ExampleSourceControlConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSourceControlConfigurationsClient().BeginDelete(ctx, "rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", "SRS_GitHubConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-11-01/examples/ListSourceControlConfiguration.json -func ExampleSourceControlConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armkubernetesconfiguration.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSourceControlConfigurationsClient().NewListPager("rg1", "Microsoft.Kubernetes", "connectedClusters", "clusterName1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SourceControlConfigurationList = armkubernetesconfiguration.SourceControlConfigurationList{ - // Value: []*armkubernetesconfiguration.SourceControlConfiguration{ - // { - // Name: to.Ptr("SRS_GitHubConfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/SRS_GitHubConfig"), - // Properties: &armkubernetesconfiguration.SourceControlConfigurationProperties{ - // ComplianceStatus: &armkubernetesconfiguration.ComplianceStatus{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.ComplianceStateTypeCompliant), - // }, - // OperatorInstanceName: to.Ptr("SRSGitHubFluxOp-01"), - // OperatorNamespace: to.Ptr("SRS_Namespace"), - // OperatorScope: to.Ptr(armkubernetesconfiguration.OperatorScopeTypeNamespace), - // OperatorType: to.Ptr(armkubernetesconfiguration.OperatorTypeFlux), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateTypeSucceeded), - // RepositoryURL: to.Ptr("git@github.com:k8sdeveloper425/SRSClusterconfigs"), - // SSHKnownHostsContents: to.Ptr("c3NoLmRldi5henVyZS5jb20gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0hyMW9UV3FOcU9sekdKT2ZHSjROYWtWeUl6ZjFyWFlkNGQ3d282akJsa0x2Q0E0b2RCbEwwbURVeVowL1FVZlRUcWV1K3RtMjJnT3N2K1ZyVlRNazZ2d1JVNzVnWS95OXV0NU1iM2JSNUJWNThkS1h5cTlBOVVlQjVDYWtlaG41WmdtNngxbUtvVnlmK0ZGbjI2aVlxWEpSZ3pJWlpjWjVWNmhyRTBRZzM5a1ptNGF6NDhvMEFVYmY2U3A0U0xkdm51TWEyc1ZOd0hCYm9TN0VKa201N1hRUFZVMy9RcHlOTEhiV0Rkend0cmxTK2V6MzBTM0FkWWhMS0VPeEFHOHdlT255cnRMSkFVZW45bVRrb2w4b0lJMWVkZjdtV1diV1ZmMG5CbWx5MjErblpjbUNUSVNRQnRkY3lQYUVubzdmRlFNREQyNi9zMGxmS29iNEt3OEg="), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // }, - // { - // Name: to.Ptr("SCRS_GitHubConfig"), - // Type: to.Ptr("Microsoft.KubernetesConfiguration/sourceControlConfigurations"), - // ID: to.Ptr("/subscriptions/subId1/resourceGroups/rg1/providers/Microsoft.Kubernetes/connectedClusters/clusterName1/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/SCRS_GitHubConfig"), - // Properties: &armkubernetesconfiguration.SourceControlConfigurationProperties{ - // ComplianceStatus: &armkubernetesconfiguration.ComplianceStatus{ - // ComplianceState: to.Ptr(armkubernetesconfiguration.ComplianceStateTypeCompliant), - // }, - // OperatorInstanceName: to.Ptr("SCRSGitHubFluxOp-02"), - // OperatorNamespace: to.Ptr("SCRS_Namespace"), - // OperatorScope: to.Ptr(armkubernetesconfiguration.OperatorScopeTypeCluster), - // OperatorType: to.Ptr(armkubernetesconfiguration.OperatorTypeFlux), - // ProvisioningState: to.Ptr(armkubernetesconfiguration.ProvisioningStateTypeSucceeded), - // RepositoryURL: to.Ptr("git@github.com:k8sdeveloper425/SCRSClusterconfigs"), - // SSHKnownHostsContents: to.Ptr("c3NoLmRldi5henVyZS5jb20gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0hyMW9UV3FOcU9sekdKT2ZHSjROYWtWeUl6ZjFyWFlkNGQ3d282akJsa0x2Q0E0b2RCbEwwbURVeVowL1FVZlRUcWV1K3RtMjJnT3N2K1ZyVlRNazZ2d1JVNzVnWS95OXV0NU1iM2JSNUJWNThkS1h5cTlBOVVlQjVDYWtlaG41WmdtNngxbUtvVnlmK0ZGbjI2aVlxWEpSZ3pJWlpjWjVWNmhyRTBRZzM5a1ptNGF6NDhvMEFVYmY2U3A0U0xkdm51TWEyc1ZOd0hCYm9TN0VKa201N1hRUFZVMy9RcHlOTEhiV0Rkend0cmxTK2V6MzBTM0FkWWhMS0VPeEFHOHdlT255cnRMSkFVZW45bVRrb2w4b0lJMWVkZjdtV1diV1ZmMG5CbWx5MjErblpjbUNUSVNRQnRkY3lQYUVubzdmRlFNREQyNi9zMGxmS29iNEt3OEg="), - // }, - // SystemData: &armkubernetesconfiguration.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:10:57.027Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-08T05:10:57.027Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armkubernetesconfiguration.CreatedByTypeApplication), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/time_rfc3339.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/time_rfc3339.go index 05cf41fd7ceb..648a81ae1fcb 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/time_rfc3339.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armkubernetesconfiguration