diff --git a/sdk/resourcemanager/elastic/armelastic/CHANGELOG.md b/sdk/resourcemanager/elastic/armelastic/CHANGELOG.md index ce0f66ec5b11..13f7f88f604d 100644 --- a/sdk/resourcemanager/elastic/armelastic/CHANGELOG.md +++ b/sdk/resourcemanager/elastic/armelastic/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 0.7.0 (2023-01-10) +### Features Added + +- New field `DeploymentURL` in struct `DeploymentInfoResponse` + + ## 0.6.0 (2022-11-10) ### Features Added diff --git a/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client.go b/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client.go index 36587b1a2bed..af0934c27461 100644 --- a/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client.go +++ b/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client.go @@ -65,7 +65,7 @@ func NewAllTrafficFiltersClient(subscriptionID string, credential azcore.TokenCr // List - Get the list of all traffic filters for the account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - AllTrafficFiltersClientListOptions contains the optional parameters for the AllTrafficFiltersClient.List method. @@ -104,7 +104,7 @@ func (client *AllTrafficFiltersClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client_example_test.go deleted file mode 100644 index beeaccb7cc21..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/AllTrafficFilters_list.json -func ExampleAllTrafficFiltersClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewAllTrafficFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client.go b/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client.go index 8faf175a506e..e94d202087ac 100644 --- a/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client.go @@ -65,7 +65,7 @@ func NewAssociateTrafficFilterClient(subscriptionID string, credential azcore.To // BeginAssociate - Associate traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - AssociateTrafficFilterClientBeginAssociateOptions contains the optional parameters for the AssociateTrafficFilterClient.BeginAssociate @@ -84,7 +84,7 @@ func (client *AssociateTrafficFilterClient) BeginAssociate(ctx context.Context, // Associate - Associate traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview func (client *AssociateTrafficFilterClient) associate(ctx context.Context, resourceGroupName string, monitorName string, options *AssociateTrafficFilterClientBeginAssociateOptions) (*http.Response, error) { req, err := client.associateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -120,7 +120,7 @@ func (client *AssociateTrafficFilterClient) associateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.RulesetID != nil { reqQP.Set("rulesetId", *options.RulesetID) } diff --git a/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client_example_test.go deleted file mode 100644 index edecd73f62b1..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/AssociateTrafficFilter_Update.json -func ExampleAssociateTrafficFilterClient_BeginAssociate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewAssociateTrafficFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAssociate(ctx, "myResourceGroup", "myMonitor", &armelastic.AssociateTrafficFilterClientBeginAssociateOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")}) - 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/autorest.md b/sdk/resourcemanager/elastic/armelastic/autorest.md index 603c2442d9d4..fd1f81202710 100644 --- a/sdk/resourcemanager/elastic/armelastic/autorest.md +++ b/sdk/resourcemanager/elastic/armelastic/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/232b858812a4f946a82bc11a81241826f5554fbd/specification/elastic/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/232b858812a4f946a82bc11a81241826f5554fbd/specification/elastic/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/elastic/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/elastic/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.6.0 +module-version: 0.7.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/elastic/armelastic/constants.go b/sdk/resourcemanager/elastic/armelastic/constants.go index 8eb77ac1802a..891c59588546 100644 --- a/sdk/resourcemanager/elastic/armelastic/constants.go +++ b/sdk/resourcemanager/elastic/armelastic/constants.go @@ -19,7 +19,7 @@ package armelastic const ( moduleName = "armelastic" - moduleVersion = "v0.6.0" + moduleVersion = "v0.7.0" ) // CreatedByType - The type of identity that created the resource. diff --git a/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client.go b/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client.go index 91540e714e30..ee3783230abe 100644 --- a/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client.go @@ -65,7 +65,7 @@ func NewCreateAndAssociateIPFilterClient(subscriptionID string, credential azcor // BeginCreate - Create and Associate IP traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - CreateAndAssociateIPFilterClientBeginCreateOptions contains the optional parameters for the CreateAndAssociateIPFilterClient.BeginCreate @@ -84,7 +84,7 @@ func (client *CreateAndAssociateIPFilterClient) BeginCreate(ctx context.Context, // Create - Create and Associate IP traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview func (client *CreateAndAssociateIPFilterClient) create(ctx context.Context, resourceGroupName string, monitorName string, options *CreateAndAssociateIPFilterClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -94,7 +94,7 @@ func (client *CreateAndAssociateIPFilterClient) create(ctx context.Context, reso if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusCreated) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -120,7 +120,7 @@ func (client *CreateAndAssociateIPFilterClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.IPs != nil { reqQP.Set("ips", *options.IPs) } diff --git a/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client_example_test.go deleted file mode 100644 index 788b0cc85e26..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/IPTrafficFilter_Create.json -func ExampleCreateAndAssociateIPFilterClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewCreateAndAssociateIPFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.CreateAndAssociateIPFilterClientBeginCreateOptions{IPs: to.Ptr("192.168.131.0, 192.168.132.6/22"), - Name: 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client.go b/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client.go index 41621a95a63c..c195ed9142ff 100644 --- a/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client.go @@ -65,7 +65,7 @@ func NewCreateAndAssociatePLFilterClient(subscriptionID string, credential azcor // BeginCreate - Create and Associate private link traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - CreateAndAssociatePLFilterClientBeginCreateOptions contains the optional parameters for the CreateAndAssociatePLFilterClient.BeginCreate @@ -84,7 +84,7 @@ func (client *CreateAndAssociatePLFilterClient) BeginCreate(ctx context.Context, // Create - Create and Associate private link traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview func (client *CreateAndAssociatePLFilterClient) create(ctx context.Context, resourceGroupName string, monitorName string, options *CreateAndAssociatePLFilterClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -94,7 +94,7 @@ func (client *CreateAndAssociatePLFilterClient) create(ctx context.Context, reso if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusCreated) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -120,7 +120,7 @@ func (client *CreateAndAssociatePLFilterClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Name != nil { reqQP.Set("name", *options.Name) } diff --git a/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client_example_test.go deleted file mode 100644 index a5924bc02c04..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client_example_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/PrivateLinkTrafficFilters_Create.json -func ExampleCreateAndAssociatePLFilterClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewCreateAndAssociatePLFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.CreateAndAssociatePLFilterClientBeginCreateOptions{Name: nil, - PrivateEndpointGUID: to.Ptr("fdb54d3b-e85e-4d08-8958-0d2f7g523df9"), - PrivateEndpointName: to.Ptr("myPrivateEndpoint"), - }) - 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client.go b/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client.go index 863b871ce7ec..190dfa44cc15 100644 --- a/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client.go +++ b/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client.go @@ -65,7 +65,7 @@ func NewDeploymentInfoClient(subscriptionID string, credential azcore.TokenCrede // List - Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - DeploymentInfoClientListOptions contains the optional parameters for the DeploymentInfoClient.List method. @@ -104,7 +104,7 @@ func (client *DeploymentInfoClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client_example_test.go deleted file mode 100644 index 45f09dd244a3..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/DeploymentInfo_List.json -func ExampleDeploymentInfoClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewDeploymentInfoClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client.go b/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client.go index 580fdfabe04c..9cdff40f40e7 100644 --- a/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client.go @@ -65,7 +65,7 @@ func NewDetachAndDeleteTrafficFilterClient(subscriptionID string, credential azc // Delete - Detach and Delete traffic filter from the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - DetachAndDeleteTrafficFilterClientDeleteOptions contains the optional parameters for the DetachAndDeleteTrafficFilterClient.Delete @@ -105,7 +105,7 @@ func (client *DetachAndDeleteTrafficFilterClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.RulesetID != nil { reqQP.Set("rulesetId", *options.RulesetID) } diff --git a/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client_example_test.go deleted file mode 100644 index 34ee8a29afc6..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/DetachAndDeleteTrafficFilter_Delete.json -func ExampleDetachAndDeleteTrafficFilterClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewDetachAndDeleteTrafficFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "myResourceGroup", "myMonitor", &armelastic.DetachAndDeleteTrafficFilterClientDeleteOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client.go b/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client.go index f5b6d2b96871..36c684099074 100644 --- a/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client.go @@ -65,7 +65,7 @@ func NewDetachTrafficFilterClient(subscriptionID string, credential azcore.Token // BeginUpdate - Detach traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - DetachTrafficFilterClientBeginUpdateOptions contains the optional parameters for the DetachTrafficFilterClient.BeginUpdate @@ -84,7 +84,7 @@ func (client *DetachTrafficFilterClient) BeginUpdate(ctx context.Context, resour // Update - Detach traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview func (client *DetachTrafficFilterClient) update(ctx context.Context, resourceGroupName string, monitorName string, options *DetachTrafficFilterClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -120,7 +120,7 @@ func (client *DetachTrafficFilterClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.RulesetID != nil { reqQP.Set("rulesetId", *options.RulesetID) } diff --git a/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client_example_test.go deleted file mode 100644 index 2c92ee42faa2..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/DetachTrafficFilters_Update.json -func ExampleDetachTrafficFilterClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewDetachTrafficFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myMonitor", &armelastic.DetachTrafficFilterClientBeginUpdateOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")}) - 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/externaluser_client.go b/sdk/resourcemanager/elastic/armelastic/externaluser_client.go index d04280112650..ac0378150ebc 100644 --- a/sdk/resourcemanager/elastic/armelastic/externaluser_client.go +++ b/sdk/resourcemanager/elastic/armelastic/externaluser_client.go @@ -66,7 +66,7 @@ func NewExternalUserClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create User inside elastic deployment which are used by customers to perform operations on the elastic // deployment // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - ExternalUserClientCreateOrUpdateOptions contains the optional parameters for the ExternalUserClient.CreateOrUpdate @@ -106,7 +106,7 @@ func (client *ExternalUserClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/elastic/armelastic/externaluser_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/externaluser_client_example_test.go deleted file mode 100644 index 5f8910d9592f..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/externaluser_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/ExternalUserInfo.json -func ExampleExternalUserClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewExternalUserClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "myResourceGroup", "myMonitor", &armelastic.ExternalUserClientCreateOrUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/go.mod b/sdk/resourcemanager/elastic/armelastic/go.mod index 860dc4999af5..625e7e37a024 100644 --- a/sdk/resourcemanager/elastic/armelastic/go.mod +++ b/sdk/resourcemanager/elastic/armelastic/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/elastic/armelastic/go.sum b/sdk/resourcemanager/elastic/armelastic/go.sum index 8c0539b73123..3afb578030a5 100644 --- a/sdk/resourcemanager/elastic/armelastic/go.sum +++ b/sdk/resourcemanager/elastic/armelastic/go.sum @@ -1,30 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= 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.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/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.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +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/elastic/armelastic/listassociatedtrafficfilters_client.go b/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client.go index 869134347ff8..6fe56bb784fa 100644 --- a/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client.go +++ b/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client.go @@ -65,7 +65,7 @@ func NewListAssociatedTrafficFiltersClient(subscriptionID string, credential azc // List - Get the list of all associated traffic filters for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - ListAssociatedTrafficFiltersClientListOptions contains the optional parameters for the ListAssociatedTrafficFiltersClient.List @@ -105,7 +105,7 @@ func (client *ListAssociatedTrafficFiltersClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client_example_test.go deleted file mode 100644 index 4a08035bf1f3..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/AssociatedFiltersForDeployment_list.json -func ExampleListAssociatedTrafficFiltersClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewListAssociatedTrafficFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/models.go b/sdk/resourcemanager/elastic/armelastic/models.go index 4ef97417c273..e70b02109ba0 100644 --- a/sdk/resourcemanager/elastic/armelastic/models.go +++ b/sdk/resourcemanager/elastic/armelastic/models.go @@ -118,6 +118,9 @@ type DeploymentInfoClientListOptions struct { // DeploymentInfoResponse - The properties of deployment in Elastic cloud corresponding to the Elastic monitor resource. type DeploymentInfoResponse struct { + // READ-ONLY; Deployment URL of the elasticsearch in Elastic cloud deployment. + DeploymentURL *string `json:"deploymentUrl,omitempty" azure:"ro"` + // READ-ONLY; Disk capacity of the elasticsearch in Elastic cloud deployment. DiskCapacity *string `json:"diskCapacity,omitempty" azure:"ro"` diff --git a/sdk/resourcemanager/elastic/armelastic/models_serde.go b/sdk/resourcemanager/elastic/armelastic/models_serde.go index 8385411b1eb0..1c6e2679b385 100644 --- a/sdk/resourcemanager/elastic/armelastic/models_serde.go +++ b/sdk/resourcemanager/elastic/armelastic/models_serde.go @@ -156,6 +156,7 @@ func (c *CompanyInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeploymentInfoResponse. func (d DeploymentInfoResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "deploymentUrl", d.DeploymentURL) populate(objectMap, "diskCapacity", d.DiskCapacity) populate(objectMap, "memoryCapacity", d.MemoryCapacity) populate(objectMap, "status", d.Status) @@ -172,6 +173,9 @@ func (d *DeploymentInfoResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "deploymentUrl": + err = unpopulate(val, "DeploymentURL", &d.DeploymentURL) + delete(rawMsg, key) case "diskCapacity": err = unpopulate(val, "DiskCapacity", &d.DiskCapacity) delete(rawMsg, key) diff --git a/sdk/resourcemanager/elastic/armelastic/monitor_client.go b/sdk/resourcemanager/elastic/armelastic/monitor_client.go index 01b9dbf28896..96177ec9f11f 100644 --- a/sdk/resourcemanager/elastic/armelastic/monitor_client.go +++ b/sdk/resourcemanager/elastic/armelastic/monitor_client.go @@ -65,7 +65,7 @@ func NewMonitorClient(subscriptionID string, credential azcore.TokenCredential, // BeginUpgrade - Upgradable version for a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - MonitorClientBeginUpgradeOptions contains the optional parameters for the MonitorClient.BeginUpgrade method. @@ -83,7 +83,7 @@ func (client *MonitorClient) BeginUpgrade(ctx context.Context, resourceGroupName // Upgrade - Upgradable version for a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview func (client *MonitorClient) upgrade(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorClientBeginUpgradeOptions) (*http.Response, error) { req, err := client.upgradeCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -119,7 +119,7 @@ func (client *MonitorClient) upgradeCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/elastic/armelastic/monitor_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/monitor_client_example_test.go deleted file mode 100644 index 8873cb24c165..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/monitor_client_example_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitor_Upgrade.json -func ExampleMonitorClient_BeginUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpgrade(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorClientBeginUpgradeOptions{Body: 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/monitoredresources_client.go b/sdk/resourcemanager/elastic/armelastic/monitoredresources_client.go index de5ac0575378..1d2fc6bbf303 100644 --- a/sdk/resourcemanager/elastic/armelastic/monitoredresources_client.go +++ b/sdk/resourcemanager/elastic/armelastic/monitoredresources_client.go @@ -64,7 +64,7 @@ func NewMonitoredResourcesClient(subscriptionID string, credential azcore.TokenC } // NewListPager - List the resources currently being monitored by the Elastic monitor resource. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - MonitoredResourcesClientListOptions contains the optional parameters for the MonitoredResourcesClient.List method. @@ -116,7 +116,7 @@ func (client *MonitoredResourcesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/monitoredresources_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/monitoredresources_client_example_test.go deleted file mode 100644 index d517d2b1a470..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/monitoredresources_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/MonitoredResources_List.json -func ExampleMonitoredResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitoredResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/monitors_client.go b/sdk/resourcemanager/elastic/armelastic/monitors_client.go index 10c91254f3e3..2cd692ed34a2 100644 --- a/sdk/resourcemanager/elastic/armelastic/monitors_client.go +++ b/sdk/resourcemanager/elastic/armelastic/monitors_client.go @@ -65,7 +65,7 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Create a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - MonitorsClientBeginCreateOptions contains the optional parameters for the MonitorsClient.BeginCreate method. @@ -85,7 +85,7 @@ func (client *MonitorsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Create a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview func (client *MonitorsClient) create(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -121,7 +121,7 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -132,7 +132,7 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Delete a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. @@ -150,7 +150,7 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -186,7 +186,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +194,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the properties of a specific monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. @@ -233,7 +233,7 @@ func (client *MonitorsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *MonitorsClient) getHandleResponse(resp *http.Response) (MonitorsCl } // NewListPager - List all monitors under the specified subscription. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // options - MonitorsClientListOptions contains the optional parameters for the MonitorsClient.List method. func (client *MonitorsClient) NewListPager(options *MonitorsClientListOptions) *runtime.Pager[MonitorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MonitorsClientListResponse]{ @@ -291,7 +291,7 @@ func (client *MonitorsClient) listCreateRequest(ctx context.Context, options *Mo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,7 +307,7 @@ func (client *MonitorsClient) listHandleResponse(resp *http.Response) (MonitorsC } // NewListByResourceGroupPager - List all monitors under the specified resource group. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.ListByResourceGroup // method. @@ -355,7 +355,7 @@ func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,7 +372,7 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo // Update - Update a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - MonitorsClientUpdateOptions contains the optional parameters for the MonitorsClient.Update method. @@ -411,7 +411,7 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/elastic/armelastic/monitors_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/monitors_client_example_test.go deleted file mode 100644 index 1cb2be29ae11..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/monitors_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_List.json -func ExampleMonitorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_ListByResourceGroup.json -func ExampleMonitorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_Get.json -func ExampleMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_Create.json -func ExampleMonitorsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorsClientBeginCreateOptions{Body: 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_Update.json -func ExampleMonitorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorsClientUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_Delete.json -func ExampleMonitorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myMonitor", 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/operations_client.go b/sdk/resourcemanager/elastic/armelastic/operations_client.go index be3f5e8cd80a..f585f47d1a31 100644 --- a/sdk/resourcemanager/elastic/armelastic/operations_client.go +++ b/sdk/resourcemanager/elastic/armelastic/operations_client.go @@ -58,7 +58,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - List all operations provided by Microsoft.Elastic. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -96,7 +96,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/operations_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/operations_client_example_test.go deleted file mode 100644 index 042f74a3063a..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/operations_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/tagrules_client.go b/sdk/resourcemanager/elastic/armelastic/tagrules_client.go index 33ec9c128a81..955c925e703a 100644 --- a/sdk/resourcemanager/elastic/armelastic/tagrules_client.go +++ b/sdk/resourcemanager/elastic/armelastic/tagrules_client.go @@ -65,7 +65,7 @@ func NewTagRulesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Create or update a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // ruleSetName - Tag Rule Set resource name @@ -109,7 +109,7 @@ func (client *TagRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -129,7 +129,7 @@ func (client *TagRulesClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Delete a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // ruleSetName - Tag Rule Set resource name @@ -148,7 +148,7 @@ func (client *TagRulesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview func (client *TagRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, options) if err != nil { @@ -188,7 +188,7 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +196,7 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // ruleSetName - Tag Rule Set resource name @@ -240,7 +240,7 @@ func (client *TagRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +256,7 @@ func (client *TagRulesClient) getHandleResponse(resp *http.Response) (TagRulesCl } // NewListPager - List the tag rules for a given monitor resource. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - TagRulesClientListOptions contains the optional parameters for the TagRulesClient.List method. @@ -308,7 +308,7 @@ func (client *TagRulesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/tagrules_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/tagrules_client_example_test.go deleted file mode 100644 index 2c3a9aa87425..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/tagrules_client_example_test.go +++ /dev/null @@ -1,100 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TagRules_List.json -func ExampleTagRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TagRules_CreateOrUpdate.json -func ExampleTagRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", &armelastic.TagRulesClientCreateOrUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TagRules_Get.json -func ExampleTagRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TagRules_Delete.json -func ExampleTagRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myMonitor", "default", 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/trafficfilters_client.go b/sdk/resourcemanager/elastic/armelastic/trafficfilters_client.go index 9e985e23b41a..24156e825be7 100644 --- a/sdk/resourcemanager/elastic/armelastic/trafficfilters_client.go +++ b/sdk/resourcemanager/elastic/armelastic/trafficfilters_client.go @@ -65,7 +65,7 @@ func NewTrafficFiltersClient(subscriptionID string, credential azcore.TokenCrede // Delete - Delete traffic filter from the account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - TrafficFiltersClientDeleteOptions contains the optional parameters for the TrafficFiltersClient.Delete method. @@ -104,7 +104,7 @@ func (client *TrafficFiltersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.RulesetID != nil { reqQP.Set("rulesetId", *options.RulesetID) } diff --git a/sdk/resourcemanager/elastic/armelastic/trafficfilters_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/trafficfilters_client_example_test.go deleted file mode 100644 index c2e1c28c65e8..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/trafficfilters_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TrafficFilters_Delete.json -func ExampleTrafficFiltersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTrafficFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "myResourceGroup", "myMonitor", &armelastic.TrafficFiltersClientDeleteOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/upgradableversions_client.go b/sdk/resourcemanager/elastic/armelastic/upgradableversions_client.go index 2756ca2a8488..e0fd477b1ea3 100644 --- a/sdk/resourcemanager/elastic/armelastic/upgradableversions_client.go +++ b/sdk/resourcemanager/elastic/armelastic/upgradableversions_client.go @@ -65,7 +65,7 @@ func NewUpgradableVersionsClient(subscriptionID string, credential azcore.TokenC // Details - List of upgradable versions for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - UpgradableVersionsClientDetailsOptions contains the optional parameters for the UpgradableVersionsClient.Details @@ -105,7 +105,7 @@ func (client *UpgradableVersionsClient) detailsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/upgradableversions_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/upgradableversions_client_example_test.go deleted file mode 100644 index 2d20a4d93ed9..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/upgradableversions_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/UpgradableVersions_Details.json -func ExampleUpgradableVersionsClient_Details() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewUpgradableVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Details(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/vmcollection_client.go b/sdk/resourcemanager/elastic/armelastic/vmcollection_client.go index 9d408c9e3954..7f535d78e6ba 100644 --- a/sdk/resourcemanager/elastic/armelastic/vmcollection_client.go +++ b/sdk/resourcemanager/elastic/armelastic/vmcollection_client.go @@ -65,7 +65,7 @@ func NewVMCollectionClient(subscriptionID string, credential azcore.TokenCredent // Update - Update the vm details that will be monitored by the Elastic monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - VMCollectionClientUpdateOptions contains the optional parameters for the VMCollectionClient.Update method. @@ -104,7 +104,7 @@ func (client *VMCollectionClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/elastic/armelastic/vmcollection_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/vmcollection_client_example_test.go deleted file mode 100644 index 2b7a78b82cd8..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/vmcollection_client_example_test.go +++ /dev/null @@ -1,34 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/VMCollection_Update.json -func ExampleVMCollectionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewVMCollectionClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, "myResourceGroup", "myMonitor", &armelastic.VMCollectionClientUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/vmhost_client.go b/sdk/resourcemanager/elastic/armelastic/vmhost_client.go index 5fcce2e69f40..89d295e59258 100644 --- a/sdk/resourcemanager/elastic/armelastic/vmhost_client.go +++ b/sdk/resourcemanager/elastic/armelastic/vmhost_client.go @@ -64,7 +64,7 @@ func NewVMHostClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListPager - List the vm resources currently being monitored by the Elastic monitor resource. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - VMHostClientListOptions contains the optional parameters for the VMHostClient.List method. @@ -116,7 +116,7 @@ func (client *VMHostClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/vmhost_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/vmhost_client_example_test.go deleted file mode 100644 index 9ed96a8c9e30..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/vmhost_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/VMHost_List.json -func ExampleVMHostClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewVMHostClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/vmingestion_client.go b/sdk/resourcemanager/elastic/armelastic/vmingestion_client.go index 7c3d1b9734c4..a94586e0b198 100644 --- a/sdk/resourcemanager/elastic/armelastic/vmingestion_client.go +++ b/sdk/resourcemanager/elastic/armelastic/vmingestion_client.go @@ -65,7 +65,7 @@ func NewVMIngestionClient(subscriptionID string, credential azcore.TokenCredenti // Details - List the vm ingestion details that will be monitored by the Elastic monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// Generated from API version 2022-09-01-preview // resourceGroupName - The name of the resource group to which the Elastic resource belongs. // monitorName - Monitor resource name // options - VMIngestionClientDetailsOptions contains the optional parameters for the VMIngestionClient.Details method. @@ -104,7 +104,7 @@ func (client *VMIngestionClient) detailsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/vmingestion_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/vmingestion_client_example_test.go deleted file mode 100644 index ae43631a2b5c..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/vmingestion_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/VMIngestion_Details.json -func ExampleVMIngestionClient_Details() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewVMIngestionClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Details(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -}