From c185ca8f4091f86056e6ff2dbf7b8208c4be52d2 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 21 Jan 2025 00:47:16 -0800 Subject: [PATCH] [Release] sdk/resourcemanager/computeschedule/armcomputeschedule/1.0.0 (#23930) * [Release] sdk/resourcemanager/computeschedule/armcomputeschedule/1.0.0 generation from spec commit: 8a4eca6b060cf70da696963245656fdc440b666b * add live test * add config * add live test --------- Co-authored-by: ReleaseHelper Co-authored-by: jliusan --- .../armcomputeschedule/CHANGELOG.md | 12 + .../armcomputeschedule/assets.json | 6 + .../armcomputeschedule/autorest.md | 8 +- .../computeschedule/armcomputeschedule/ci.yml | 1 + .../armcomputeschedule/constants.go | 4 +- .../computeschedule/armcomputeschedule/go.mod | 15 +- .../computeschedule/armcomputeschedule/go.sum | 31 +- .../armcomputeschedule/models.go | 81 +- .../armcomputeschedule/models_serde.go | 24 +- .../armcomputeschedule/operation_live_test.go | 101 +++ .../armcomputeschedule/operations_client.go | 4 +- .../operations_client_example_test.go | 41 +- .../scheduledactions_client.go | 64 +- .../scheduledactions_client_example_test.go | 709 ++++++------------ .../armcomputeschedule/utils_test.go | 29 + 15 files changed, 511 insertions(+), 619 deletions(-) create mode 100644 sdk/resourcemanager/computeschedule/armcomputeschedule/assets.json create mode 100644 sdk/resourcemanager/computeschedule/armcomputeschedule/operation_live_test.go create mode 100644 sdk/resourcemanager/computeschedule/armcomputeschedule/utils_test.go diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/CHANGELOG.md b/sdk/resourcemanager/computeschedule/armcomputeschedule/CHANGELOG.md index 0540d5931124..05bafe390c04 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/CHANGELOG.md +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 1.0.0 (2025-01-24) +### Breaking Changes + +- Type of `OperationErrorDetails.ErrorDetails` has been changed from `*time.Time` to `*string` + +### Features Added + +- New field `AzureOperationName`, `Timestamp` in struct `OperationErrorDetails` +- New field `Timezone` in struct `ResourceOperationDetails` +- New field `Deadline`, `Timezone` in struct `Schedule` + + ## 0.1.0 (2024-09-27) ### Other Changes diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/assets.json b/sdk/resourcemanager/computeschedule/armcomputeschedule/assets.json new file mode 100644 index 000000000000..ee221171d611 --- /dev/null +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "go", + "TagPrefix": "go/resourcemanager/computeschedule/armcomputeschedule", + "Tag": "go/resourcemanager/computeschedule/armcomputeschedule_64008a328d" +} diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/autorest.md b/sdk/resourcemanager/computeschedule/armcomputeschedule/autorest.md index e944348282d9..ed1d8d0e071a 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/autorest.md +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 -tag: package-2024-08-15-preview +module-version: 1.0.0 +tag: package-2024-10-01 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/ci.yml b/sdk/resourcemanager/computeschedule/armcomputeschedule/ci.yml index 92844a7fc49f..a9075af131f0 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/ci.yml +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/ci.yml @@ -26,3 +26,4 @@ extends: parameters: IncludeRelease: true ServiceDirectory: 'resourcemanager/computeschedule/armcomputeschedule' + UsePipelineProxy: false diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/constants.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/constants.go index 1fb518798fba..373c327a661b 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/constants.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/constants.go @@ -10,7 +10,7 @@ package armcomputeschedule const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computeschedule/armcomputeschedule" - moduleVersion = "v0.1.0" + moduleVersion = "v1.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -54,7 +54,7 @@ type OperationState string const ( // OperationStateBlocked - Operations that are blocked OperationStateBlocked OperationState = "Blocked" - // OperationStateCancelled - Operations that have been cancelled by the user + // OperationStateCancelled - Operations that have been Cancelled by the user OperationStateCancelled OperationState = "Cancelled" // OperationStateExecuting - Operations that are in the process of being executed OperationStateExecuting OperationState = "Executing" diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/go.mod b/sdk/resourcemanager/computeschedule/armcomputeschedule/go.mod index 186e638d37df..e231648db3b4 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/go.mod +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/go.mod @@ -4,16 +4,25 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 + github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect + github.com/stretchr/testify v1.10.0 golang.org/x/crypto v0.31.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/go.sum b/sdk/resourcemanager/computeschedule/armcomputeschedule/go.sum index 9620a8f197a3..d9081d776c9b 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/go.sum +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/go.sum @@ -1,28 +1,34 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 h1:kYRSnvJju5gYVyhkij+RTJ/VR6QIUaCfWeaFm2ycsjQ= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0/go.mod h1:AW8VEadnhw9xox+VaVd9sP7NjzOAnaZBLRH6Tq3cJ38= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 h1:pPvTJ1dY0sA35JOeFq6TsY2xj6Z85Yo23Pj4wCCvu4o= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= @@ -32,4 +38,7 @@ golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/models.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/models.go index ffe9dcefc02a..3e78e04f6504 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/models.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/models.go @@ -12,7 +12,7 @@ import "time" // CancelOperationsRequest - This is the request to cancel running operations in scheduled actions using the operation ids type CancelOperationsRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The list of operation ids to cancel operations on @@ -42,7 +42,7 @@ type DeallocateResourceOperationResponse struct { // ExecuteDeallocateRequest - The ExecuteDeallocateRequest request for executeDeallocate operations type ExecuteDeallocateRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -54,7 +54,7 @@ type ExecuteDeallocateRequest struct { // ExecuteHibernateRequest - The ExecuteHibernateRequest request for executeHibernate operations type ExecuteHibernateRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -66,7 +66,7 @@ type ExecuteHibernateRequest struct { // ExecuteStartRequest - The ExecuteStartRequest request for executeStart operations type ExecuteStartRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -99,7 +99,7 @@ type GetOperationErrorsResponse struct { // GetOperationStatusRequest - This is the request to get operation status using operationids type GetOperationStatusRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The list of operation ids to get the status of @@ -168,17 +168,23 @@ type OperationDisplay struct { // OperationErrorDetails - This defines a list of operation errors associated with a unique operationId type OperationErrorDetails struct { - // REQUIRED; CRP operationid of the operation for deeper analysis - CrpOperationID *string - // REQUIRED; The error code of the operation ErrorCode *string // REQUIRED; The error details of the operation - ErrorDetails *time.Time + ErrorDetails *string + + // The compute operationid of the Start/Deallocate/Hibernate request + AzureOperationName *string + + // The compute operationid of the Start/Deallocate/Hibernate request + CrpOperationID *string - // REQUIRED; The timestamp of the error occurence + // The timestamp of the error occurence TimeStamp *time.Time + + // The timestamp of the error occurence + Timestamp *time.Time } // OperationErrorsResult - This is the first level of operation errors from the request when clients get errors per vm operation @@ -232,38 +238,41 @@ type ResourceOperation struct { // ResourceOperationDetails - The details of a response from an operation on a resource type ResourceOperationDetails struct { - // REQUIRED; Deadline for the operation + // REQUIRED; Operation identifier for the unique operation + OperationID *string + + // Time the operation was complete if errors are null + CompletedAt *time.Time + + // Deadline for the operation Deadline *time.Time - // REQUIRED; Type of deadline of the operation + // Type of deadline of the operation DeadlineType *DeadlineType - // REQUIRED; Type of operation performed on the resources + // Type of operation performed on the resources OpType *ResourceOperationType - // REQUIRED; Operation identifier for the unique operation - OperationID *string - - // REQUIRED; Unique identifier for the resource involved in the operation, eg ArmId + // Unique identifier for the resource involved in the operation, eg ArmId ResourceID *string - // REQUIRED; Current state of the operation - State *OperationState - - // REQUIRED; Subscription id attached to the request - SubscriptionID *string - - // Time the operation was complete if errors are null - CompletedAt *time.Time - // Operation level errors if they exist ResourceOperationError *ResourceOperationError // Retry policy the user can pass RetryPolicy *RetryPolicy + // Current state of the operation + State *OperationState + + // Subscription id attached to the request + SubscriptionID *string + // Timezone for the operation TimeZone *string + + // Timezone for the operation + Timezone *string } // ResourceOperationError - These describe errors that occur at the resource level @@ -292,14 +301,20 @@ type RetryPolicy struct { // Schedule - The schedule details for the user request type Schedule struct { - // REQUIRED; The deadline for the operation - DeadLine *time.Time - // REQUIRED; The deadlinetype of the operation, this can either be InitiateAt or CompleteBy DeadlineType *DeadlineType - // REQUIRED; The timezone for the operation + // The deadline for the operation + DeadLine *time.Time + + // The deadline for the operation + Deadline *time.Time + + // The timezone for the operation TimeZone *string + + // The timezone for the operation + Timezone *string } // StartResourceOperationResponse - The response from a start request @@ -319,7 +334,7 @@ type StartResourceOperationResponse struct { // SubmitDeallocateRequest - The deallocate request for resources type SubmitDeallocateRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -334,7 +349,7 @@ type SubmitDeallocateRequest struct { // SubmitHibernateRequest - This is the request for hibernate type SubmitHibernateRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -349,7 +364,7 @@ type SubmitHibernateRequest struct { // SubmitStartRequest - This is the request for start type SubmitStartRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/models_serde.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/models_serde.go index c55c4955f270..9fb0a1ac9c20 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/models_serde.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/models_serde.go @@ -484,10 +484,12 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationErrorDetails. func (o OperationErrorDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "azureOperationName", o.AzureOperationName) populate(objectMap, "crpOperationId", o.CrpOperationID) populate(objectMap, "errorCode", o.ErrorCode) - populateDateTimeRFC3339(objectMap, "errorDetails", o.ErrorDetails) + populate(objectMap, "errorDetails", o.ErrorDetails) populateDateTimeRFC3339(objectMap, "timeStamp", o.TimeStamp) + populateDateTimeRFC3339(objectMap, "timestamp", o.Timestamp) return json.Marshal(objectMap) } @@ -500,6 +502,9 @@ func (o *OperationErrorDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "azureOperationName": + err = unpopulate(val, "AzureOperationName", &o.AzureOperationName) + delete(rawMsg, key) case "crpOperationId": err = unpopulate(val, "CrpOperationID", &o.CrpOperationID) delete(rawMsg, key) @@ -507,11 +512,14 @@ func (o *OperationErrorDetails) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ErrorCode", &o.ErrorCode) delete(rawMsg, key) case "errorDetails": - err = unpopulateDateTimeRFC3339(val, "ErrorDetails", &o.ErrorDetails) + err = unpopulate(val, "ErrorDetails", &o.ErrorDetails) delete(rawMsg, key) case "timeStamp": err = unpopulateDateTimeRFC3339(val, "TimeStamp", &o.TimeStamp) delete(rawMsg, key) + case "timestamp": + err = unpopulateDateTimeRFC3339(val, "Timestamp", &o.Timestamp) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -655,6 +663,7 @@ func (r ResourceOperationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "state", r.State) populate(objectMap, "subscriptionId", r.SubscriptionID) populate(objectMap, "timeZone", r.TimeZone) + populate(objectMap, "timezone", r.Timezone) return json.Marshal(objectMap) } @@ -700,6 +709,9 @@ func (r *ResourceOperationDetails) UnmarshalJSON(data []byte) error { case "timeZone": err = unpopulate(val, "TimeZone", &r.TimeZone) delete(rawMsg, key) + case "timezone": + err = unpopulate(val, "Timezone", &r.Timezone) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -801,8 +813,10 @@ func (r *RetryPolicy) UnmarshalJSON(data []byte) error { func (s Schedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "deadLine", s.DeadLine) + populateDateTimeRFC3339(objectMap, "deadline", s.Deadline) populate(objectMap, "deadlineType", s.DeadlineType) populate(objectMap, "timeZone", s.TimeZone) + populate(objectMap, "timezone", s.Timezone) return json.Marshal(objectMap) } @@ -818,12 +832,18 @@ func (s *Schedule) UnmarshalJSON(data []byte) error { case "deadLine": err = unpopulateDateTimeRFC3339(val, "DeadLine", &s.DeadLine) delete(rawMsg, key) + case "deadline": + err = unpopulateDateTimeRFC3339(val, "Deadline", &s.Deadline) + delete(rawMsg, key) case "deadlineType": err = unpopulate(val, "DeadlineType", &s.DeadlineType) delete(rawMsg, key) case "timeZone": err = unpopulate(val, "TimeZone", &s.TimeZone) delete(rawMsg, key) + case "timezone": + err = unpopulate(val, "Timezone", &s.Timezone) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/operation_live_test.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/operation_live_test.go new file mode 100644 index 000000000000..6be060ec0461 --- /dev/null +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/operation_live_test.go @@ -0,0 +1,101 @@ +//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. +package armcomputeschedule_test + +import ( + "context" + "fmt" + "testing" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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/internal/recording" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computeschedule/armcomputeschedule" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/stretchr/testify/suite" +) + +const ( + ResourceLocation = "eastus2" +) + +type ComputeScheduleOperationsTestSuite struct { + suite.Suite + ctx context.Context + cred azcore.TokenCredential + options *arm.ClientOptions + location string + resourceGroupName string + subscriptionId string +} + +func (testsuite *ComputeScheduleOperationsTestSuite) SetupSuite() { + testutil.StartRecording(testsuite.T(), pathToPackage) + + testsuite.ctx = context.Background() + testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) + testsuite.location = recording.GetEnvVariable("LOCATION", ResourceLocation) + testsuite.resourceGroupName = recording.GetEnvVariable("RESOURCE_GROUP_NAME", "operationTestTempGroup") + testsuite.subscriptionId = recording.GetEnvVariable("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + + resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) + testsuite.Require().NoError(err) + testsuite.resourceGroupName = *resourceGroup.Name + + fmt.Println("create new resource group ", testsuite.resourceGroupName, " of ", testsuite.subscriptionId, "successfully") + testsuite.Prepare() +} + +func TestComputeScheduleOperationsTestSuite(t *testing.T) { + suite.Run(t, new(ComputeScheduleOperationsTestSuite)) +} + +func (testsuite *ComputeScheduleOperationsTestSuite) TearDownSuite() { + _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) + testsuite.Require().NoError(err) + testutil.StopRecording(testsuite.T()) +} + +func (testsuite *ComputeScheduleOperationsTestSuite) TestOperationsNewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + testsuite.Require().NoError(err) + ctx := context.Background() + clientFactory, err := armcomputeschedule.NewClientFactory(testsuite.subscriptionId, cred, testsuite.options) + testsuite.Require().NoError(err) + pager := clientFactory.NewOperationsClient().NewListPager(nil) + for pager.More() { + _, err := pager.NextPage(ctx) + testsuite.Require().NoError(err) + } +} + +func (testsuite *ComputeScheduleOperationsTestSuite) Prepare() { + // get default credential + cred, err := azidentity.NewDefaultAzureCredential(nil) + testsuite.Require().NoError(err) + // new client factory + + fmt.Println("subscriptionId", testsuite.subscriptionId, "groupName", testsuite.resourceGroupName, "location", testsuite.location) + clientFactory, err := armresources.NewClientFactory(testsuite.subscriptionId, cred, testsuite.options) + testsuite.Require().NoError(err) + client := clientFactory.NewResourceGroupsClient() + + testsuite.Require().NoError(err) + // check whether create new group successfully + res, err := client.CheckExistence(testsuite.ctx, testsuite.resourceGroupName, nil) + testsuite.Require().NoError(err) + if !res.Success { + _, err = client.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, armresources.ResourceGroup{ + Location: to.Ptr(testsuite.location), + }, nil) + testsuite.Require().NoError(err) + } + + fmt.Println("create new resource group ", testsuite.resourceGroupName, " of ", testsuite.subscriptionId, "successfully") +} diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client.go index eb20a5fc8271..90c8dbfcfb1b 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client_example_test.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client_example_test.go index 57bacbc6ea56..95ee2e4dcf2e 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client_example_test.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client_example_test.go @@ -17,8 +17,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computeschedule/armcomputeschedule" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaxGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/Operations_List.json +func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -42,13 +42,13 @@ func ExampleOperationsClient_NewListPager_operationsListMaxGeneratedByMaximumSet // page.OperationListResult = armcomputeschedule.OperationListResult{ // Value: []*armcomputeschedule.Operation{ // { - // Name: to.Ptr("ennucrkvxylbsli"), + // Name: to.Ptr("mtiwosbky"), // ActionType: to.Ptr(armcomputeschedule.ActionTypeInternal), // Display: &armcomputeschedule.OperationDisplay{ - // Description: to.Ptr("tsqbr"), - // Operation: to.Ptr("sjldnlycokfcufegoktphlwpvxkx"), - // Provider: to.Ptr("brssqjspiggui"), - // Resource: to.Ptr("aujpznmlzjgsyynq"), + // Description: to.Ptr("moyje"), + // Operation: to.Ptr("tuneyqwanedwnnbztrmq"), + // Provider: to.Ptr("vtlhmqtfhlyllnplzpdpq"), + // Resource: to.Ptr("epj"), // }, // IsDataAction: to.Ptr(true), // Origin: to.Ptr(armcomputeschedule.OriginUser), @@ -56,30 +56,3 @@ func ExampleOperationsClient_NewListPager_operationsListMaxGeneratedByMaximumSet // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.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.OperationListResult = armcomputeschedule.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client.go index 8e18116fac53..10d1780d4da3 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client.go @@ -43,10 +43,11 @@ func NewScheduledActionsClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// VirtualMachinesCancelOperations - virtualMachinesCancelOperations: cancelOperations for a virtual machine +// VirtualMachinesCancelOperations - VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) +// request // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesCancelOperationsOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesCancelOperations @@ -89,7 +90,7 @@ func (client *ScheduledActionsClient) virtualMachinesCancelOperationsCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -107,10 +108,11 @@ func (client *ScheduledActionsClient) virtualMachinesCancelOperationsHandleRespo return result, nil } -// VirtualMachinesExecuteDeallocate - virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine +// VirtualMachinesExecuteDeallocate - VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual +// machines, this operation is triggered as soon as Computeschedule receives it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesExecuteDeallocateOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesExecuteDeallocate @@ -153,7 +155,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteDeallocateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -171,10 +173,11 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteDeallocateHandleResp return result, nil } -// VirtualMachinesExecuteHibernate - virtualMachinesExecuteHibernate: executeHibernate for a virtual machine +// VirtualMachinesExecuteHibernate - VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, +// this operation is triggered as soon as Computeschedule receives it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesExecuteHibernateOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesExecuteHibernate @@ -217,7 +220,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteHibernateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -235,10 +238,11 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteHibernateHandleRespo return result, nil } -// VirtualMachinesExecuteStart - virtualMachinesExecuteStart: executeStart for a virtual machine +// VirtualMachinesExecuteStart - VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this +// operation is triggered as soon as Computeschedule receives it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesExecuteStartOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesExecuteStart @@ -281,7 +285,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteStartCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -299,11 +303,11 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteStartHandleResponse( return result, nil } -// VirtualMachinesGetOperationErrors - virtualMachinesGetOperationErrors: getOperationErrors associated with an operation -// on a virtual machine +// VirtualMachinesGetOperationErrors - VirtualMachinesGetOperationErrors: Get error details on operation errors (like transient +// errors encountered, additional logs) if they exist. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesGetOperationErrorsOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesGetOperationErrors @@ -346,7 +350,7 @@ func (client *ScheduledActionsClient) virtualMachinesGetOperationErrorsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -364,10 +368,11 @@ func (client *ScheduledActionsClient) virtualMachinesGetOperationErrorsHandleRes return result, nil } -// VirtualMachinesGetOperationStatus - virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine +// VirtualMachinesGetOperationStatus - VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed +// on virtual machines // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesGetOperationStatusOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesGetOperationStatus @@ -410,7 +415,7 @@ func (client *ScheduledActionsClient) virtualMachinesGetOperationStatusCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -428,10 +433,11 @@ func (client *ScheduledActionsClient) virtualMachinesGetOperationStatusHandleRes return result, nil } -// VirtualMachinesSubmitDeallocate - virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine +// VirtualMachinesSubmitDeallocate - VirtualMachinesSubmitDeallocate: Schedule deallocate operation for a batch of virtual +// machines at datetime in future. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesSubmitDeallocateOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesSubmitDeallocate @@ -474,7 +480,7 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitDeallocateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -492,10 +498,11 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitDeallocateHandleRespo return result, nil } -// VirtualMachinesSubmitHibernate - virtualMachinesSubmitHibernate: submitHibernate for a virtual machine +// VirtualMachinesSubmitHibernate - VirtualMachinesSubmitHibernate: Schedule hibernate operation for a batch of virtual machines +// at datetime in future. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesSubmitHibernateOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesSubmitHibernate @@ -538,7 +545,7 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitHibernateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -556,10 +563,11 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitHibernateHandleRespon return result, nil } -// VirtualMachinesSubmitStart - virtualMachinesSubmitStart: submitStart for a virtual machine +// VirtualMachinesSubmitStart - VirtualMachinesSubmitStart: Schedule start operation for a batch of virtual machines at datetime +// in future. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesSubmitStartOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesSubmitStart @@ -602,7 +610,7 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitStartCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client_example_test.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client_example_test.go index 4cc4adc82b15..b9fd4877476e 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client_example_test.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client_example_test.go @@ -20,8 +20,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computeschedule/armcomputeschedule" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesCancelOperations_scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesCancelOperations.json +func ExampleScheduledActionsClient_VirtualMachinesCancelOperations() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -31,8 +31,8 @@ func ExampleScheduledActionsClient_VirtualMachinesCancelOperations_scheduledActi if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesCancelOperations(ctx, "tdxypnse", armcomputeschedule.CancelOperationsRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesCancelOperations(ctx, "eastus2euap", armcomputeschedule.CancelOperationsRequest{ + Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-gg25eec1f34r"), OperationIDs: []*string{ to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r")}, }, nil) @@ -45,63 +45,35 @@ func ExampleScheduledActionsClient_VirtualMachinesCancelOperations_scheduledActi // res.CancelOperationsResponse = armcomputeschedule.CancelOperationsResponse{ // Results: []*armcomputeschedule.ResourceOperation{ // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource1"), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.668Z"); return t}()), + // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.667Z"); return t}()), + // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeDeallocate), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // }, // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), + // RetryCount: to.Ptr[int32](4), // RetryWindowInMinutes: to.Ptr[int32](27), // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), + // State: to.Ptr(armcomputeschedule.OperationStateCancelled), + // SubscriptionID: to.Ptr("D8E30CC0-2763-4FCC-84A8-3C5659281032"), + // TimeZone: to.Ptr("UTC"), + // Timezone: to.Ptr("UTC"), // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource1"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesCancelOperations_scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesCancelOperations(ctx, "lwapkjsbltcqp", armcomputeschedule.CancelOperationsRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - OperationIDs: []*string{ - to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r")}, - }, 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.CancelOperationsResponse = armcomputeschedule.CancelOperationsResponse{ - // Results: []*armcomputeschedule.ResourceOperation{ - // { + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteDeallocate_scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesExecuteDeallocate.json +func ExampleScheduledActionsClient_VirtualMachinesExecuteDeallocate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -111,18 +83,17 @@ func ExampleScheduledActionsClient_VirtualMachinesExecuteDeallocate_scheduledAct if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteDeallocate(ctx, "mklyzgztbivwzo", armcomputeschedule.ExecuteDeallocateRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eddf1f3c1"), + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteDeallocate(ctx, "eastus2euap", armcomputeschedule.ExecuteDeallocateRequest{ + Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), + RetryCount: to.Ptr[int32](4), RetryWindowInMinutes: to.Ptr[int32](27), }, }, Resources: &armcomputeschedule.Resources{ IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2")}, + to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, }, }, nil) if err != nil { @@ -132,39 +103,40 @@ func ExampleScheduledActionsClient_VirtualMachinesExecuteDeallocate_scheduledAct _ = 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.DeallocateResourceOperationResponse = armcomputeschedule.DeallocateResourceOperationResponse{ - // Type: to.Ptr("eokrhxypminzcgplibblmwojvjd"), - // Description: to.Ptr("ndhb"), - // Location: to.Ptr("qbbvrdisvjgxirnzdvdsodkt"), + // Type: to.Ptr("VirtualMachine"), + // Description: to.Ptr("Deallocate Resource Request"), + // Location: to.Ptr("eastus2euap"), // Results: []*armcomputeschedule.ResourceOperation{ // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2"), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.668Z"); return t}()), + // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.667Z"); return t}()), + // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeDeallocate), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // }, // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), + // RetryCount: to.Ptr[int32](4), // RetryWindowInMinutes: to.Ptr[int32](27), // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), + // State: to.Ptr(armcomputeschedule.OperationStateSucceeded), + // SubscriptionID: to.Ptr("D8E30CC0-2763-4FCC-84A8-3C5659281032"), + // TimeZone: to.Ptr("UTC"), + // Timezone: to.Ptr("UTC"), // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2"), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteDeallocate_scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesExecuteHibernate.json +func ExampleScheduledActionsClient_VirtualMachinesExecuteHibernate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -174,44 +146,11 @@ func ExampleScheduledActionsClient_VirtualMachinesExecuteDeallocate_scheduledAct if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteDeallocate(ctx, "irbtacrhjgfpyvhvjo", armcomputeschedule.ExecuteDeallocateRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eddf1f3c1"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2")}, - }, - }, 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.DeallocateResourceOperationResponse = armcomputeschedule.DeallocateResourceOperationResponse{ - // Type: to.Ptr("eokrhxypminzcgplibblmwojvjd"), - // Description: to.Ptr("ndhb"), - // Location: to.Ptr("qbbvrdisvjgxirnzdvdsodkt"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteHibernate_scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteHibernate(ctx, "sejdmamuhhvfpljomwumsplc", armcomputeschedule.ExecuteHibernateRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteHibernate(ctx, "eastus2euap", armcomputeschedule.ExecuteHibernateRequest{ + Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), + RetryCount: to.Ptr[int32](5), RetryWindowInMinutes: to.Ptr[int32](27), }, }, @@ -227,71 +166,40 @@ func ExampleScheduledActionsClient_VirtualMachinesExecuteHibernate_scheduledActi _ = 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.HibernateResourceOperationResponse = armcomputeschedule.HibernateResourceOperationResponse{ - // Type: to.Ptr("mkmgbfpkiudefzhdppgjmqztx"), - // Description: to.Ptr("wbxeejgkmtwtkcsepidgox"), - // Location: to.Ptr("rvlnzczpesuvusbmbcjctzcinzlr"), + // Type: to.Ptr("VirtualMachine"), + // Description: to.Ptr("Hibernate Resource Request"), + // Location: to.Ptr("eastus2euap"), // Results: []*armcomputeschedule.ResourceOperation{ // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.668Z"); return t}()), + // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.667Z"); return t}()), + // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeHibernate), // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // }, // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), + // RetryCount: to.Ptr[int32](5), // RetryWindowInMinutes: to.Ptr[int32](27), // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), + // State: to.Ptr(armcomputeschedule.OperationStateSucceeded), + // SubscriptionID: to.Ptr("D8E30CC0-2763-4FCC-84A8-3C5659281032"), + // TimeZone: to.Ptr("UTC"), + // Timezone: to.Ptr("UTC"), // }, // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteHibernate_scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteHibernate(ctx, "kga", armcomputeschedule.ExecuteHibernateRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, - }, - }, 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.HibernateResourceOperationResponse = armcomputeschedule.HibernateResourceOperationResponse{ - // Type: to.Ptr("mkmgbfpkiudefzhdppgjmqztx"), - // Description: to.Ptr("wbxeejgkmtwtkcsepidgox"), - // Location: to.Ptr("rvlnzczpesuvusbmbcjctzcinzlr"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteStart_scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesExecuteStart.json +func ExampleScheduledActionsClient_VirtualMachinesExecuteStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -301,18 +209,17 @@ func ExampleScheduledActionsClient_VirtualMachinesExecuteStart_scheduledActionsV if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteStart(ctx, "ysfrwcfmfsh", armcomputeschedule.ExecuteStartRequest{ - Correlationid: to.Ptr("23230d2f-1dca-4610-afb4-dd25eec1f34"), + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteStart(ctx, "eastus2euap", armcomputeschedule.ExecuteStartRequest{ + Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), + RetryCount: to.Ptr[int32](2), RetryWindowInMinutes: to.Ptr[int32](27), }, }, Resources: &armcomputeschedule.Resources{ IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4")}, + to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, }, }, nil) if err != nil { @@ -322,71 +229,40 @@ func ExampleScheduledActionsClient_VirtualMachinesExecuteStart_scheduledActionsV _ = 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.StartResourceOperationResponse = armcomputeschedule.StartResourceOperationResponse{ - // Type: to.Ptr("gxmnjtgu"), - // Description: to.Ptr("raacd"), - // Location: to.Ptr("uvlidhowwv"), + // Type: to.Ptr("virtualMachine"), + // Description: to.Ptr("Start Resource Request"), + // Location: to.Ptr("eastus2euap"), // Results: []*armcomputeschedule.ResourceOperation{ // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.668Z"); return t}()), + // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.667Z"); return t}()), + // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeStart), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // }, // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), + // RetryCount: to.Ptr[int32](2), // RetryWindowInMinutes: to.Ptr[int32](27), // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), + // State: to.Ptr(armcomputeschedule.OperationStateSucceeded), + // SubscriptionID: to.Ptr("D8E30CC0-2763-4FCC-84A8-3C5659281032"), + // TimeZone: to.Ptr("UTC"), + // Timezone: to.Ptr("UTC"), // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteStart_scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteStart(ctx, "qegbgjculewswqvnmaclcgpqqidl", armcomputeschedule.ExecuteStartRequest{ - Correlationid: to.Ptr("23230d2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4")}, - }, - }, 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.StartResourceOperationResponse = armcomputeschedule.StartResourceOperationResponse{ - // Type: to.Ptr("gxmnjtgu"), - // Description: to.Ptr("raacd"), - // Location: to.Ptr("uvlidhowwv"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesGetOperationErrors_csScheduledActionsVirtualMachinesGetOperationErrorsMax() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesGetOperationErrors.json +func ExampleScheduledActionsClient_VirtualMachinesGetOperationErrors() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -396,9 +272,9 @@ func ExampleScheduledActionsClient_VirtualMachinesGetOperationErrors_csScheduled if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationErrors(ctx, "hfsa", armcomputeschedule.GetOperationErrorsRequest{ + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationErrors(ctx, "eastus2euap", armcomputeschedule.GetOperationErrorsRequest{ OperationIDs: []*string{ - to.Ptr("DE84A209-5715-43E7-BC76-3E208A9A323")}, + to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -409,25 +285,27 @@ func ExampleScheduledActionsClient_VirtualMachinesGetOperationErrors_csScheduled // res.GetOperationErrorsResponse = armcomputeschedule.GetOperationErrorsResponse{ // Results: []*armcomputeschedule.OperationErrorsResult{ // { - // OperationID: to.Ptr("DE84A209-5715-43E7-BC76-3E208A9A323"), - // ActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // ActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.999Z"); return t}()), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.999Z"); return t}()), + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.999Z"); return t}()), // OperationErrors: []*armcomputeschedule.OperationErrorDetails{ // { - // CrpOperationID: to.Ptr("DE84A209-5715-43E7-BC76-3E208A9A32C5"), - // ErrorCode: to.Ptr("nr"), - // ErrorDetails: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), + // AzureOperationName: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CrpOperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), + // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-27T16:55:03.357Z"); return t}()), + // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.999Z"); return t}()), // }}, - // RequestErrorCode: to.Ptr("hyfvxj"), - // RequestErrorDetails: to.Ptr("heqpzxzbtrimbxalapqypezeflkyo"), + // RequestErrorCode: to.Ptr("null"), + // RequestErrorDetails: to.Ptr("null"), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesGetOperationErrors_csScheduledActionsVirtualMachinesGetOperationErrorsMin() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesGetOperationStatus.json +func ExampleScheduledActionsClient_VirtualMachinesGetOperationStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -437,69 +315,10 @@ func ExampleScheduledActionsClient_VirtualMachinesGetOperationErrors_csScheduled if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationErrors(ctx, "ggxoaxzxtdbi", armcomputeschedule.GetOperationErrorsRequest{ + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationStatus(ctx, "eastus2euap", armcomputeschedule.GetOperationStatusRequest{ + Correlationid: to.Ptr("35780d2f-1dca-4610-afb4-dd25eec1f34r"), OperationIDs: []*string{ - to.Ptr("qeicik")}, - }, 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.GetOperationErrorsResponse = armcomputeschedule.GetOperationErrorsResponse{ - // Results: []*armcomputeschedule.OperationErrorsResult{ - // { - // OperationID: to.Ptr("wetjrhx"), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesGetOperationStatus_scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationStatus(ctx, "csay", armcomputeschedule.GetOperationStatusRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - OperationIDs: []*string{ - to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3df")}, - }, 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.GetOperationStatusResponse = armcomputeschedule.GetOperationStatusResponse{ - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesGetOperationStatus_scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationStatus(ctx, "htxxasfxaesuecem", armcomputeschedule.GetOperationStatusRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - OperationIDs: []*string{ - to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3df")}, + to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -510,34 +329,35 @@ func ExampleScheduledActionsClient_VirtualMachinesGetOperationStatus_scheduledAc // res.GetOperationStatusResponse = armcomputeschedule.GetOperationStatusResponse{ // Results: []*armcomputeschedule.ResourceOperation{ // { - // ErrorCode: to.Ptr("ipyvwgk"), - // ErrorDetails: to.Ptr("dfegatwcb"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("brvr"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:13.928Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:13.928Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.668Z"); return t}()), + // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.667Z"); return t}()), + // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeDeallocate), // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("ryxlbd"), - // ErrorDetails: to.Ptr("vdwoj"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // }, // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](5), - // RetryWindowInMinutes: to.Ptr[int32](17), + // RetryCount: to.Ptr[int32](4), + // RetryWindowInMinutes: to.Ptr[int32](27), // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("l"), - // TimeZone: to.Ptr("ggsopagtvrtsjltyyccqgufgm"), + // State: to.Ptr(armcomputeschedule.OperationStateSucceeded), + // SubscriptionID: to.Ptr("D8E30CC0-2763-4FCC-84A8-3C5659281032"), + // TimeZone: to.Ptr("UTC"), + // Timezone: to.Ptr("UTC"), // }, // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitDeallocate_scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesSubmitDeallocate.json +func ExampleScheduledActionsClient_VirtualMachinesSubmitDeallocate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -547,23 +367,22 @@ func ExampleScheduledActionsClient_VirtualMachinesSubmitDeallocate_scheduledActi if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitDeallocate(ctx, "ibfxsvilwrgqttuslbduzdtxcckdet", armcomputeschedule.SubmitDeallocateRequest{ - Correlationid: to.Ptr("23519o2f-1dca-4610-afb4-dd25eec1f34"), + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitDeallocate(ctx, "eastus2euap", armcomputeschedule.SubmitDeallocateRequest{ + Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), + RetryCount: to.Ptr[int32](4), RetryWindowInMinutes: to.Ptr[int32](27), }, }, Resources: &armcomputeschedule.Resources{ IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2")}, + to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, }, Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), + Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:54.215Z"); return t }()), + DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + Timezone: to.Ptr("UTC"), }, }, nil) if err != nil { @@ -573,39 +392,40 @@ func ExampleScheduledActionsClient_VirtualMachinesSubmitDeallocate_scheduledActi _ = 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.DeallocateResourceOperationResponse = armcomputeschedule.DeallocateResourceOperationResponse{ - // Type: to.Ptr("eokrhxypminzcgplibblmwojvjd"), - // Description: to.Ptr("ndhb"), - // Location: to.Ptr("qbbvrdisvjgxirnzdvdsodkt"), + // Type: to.Ptr("virtualMachine"), + // Description: to.Ptr("Deallocate Resource Request"), + // Location: to.Ptr("eastus2euap"), // Results: []*armcomputeschedule.ResourceOperation{ // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2"), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.668Z"); return t}()), + // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.667Z"); return t}()), + // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeDeallocate), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // }, // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), + // RetryCount: to.Ptr[int32](4), // RetryWindowInMinutes: to.Ptr[int32](27), // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), + // State: to.Ptr(armcomputeschedule.OperationStateSucceeded), + // SubscriptionID: to.Ptr("D8E30CC0-2763-4FCC-84A8-3C5659281032"), + // TimeZone: to.Ptr("UTC"), + // Timezone: to.Ptr("UTC"), // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2"), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitDeallocate_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitDeallocate_scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesSubmitHibernate.json +func ExampleScheduledActionsClient_VirtualMachinesSubmitHibernate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -615,49 +435,11 @@ func ExampleScheduledActionsClient_VirtualMachinesSubmitDeallocate_scheduledActi if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitDeallocate(ctx, "qwfcdtmshnlownbkyh", armcomputeschedule.SubmitDeallocateRequest{ - Correlationid: to.Ptr("23519o2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, 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.DeallocateResourceOperationResponse = armcomputeschedule.DeallocateResourceOperationResponse{ - // Type: to.Ptr("eokrhxypminzcgplibblmwojvjd"), - // Description: to.Ptr("ndhb"), - // Location: to.Ptr("qbbvrdisvjgxirnzdvdsodkt"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitHibernate_scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitHibernate(ctx, "bgxeayimbxqzev", armcomputeschedule.SubmitHibernateRequest{ - Correlationid: to.Ptr("23519o2f-1dca-4610-afb4-dd25eec1f34"), + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitHibernate(ctx, "eastus2euap", armcomputeschedule.SubmitHibernateRequest{ + Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), + RetryCount: to.Ptr[int32](2), RetryWindowInMinutes: to.Ptr[int32](27), }, }, @@ -666,9 +448,9 @@ func ExampleScheduledActionsClient_VirtualMachinesSubmitHibernate_scheduledActio to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, }, Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), + Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:54.215Z"); return t }()), + DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + Timezone: to.Ptr("UTC"), }, }, nil) if err != nil { @@ -678,76 +460,40 @@ func ExampleScheduledActionsClient_VirtualMachinesSubmitHibernate_scheduledActio _ = 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.HibernateResourceOperationResponse = armcomputeschedule.HibernateResourceOperationResponse{ - // Type: to.Ptr("mkmgbfpkiudefzhdppgjmqztx"), - // Description: to.Ptr("wbxeejgkmtwtkcsepidgox"), - // Location: to.Ptr("rvlnzczpesuvusbmbcjctzcinzlr"), + // Type: to.Ptr("virtualMachine"), + // Description: to.Ptr("Hibernate Resource Request"), + // Location: to.Ptr("eastus2euap"), // Results: []*armcomputeschedule.ResourceOperation{ // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.668Z"); return t}()), + // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.667Z"); return t}()), + // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeHibernate), // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // }, // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), + // RetryCount: to.Ptr[int32](2), // RetryWindowInMinutes: to.Ptr[int32](27), // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), + // State: to.Ptr(armcomputeschedule.OperationStateSucceeded), + // SubscriptionID: to.Ptr("D8E30CC0-2763-4FCC-84A8-3C5659281032"), + // TimeZone: to.Ptr("UTC"), + // Timezone: to.Ptr("UTC"), // }, // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitHibernate_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitHibernate_scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitHibernate(ctx, "fvjciwudfbndlqumcgqs", armcomputeschedule.SubmitHibernateRequest{ - Correlationid: to.Ptr("23519o2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, 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.HibernateResourceOperationResponse = armcomputeschedule.HibernateResourceOperationResponse{ - // Type: to.Ptr("mkmgbfpkiudefzhdppgjmqztx"), - // Description: to.Ptr("wbxeejgkmtwtkcsepidgox"), - // Location: to.Ptr("rvlnzczpesuvusbmbcjctzcinzlr"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitStart_scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a4eca6b060cf70da696963245656fdc440b666b/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/stable/2024-10-01/examples/ScheduledActions_VirtualMachinesSubmitStart.json +func ExampleScheduledActionsClient_VirtualMachinesSubmitStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -757,23 +503,22 @@ func ExampleScheduledActionsClient_VirtualMachinesSubmitStart_scheduledActionsVi if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitStart(ctx, "fxiidszhrokwjmewlahfqjiocnes", armcomputeschedule.SubmitStartRequest{ - Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), + res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitStart(ctx, "eastus2euap", armcomputeschedule.SubmitStartRequest{ + Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), + RetryCount: to.Ptr[int32](5), RetryWindowInMinutes: to.Ptr[int32](27), }, }, Resources: &armcomputeschedule.Resources{ IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4")}, + to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, }, Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), + Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:54.215Z"); return t }()), + DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + Timezone: to.Ptr("UTC"), }, }, nil) if err != nil { @@ -783,70 +528,34 @@ func ExampleScheduledActionsClient_VirtualMachinesSubmitStart_scheduledActionsVi _ = 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.StartResourceOperationResponse = armcomputeschedule.StartResourceOperationResponse{ - // Type: to.Ptr("gxmnjtgu"), - // Description: to.Ptr("raacd"), - // Location: to.Ptr("uvlidhowwv"), + // Type: to.Ptr("virtualMachine"), + // Description: to.Ptr("Start Resource Request"), + // Location: to.Ptr("eastus2euap"), // Results: []*armcomputeschedule.ResourceOperation{ // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"), + // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r"), + // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.668Z"); return t}()), + // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T17:52:53.667Z"); return t}()), + // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeInitiateAt), + // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeStart), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), + // ErrorCode: to.Ptr("null"), + // ErrorDetails: to.Ptr("null"), // }, // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), + // RetryCount: to.Ptr[int32](5), // RetryWindowInMinutes: to.Ptr[int32](27), // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), + // State: to.Ptr(armcomputeschedule.OperationStateSucceeded), + // SubscriptionID: to.Ptr("D8E30CC0-2763-4FCC-84A8-3C5659281032"), + // TimeZone: to.Ptr("UTC"), + // Timezone: to.Ptr("UTC"), // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"), + // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), // }}, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitStart_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitStart_scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitStart(ctx, "httzei", armcomputeschedule.SubmitStartRequest{ - Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, 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.StartResourceOperationResponse = armcomputeschedule.StartResourceOperationResponse{ - // Type: to.Ptr("gxmnjtgu"), - // Description: to.Ptr("raacd"), - // Location: to.Ptr("uvlidhowwv"), - // } -} diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/utils_test.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/utils_test.go new file mode 100644 index 000000000000..9938672db865 --- /dev/null +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/utils_test.go @@ -0,0 +1,29 @@ +//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. + +package armcomputeschedule_test + +import ( + "os" + "testing" + + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" +) + +const ( + pathToPackage = "sdk/resourcemanager/computeschedule/armcomputeschedule/testdata" +) + +func TestMain(m *testing.M) { + code := run(m) + os.Exit(code) +} + +func run(m *testing.M) int { + f := testutil.StartProxy(pathToPackage) + defer f() + return m.Run() +}