From 3094897ca02e4f022b1d52a21f5c8e02107e3229 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 21 Feb 2019 20:53:50 +0000 Subject: [PATCH 1/3] Generated from ea3fd47083be0750f53afa9c08c58a6d46447fff server restart changes2 --- profiles/latest/mysql/mgmt/mysql/models.go | 8 ++ .../mysql/mgmt/mysql/mysqlapi/models.go | 1 + .../postgresql/mgmt/postgresql/models.go | 8 ++ .../mgmt/postgresql/postgresqlapi/models.go | 1 + profiles/preview/mysql/mgmt/mysql/models.go | 8 ++ .../mysql/mgmt/mysql/mysqlapi/models.go | 1 + .../postgresql/mgmt/postgresql/models.go | 8 ++ .../mgmt/postgresql/postgresqlapi/models.go | 1 + .../mysql/mgmt/2017-12-01/mysql/models.go | 23 ++++ .../2017-12-01/mysql/mysqlapi/interfaces.go | 7 + .../mysql/mgmt/2017-12-01/mysql/server.go | 120 ++++++++++++++++++ .../mgmt/2017-12-01/postgresql/models.go | 23 ++++ .../postgresql/postgresqlapi/interfaces.go | 7 + .../mgmt/2017-12-01/postgresql/server.go | 120 ++++++++++++++++++ 14 files changed, 336 insertions(+) create mode 100644 services/mysql/mgmt/2017-12-01/mysql/server.go create mode 100644 services/postgresql/mgmt/2017-12-01/postgresql/server.go diff --git a/profiles/latest/mysql/mgmt/mysql/models.go b/profiles/latest/mysql/mgmt/mysql/models.go index 7329108ae49f..d77cf6a92171 100644 --- a/profiles/latest/mysql/mgmt/mysql/models.go +++ b/profiles/latest/mysql/mgmt/mysql/models.go @@ -139,6 +139,7 @@ type ProxyResource = original.ProxyResource type ReplicasClient = original.ReplicasClient type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server +type ServerClient = original.ServerClient type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -147,6 +148,7 @@ type ServerPropertiesForDefaultCreate = original.ServerPropertiesForDefaultCreat type ServerPropertiesForGeoRestore = original.ServerPropertiesForGeoRestore type ServerPropertiesForReplica = original.ServerPropertiesForReplica type ServerPropertiesForRestore = original.ServerPropertiesForRestore +type ServerRestartFuture = original.ServerRestartFuture type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy @@ -219,6 +221,12 @@ func NewReplicasClient(subscriptionID string) ReplicasClient { func NewReplicasClientWithBaseURI(baseURI string, subscriptionID string) ReplicasClient { return original.NewReplicasClientWithBaseURI(baseURI, subscriptionID) } +func NewServerClient(subscriptionID string) ServerClient { + return original.NewServerClient(subscriptionID) +} +func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { + return original.NewServerClientWithBaseURI(baseURI, subscriptionID) +} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/latest/mysql/mgmt/mysql/mysqlapi/models.go b/profiles/latest/mysql/mgmt/mysql/mysqlapi/models.go index 4765fcda409b..72765c774e06 100644 --- a/profiles/latest/mysql/mgmt/mysql/mysqlapi/models.go +++ b/profiles/latest/mysql/mgmt/mysql/mysqlapi/models.go @@ -29,6 +29,7 @@ type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTi type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI type ReplicasClientAPI = original.ReplicasClientAPI +type ServerClientAPI = original.ServerClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/latest/postgresql/mgmt/postgresql/models.go b/profiles/latest/postgresql/mgmt/postgresql/models.go index 27f082c8cb33..8bf4ea27f740 100644 --- a/profiles/latest/postgresql/mgmt/postgresql/models.go +++ b/profiles/latest/postgresql/mgmt/postgresql/models.go @@ -140,6 +140,7 @@ type PerformanceTierServiceLevelObjectives = original.PerformanceTierServiceLeve type ProxyResource = original.ProxyResource type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server +type ServerClient = original.ServerClient type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -147,6 +148,7 @@ type ServerPropertiesForCreate = original.ServerPropertiesForCreate type ServerPropertiesForDefaultCreate = original.ServerPropertiesForDefaultCreate type ServerPropertiesForGeoRestore = original.ServerPropertiesForGeoRestore type ServerPropertiesForRestore = original.ServerPropertiesForRestore +type ServerRestartFuture = original.ServerRestartFuture type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy @@ -213,6 +215,12 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewServerClient(subscriptionID string) ServerClient { + return original.NewServerClient(subscriptionID) +} +func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { + return original.NewServerClientWithBaseURI(baseURI, subscriptionID) +} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/latest/postgresql/mgmt/postgresql/postgresqlapi/models.go b/profiles/latest/postgresql/mgmt/postgresql/postgresqlapi/models.go index 599f4a3c6eda..561e08abfbc7 100644 --- a/profiles/latest/postgresql/mgmt/postgresql/postgresqlapi/models.go +++ b/profiles/latest/postgresql/mgmt/postgresql/postgresqlapi/models.go @@ -28,6 +28,7 @@ type FirewallRulesClientAPI = original.FirewallRulesClientAPI type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTierClientAPI type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI +type ServerClientAPI = original.ServerClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/preview/mysql/mgmt/mysql/models.go b/profiles/preview/mysql/mgmt/mysql/models.go index 737015440041..b3ab30775834 100644 --- a/profiles/preview/mysql/mgmt/mysql/models.go +++ b/profiles/preview/mysql/mgmt/mysql/models.go @@ -139,6 +139,7 @@ type ProxyResource = original.ProxyResource type ReplicasClient = original.ReplicasClient type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server +type ServerClient = original.ServerClient type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -147,6 +148,7 @@ type ServerPropertiesForDefaultCreate = original.ServerPropertiesForDefaultCreat type ServerPropertiesForGeoRestore = original.ServerPropertiesForGeoRestore type ServerPropertiesForReplica = original.ServerPropertiesForReplica type ServerPropertiesForRestore = original.ServerPropertiesForRestore +type ServerRestartFuture = original.ServerRestartFuture type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy @@ -219,6 +221,12 @@ func NewReplicasClient(subscriptionID string) ReplicasClient { func NewReplicasClientWithBaseURI(baseURI string, subscriptionID string) ReplicasClient { return original.NewReplicasClientWithBaseURI(baseURI, subscriptionID) } +func NewServerClient(subscriptionID string) ServerClient { + return original.NewServerClient(subscriptionID) +} +func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { + return original.NewServerClientWithBaseURI(baseURI, subscriptionID) +} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/preview/mysql/mgmt/mysql/mysqlapi/models.go b/profiles/preview/mysql/mgmt/mysql/mysqlapi/models.go index 4765fcda409b..72765c774e06 100644 --- a/profiles/preview/mysql/mgmt/mysql/mysqlapi/models.go +++ b/profiles/preview/mysql/mgmt/mysql/mysqlapi/models.go @@ -29,6 +29,7 @@ type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTi type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI type ReplicasClientAPI = original.ReplicasClientAPI +type ServerClientAPI = original.ServerClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/preview/postgresql/mgmt/postgresql/models.go b/profiles/preview/postgresql/mgmt/postgresql/models.go index da02d597927e..9105e1a8b01e 100644 --- a/profiles/preview/postgresql/mgmt/postgresql/models.go +++ b/profiles/preview/postgresql/mgmt/postgresql/models.go @@ -140,6 +140,7 @@ type PerformanceTierServiceLevelObjectives = original.PerformanceTierServiceLeve type ProxyResource = original.ProxyResource type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server +type ServerClient = original.ServerClient type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -147,6 +148,7 @@ type ServerPropertiesForCreate = original.ServerPropertiesForCreate type ServerPropertiesForDefaultCreate = original.ServerPropertiesForDefaultCreate type ServerPropertiesForGeoRestore = original.ServerPropertiesForGeoRestore type ServerPropertiesForRestore = original.ServerPropertiesForRestore +type ServerRestartFuture = original.ServerRestartFuture type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy @@ -213,6 +215,12 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewServerClient(subscriptionID string) ServerClient { + return original.NewServerClient(subscriptionID) +} +func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { + return original.NewServerClientWithBaseURI(baseURI, subscriptionID) +} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go b/profiles/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go index 599f4a3c6eda..561e08abfbc7 100644 --- a/profiles/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go +++ b/profiles/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go @@ -28,6 +28,7 @@ type FirewallRulesClientAPI = original.FirewallRulesClientAPI type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTierClientAPI type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI +type ServerClientAPI = original.ServerClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/services/mysql/mgmt/2017-12-01/mysql/models.go b/services/mysql/mgmt/2017-12-01/mysql/models.go index a07ed19436b9..23d360fecaca 100644 --- a/services/mysql/mgmt/2017-12-01/mysql/models.go +++ b/services/mysql/mgmt/2017-12-01/mysql/models.go @@ -1476,6 +1476,29 @@ func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (Basic return &spfr, true } +// ServerRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServerRestartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerRestartFuture) Result(client ServerClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServerRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("mysql.ServerRestartFuture") + return + } + ar.Response = future.Response() + return +} + // ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersCreateFuture struct { diff --git a/services/mysql/mgmt/2017-12-01/mysql/mysqlapi/interfaces.go b/services/mysql/mgmt/2017-12-01/mysql/mysqlapi/interfaces.go index 13f451552b49..2f653acdfa6b 100644 --- a/services/mysql/mgmt/2017-12-01/mysql/mysqlapi/interfaces.go +++ b/services/mysql/mgmt/2017-12-01/mysql/mysqlapi/interfaces.go @@ -34,6 +34,13 @@ type ServersClientAPI interface { var _ ServersClientAPI = (*mysql.ServersClient)(nil) +// ServerClientAPI contains the set of methods on the ServerClient type. +type ServerClientAPI interface { + Restart(ctx context.Context, resourceGroupName string, serverName string) (result mysql.ServerRestartFuture, err error) +} + +var _ ServerClientAPI = (*mysql.ServerClient)(nil) + // ReplicasClientAPI contains the set of methods on the ReplicasClient type. type ReplicasClientAPI interface { ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result mysql.ServerListResult, err error) diff --git a/services/mysql/mgmt/2017-12-01/mysql/server.go b/services/mysql/mgmt/2017-12-01/mysql/server.go new file mode 100644 index 000000000000..04dfee8c525c --- /dev/null +++ b/services/mysql/mgmt/2017-12-01/mysql/server.go @@ -0,0 +1,120 @@ +package mysql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServerClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for +// Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with +// new business model. +type ServerClient struct { + BaseClient +} + +// NewServerClient creates an instance of the ServerClient client. +func NewServerClient(subscriptionID string) ServerClient { + return NewServerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerClientWithBaseURI creates an instance of the ServerClient client. +func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { + return ServerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Restart restarts a server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ServerClient) Restart(ctx context.Context, resourceGroupName string, serverName string) (result ServerRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerClient.Restart") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServerClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServerClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ServerClient) RestartPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ServerClient) RestartSender(req *http.Request) (future ServerRestartFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ServerClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/postgresql/mgmt/2017-12-01/postgresql/models.go b/services/postgresql/mgmt/2017-12-01/postgresql/models.go index 6e886e0dc363..e858385c1d9f 100644 --- a/services/postgresql/mgmt/2017-12-01/postgresql/models.go +++ b/services/postgresql/mgmt/2017-12-01/postgresql/models.go @@ -1383,6 +1383,29 @@ func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (Basic return &spfr, true } +// ServerRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServerRestartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServerRestartFuture) Result(client ServerClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("postgresql.ServerRestartFuture") + return + } + ar.Response = future.Response() + return +} + // ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersCreateFuture struct { diff --git a/services/postgresql/mgmt/2017-12-01/postgresql/postgresqlapi/interfaces.go b/services/postgresql/mgmt/2017-12-01/postgresql/postgresqlapi/interfaces.go index ecac12db98e5..e54cd9bd151b 100644 --- a/services/postgresql/mgmt/2017-12-01/postgresql/postgresqlapi/interfaces.go +++ b/services/postgresql/mgmt/2017-12-01/postgresql/postgresqlapi/interfaces.go @@ -34,6 +34,13 @@ type ServersClientAPI interface { var _ ServersClientAPI = (*postgresql.ServersClient)(nil) +// ServerClientAPI contains the set of methods on the ServerClient type. +type ServerClientAPI interface { + Restart(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerRestartFuture, err error) +} + +var _ ServerClientAPI = (*postgresql.ServerClient)(nil) + // FirewallRulesClientAPI contains the set of methods on the FirewallRulesClient type. type FirewallRulesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters postgresql.FirewallRule) (result postgresql.FirewallRulesCreateOrUpdateFuture, err error) diff --git a/services/postgresql/mgmt/2017-12-01/postgresql/server.go b/services/postgresql/mgmt/2017-12-01/postgresql/server.go new file mode 100644 index 000000000000..c06241a683f9 --- /dev/null +++ b/services/postgresql/mgmt/2017-12-01/postgresql/server.go @@ -0,0 +1,120 @@ +package postgresql + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServerClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for +// Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log +// files and configurations with new business model. +type ServerClient struct { + BaseClient +} + +// NewServerClient creates an instance of the ServerClient client. +func NewServerClient(subscriptionID string) ServerClient { + return NewServerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerClientWithBaseURI creates an instance of the ServerClient client. +func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { + return ServerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Restart restarts a server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ServerClient) Restart(ctx context.Context, resourceGroupName string, serverName string) (result ServerRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerClient.Restart") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServerClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ServerClient) RestartPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ServerClient) RestartSender(req *http.Request) (future ServerRestartFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ServerClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} From c2f14b3c9961dcd284e7b76f943491c3d4543d14 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 22 Feb 2019 18:57:21 +0000 Subject: [PATCH 2/3] Generated from f4a5bea9460b32f10d02acf8b30e85e775fe3d57 server restart changes 3 --- profiles/latest/mysql/mgmt/mysql/models.go | 9 +- .../mysql/mgmt/mysql/mysqlapi/models.go | 1 - .../postgresql/mgmt/postgresql/models.go | 9 +- .../mgmt/postgresql/postgresqlapi/models.go | 1 - profiles/preview/mysql/mgmt/mysql/models.go | 9 +- .../mysql/mgmt/mysql/mysqlapi/models.go | 1 - .../postgresql/mgmt/postgresql/models.go | 9 +- .../mgmt/postgresql/postgresqlapi/models.go | 1 - .../mysql/mgmt/2017-12-01/mysql/models.go | 46 +++---- .../2017-12-01/mysql/mysqlapi/interfaces.go | 8 +- .../mysql/mgmt/2017-12-01/mysql/server.go | 120 ------------------ .../mysql/mgmt/2017-12-01/mysql/servers.go | 77 +++++++++++ .../mgmt/2017-12-01/postgresql/models.go | 46 +++---- .../postgresql/postgresqlapi/interfaces.go | 8 +- .../mgmt/2017-12-01/postgresql/server.go | 120 ------------------ .../mgmt/2017-12-01/postgresql/servers.go | 77 +++++++++++ 16 files changed, 206 insertions(+), 336 deletions(-) delete mode 100644 services/mysql/mgmt/2017-12-01/mysql/server.go delete mode 100644 services/postgresql/mgmt/2017-12-01/postgresql/server.go diff --git a/profiles/latest/mysql/mgmt/mysql/models.go b/profiles/latest/mysql/mgmt/mysql/models.go index d77cf6a92171..0f1e0467559b 100644 --- a/profiles/latest/mysql/mgmt/mysql/models.go +++ b/profiles/latest/mysql/mgmt/mysql/models.go @@ -139,7 +139,6 @@ type ProxyResource = original.ProxyResource type ReplicasClient = original.ReplicasClient type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server -type ServerClient = original.ServerClient type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -148,7 +147,6 @@ type ServerPropertiesForDefaultCreate = original.ServerPropertiesForDefaultCreat type ServerPropertiesForGeoRestore = original.ServerPropertiesForGeoRestore type ServerPropertiesForReplica = original.ServerPropertiesForReplica type ServerPropertiesForRestore = original.ServerPropertiesForRestore -type ServerRestartFuture = original.ServerRestartFuture type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy @@ -157,6 +155,7 @@ type ServerUpdateParametersProperties = original.ServerUpdateParametersPropertie type ServersClient = original.ServersClient type ServersCreateFuture = original.ServersCreateFuture type ServersDeleteFuture = original.ServersDeleteFuture +type ServersRestartFuture = original.ServersRestartFuture type ServersUpdateFuture = original.ServersUpdateFuture type Sku = original.Sku type StorageProfile = original.StorageProfile @@ -221,12 +220,6 @@ func NewReplicasClient(subscriptionID string) ReplicasClient { func NewReplicasClientWithBaseURI(baseURI string, subscriptionID string) ReplicasClient { return original.NewReplicasClientWithBaseURI(baseURI, subscriptionID) } -func NewServerClient(subscriptionID string) ServerClient { - return original.NewServerClient(subscriptionID) -} -func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { - return original.NewServerClientWithBaseURI(baseURI, subscriptionID) -} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/latest/mysql/mgmt/mysql/mysqlapi/models.go b/profiles/latest/mysql/mgmt/mysql/mysqlapi/models.go index 72765c774e06..4765fcda409b 100644 --- a/profiles/latest/mysql/mgmt/mysql/mysqlapi/models.go +++ b/profiles/latest/mysql/mgmt/mysql/mysqlapi/models.go @@ -29,7 +29,6 @@ type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTi type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI type ReplicasClientAPI = original.ReplicasClientAPI -type ServerClientAPI = original.ServerClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/latest/postgresql/mgmt/postgresql/models.go b/profiles/latest/postgresql/mgmt/postgresql/models.go index 8bf4ea27f740..f2465cc39191 100644 --- a/profiles/latest/postgresql/mgmt/postgresql/models.go +++ b/profiles/latest/postgresql/mgmt/postgresql/models.go @@ -140,7 +140,6 @@ type PerformanceTierServiceLevelObjectives = original.PerformanceTierServiceLeve type ProxyResource = original.ProxyResource type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server -type ServerClient = original.ServerClient type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -148,7 +147,6 @@ type ServerPropertiesForCreate = original.ServerPropertiesForCreate type ServerPropertiesForDefaultCreate = original.ServerPropertiesForDefaultCreate type ServerPropertiesForGeoRestore = original.ServerPropertiesForGeoRestore type ServerPropertiesForRestore = original.ServerPropertiesForRestore -type ServerRestartFuture = original.ServerRestartFuture type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy @@ -157,6 +155,7 @@ type ServerUpdateParametersProperties = original.ServerUpdateParametersPropertie type ServersClient = original.ServersClient type ServersCreateFuture = original.ServersCreateFuture type ServersDeleteFuture = original.ServersDeleteFuture +type ServersRestartFuture = original.ServersRestartFuture type ServersUpdateFuture = original.ServersUpdateFuture type Sku = original.Sku type StorageProfile = original.StorageProfile @@ -215,12 +214,6 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } -func NewServerClient(subscriptionID string) ServerClient { - return original.NewServerClient(subscriptionID) -} -func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { - return original.NewServerClientWithBaseURI(baseURI, subscriptionID) -} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/latest/postgresql/mgmt/postgresql/postgresqlapi/models.go b/profiles/latest/postgresql/mgmt/postgresql/postgresqlapi/models.go index 561e08abfbc7..599f4a3c6eda 100644 --- a/profiles/latest/postgresql/mgmt/postgresql/postgresqlapi/models.go +++ b/profiles/latest/postgresql/mgmt/postgresql/postgresqlapi/models.go @@ -28,7 +28,6 @@ type FirewallRulesClientAPI = original.FirewallRulesClientAPI type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTierClientAPI type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI -type ServerClientAPI = original.ServerClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/preview/mysql/mgmt/mysql/models.go b/profiles/preview/mysql/mgmt/mysql/models.go index b3ab30775834..8c39b78f3dfe 100644 --- a/profiles/preview/mysql/mgmt/mysql/models.go +++ b/profiles/preview/mysql/mgmt/mysql/models.go @@ -139,7 +139,6 @@ type ProxyResource = original.ProxyResource type ReplicasClient = original.ReplicasClient type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server -type ServerClient = original.ServerClient type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -148,7 +147,6 @@ type ServerPropertiesForDefaultCreate = original.ServerPropertiesForDefaultCreat type ServerPropertiesForGeoRestore = original.ServerPropertiesForGeoRestore type ServerPropertiesForReplica = original.ServerPropertiesForReplica type ServerPropertiesForRestore = original.ServerPropertiesForRestore -type ServerRestartFuture = original.ServerRestartFuture type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy @@ -157,6 +155,7 @@ type ServerUpdateParametersProperties = original.ServerUpdateParametersPropertie type ServersClient = original.ServersClient type ServersCreateFuture = original.ServersCreateFuture type ServersDeleteFuture = original.ServersDeleteFuture +type ServersRestartFuture = original.ServersRestartFuture type ServersUpdateFuture = original.ServersUpdateFuture type Sku = original.Sku type StorageProfile = original.StorageProfile @@ -221,12 +220,6 @@ func NewReplicasClient(subscriptionID string) ReplicasClient { func NewReplicasClientWithBaseURI(baseURI string, subscriptionID string) ReplicasClient { return original.NewReplicasClientWithBaseURI(baseURI, subscriptionID) } -func NewServerClient(subscriptionID string) ServerClient { - return original.NewServerClient(subscriptionID) -} -func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { - return original.NewServerClientWithBaseURI(baseURI, subscriptionID) -} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/preview/mysql/mgmt/mysql/mysqlapi/models.go b/profiles/preview/mysql/mgmt/mysql/mysqlapi/models.go index 72765c774e06..4765fcda409b 100644 --- a/profiles/preview/mysql/mgmt/mysql/mysqlapi/models.go +++ b/profiles/preview/mysql/mgmt/mysql/mysqlapi/models.go @@ -29,7 +29,6 @@ type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTi type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI type ReplicasClientAPI = original.ReplicasClientAPI -type ServerClientAPI = original.ServerClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/profiles/preview/postgresql/mgmt/postgresql/models.go b/profiles/preview/postgresql/mgmt/postgresql/models.go index 9105e1a8b01e..f34652e61d3e 100644 --- a/profiles/preview/postgresql/mgmt/postgresql/models.go +++ b/profiles/preview/postgresql/mgmt/postgresql/models.go @@ -140,7 +140,6 @@ type PerformanceTierServiceLevelObjectives = original.PerformanceTierServiceLeve type ProxyResource = original.ProxyResource type SecurityAlertPolicyProperties = original.SecurityAlertPolicyProperties type Server = original.Server -type ServerClient = original.ServerClient type ServerForCreate = original.ServerForCreate type ServerListResult = original.ServerListResult type ServerProperties = original.ServerProperties @@ -148,7 +147,6 @@ type ServerPropertiesForCreate = original.ServerPropertiesForCreate type ServerPropertiesForDefaultCreate = original.ServerPropertiesForDefaultCreate type ServerPropertiesForGeoRestore = original.ServerPropertiesForGeoRestore type ServerPropertiesForRestore = original.ServerPropertiesForRestore -type ServerRestartFuture = original.ServerRestartFuture type ServerSecurityAlertPoliciesClient = original.ServerSecurityAlertPoliciesClient type ServerSecurityAlertPoliciesCreateOrUpdateFuture = original.ServerSecurityAlertPoliciesCreateOrUpdateFuture type ServerSecurityAlertPolicy = original.ServerSecurityAlertPolicy @@ -157,6 +155,7 @@ type ServerUpdateParametersProperties = original.ServerUpdateParametersPropertie type ServersClient = original.ServersClient type ServersCreateFuture = original.ServersCreateFuture type ServersDeleteFuture = original.ServersDeleteFuture +type ServersRestartFuture = original.ServersRestartFuture type ServersUpdateFuture = original.ServersUpdateFuture type Sku = original.Sku type StorageProfile = original.StorageProfile @@ -215,12 +214,6 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } -func NewServerClient(subscriptionID string) ServerClient { - return original.NewServerClient(subscriptionID) -} -func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { - return original.NewServerClientWithBaseURI(baseURI, subscriptionID) -} func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { return original.NewServerSecurityAlertPoliciesClient(subscriptionID) } diff --git a/profiles/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go b/profiles/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go index 561e08abfbc7..599f4a3c6eda 100644 --- a/profiles/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go +++ b/profiles/preview/postgresql/mgmt/postgresql/postgresqlapi/models.go @@ -28,7 +28,6 @@ type FirewallRulesClientAPI = original.FirewallRulesClientAPI type LocationBasedPerformanceTierClientAPI = original.LocationBasedPerformanceTierClientAPI type LogFilesClientAPI = original.LogFilesClientAPI type OperationsClientAPI = original.OperationsClientAPI -type ServerClientAPI = original.ServerClientAPI type ServerSecurityAlertPoliciesClientAPI = original.ServerSecurityAlertPoliciesClientAPI type ServersClientAPI = original.ServersClientAPI type VirtualNetworkRulesClientAPI = original.VirtualNetworkRulesClientAPI diff --git a/services/mysql/mgmt/2017-12-01/mysql/models.go b/services/mysql/mgmt/2017-12-01/mysql/models.go index 23d360fecaca..0458021fc1cc 100644 --- a/services/mysql/mgmt/2017-12-01/mysql/models.go +++ b/services/mysql/mgmt/2017-12-01/mysql/models.go @@ -1476,29 +1476,6 @@ func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (Basic return &spfr, true } -// ServerRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServerRestartFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerRestartFuture) Result(client ServerClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.ServerRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("mysql.ServerRestartFuture") - return - } - ar.Response = future.Response() - return -} - // ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersCreateFuture struct { @@ -1662,6 +1639,29 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { return nil } +// ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServersRestartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServersRestartFuture) Result(client ServersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("mysql.ServersRestartFuture") + return + } + ar.Response = future.Response() + return +} + // ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersUpdateFuture struct { diff --git a/services/mysql/mgmt/2017-12-01/mysql/mysqlapi/interfaces.go b/services/mysql/mgmt/2017-12-01/mysql/mysqlapi/interfaces.go index 2f653acdfa6b..3b3892437114 100644 --- a/services/mysql/mgmt/2017-12-01/mysql/mysqlapi/interfaces.go +++ b/services/mysql/mgmt/2017-12-01/mysql/mysqlapi/interfaces.go @@ -29,18 +29,12 @@ type ServersClientAPI interface { Get(ctx context.Context, resourceGroupName string, serverName string) (result mysql.Server, err error) List(ctx context.Context) (result mysql.ServerListResult, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result mysql.ServerListResult, err error) + Restart(ctx context.Context, resourceGroupName string, serverName string) (result mysql.ServersRestartFuture, err error) Update(ctx context.Context, resourceGroupName string, serverName string, parameters mysql.ServerUpdateParameters) (result mysql.ServersUpdateFuture, err error) } var _ ServersClientAPI = (*mysql.ServersClient)(nil) -// ServerClientAPI contains the set of methods on the ServerClient type. -type ServerClientAPI interface { - Restart(ctx context.Context, resourceGroupName string, serverName string) (result mysql.ServerRestartFuture, err error) -} - -var _ ServerClientAPI = (*mysql.ServerClient)(nil) - // ReplicasClientAPI contains the set of methods on the ReplicasClient type. type ReplicasClientAPI interface { ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result mysql.ServerListResult, err error) diff --git a/services/mysql/mgmt/2017-12-01/mysql/server.go b/services/mysql/mgmt/2017-12-01/mysql/server.go deleted file mode 100644 index 04dfee8c525c..000000000000 --- a/services/mysql/mgmt/2017-12-01/mysql/server.go +++ /dev/null @@ -1,120 +0,0 @@ -package mysql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServerClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with -// new business model. -type ServerClient struct { - BaseClient -} - -// NewServerClient creates an instance of the ServerClient client. -func NewServerClient(subscriptionID string) ServerClient { - return NewServerClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServerClientWithBaseURI creates an instance of the ServerClient client. -func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { - return ServerClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Restart restarts a server. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -func (client ServerClient) Restart(ctx context.Context, resourceGroupName string, serverName string) (result ServerRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerClient.Restart") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.ServerClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.ServerClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client ServerClient) RestartPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client ServerClient) RestartSender(req *http.Request) (future ServerRestartFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client ServerClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/mysql/mgmt/2017-12-01/mysql/servers.go b/services/mysql/mgmt/2017-12-01/mysql/servers.go index fa51290fe446..bbaf0cd58de5 100644 --- a/services/mysql/mgmt/2017-12-01/mysql/servers.go +++ b/services/mysql/mgmt/2017-12-01/mysql/servers.go @@ -438,6 +438,83 @@ func (client ServersClient) ListByResourceGroupResponder(resp *http.Response) (r return } +// Restart restarts a server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ServersClient) Restart(ctx context.Context, resourceGroupName string, serverName string) (result ServersRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Restart") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ServersClient) RestartPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ServersClient) RestartSender(req *http.Request) (future ServersRestartFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ServersClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // Update updates an existing server. The request body can contain one to many of the properties present in the normal // server definition. // Parameters: diff --git a/services/postgresql/mgmt/2017-12-01/postgresql/models.go b/services/postgresql/mgmt/2017-12-01/postgresql/models.go index e858385c1d9f..dc8b97701173 100644 --- a/services/postgresql/mgmt/2017-12-01/postgresql/models.go +++ b/services/postgresql/mgmt/2017-12-01/postgresql/models.go @@ -1383,29 +1383,6 @@ func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (Basic return &spfr, true } -// ServerRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServerRestartFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServerRestartFuture) Result(client ServerClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.ServerRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("postgresql.ServerRestartFuture") - return - } - ar.Response = future.Response() - return -} - // ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersCreateFuture struct { @@ -1569,6 +1546,29 @@ func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { return nil } +// ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServersRestartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServersRestartFuture) Result(client ServersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("postgresql.ServersRestartFuture") + return + } + ar.Response = future.Response() + return +} + // ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersUpdateFuture struct { diff --git a/services/postgresql/mgmt/2017-12-01/postgresql/postgresqlapi/interfaces.go b/services/postgresql/mgmt/2017-12-01/postgresql/postgresqlapi/interfaces.go index e54cd9bd151b..aead6c942302 100644 --- a/services/postgresql/mgmt/2017-12-01/postgresql/postgresqlapi/interfaces.go +++ b/services/postgresql/mgmt/2017-12-01/postgresql/postgresqlapi/interfaces.go @@ -29,18 +29,12 @@ type ServersClientAPI interface { Get(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.Server, err error) List(ctx context.Context) (result postgresql.ServerListResult, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result postgresql.ServerListResult, err error) + Restart(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServersRestartFuture, err error) Update(ctx context.Context, resourceGroupName string, serverName string, parameters postgresql.ServerUpdateParameters) (result postgresql.ServersUpdateFuture, err error) } var _ ServersClientAPI = (*postgresql.ServersClient)(nil) -// ServerClientAPI contains the set of methods on the ServerClient type. -type ServerClientAPI interface { - Restart(ctx context.Context, resourceGroupName string, serverName string) (result postgresql.ServerRestartFuture, err error) -} - -var _ ServerClientAPI = (*postgresql.ServerClient)(nil) - // FirewallRulesClientAPI contains the set of methods on the FirewallRulesClient type. type FirewallRulesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters postgresql.FirewallRule) (result postgresql.FirewallRulesCreateOrUpdateFuture, err error) diff --git a/services/postgresql/mgmt/2017-12-01/postgresql/server.go b/services/postgresql/mgmt/2017-12-01/postgresql/server.go deleted file mode 100644 index c06241a683f9..000000000000 --- a/services/postgresql/mgmt/2017-12-01/postgresql/server.go +++ /dev/null @@ -1,120 +0,0 @@ -package postgresql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServerClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log -// files and configurations with new business model. -type ServerClient struct { - BaseClient -} - -// NewServerClient creates an instance of the ServerClient client. -func NewServerClient(subscriptionID string) ServerClient { - return NewServerClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServerClientWithBaseURI creates an instance of the ServerClient client. -func NewServerClientWithBaseURI(baseURI string, subscriptionID string) ServerClient { - return ServerClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Restart restarts a server. -// Parameters: -// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value -// from the Azure Resource Manager API or the portal. -// serverName - the name of the server. -func (client ServerClient) Restart(ctx context.Context, resourceGroupName string, serverName string) (result ServerRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerClient.Restart") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.ServerClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.ServerClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client ServerClient) RestartPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client ServerClient) RestartSender(req *http.Request) (future ServerRestartFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client ServerClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/postgresql/mgmt/2017-12-01/postgresql/servers.go b/services/postgresql/mgmt/2017-12-01/postgresql/servers.go index 35e9bb4cd26e..b9570ccb834c 100644 --- a/services/postgresql/mgmt/2017-12-01/postgresql/servers.go +++ b/services/postgresql/mgmt/2017-12-01/postgresql/servers.go @@ -438,6 +438,83 @@ func (client ServersClient) ListByResourceGroupResponder(resp *http.Response) (r return } +// Restart restarts a server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ServersClient) Restart(ctx context.Context, resourceGroupName string, serverName string) (result ServersRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Restart") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ServersClient) RestartPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ServersClient) RestartSender(req *http.Request) (future ServersRestartFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ServersClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // Update updates an existing server. The request body can contain one to many of the properties present in the normal // server definition. // Parameters: From 8c199613da79ce5c8b90d91c7d25a3cca6c218df Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 26 Feb 2019 01:01:05 +0000 Subject: [PATCH 3/3] Generated from ff2dd2a4eb33128c1be0aa26d416b01a046af1e2 server restart changes 5 --- profiles/latest/mysql/mgmt/mysql/models.go | 2 ++ .../latest/postgresql/mgmt/postgresql/models.go | 2 ++ profiles/preview/mysql/mgmt/mysql/models.go | 2 ++ .../postgresql/mgmt/postgresql/models.go | 2 ++ services/mysql/mgmt/2017-12-01/mysql/models.go | 17 +++++++++++++++++ .../mgmt/2017-12-01/postgresql/models.go | 17 +++++++++++++++++ 6 files changed, 42 insertions(+) diff --git a/profiles/latest/mysql/mgmt/mysql/models.go b/profiles/latest/mysql/mgmt/mysql/models.go index 0f1e0467559b..b07917e5c7c4 100644 --- a/profiles/latest/mysql/mgmt/mysql/models.go +++ b/profiles/latest/mysql/mgmt/mysql/models.go @@ -104,6 +104,8 @@ const ( type BaseClient = original.BaseClient type BasicServerPropertiesForCreate = original.BasicServerPropertiesForCreate type CheckNameAvailabilityClient = original.CheckNameAvailabilityClient +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody type Configuration = original.Configuration type ConfigurationListResult = original.ConfigurationListResult type ConfigurationProperties = original.ConfigurationProperties diff --git a/profiles/latest/postgresql/mgmt/postgresql/models.go b/profiles/latest/postgresql/mgmt/postgresql/models.go index f2465cc39191..9561d7b52412 100644 --- a/profiles/latest/postgresql/mgmt/postgresql/models.go +++ b/profiles/latest/postgresql/mgmt/postgresql/models.go @@ -106,6 +106,8 @@ const ( type BaseClient = original.BaseClient type BasicServerPropertiesForCreate = original.BasicServerPropertiesForCreate type CheckNameAvailabilityClient = original.CheckNameAvailabilityClient +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody type Configuration = original.Configuration type ConfigurationListResult = original.ConfigurationListResult type ConfigurationProperties = original.ConfigurationProperties diff --git a/profiles/preview/mysql/mgmt/mysql/models.go b/profiles/preview/mysql/mgmt/mysql/models.go index 8c39b78f3dfe..639791bd363e 100644 --- a/profiles/preview/mysql/mgmt/mysql/models.go +++ b/profiles/preview/mysql/mgmt/mysql/models.go @@ -104,6 +104,8 @@ const ( type BaseClient = original.BaseClient type BasicServerPropertiesForCreate = original.BasicServerPropertiesForCreate type CheckNameAvailabilityClient = original.CheckNameAvailabilityClient +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody type Configuration = original.Configuration type ConfigurationListResult = original.ConfigurationListResult type ConfigurationProperties = original.ConfigurationProperties diff --git a/profiles/preview/postgresql/mgmt/postgresql/models.go b/profiles/preview/postgresql/mgmt/postgresql/models.go index f34652e61d3e..abcc294396e9 100644 --- a/profiles/preview/postgresql/mgmt/postgresql/models.go +++ b/profiles/preview/postgresql/mgmt/postgresql/models.go @@ -106,6 +106,8 @@ const ( type BaseClient = original.BaseClient type BasicServerPropertiesForCreate = original.BasicServerPropertiesForCreate type CheckNameAvailabilityClient = original.CheckNameAvailabilityClient +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody type Configuration = original.Configuration type ConfigurationListResult = original.ConfigurationListResult type ConfigurationProperties = original.ConfigurationProperties diff --git a/services/mysql/mgmt/2017-12-01/mysql/models.go b/services/mysql/mgmt/2017-12-01/mysql/models.go index 0458021fc1cc..6210850d2a33 100644 --- a/services/mysql/mgmt/2017-12-01/mysql/models.go +++ b/services/mysql/mgmt/2017-12-01/mysql/models.go @@ -184,6 +184,23 @@ func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { return []VirtualNetworkRuleState{Deleting, Initializing, InProgress, Ready, Unknown} } +// CloudError an error response from the Batch service. +type CloudError struct { + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Batch service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + // Configuration represents a Configuration. type Configuration struct { autorest.Response `json:"-"` diff --git a/services/postgresql/mgmt/2017-12-01/postgresql/models.go b/services/postgresql/mgmt/2017-12-01/postgresql/models.go index dc8b97701173..58e77248c77c 100644 --- a/services/postgresql/mgmt/2017-12-01/postgresql/models.go +++ b/services/postgresql/mgmt/2017-12-01/postgresql/models.go @@ -188,6 +188,23 @@ func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { return []VirtualNetworkRuleState{Deleting, Initializing, InProgress, Ready, Unknown} } +// CloudError an error response from the Batch service. +type CloudError struct { + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Batch service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + // Configuration represents a Configuration. type Configuration struct { autorest.Response `json:"-"`