diff --git a/services/azurestack/mgmt/2017-06-01/azurestack/CHANGELOG.md b/services/azurestack/mgmt/2017-06-01/azurestack/CHANGELOG.md index 52911e4cc5e4..eb6f01676b50 100644 --- a/services/azurestack/mgmt/2017-06-01/azurestack/CHANGELOG.md +++ b/services/azurestack/mgmt/2017-06-01/azurestack/CHANGELOG.md @@ -1,2 +1,34 @@ -# Change History +# Unreleased +## Breaking Changes + +### Signature Changes + +#### Funcs + +1. ProductsClient.GetProducts + - Params + - From: context.Context, string, string, *DeviceConfiguration + - To: context.Context, string, string, string, *DeviceConfiguration +1. ProductsClient.GetProductsPreparer + - Params + - From: context.Context, string, string, *DeviceConfiguration + - To: context.Context, string, string, string, *DeviceConfiguration + +## Additive Changes + +### New Funcs + +1. ProductsClient.ListProducts(context.Context, string, string, string, *DeviceConfiguration) (ProductList, error) +1. ProductsClient.ListProductsPreparer(context.Context, string, string, string, *DeviceConfiguration) (*http.Request, error) +1. ProductsClient.ListProductsResponder(*http.Response) (ProductList, error) +1. ProductsClient.ListProductsSender(*http.Request) (*http.Response, error) +1. RegistrationsClient.EnableRemoteManagement(context.Context, string, string) (autorest.Response, error) +1. RegistrationsClient.EnableRemoteManagementPreparer(context.Context, string, string) (*http.Request, error) +1. RegistrationsClient.EnableRemoteManagementResponder(*http.Response) (autorest.Response, error) +1. RegistrationsClient.EnableRemoteManagementSender(*http.Request) (*http.Response, error) +1. RegistrationsClient.ListBySubscription(context.Context) (RegistrationListPage, error) +1. RegistrationsClient.ListBySubscriptionComplete(context.Context) (RegistrationListIterator, error) +1. RegistrationsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. RegistrationsClient.ListBySubscriptionResponder(*http.Response) (RegistrationList, error) +1. RegistrationsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) diff --git a/services/azurestack/mgmt/2017-06-01/azurestack/_meta.json b/services/azurestack/mgmt/2017-06-01/azurestack/_meta.json index 4c892e2b998b..f6f995fe9056 100644 --- a/services/azurestack/mgmt/2017-06-01/azurestack/_meta.json +++ b/services/azurestack/mgmt/2017-06-01/azurestack/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "b90cbe65bddafa17272cc19b24e49018d912a683", "readme": "/_/azure-rest-api-specs/specification/azurestack/resource-manager/readme.md", "tag": "package-2017-06-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/azurestack/mgmt/2017-06-01/azurestack/azurestackapi/interfaces.go b/services/azurestack/mgmt/2017-06-01/azurestack/azurestackapi/interfaces.go index 63b1f3277437..b9e5cc4b9087 100644 --- a/services/azurestack/mgmt/2017-06-01/azurestack/azurestackapi/interfaces.go +++ b/services/azurestack/mgmt/2017-06-01/azurestack/azurestackapi/interfaces.go @@ -32,10 +32,11 @@ var _ CloudManifestFileClientAPI = (*azurestack.CloudManifestFileClient)(nil) type ProductsClientAPI interface { Get(ctx context.Context, resourceGroup string, registrationName string, productName string) (result azurestack.Product, err error) GetProduct(ctx context.Context, resourceGroup string, registrationName string, productName string, deviceConfiguration *azurestack.DeviceConfiguration) (result azurestack.Product, err error) - GetProducts(ctx context.Context, resourceGroup string, registrationName string, deviceConfiguration *azurestack.DeviceConfiguration) (result azurestack.ProductList, err error) + GetProducts(ctx context.Context, resourceGroup string, registrationName string, productName string, deviceConfiguration *azurestack.DeviceConfiguration) (result azurestack.ProductList, err error) List(ctx context.Context, resourceGroup string, registrationName string) (result azurestack.ProductListPage, err error) ListComplete(ctx context.Context, resourceGroup string, registrationName string) (result azurestack.ProductListIterator, err error) ListDetails(ctx context.Context, resourceGroup string, registrationName string, productName string) (result azurestack.ExtendedProduct, err error) + ListProducts(ctx context.Context, resourceGroup string, registrationName string, productName string, deviceConfiguration *azurestack.DeviceConfiguration) (result azurestack.ProductList, err error) UploadLog(ctx context.Context, resourceGroup string, registrationName string, productName string, marketplaceProductLogUpdate *azurestack.MarketplaceProductLogUpdate) (result azurestack.ProductLog, err error) } @@ -45,10 +46,13 @@ var _ ProductsClientAPI = (*azurestack.ProductsClient)(nil) type RegistrationsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroup string, registrationName string, tokenParameter azurestack.RegistrationParameter) (result azurestack.Registration, err error) Delete(ctx context.Context, resourceGroup string, registrationName string) (result autorest.Response, err error) + EnableRemoteManagement(ctx context.Context, resourceGroup string, registrationName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroup string, registrationName string) (result azurestack.Registration, err error) GetActivationKey(ctx context.Context, resourceGroup string, registrationName string) (result azurestack.ActivationKeyResult, err error) List(ctx context.Context, resourceGroup string) (result azurestack.RegistrationListPage, err error) ListComplete(ctx context.Context, resourceGroup string) (result azurestack.RegistrationListIterator, err error) + ListBySubscription(ctx context.Context) (result azurestack.RegistrationListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result azurestack.RegistrationListIterator, err error) Update(ctx context.Context, resourceGroup string, registrationName string, tokenParameter azurestack.RegistrationParameter) (result azurestack.Registration, err error) } diff --git a/services/azurestack/mgmt/2017-06-01/azurestack/products.go b/services/azurestack/mgmt/2017-06-01/azurestack/products.go index 01a980d8a1b7..445df2bd4499 100644 --- a/services/azurestack/mgmt/2017-06-01/azurestack/products.go +++ b/services/azurestack/mgmt/2017-06-01/azurestack/products.go @@ -167,7 +167,7 @@ func (client ProductsClient) GetProductPreparer(ctx context.Context, resourceGro autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/GetProduct", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/getProduct", pathParameters), autorest.WithQueryParameters(queryParameters)) if deviceConfiguration != nil { preparer = autorest.DecoratePreparer(preparer, @@ -198,8 +198,9 @@ func (client ProductsClient) GetProductResponder(resp *http.Response) (result Pr // Parameters: // resourceGroup - name of the resource group. // registrationName - name of the Azure Stack registration. +// productName - name of the product. // deviceConfiguration - device configuration. -func (client ProductsClient) GetProducts(ctx context.Context, resourceGroup string, registrationName string, deviceConfiguration *DeviceConfiguration) (result ProductList, err error) { +func (client ProductsClient) GetProducts(ctx context.Context, resourceGroup string, registrationName string, productName string, deviceConfiguration *DeviceConfiguration) (result ProductList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.GetProducts") defer func() { @@ -210,7 +211,7 @@ func (client ProductsClient) GetProducts(ctx context.Context, resourceGroup stri tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetProductsPreparer(ctx, resourceGroup, registrationName, deviceConfiguration) + req, err := client.GetProductsPreparer(ctx, resourceGroup, registrationName, productName, deviceConfiguration) if err != nil { err = autorest.NewErrorWithError(err, "azurestack.ProductsClient", "GetProducts", nil, "Failure preparing request") return @@ -233,8 +234,9 @@ func (client ProductsClient) GetProducts(ctx context.Context, resourceGroup stri } // GetProductsPreparer prepares the GetProducts request. -func (client ProductsClient) GetProductsPreparer(ctx context.Context, resourceGroup string, registrationName string, deviceConfiguration *DeviceConfiguration) (*http.Request, error) { +func (client ProductsClient) GetProductsPreparer(ctx context.Context, resourceGroup string, registrationName string, productName string, deviceConfiguration *DeviceConfiguration) (*http.Request, error) { pathParameters := map[string]interface{}{ + "productName": autorest.Encode("path", productName), "registrationName": autorest.Encode("path", registrationName), "resourceGroup": autorest.Encode("path", resourceGroup), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -251,7 +253,7 @@ func (client ProductsClient) GetProductsPreparer(ctx context.Context, resourceGr autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/_all/GetProducts", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/getProducts", pathParameters), autorest.WithQueryParameters(queryParameters)) if deviceConfiguration != nil { preparer = autorest.DecoratePreparer(preparer, @@ -474,6 +476,92 @@ func (client ProductsClient) ListDetailsResponder(resp *http.Response) (result E return } +// ListProducts returns a list of products. +// Parameters: +// resourceGroup - name of the resource group. +// registrationName - name of the Azure Stack registration. +// productName - name of the product. +// deviceConfiguration - device configuration. +func (client ProductsClient) ListProducts(ctx context.Context, resourceGroup string, registrationName string, productName string, deviceConfiguration *DeviceConfiguration) (result ProductList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListProducts") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListProductsPreparer(ctx, resourceGroup, registrationName, productName, deviceConfiguration) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestack.ProductsClient", "ListProducts", nil, "Failure preparing request") + return + } + + resp, err := client.ListProductsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestack.ProductsClient", "ListProducts", resp, "Failure sending request") + return + } + + result, err = client.ListProductsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestack.ProductsClient", "ListProducts", resp, "Failure responding to request") + return + } + + return +} + +// ListProductsPreparer prepares the ListProducts request. +func (client ProductsClient) ListProductsPreparer(ctx context.Context, resourceGroup string, registrationName string, productName string, deviceConfiguration *DeviceConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "productName": autorest.Encode("path", productName), + "registrationName": autorest.Encode("path", registrationName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + deviceConfiguration.DeviceVersion = nil + deviceConfiguration.IdentitySystem = "" + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/listProducts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if deviceConfiguration != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(deviceConfiguration)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListProductsSender sends the ListProducts request. The method will close the +// http.Response Body if it receives an error. +func (client ProductsClient) ListProductsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListProductsResponder handles the response to the ListProducts request. The method always +// closes the http.Response Body. +func (client ProductsClient) ListProductsResponder(resp *http.Response) (result ProductList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // UploadLog returns the specified product. // Parameters: // resourceGroup - name of the resource group. diff --git a/services/azurestack/mgmt/2017-06-01/azurestack/registrations.go b/services/azurestack/mgmt/2017-06-01/azurestack/registrations.go index 7ceb187accb5..16ccb03631a2 100644 --- a/services/azurestack/mgmt/2017-06-01/azurestack/registrations.go +++ b/services/azurestack/mgmt/2017-06-01/azurestack/registrations.go @@ -193,6 +193,75 @@ func (client RegistrationsClient) DeleteResponder(resp *http.Response) (result a return } +// EnableRemoteManagement enables remote management for device under the Azure Stack registration. +// Parameters: +// resourceGroup - name of the resource group. +// registrationName - name of the Azure Stack registration. +func (client RegistrationsClient) EnableRemoteManagement(ctx context.Context, resourceGroup string, registrationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationsClient.EnableRemoteManagement") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.EnableRemoteManagementPreparer(ctx, resourceGroup, registrationName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "EnableRemoteManagement", nil, "Failure preparing request") + return + } + + resp, err := client.EnableRemoteManagementSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "EnableRemoteManagement", resp, "Failure sending request") + return + } + + result, err = client.EnableRemoteManagementResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "EnableRemoteManagement", resp, "Failure responding to request") + return + } + + return +} + +// EnableRemoteManagementPreparer prepares the EnableRemoteManagement request. +func (client RegistrationsClient) EnableRemoteManagementPreparer(ctx context.Context, resourceGroup string, registrationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registrationName": autorest.Encode("path", registrationName), + "resourceGroup": autorest.Encode("path", resourceGroup), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/enableRemoteManagement", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EnableRemoteManagementSender sends the EnableRemoteManagement request. The method will close the +// http.Response Body if it receives an error. +func (client RegistrationsClient) EnableRemoteManagementSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// EnableRemoteManagementResponder handles the response to the EnableRemoteManagement request. The method always +// closes the http.Response Body. +func (client RegistrationsClient) EnableRemoteManagementResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + // Get returns the properties of an Azure Stack registration. // Parameters: // resourceGroup - name of the resource group. @@ -461,6 +530,119 @@ func (client RegistrationsClient) ListComplete(ctx context.Context, resourceGrou return } +// ListBySubscription returns a list of all registrations under current subscription. +func (client RegistrationsClient) ListBySubscription(ctx context.Context) (result RegistrationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationsClient.ListBySubscription") + defer func() { + sc := -1 + if result.rl.Response.Response != nil { + sc = result.rl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.rl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.rl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.rl.hasNextLink() && result.rl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client RegistrationsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStack/registrations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RegistrationsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client RegistrationsClient) ListBySubscriptionResponder(resp *http.Response) (result RegistrationList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client RegistrationsClient) listBySubscriptionNextResults(ctx context.Context, lastResults RegistrationList) (result RegistrationList, err error) { + req, err := lastResults.registrationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestack.RegistrationsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegistrationsClient) ListBySubscriptionComplete(ctx context.Context) (result RegistrationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + // Update patch an Azure Stack registration. // Parameters: // resourceGroup - name of the resource group.