vendor: update all dependencies to latest versions
This commit is contained in:
Generated
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
// Package commitmentplans implements the Azure ARM Commitmentplans service API version 2016-05-01-preview.
|
||||
//
|
||||
// These APIs allow end users to operate on Azure Machine Learning Commitment Plans resources and their child
|
||||
// Commitment Association resources. They support CRUD operations for commitment plans, get and list operations for
|
||||
// commitment associations, moving commitment associations between commitment plans, and retrieving commitment plan
|
||||
// usage history.
|
||||
package commitmentplans
|
||||
|
||||
// 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 (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Commitmentplans
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Commitmentplans.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client.
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+279
@@ -0,0 +1,279 @@
|
||||
package commitmentplans
|
||||
|
||||
// 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"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// CommitmentAssociationsClient is the these APIs allow end users to operate on Azure Machine Learning Commitment Plans
|
||||
// resources and their child Commitment Association resources. They support CRUD operations for commitment plans, get
|
||||
// and list operations for commitment associations, moving commitment associations between commitment plans, and
|
||||
// retrieving commitment plan usage history.
|
||||
type CommitmentAssociationsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewCommitmentAssociationsClient creates an instance of the CommitmentAssociationsClient client.
|
||||
func NewCommitmentAssociationsClient(subscriptionID string) CommitmentAssociationsClient {
|
||||
return NewCommitmentAssociationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewCommitmentAssociationsClientWithBaseURI creates an instance of the CommitmentAssociationsClient client.
|
||||
func NewCommitmentAssociationsClientWithBaseURI(baseURI string, subscriptionID string) CommitmentAssociationsClient {
|
||||
return CommitmentAssociationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Get get a commitment association.
|
||||
//
|
||||
// resourceGroupName is the resource group name. commitmentPlanName is the Azure ML commitment plan name.
|
||||
// commitmentAssociationName is the commitment association name.
|
||||
func (client CommitmentAssociationsClient) Get(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentAssociationName string) (result CommitmentAssociation, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, commitmentPlanName, commitmentAssociationName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client CommitmentAssociationsClient) GetPreparer(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentAssociationName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commitmentAssociationName": autorest.Encode("path", commitmentAssociationName),
|
||||
"commitmentPlanName": autorest.Encode("path", commitmentPlanName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client CommitmentAssociationsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client CommitmentAssociationsClient) GetResponder(resp *http.Response) (result CommitmentAssociation, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List get all commitment associations for a parent commitment plan.
|
||||
//
|
||||
// resourceGroupName is the resource group name. commitmentPlanName is the Azure ML commitment plan name. skipToken is
|
||||
// continuation token for pagination.
|
||||
func (client CommitmentAssociationsClient) List(ctx context.Context, resourceGroupName string, commitmentPlanName string, skipToken string) (result CommitmentAssociationListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, commitmentPlanName, skipToken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.calr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.calr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client CommitmentAssociationsClient) ListPreparer(ctx context.Context, resourceGroupName string, commitmentPlanName string, skipToken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commitmentPlanName": autorest.Encode("path", commitmentPlanName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skipToken) > 0 {
|
||||
queryParameters["$skipToken"] = autorest.Encode("query", skipToken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client CommitmentAssociationsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client CommitmentAssociationsClient) ListResponder(resp *http.Response) (result CommitmentAssociationListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client CommitmentAssociationsClient) listNextResults(lastResults CommitmentAssociationListResult) (result CommitmentAssociationListResult, err error) {
|
||||
req, err := lastResults.commitmentAssociationListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "listNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client CommitmentAssociationsClient) ListComplete(ctx context.Context, resourceGroupName string, commitmentPlanName string, skipToken string) (result CommitmentAssociationListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx, resourceGroupName, commitmentPlanName, skipToken)
|
||||
return
|
||||
}
|
||||
|
||||
// Move re-parent a commitment association from one commitment plan to another.
|
||||
//
|
||||
// resourceGroupName is the resource group name. commitmentPlanName is the Azure ML commitment plan name.
|
||||
// commitmentAssociationName is the commitment association name. movePayload is the move request payload.
|
||||
func (client CommitmentAssociationsClient) Move(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentAssociationName string, movePayload MoveCommitmentAssociationRequest) (result CommitmentAssociation, err error) {
|
||||
req, err := client.MovePreparer(ctx, resourceGroupName, commitmentPlanName, commitmentAssociationName, movePayload)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "Move", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.MoveSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "Move", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.MoveResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.CommitmentAssociationsClient", "Move", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MovePreparer prepares the Move request.
|
||||
func (client CommitmentAssociationsClient) MovePreparer(ctx context.Context, resourceGroupName string, commitmentPlanName string, commitmentAssociationName string, movePayload MoveCommitmentAssociationRequest) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commitmentAssociationName": autorest.Encode("path", commitmentAssociationName),
|
||||
"commitmentPlanName": autorest.Encode("path", commitmentPlanName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}/move", pathParameters),
|
||||
autorest.WithJSON(movePayload),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// MoveSender sends the Move request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client CommitmentAssociationsClient) MoveSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// MoveResponder handles the response to the Move request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client CommitmentAssociationsClient) MoveResponder(resp *http.Response) (result CommitmentAssociation, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+504
@@ -0,0 +1,504 @@
|
||||
package commitmentplans
|
||||
|
||||
// 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"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Client is the these APIs allow end users to operate on Azure Machine Learning Commitment Plans resources and their
|
||||
// child Commitment Association resources. They support CRUD operations for commitment plans, get and list operations
|
||||
// for commitment associations, moving commitment associations between commitment plans, and retrieving commitment plan
|
||||
// usage history.
|
||||
type Client struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewClient creates an instance of the Client client.
|
||||
func NewClient(subscriptionID string) Client {
|
||||
return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewClientWithBaseURI creates an instance of the Client client.
|
||||
func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
|
||||
return Client{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate create a new Azure ML commitment plan resource or updates an existing one.
|
||||
//
|
||||
// createOrUpdatePayload is the payload to create or update the Azure ML commitment plan. resourceGroupName is the
|
||||
// resource group name. commitmentPlanName is the Azure ML commitment plan name.
|
||||
func (client Client) CreateOrUpdate(ctx context.Context, createOrUpdatePayload CommitmentPlan, resourceGroupName string, commitmentPlanName string) (result CommitmentPlan, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, createOrUpdatePayload, resourceGroupName, commitmentPlanName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client Client) CreateOrUpdatePreparer(ctx context.Context, createOrUpdatePayload CommitmentPlan, resourceGroupName string, commitmentPlanName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commitmentPlanName": autorest.Encode("path", commitmentPlanName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}", pathParameters),
|
||||
autorest.WithJSON(createOrUpdatePayload),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) CreateOrUpdateResponder(resp *http.Response) (result CommitmentPlan, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Get retrieve an Azure ML commitment plan by its subscription, resource group and name.
|
||||
//
|
||||
// resourceGroupName is the resource group name. commitmentPlanName is the Azure ML commitment plan name.
|
||||
func (client Client) Get(ctx context.Context, resourceGroupName string, commitmentPlanName string) (result CommitmentPlan, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, commitmentPlanName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, commitmentPlanName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commitmentPlanName": autorest.Encode("path", commitmentPlanName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) GetResponder(resp *http.Response) (result CommitmentPlan, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List retrieve all Azure ML commitment plans in a subscription.
|
||||
//
|
||||
// skipToken is continuation token for pagination.
|
||||
func (client Client) List(ctx context.Context, skipToken string) (result ListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, skipToken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.lr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.lr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client Client) ListPreparer(ctx context.Context, skipToken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skipToken) > 0 {
|
||||
queryParameters["$skipToken"] = autorest.Encode("query", skipToken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/commitmentPlans", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client Client) listNextResults(lastResults ListResult) (result ListResult, err error) {
|
||||
req, err := lastResults.listResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "commitmentplans.Client", "listNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "commitmentplans.Client", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client Client) ListComplete(ctx context.Context, skipToken string) (result ListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx, skipToken)
|
||||
return
|
||||
}
|
||||
|
||||
// ListInResourceGroup retrieve all Azure ML commitment plans in a resource group.
|
||||
//
|
||||
// resourceGroupName is the resource group name. skipToken is continuation token for pagination.
|
||||
func (client Client) ListInResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result ListResultPage, err error) {
|
||||
result.fn = client.listInResourceGroupNextResults
|
||||
req, err := client.ListInResourceGroupPreparer(ctx, resourceGroupName, skipToken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "ListInResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListInResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.lr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "ListInResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.lr, err = client.ListInResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "ListInResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListInResourceGroupPreparer prepares the ListInResourceGroup request.
|
||||
func (client Client) ListInResourceGroupPreparer(ctx context.Context, resourceGroupName string, skipToken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skipToken) > 0 {
|
||||
queryParameters["$skipToken"] = autorest.Encode("query", skipToken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListInResourceGroupSender sends the ListInResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ListInResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListInResourceGroupResponder handles the response to the ListInResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) ListInResourceGroupResponder(resp *http.Response) (result ListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listInResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client Client) listInResourceGroupNextResults(lastResults ListResult) (result ListResult, err error) {
|
||||
req, err := lastResults.listResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "commitmentplans.Client", "listInResourceGroupNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListInResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "commitmentplans.Client", "listInResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListInResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "listInResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListInResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client Client) ListInResourceGroupComplete(ctx context.Context, resourceGroupName string, skipToken string) (result ListResultIterator, err error) {
|
||||
result.page, err = client.ListInResourceGroup(ctx, resourceGroupName, skipToken)
|
||||
return
|
||||
}
|
||||
|
||||
// Patch patch an existing Azure ML commitment plan resource.
|
||||
//
|
||||
// patchPayload is the payload to use to patch the Azure ML commitment plan. Only tags and SKU may be modified on an
|
||||
// existing commitment plan. resourceGroupName is the resource group name. commitmentPlanName is the Azure ML
|
||||
// commitment plan name.
|
||||
func (client Client) Patch(ctx context.Context, patchPayload PatchPayload, resourceGroupName string, commitmentPlanName string) (result CommitmentPlan, err error) {
|
||||
req, err := client.PatchPreparer(ctx, patchPayload, resourceGroupName, commitmentPlanName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Patch", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.PatchSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Patch", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PatchResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Patch", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PatchPreparer prepares the Patch request.
|
||||
func (client Client) PatchPreparer(ctx context.Context, patchPayload PatchPayload, resourceGroupName string, commitmentPlanName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commitmentPlanName": autorest.Encode("path", commitmentPlanName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}", pathParameters),
|
||||
autorest.WithJSON(patchPayload),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// PatchSender sends the Patch request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) PatchSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// PatchResponder handles the response to the Patch request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) PatchResponder(resp *http.Response) (result CommitmentPlan, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Remove remove an existing Azure ML commitment plan.
|
||||
//
|
||||
// resourceGroupName is the resource group name. commitmentPlanName is the Azure ML commitment plan name.
|
||||
func (client Client) Remove(ctx context.Context, resourceGroupName string, commitmentPlanName string) (result autorest.Response, err error) {
|
||||
req, err := client.RemovePreparer(ctx, resourceGroupName, commitmentPlanName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Remove", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.RemoveSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Remove", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.RemoveResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.Client", "Remove", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// RemovePreparer prepares the Remove request.
|
||||
func (client Client) RemovePreparer(ctx context.Context, resourceGroupName string, commitmentPlanName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commitmentPlanName": autorest.Encode("path", commitmentPlanName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// RemoveSender sends the Remove request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) RemoveSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// RemoveResponder handles the response to the Remove request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) RemoveResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+475
@@ -0,0 +1,475 @@
|
||||
package commitmentplans
|
||||
|
||||
// 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 (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// CommitmentAssociation represents the association between a commitment plan and some other resource, such as a
|
||||
// Machine Learning web service.
|
||||
type CommitmentAssociation struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Resource Id.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Resource name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Resource location.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Resource type.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - User-defined tags for the resource.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// Etag - An entity tag used to enforce optimistic concurrency.
|
||||
Etag *string `json:"etag,omitempty"`
|
||||
// Properties - The properties of the commitment association resource.
|
||||
Properties *CommitmentAssociationProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// CommitmentAssociationListResult a page of commitment association resources.
|
||||
type CommitmentAssociationListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// NextLink - A URI to retrieve the next page of results.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
// Value - The set of results for this page.
|
||||
Value *[]CommitmentAssociation `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// CommitmentAssociationListResultIterator provides access to a complete listing of CommitmentAssociation values.
|
||||
type CommitmentAssociationListResultIterator struct {
|
||||
i int
|
||||
page CommitmentAssociationListResultPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *CommitmentAssociationListResultIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter CommitmentAssociationListResultIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter CommitmentAssociationListResultIterator) Response() CommitmentAssociationListResult {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter CommitmentAssociationListResultIterator) Value() CommitmentAssociation {
|
||||
if !iter.page.NotDone() {
|
||||
return CommitmentAssociation{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (calr CommitmentAssociationListResult) IsEmpty() bool {
|
||||
return calr.Value == nil || len(*calr.Value) == 0
|
||||
}
|
||||
|
||||
// commitmentAssociationListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (calr CommitmentAssociationListResult) commitmentAssociationListResultPreparer() (*http.Request, error) {
|
||||
if calr.NextLink == nil || len(to.String(calr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(calr.NextLink)))
|
||||
}
|
||||
|
||||
// CommitmentAssociationListResultPage contains a page of CommitmentAssociation values.
|
||||
type CommitmentAssociationListResultPage struct {
|
||||
fn func(CommitmentAssociationListResult) (CommitmentAssociationListResult, error)
|
||||
calr CommitmentAssociationListResult
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *CommitmentAssociationListResultPage) Next() error {
|
||||
next, err := page.fn(page.calr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.calr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page CommitmentAssociationListResultPage) NotDone() bool {
|
||||
return !page.calr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page CommitmentAssociationListResultPage) Response() CommitmentAssociationListResult {
|
||||
return page.calr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page CommitmentAssociationListResultPage) Values() []CommitmentAssociation {
|
||||
if page.calr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.calr.Value
|
||||
}
|
||||
|
||||
// CommitmentAssociationProperties properties of an Azure ML commitment association.
|
||||
type CommitmentAssociationProperties struct {
|
||||
// AssociatedResourceID - The ID of the resource this association points to, such as the ARM ID of an Azure ML web service.
|
||||
AssociatedResourceID *string `json:"associatedResourceId,omitempty"`
|
||||
// CommitmentPlanID - The ARM ID of the parent Azure ML commitment plan.
|
||||
CommitmentPlanID *string `json:"commitmentPlanId,omitempty"`
|
||||
// CreationDate - The date at which this commitment association was created, in ISO 8601 format.
|
||||
CreationDate *date.Time `json:"creationDate,omitempty"`
|
||||
}
|
||||
|
||||
// CommitmentPlan an Azure ML commitment plan resource.
|
||||
type CommitmentPlan struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Resource Id.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Resource name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Resource location.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Resource type.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - User-defined tags for the resource.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// Etag - An entity tag used to enforce optimistic concurrency.
|
||||
Etag *string `json:"etag,omitempty"`
|
||||
// Properties - The commitment plan properties.
|
||||
Properties *Properties `json:"properties,omitempty"`
|
||||
// Sku - The commitment plan SKU.
|
||||
Sku *ResourceSku `json:"sku,omitempty"`
|
||||
}
|
||||
|
||||
// ListResult a page of commitment plan resources.
|
||||
type ListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// NextLink - A URI to retrieve the next page of results.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
// Value - The set of results for this page.
|
||||
Value *[]CommitmentPlan `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// ListResultIterator provides access to a complete listing of CommitmentPlan values.
|
||||
type ListResultIterator struct {
|
||||
i int
|
||||
page ListResultPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *ListResultIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter ListResultIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter ListResultIterator) Response() ListResult {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter ListResultIterator) Value() CommitmentPlan {
|
||||
if !iter.page.NotDone() {
|
||||
return CommitmentPlan{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (lr ListResult) IsEmpty() bool {
|
||||
return lr.Value == nil || len(*lr.Value) == 0
|
||||
}
|
||||
|
||||
// listResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (lr ListResult) listResultPreparer() (*http.Request, error) {
|
||||
if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(lr.NextLink)))
|
||||
}
|
||||
|
||||
// ListResultPage contains a page of CommitmentPlan values.
|
||||
type ListResultPage struct {
|
||||
fn func(ListResult) (ListResult, error)
|
||||
lr ListResult
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *ListResultPage) Next() error {
|
||||
next, err := page.fn(page.lr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.lr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page ListResultPage) NotDone() bool {
|
||||
return !page.lr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page ListResultPage) Response() ListResult {
|
||||
return page.lr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page ListResultPage) Values() []CommitmentPlan {
|
||||
if page.lr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.lr.Value
|
||||
}
|
||||
|
||||
// MoveCommitmentAssociationRequest specifies the destination Azure ML commitment plan for a move operation.
|
||||
type MoveCommitmentAssociationRequest struct {
|
||||
// DestinationPlanID - The ARM ID of the commitment plan to re-parent the commitment association to.
|
||||
DestinationPlanID *string `json:"destinationPlanId,omitempty"`
|
||||
}
|
||||
|
||||
// PatchPayload the properties of a commitment plan which may be updated via PATCH.
|
||||
type PatchPayload struct {
|
||||
// Tags - User-defined tags for the commitment plan.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// Sku - The commitment plan SKU.
|
||||
Sku *ResourceSku `json:"sku,omitempty"`
|
||||
}
|
||||
|
||||
// PlanQuantity represents the quantity a commitment plan provides of a metered resource.
|
||||
type PlanQuantity struct {
|
||||
// Allowance - The quantity added to the commitment plan at an interval specified by its allowance frequency.
|
||||
Allowance *float64 `json:"allowance,omitempty"`
|
||||
// Amount - The quantity available to the plan the last time usage was calculated.
|
||||
Amount *float64 `json:"amount,omitempty"`
|
||||
// IncludedQuantityMeter - The Azure meter for usage against included quantities.
|
||||
IncludedQuantityMeter *string `json:"includedQuantityMeter,omitempty"`
|
||||
// OverageMeter - The Azure meter for usage which exceeds included quantities.
|
||||
OverageMeter *string `json:"overageMeter,omitempty"`
|
||||
}
|
||||
|
||||
// PlanUsageHistory represents historical information about usage of the Azure resources associated with a commitment
|
||||
// plan.
|
||||
type PlanUsageHistory struct {
|
||||
// PlanDeletionOverage - Overage incurred as a result of deleting a commitment plan.
|
||||
PlanDeletionOverage *map[string]*float64 `json:"planDeletionOverage,omitempty"`
|
||||
// PlanMigrationOverage - Overage incurred as a result of migrating a commitment plan from one SKU to another.
|
||||
PlanMigrationOverage *map[string]*float64 `json:"planMigrationOverage,omitempty"`
|
||||
// PlanQuantitiesAfterUsage - Included quantities remaining after usage against the commitment plan's associated resources was calculated.
|
||||
PlanQuantitiesAfterUsage *map[string]*float64 `json:"planQuantitiesAfterUsage,omitempty"`
|
||||
// PlanQuantitiesBeforeUsage - Included quantities remaining before usage against the commitment plan's associated resources was calculated.
|
||||
PlanQuantitiesBeforeUsage *map[string]*float64 `json:"planQuantitiesBeforeUsage,omitempty"`
|
||||
// PlanUsageOverage - Usage against the commitment plan's associated resources which was not covered by included quantities and is therefore overage.
|
||||
PlanUsageOverage *map[string]*float64 `json:"planUsageOverage,omitempty"`
|
||||
// Usage - Usage against the commitment plan's associated resources.
|
||||
Usage *map[string]*float64 `json:"usage,omitempty"`
|
||||
// UsageDate - The date of usage, in ISO 8601 format.
|
||||
UsageDate *date.Time `json:"usageDate,omitempty"`
|
||||
}
|
||||
|
||||
// PlanUsageHistoryListResult a page of usage history.
|
||||
type PlanUsageHistoryListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// NextLink - A URI to retrieve the next page of results.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
// Value - The set of results for this page.
|
||||
Value *[]PlanUsageHistory `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// PlanUsageHistoryListResultIterator provides access to a complete listing of PlanUsageHistory values.
|
||||
type PlanUsageHistoryListResultIterator struct {
|
||||
i int
|
||||
page PlanUsageHistoryListResultPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *PlanUsageHistoryListResultIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter PlanUsageHistoryListResultIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter PlanUsageHistoryListResultIterator) Response() PlanUsageHistoryListResult {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter PlanUsageHistoryListResultIterator) Value() PlanUsageHistory {
|
||||
if !iter.page.NotDone() {
|
||||
return PlanUsageHistory{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (puhlr PlanUsageHistoryListResult) IsEmpty() bool {
|
||||
return puhlr.Value == nil || len(*puhlr.Value) == 0
|
||||
}
|
||||
|
||||
// planUsageHistoryListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (puhlr PlanUsageHistoryListResult) planUsageHistoryListResultPreparer() (*http.Request, error) {
|
||||
if puhlr.NextLink == nil || len(to.String(puhlr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(puhlr.NextLink)))
|
||||
}
|
||||
|
||||
// PlanUsageHistoryListResultPage contains a page of PlanUsageHistory values.
|
||||
type PlanUsageHistoryListResultPage struct {
|
||||
fn func(PlanUsageHistoryListResult) (PlanUsageHistoryListResult, error)
|
||||
puhlr PlanUsageHistoryListResult
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *PlanUsageHistoryListResultPage) Next() error {
|
||||
next, err := page.fn(page.puhlr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.puhlr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page PlanUsageHistoryListResultPage) NotDone() bool {
|
||||
return !page.puhlr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page PlanUsageHistoryListResultPage) Response() PlanUsageHistoryListResult {
|
||||
return page.puhlr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page PlanUsageHistoryListResultPage) Values() []PlanUsageHistory {
|
||||
if page.puhlr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.puhlr.Value
|
||||
}
|
||||
|
||||
// Properties properties of an Azure ML commitment plan.
|
||||
type Properties struct {
|
||||
// ChargeForOverage - Indicates whether usage beyond the commitment plan's included quantities will be charged.
|
||||
ChargeForOverage *bool `json:"chargeForOverage,omitempty"`
|
||||
// ChargeForPlan - Indicates whether the commitment plan will incur a charge.
|
||||
ChargeForPlan *bool `json:"chargeForPlan,omitempty"`
|
||||
// CreationDate - The date at which this commitment plan was created, in ISO 8601 format.
|
||||
CreationDate *date.Time `json:"creationDate,omitempty"`
|
||||
// IncludedQuantities - The included resource quantities this plan gives you.
|
||||
IncludedQuantities *map[string]*PlanQuantity `json:"includedQuantities,omitempty"`
|
||||
// MaxAssociationLimit - The maximum number of commitment associations that can be children of this commitment plan.
|
||||
MaxAssociationLimit *int32 `json:"maxAssociationLimit,omitempty"`
|
||||
// MaxCapacityLimit - The maximum scale-out capacity for this commitment plan.
|
||||
MaxCapacityLimit *int32 `json:"maxCapacityLimit,omitempty"`
|
||||
// MinCapacityLimit - The minimum scale-out capacity for this commitment plan.
|
||||
MinCapacityLimit *int32 `json:"minCapacityLimit,omitempty"`
|
||||
// PlanMeter - The Azure meter which will be used to charge for this commitment plan.
|
||||
PlanMeter *string `json:"planMeter,omitempty"`
|
||||
// RefillFrequencyInDays - The frequency at which this commitment plan's included quantities are refilled.
|
||||
RefillFrequencyInDays *int32 `json:"refillFrequencyInDays,omitempty"`
|
||||
// SuspendPlanOnOverage - Indicates whether this commitment plan will be moved into a suspended state if usage goes beyond the commitment plan's included quantities.
|
||||
SuspendPlanOnOverage *bool `json:"suspendPlanOnOverage,omitempty"`
|
||||
}
|
||||
|
||||
// Resource common properties of an ARM resource.
|
||||
type Resource struct {
|
||||
// ID - Resource Id.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Resource name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Resource location.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Resource type.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - User-defined tags for the resource.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceSku the SKU of a resource.
|
||||
type ResourceSku struct {
|
||||
// Capacity - The scale-out capacity of the resource. 1 is 1x, 2 is 2x, etc. This impacts the quantities and cost of any commitment plan resource.
|
||||
Capacity *int32 `json:"capacity,omitempty"`
|
||||
// Name - The SKU name. Along with tier, uniquely identifies the SKU.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Tier - The SKU tier. Along with name, uniquely identifies the SKU.
|
||||
Tier *string `json:"tier,omitempty"`
|
||||
}
|
||||
Generated
Vendored
+141
@@ -0,0 +1,141 @@
|
||||
package commitmentplans
|
||||
|
||||
// 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"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// UsageHistoryClient is the these APIs allow end users to operate on Azure Machine Learning Commitment Plans resources
|
||||
// and their child Commitment Association resources. They support CRUD operations for commitment plans, get and list
|
||||
// operations for commitment associations, moving commitment associations between commitment plans, and retrieving
|
||||
// commitment plan usage history.
|
||||
type UsageHistoryClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewUsageHistoryClient creates an instance of the UsageHistoryClient client.
|
||||
func NewUsageHistoryClient(subscriptionID string) UsageHistoryClient {
|
||||
return NewUsageHistoryClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewUsageHistoryClientWithBaseURI creates an instance of the UsageHistoryClient client.
|
||||
func NewUsageHistoryClientWithBaseURI(baseURI string, subscriptionID string) UsageHistoryClient {
|
||||
return UsageHistoryClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List retrieve the usage history for an Azure ML commitment plan.
|
||||
//
|
||||
// resourceGroupName is the resource group name. commitmentPlanName is the Azure ML commitment plan name. skipToken is
|
||||
// continuation token for pagination.
|
||||
func (client UsageHistoryClient) List(ctx context.Context, resourceGroupName string, commitmentPlanName string, skipToken string) (result PlanUsageHistoryListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, commitmentPlanName, skipToken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.UsageHistoryClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.puhlr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.UsageHistoryClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.puhlr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.UsageHistoryClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client UsageHistoryClient) ListPreparer(ctx context.Context, resourceGroupName string, commitmentPlanName string, skipToken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commitmentPlanName": autorest.Encode("path", commitmentPlanName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skipToken) > 0 {
|
||||
queryParameters["$skipToken"] = autorest.Encode("query", skipToken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/usageHistory", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client UsageHistoryClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client UsageHistoryClient) ListResponder(resp *http.Response) (result PlanUsageHistoryListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client UsageHistoryClient) listNextResults(lastResults PlanUsageHistoryListResult) (result PlanUsageHistoryListResult, err error) {
|
||||
req, err := lastResults.planUsageHistoryListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "commitmentplans.UsageHistoryClient", "listNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "commitmentplans.UsageHistoryClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "commitmentplans.UsageHistoryClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client UsageHistoryClient) ListComplete(ctx context.Context, resourceGroupName string, commitmentPlanName string, skipToken string) (result PlanUsageHistoryListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx, resourceGroupName, commitmentPlanName, skipToken)
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
package commitmentplans
|
||||
|
||||
// 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.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v12.2.0-beta services"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v12.2.0-beta"
|
||||
}
|
||||
Generated
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
// Package webservices implements the Azure ARM Webservices service API version 2016-05-01-preview.
|
||||
//
|
||||
// These APIs allow end users to operate on Azure Machine Learning Web Services resources. They support the following
|
||||
// operations:<ul><li>Create or update a web service</li><li>Get a web service</li><li>Patch a web
|
||||
// service</li><li>Delete a web service</li><li>Get All Web Services in a Resource Group </li><li>Get All Web Services
|
||||
// in a Subscription</li><li>Get Web Services Keys</li></ul>
|
||||
package webservices
|
||||
|
||||
// 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 (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Webservices
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Webservices.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client.
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+862
@@ -0,0 +1,862 @@
|
||||
package webservices
|
||||
|
||||
// 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 (
|
||||
"encoding/json"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AssetType enumerates the values for asset type.
|
||||
type AssetType string
|
||||
|
||||
const (
|
||||
// AssetTypeModule ...
|
||||
AssetTypeModule AssetType = "Module"
|
||||
// AssetTypeResource ...
|
||||
AssetTypeResource AssetType = "Resource"
|
||||
)
|
||||
|
||||
// ColumnFormat enumerates the values for column format.
|
||||
type ColumnFormat string
|
||||
|
||||
const (
|
||||
// Byte ...
|
||||
Byte ColumnFormat = "Byte"
|
||||
// Char ...
|
||||
Char ColumnFormat = "Char"
|
||||
// Complex128 ...
|
||||
Complex128 ColumnFormat = "Complex128"
|
||||
// Complex64 ...
|
||||
Complex64 ColumnFormat = "Complex64"
|
||||
// DateTime ...
|
||||
DateTime ColumnFormat = "Date-time"
|
||||
// DateTimeOffset ...
|
||||
DateTimeOffset ColumnFormat = "Date-timeOffset"
|
||||
// Double ...
|
||||
Double ColumnFormat = "Double"
|
||||
// Duration ...
|
||||
Duration ColumnFormat = "Duration"
|
||||
// Float ...
|
||||
Float ColumnFormat = "Float"
|
||||
// Int16 ...
|
||||
Int16 ColumnFormat = "Int16"
|
||||
// Int32 ...
|
||||
Int32 ColumnFormat = "Int32"
|
||||
// Int64 ...
|
||||
Int64 ColumnFormat = "Int64"
|
||||
// Int8 ...
|
||||
Int8 ColumnFormat = "Int8"
|
||||
// Uint16 ...
|
||||
Uint16 ColumnFormat = "Uint16"
|
||||
// Uint32 ...
|
||||
Uint32 ColumnFormat = "Uint32"
|
||||
// Uint64 ...
|
||||
Uint64 ColumnFormat = "Uint64"
|
||||
// Uint8 ...
|
||||
Uint8 ColumnFormat = "Uint8"
|
||||
)
|
||||
|
||||
// ColumnType enumerates the values for column type.
|
||||
type ColumnType string
|
||||
|
||||
const (
|
||||
// Boolean ...
|
||||
Boolean ColumnType = "Boolean"
|
||||
// Integer ...
|
||||
Integer ColumnType = "Integer"
|
||||
// Number ...
|
||||
Number ColumnType = "Number"
|
||||
// String ...
|
||||
String ColumnType = "String"
|
||||
)
|
||||
|
||||
// DiagnosticsLevel enumerates the values for diagnostics level.
|
||||
type DiagnosticsLevel string
|
||||
|
||||
const (
|
||||
// All ...
|
||||
All DiagnosticsLevel = "All"
|
||||
// Error ...
|
||||
Error DiagnosticsLevel = "Error"
|
||||
// None ...
|
||||
None DiagnosticsLevel = "None"
|
||||
)
|
||||
|
||||
// InputPortType enumerates the values for input port type.
|
||||
type InputPortType string
|
||||
|
||||
const (
|
||||
// Dataset ...
|
||||
Dataset InputPortType = "Dataset"
|
||||
)
|
||||
|
||||
// OutputPortType enumerates the values for output port type.
|
||||
type OutputPortType string
|
||||
|
||||
const (
|
||||
// OutputPortTypeDataset ...
|
||||
OutputPortTypeDataset OutputPortType = "Dataset"
|
||||
)
|
||||
|
||||
// PackageType enumerates the values for package type.
|
||||
type PackageType string
|
||||
|
||||
const (
|
||||
// PackageTypeGraph ...
|
||||
PackageTypeGraph PackageType = "Graph"
|
||||
// PackageTypeWebServiceProperties ...
|
||||
PackageTypeWebServiceProperties PackageType = "WebServiceProperties"
|
||||
)
|
||||
|
||||
// ParameterType enumerates the values for parameter type.
|
||||
type ParameterType string
|
||||
|
||||
const (
|
||||
// ParameterTypeBoolean ...
|
||||
ParameterTypeBoolean ParameterType = "Boolean"
|
||||
// ParameterTypeColumnPicker ...
|
||||
ParameterTypeColumnPicker ParameterType = "ColumnPicker"
|
||||
// ParameterTypeCredential ...
|
||||
ParameterTypeCredential ParameterType = "Credential"
|
||||
// ParameterTypeDataGatewayName ...
|
||||
ParameterTypeDataGatewayName ParameterType = "DataGatewayName"
|
||||
// ParameterTypeDouble ...
|
||||
ParameterTypeDouble ParameterType = "Double"
|
||||
// ParameterTypeEnumerated ...
|
||||
ParameterTypeEnumerated ParameterType = "Enumerated"
|
||||
// ParameterTypeFloat ...
|
||||
ParameterTypeFloat ParameterType = "Float"
|
||||
// ParameterTypeInt ...
|
||||
ParameterTypeInt ParameterType = "Int"
|
||||
// ParameterTypeMode ...
|
||||
ParameterTypeMode ParameterType = "Mode"
|
||||
// ParameterTypeParameterRange ...
|
||||
ParameterTypeParameterRange ParameterType = "ParameterRange"
|
||||
// ParameterTypeScript ...
|
||||
ParameterTypeScript ParameterType = "Script"
|
||||
// ParameterTypeString ...
|
||||
ParameterTypeString ParameterType = "String"
|
||||
)
|
||||
|
||||
// ProvisioningState enumerates the values for provisioning state.
|
||||
type ProvisioningState string
|
||||
|
||||
const (
|
||||
// Failed ...
|
||||
Failed ProvisioningState = "Failed"
|
||||
// Provisioning ...
|
||||
Provisioning ProvisioningState = "Provisioning"
|
||||
// Succeeded ...
|
||||
Succeeded ProvisioningState = "Succeeded"
|
||||
// Unknown ...
|
||||
Unknown ProvisioningState = "Unknown"
|
||||
)
|
||||
|
||||
// AssetItem information about an asset associated with the web service.
|
||||
type AssetItem struct {
|
||||
// Name - Asset's friendly name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ID - Asset's Id.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Type - Asset's type. Possible values include: 'AssetTypeModule', 'AssetTypeResource'
|
||||
Type AssetType `json:"type,omitempty"`
|
||||
// LocationInfo - Access information for the asset.
|
||||
LocationInfo *AssetLocation `json:"locationInfo,omitempty"`
|
||||
// InputPorts - Information about the asset's input ports.
|
||||
InputPorts *map[string]*InputPort `json:"inputPorts,omitempty"`
|
||||
// OutputPorts - Information about the asset's output ports.
|
||||
OutputPorts *map[string]*OutputPort `json:"outputPorts,omitempty"`
|
||||
// Metadata - If the asset is a custom module, this holds the module's metadata.
|
||||
Metadata *map[string]*string `json:"metadata,omitempty"`
|
||||
// Parameters - If the asset is a custom module, this holds the module's parameters.
|
||||
Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// AssetLocation describes the access location for a web service asset.
|
||||
type AssetLocation struct {
|
||||
// URI - The URI where the asset is accessible from, (e.g. aml://abc for system assets or https://xyz for user asets
|
||||
URI *string `json:"uri,omitempty"`
|
||||
// Credentials - Access credentials for the asset, if applicable (e.g. asset specified by storage account connection string + blob URI)
|
||||
Credentials *string `json:"credentials,omitempty"`
|
||||
}
|
||||
|
||||
// ColumnSpecification swagger 2.0 schema for a column within the data table representing a web service input or
|
||||
// output. See Swagger specification: http://swagger.io/specification/
|
||||
type ColumnSpecification struct {
|
||||
// Type - Data type of the column. Possible values include: 'Boolean', 'Integer', 'Number', 'String'
|
||||
Type ColumnType `json:"type,omitempty"`
|
||||
// Format - Additional format information for the data type. Possible values include: 'Byte', 'Char', 'Complex64', 'Complex128', 'DateTime', 'DateTimeOffset', 'Double', 'Duration', 'Float', 'Int8', 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'Uint32', 'Uint64'
|
||||
Format ColumnFormat `json:"format,omitempty"`
|
||||
// Enum - If the data type is categorical, this provides the list of accepted categories.
|
||||
Enum *[]map[string]interface{} `json:"enum,omitempty"`
|
||||
// XMsIsnullable - Flag indicating if the type supports null values or not.
|
||||
XMsIsnullable *bool `json:"x-ms-isnullable,omitempty"`
|
||||
// XMsIsordered - Flag indicating whether the categories are treated as an ordered set or not, if this is a categorical column.
|
||||
XMsIsordered *bool `json:"x-ms-isordered,omitempty"`
|
||||
}
|
||||
|
||||
// CommitmentPlan information about the machine learning commitment plan associated with the web service.
|
||||
type CommitmentPlan struct {
|
||||
// ID - Specifies the Azure Resource Manager ID of the commitment plan associated with the web service.
|
||||
ID *string `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
// DiagnosticsConfiguration diagnostics settings for an Azure ML web service.
|
||||
type DiagnosticsConfiguration struct {
|
||||
// Level - Specifies the verbosity of the diagnostic output. Valid values are: None - disables tracing; Error - collects only error (stderr) traces; All - collects all traces (stdout and stderr). Possible values include: 'None', 'Error', 'All'
|
||||
Level DiagnosticsLevel `json:"level,omitempty"`
|
||||
// Expiry - Specifies the date and time when the logging will cease. If null, diagnostic collection is not time limited.
|
||||
Expiry *date.Time `json:"expiry,omitempty"`
|
||||
}
|
||||
|
||||
// ExampleRequest sample input data for the service's input(s).
|
||||
type ExampleRequest struct {
|
||||
// Inputs - Sample input data for the web service's input(s) given as an input name to sample input values matrix map.
|
||||
Inputs *map[string][][]map[string]interface{} `json:"inputs,omitempty"`
|
||||
// GlobalParameters - Sample input data for the web service's global parameters
|
||||
GlobalParameters *map[string]*map[string]interface{} `json:"globalParameters,omitempty"`
|
||||
}
|
||||
|
||||
// GraphEdge defines an edge within the web service's graph.
|
||||
type GraphEdge struct {
|
||||
// SourceNodeID - The source graph node's identifier.
|
||||
SourceNodeID *string `json:"sourceNodeId,omitempty"`
|
||||
// SourcePortID - The identifier of the source node's port that the edge connects from.
|
||||
SourcePortID *string `json:"sourcePortId,omitempty"`
|
||||
// TargetNodeID - The destination graph node's identifier.
|
||||
TargetNodeID *string `json:"targetNodeId,omitempty"`
|
||||
// TargetPortID - The identifier of the destination node's port that the edge connects into.
|
||||
TargetPortID *string `json:"targetPortId,omitempty"`
|
||||
}
|
||||
|
||||
// GraphNode specifies a node in the web service graph. The node can either be an input, output or asset node, so only
|
||||
// one of the corresponding id properties is populated at any given time.
|
||||
type GraphNode struct {
|
||||
// AssetID - The id of the asset represented by this node.
|
||||
AssetID *string `json:"assetId,omitempty"`
|
||||
// InputID - The id of the input element represented by this node.
|
||||
InputID *string `json:"inputId,omitempty"`
|
||||
// OutputID - The id of the output element represented by this node.
|
||||
OutputID *string `json:"outputId,omitempty"`
|
||||
// Parameters - If applicable, parameters of the node. Global graph parameters map into these, with values set at runtime.
|
||||
Parameters *map[string]*string `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// GraphPackage defines the graph of modules making up the machine learning solution.
|
||||
type GraphPackage struct {
|
||||
// Nodes - The set of nodes making up the graph, provided as a nodeId to GraphNode map
|
||||
Nodes *map[string]*GraphNode `json:"nodes,omitempty"`
|
||||
// Edges - The list of edges making up the graph.
|
||||
Edges *[]GraphEdge `json:"edges,omitempty"`
|
||||
// GraphParameters - The collection of global parameters for the graph, given as a global parameter name to GraphParameter map. Each parameter here has a 1:1 match with the global parameters values map declared at the WebServiceProperties level.
|
||||
GraphParameters *map[string]*GraphParameter `json:"graphParameters,omitempty"`
|
||||
}
|
||||
|
||||
// GraphParameter defines a global parameter in the graph.
|
||||
type GraphParameter struct {
|
||||
// Description - Description of this graph parameter.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// Type - Graph parameter's type. Possible values include: 'ParameterTypeString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeEnumerated', 'ParameterTypeScript', 'ParameterTypeMode', 'ParameterTypeCredential', 'ParameterTypeBoolean', 'ParameterTypeDouble', 'ParameterTypeColumnPicker', 'ParameterTypeParameterRange', 'ParameterTypeDataGatewayName'
|
||||
Type ParameterType `json:"type,omitempty"`
|
||||
// Links - Association links for this parameter to nodes in the graph.
|
||||
Links *[]GraphParameterLink `json:"links,omitempty"`
|
||||
}
|
||||
|
||||
// GraphParameterLink association link for a graph global parameter to a node in the graph.
|
||||
type GraphParameterLink struct {
|
||||
// NodeID - The graph node's identifier
|
||||
NodeID *string `json:"nodeId,omitempty"`
|
||||
// ParameterKey - The identifier of the node parameter that the global parameter maps to.
|
||||
ParameterKey *string `json:"parameterKey,omitempty"`
|
||||
}
|
||||
|
||||
// InputPort asset input port
|
||||
type InputPort struct {
|
||||
// Type - Port data type. Possible values include: 'Dataset'
|
||||
Type InputPortType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// Keys access keys for the web service calls.
|
||||
type Keys struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Primary - The primary access key.
|
||||
Primary *string `json:"primary,omitempty"`
|
||||
// Secondary - The secondary access key.
|
||||
Secondary *string `json:"secondary,omitempty"`
|
||||
}
|
||||
|
||||
// MachineLearningWorkspace information about the machine learning workspace containing the experiment that is source
|
||||
// for the web service.
|
||||
type MachineLearningWorkspace struct {
|
||||
// ID - Specifies the workspace ID of the machine learning workspace associated with the web service
|
||||
ID *string `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
// ModeValueInfo nested parameter definition.
|
||||
type ModeValueInfo struct {
|
||||
// InterfaceString - The interface string name for the nested parameter.
|
||||
InterfaceString *string `json:"interfaceString,omitempty"`
|
||||
// Parameters - The definition of the parameter.
|
||||
Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// ModuleAssetParameter parameter definition for a module asset.
|
||||
type ModuleAssetParameter struct {
|
||||
// Name - Parameter name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ParameterType - Parameter type.
|
||||
ParameterType *string `json:"parameterType,omitempty"`
|
||||
// ModeValuesInfo - Definitions for nested interface parameters if this is a complex module parameter.
|
||||
ModeValuesInfo *map[string]*ModeValueInfo `json:"modeValuesInfo,omitempty"`
|
||||
}
|
||||
|
||||
// OutputPort asset output port
|
||||
type OutputPort struct {
|
||||
// Type - Port data type. Possible values include: 'OutputPortTypeDataset'
|
||||
Type OutputPortType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// PaginatedWebServicesList paginated list of web services.
|
||||
type PaginatedWebServicesList struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - An array of web service objects.
|
||||
Value *[]WebService `json:"value,omitempty"`
|
||||
// NextLink - A continuation link (absolute URI) to the next page of results in the list.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// PaginatedWebServicesListIterator provides access to a complete listing of WebService values.
|
||||
type PaginatedWebServicesListIterator struct {
|
||||
i int
|
||||
page PaginatedWebServicesListPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *PaginatedWebServicesListIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter PaginatedWebServicesListIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter PaginatedWebServicesListIterator) Response() PaginatedWebServicesList {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter PaginatedWebServicesListIterator) Value() WebService {
|
||||
if !iter.page.NotDone() {
|
||||
return WebService{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (pwsl PaginatedWebServicesList) IsEmpty() bool {
|
||||
return pwsl.Value == nil || len(*pwsl.Value) == 0
|
||||
}
|
||||
|
||||
// paginatedWebServicesListPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (pwsl PaginatedWebServicesList) paginatedWebServicesListPreparer() (*http.Request, error) {
|
||||
if pwsl.NextLink == nil || len(to.String(pwsl.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(pwsl.NextLink)))
|
||||
}
|
||||
|
||||
// PaginatedWebServicesListPage contains a page of WebService values.
|
||||
type PaginatedWebServicesListPage struct {
|
||||
fn func(PaginatedWebServicesList) (PaginatedWebServicesList, error)
|
||||
pwsl PaginatedWebServicesList
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *PaginatedWebServicesListPage) Next() error {
|
||||
next, err := page.fn(page.pwsl)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.pwsl = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page PaginatedWebServicesListPage) NotDone() bool {
|
||||
return !page.pwsl.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page PaginatedWebServicesListPage) Response() PaginatedWebServicesList {
|
||||
return page.pwsl
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page PaginatedWebServicesListPage) Values() []WebService {
|
||||
if page.pwsl.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.pwsl.Value
|
||||
}
|
||||
|
||||
// BasicProperties the set of properties specific to the Azure ML web service resource.
|
||||
type BasicProperties interface {
|
||||
AsPropertiesForGraph() (*PropertiesForGraph, bool)
|
||||
AsProperties() (*Properties, bool)
|
||||
}
|
||||
|
||||
// Properties the set of properties specific to the Azure ML web service resource.
|
||||
type Properties struct {
|
||||
// Title - The title of the web service.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Description - The description of the web service.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// CreatedOn - Read Only: The date and time when the web service was created.
|
||||
CreatedOn *date.Time `json:"createdOn,omitempty"`
|
||||
// ModifiedOn - Read Only: The date and time when the web service was last modified.
|
||||
ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
|
||||
// ProvisioningState - Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
// Keys - Contains the web service provisioning keys. If you do not specify provisioning keys, the Azure Machine Learning system generates them for you. Note: The keys are not returned from calls to GET operations.
|
||||
Keys *Keys `json:"keys,omitempty"`
|
||||
// ReadOnly - When set to true, indicates that the web service is read-only and can no longer be updated or patched, only removed. Default, is false. Note: Once set to true, you cannot change its value.
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
// SwaggerLocation - Read Only: Contains the URI of the swagger spec associated with this web service.
|
||||
SwaggerLocation *string `json:"swaggerLocation,omitempty"`
|
||||
// ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true.
|
||||
ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
|
||||
// RealtimeConfiguration - Contains the configuration settings for the web service endpoint.
|
||||
RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
|
||||
// Diagnostics - Settings controlling the diagnostics traces collection for the web service.
|
||||
Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
|
||||
// StorageAccount - Specifies the storage account that Azure Machine Learning uses to store information about the web service. Only the name of the storage account is returned from calls to GET operations. When updating the storage account information, you must ensure that all necessary assets are available in the new storage account or calls to your web service will fail.
|
||||
StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
|
||||
// MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service.
|
||||
MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"`
|
||||
// CommitmentPlan - Contains the commitment plan associated with this web service. Set at creation time. Once set, this value cannot be changed. Note: The commitment plan is not returned from calls to GET operations.
|
||||
CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
|
||||
// Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification.
|
||||
Input *ServiceInputOutputSpecification `json:"input,omitempty"`
|
||||
// Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification.
|
||||
Output *ServiceInputOutputSpecification `json:"output,omitempty"`
|
||||
// ExampleRequest - Defines sample input data for one or more of the service's inputs.
|
||||
ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
|
||||
// Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs.
|
||||
Assets *map[string]*AssetItem `json:"assets,omitempty"`
|
||||
// Parameters - The set of global parameters values defined for the web service, given as a global parameter name to default value map. If no default value is specified, the parameter is considered to be required.
|
||||
Parameters *map[string]*string `json:"parameters,omitempty"`
|
||||
// PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph'
|
||||
PackageType PackageType `json:"packageType,omitempty"`
|
||||
}
|
||||
|
||||
func unmarshalBasicProperties(body []byte) (BasicProperties, error) {
|
||||
var m map[string]interface{}
|
||||
err := json.Unmarshal(body, &m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch m["packageType"] {
|
||||
case string(PackageTypeGraph):
|
||||
var pfg PropertiesForGraph
|
||||
err := json.Unmarshal(body, &pfg)
|
||||
return pfg, err
|
||||
default:
|
||||
var p Properties
|
||||
err := json.Unmarshal(body, &p)
|
||||
return p, err
|
||||
}
|
||||
}
|
||||
func unmarshalBasicPropertiesArray(body []byte) ([]BasicProperties, error) {
|
||||
var rawMessages []*json.RawMessage
|
||||
err := json.Unmarshal(body, &rawMessages)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pArray := make([]BasicProperties, len(rawMessages))
|
||||
|
||||
for index, rawMessage := range rawMessages {
|
||||
p, err := unmarshalBasicProperties(*rawMessage)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pArray[index] = p
|
||||
}
|
||||
return pArray, nil
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for Properties.
|
||||
func (p Properties) MarshalJSON() ([]byte, error) {
|
||||
p.PackageType = PackageTypeWebServiceProperties
|
||||
type Alias Properties
|
||||
return json.Marshal(&struct {
|
||||
Alias
|
||||
}{
|
||||
Alias: (Alias)(p),
|
||||
})
|
||||
}
|
||||
|
||||
// AsPropertiesForGraph is the BasicProperties implementation for Properties.
|
||||
func (p Properties) AsPropertiesForGraph() (*PropertiesForGraph, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// AsProperties is the BasicProperties implementation for Properties.
|
||||
func (p Properties) AsProperties() (*Properties, bool) {
|
||||
return &p, true
|
||||
}
|
||||
|
||||
// AsBasicProperties is the BasicProperties implementation for Properties.
|
||||
func (p Properties) AsBasicProperties() (BasicProperties, bool) {
|
||||
return &p, true
|
||||
}
|
||||
|
||||
// PropertiesForGraph properties specific to a Graph based web service.
|
||||
type PropertiesForGraph struct {
|
||||
// Title - The title of the web service.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Description - The description of the web service.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// CreatedOn - Read Only: The date and time when the web service was created.
|
||||
CreatedOn *date.Time `json:"createdOn,omitempty"`
|
||||
// ModifiedOn - Read Only: The date and time when the web service was last modified.
|
||||
ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
|
||||
// ProvisioningState - Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
// Keys - Contains the web service provisioning keys. If you do not specify provisioning keys, the Azure Machine Learning system generates them for you. Note: The keys are not returned from calls to GET operations.
|
||||
Keys *Keys `json:"keys,omitempty"`
|
||||
// ReadOnly - When set to true, indicates that the web service is read-only and can no longer be updated or patched, only removed. Default, is false. Note: Once set to true, you cannot change its value.
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
// SwaggerLocation - Read Only: Contains the URI of the swagger spec associated with this web service.
|
||||
SwaggerLocation *string `json:"swaggerLocation,omitempty"`
|
||||
// ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true.
|
||||
ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
|
||||
// RealtimeConfiguration - Contains the configuration settings for the web service endpoint.
|
||||
RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
|
||||
// Diagnostics - Settings controlling the diagnostics traces collection for the web service.
|
||||
Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
|
||||
// StorageAccount - Specifies the storage account that Azure Machine Learning uses to store information about the web service. Only the name of the storage account is returned from calls to GET operations. When updating the storage account information, you must ensure that all necessary assets are available in the new storage account or calls to your web service will fail.
|
||||
StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
|
||||
// MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service.
|
||||
MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"`
|
||||
// CommitmentPlan - Contains the commitment plan associated with this web service. Set at creation time. Once set, this value cannot be changed. Note: The commitment plan is not returned from calls to GET operations.
|
||||
CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
|
||||
// Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification.
|
||||
Input *ServiceInputOutputSpecification `json:"input,omitempty"`
|
||||
// Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification.
|
||||
Output *ServiceInputOutputSpecification `json:"output,omitempty"`
|
||||
// ExampleRequest - Defines sample input data for one or more of the service's inputs.
|
||||
ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
|
||||
// Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs.
|
||||
Assets *map[string]*AssetItem `json:"assets,omitempty"`
|
||||
// Parameters - The set of global parameters values defined for the web service, given as a global parameter name to default value map. If no default value is specified, the parameter is considered to be required.
|
||||
Parameters *map[string]*string `json:"parameters,omitempty"`
|
||||
// PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph'
|
||||
PackageType PackageType `json:"packageType,omitempty"`
|
||||
// Package - The definition of the graph package making up this web service.
|
||||
Package *GraphPackage `json:"package,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for PropertiesForGraph.
|
||||
func (pfg PropertiesForGraph) MarshalJSON() ([]byte, error) {
|
||||
pfg.PackageType = PackageTypeGraph
|
||||
type Alias PropertiesForGraph
|
||||
return json.Marshal(&struct {
|
||||
Alias
|
||||
}{
|
||||
Alias: (Alias)(pfg),
|
||||
})
|
||||
}
|
||||
|
||||
// AsPropertiesForGraph is the BasicProperties implementation for PropertiesForGraph.
|
||||
func (pfg PropertiesForGraph) AsPropertiesForGraph() (*PropertiesForGraph, bool) {
|
||||
return &pfg, true
|
||||
}
|
||||
|
||||
// AsProperties is the BasicProperties implementation for PropertiesForGraph.
|
||||
func (pfg PropertiesForGraph) AsProperties() (*Properties, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// AsBasicProperties is the BasicProperties implementation for PropertiesForGraph.
|
||||
func (pfg PropertiesForGraph) AsBasicProperties() (BasicProperties, bool) {
|
||||
return &pfg, true
|
||||
}
|
||||
|
||||
// RealtimeConfiguration holds the available configuration options for an Azure ML web service endpoint.
|
||||
type RealtimeConfiguration struct {
|
||||
// MaxConcurrentCalls - Specifies the maximum concurrent calls that can be made to the web service. Minimum value: 4, Maximum value: 200.
|
||||
MaxConcurrentCalls *int32 `json:"maxConcurrentCalls,omitempty"`
|
||||
}
|
||||
|
||||
// Resource ...
|
||||
type Resource struct {
|
||||
// ID - Specifies the resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Specifies the name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Specifies the location of the resource.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Specifies the type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - Contains resource tags defined as key/value pairs.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceInputOutputSpecification the swagger 2.0 schema describing the service's inputs or outputs. See Swagger
|
||||
// specification: http://swagger.io/specification/
|
||||
type ServiceInputOutputSpecification struct {
|
||||
// Title - The title of your Swagger schema.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Description - The description of the Swagger schema.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// Type - The type of the entity described in swagger. Always 'object'.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Properties - Specifies a collection that contains the column schema for each input or output of the web service. For more information, see the Swagger specification.
|
||||
Properties *map[string]*TableSpecification `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// StorageAccount access information for a storage account.
|
||||
type StorageAccount struct {
|
||||
// Name - Specifies the name of the storage account.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Key - Specifies the key used to access the storage account.
|
||||
Key *string `json:"key,omitempty"`
|
||||
}
|
||||
|
||||
// TableSpecification the swagger 2.0 schema describing a single service input or output. See Swagger specification:
|
||||
// http://swagger.io/specification/
|
||||
type TableSpecification struct {
|
||||
// Title - Swagger schema title.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Description - Swagger schema description.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// Type - The type of the entity described in swagger.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Format - The format, if 'type' is not 'object'
|
||||
Format *string `json:"format,omitempty"`
|
||||
// Properties - The set of columns within the data table.
|
||||
Properties *map[string]*ColumnSpecification `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// WebService instance of an Azure ML web service resource.
|
||||
type WebService struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Specifies the resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Specifies the name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Specifies the location of the resource.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Specifies the type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - Contains resource tags defined as key/value pairs.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// Properties - Contains the property payload that describes the web service.
|
||||
Properties BasicProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaler for WebService struct.
|
||||
func (ws *WebService) UnmarshalJSON(body []byte) error {
|
||||
var m map[string]*json.RawMessage
|
||||
err := json.Unmarshal(body, &m)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var v *json.RawMessage
|
||||
|
||||
v = m["properties"]
|
||||
if v != nil {
|
||||
properties, err := unmarshalBasicProperties(*m["properties"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Properties = properties
|
||||
}
|
||||
|
||||
v = m["id"]
|
||||
if v != nil {
|
||||
var ID string
|
||||
err = json.Unmarshal(*m["id"], &ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.ID = &ID
|
||||
}
|
||||
|
||||
v = m["name"]
|
||||
if v != nil {
|
||||
var name string
|
||||
err = json.Unmarshal(*m["name"], &name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Name = &name
|
||||
}
|
||||
|
||||
v = m["location"]
|
||||
if v != nil {
|
||||
var location string
|
||||
err = json.Unmarshal(*m["location"], &location)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Location = &location
|
||||
}
|
||||
|
||||
v = m["type"]
|
||||
if v != nil {
|
||||
var typeVar string
|
||||
err = json.Unmarshal(*m["type"], &typeVar)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Type = &typeVar
|
||||
}
|
||||
|
||||
v = m["tags"]
|
||||
if v != nil {
|
||||
var tags map[string]*string
|
||||
err = json.Unmarshal(*m["tags"], &tags)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Tags = &tags
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// WebServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
|
||||
// operation.
|
||||
type WebServicesCreateOrUpdateFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future WebServicesCreateOrUpdateFuture) Result(client Client) (ws WebService, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return ws, autorest.NewError("webservices.WebServicesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ws, err = client.CreateOrUpdateResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ws, err = client.CreateOrUpdateResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// WebServicesPatchFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type WebServicesPatchFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future WebServicesPatchFuture) Result(client Client) (ws WebService, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return ws, autorest.NewError("webservices.WebServicesPatchFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ws, err = client.PatchResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ws, err = client.PatchResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// WebServicesRemoveFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type WebServicesRemoveFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future WebServicesRemoveFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, autorest.NewError("webservices.WebServicesRemoveFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.RemoveResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ar, err = client.RemoveResponder(resp)
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
package webservices
|
||||
|
||||
// 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.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v12.2.0-beta services"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v12.2.0-beta"
|
||||
}
|
||||
Generated
Vendored
+609
@@ -0,0 +1,609 @@
|
||||
package webservices
|
||||
|
||||
// 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/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Client is the these APIs allow end users to operate on Azure Machine Learning Web Services resources. They support
|
||||
// the following operations:<ul><li>Create or update a web service</li><li>Get a web service</li><li>Patch a web
|
||||
// service</li><li>Delete a web service</li><li>Get All Web Services in a Resource Group </li><li>Get All Web Services
|
||||
// in a Subscription</li><li>Get Web Services Keys</li></ul>
|
||||
type Client struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewClient creates an instance of the Client client.
|
||||
func NewClient(subscriptionID string) Client {
|
||||
return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewClientWithBaseURI creates an instance of the Client client.
|
||||
func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
|
||||
return Client{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate create or update a web service. This call will overwrite an existing web service. Note that there is
|
||||
// no warning or confirmation. This is a nonrecoverable operation. If your intent is to create a new web service, call
|
||||
// the Get operation first to verify that it does not exist.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service. createOrUpdatePayload is the payload that is used to create or update the web service.
|
||||
func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, webServiceName string, createOrUpdatePayload WebService) (result WebServicesCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: createOrUpdatePayload,
|
||||
Constraints: []validation.Constraint{{Target: "createOrUpdatePayload.Properties", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMaximum, Rule: 200, Chain: nil},
|
||||
{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMinimum, Rule: 4, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "createOrUpdatePayload.Properties.MachineLearningWorkspace", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.MachineLearningWorkspace.ID", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "createOrUpdatePayload.Properties.CommitmentPlan", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.CommitmentPlan.ID", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "createOrUpdatePayload.Properties.Input", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.Input.Type", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "createOrUpdatePayload.Properties.Input.Properties", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{Target: "createOrUpdatePayload.Properties.Output", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.Output.Type", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "createOrUpdatePayload.Properties.Output.Properties", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "webservices.Client", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, webServiceName, createOrUpdatePayload)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, webServiceName string, createOrUpdatePayload WebService) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
|
||||
autorest.WithJSON(createOrUpdatePayload),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) CreateOrUpdateSender(req *http.Request) (future WebServicesCreateOrUpdateFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) CreateOrUpdateResponder(resp *http.Response) (result WebService, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets the Web Service Definiton as specified by a subscription, resource group, and name. Note that the storage
|
||||
// credentials and web service keys are not returned by this call. To get the web service access keys, call List Keys.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service.
|
||||
func (client Client) Get(ctx context.Context, resourceGroupName string, webServiceName string) (result WebService, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, webServiceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, webServiceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) GetResponder(resp *http.Response) (result WebService, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List gets the web services in the specified subscription.
|
||||
//
|
||||
// skiptoken is continuation token for pagination.
|
||||
func (client Client) List(ctx context.Context, skiptoken string) (result PaginatedWebServicesListPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, skiptoken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.pwsl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.pwsl, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client Client) ListPreparer(ctx context.Context, skiptoken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skiptoken) > 0 {
|
||||
queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/webServices", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) ListResponder(resp *http.Response) (result PaginatedWebServicesList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client Client) listNextResults(lastResults PaginatedWebServicesList) (result PaginatedWebServicesList, err error) {
|
||||
req, err := lastResults.paginatedWebServicesListPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "webservices.Client", "listNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "webservices.Client", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client Client) ListComplete(ctx context.Context, skiptoken string) (result PaginatedWebServicesListIterator, err error) {
|
||||
result.page, err = client.List(ctx, skiptoken)
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup gets the web services in the specified resource group.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. skiptoken is continuation token
|
||||
// for pagination.
|
||||
func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result PaginatedWebServicesListPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, skiptoken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.pwsl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.pwsl, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client Client) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, skiptoken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skiptoken) > 0 {
|
||||
queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) ListByResourceGroupResponder(resp *http.Response) (result PaginatedWebServicesList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client Client) listByResourceGroupNextResults(lastResults PaginatedWebServicesList) (result PaginatedWebServicesList, err error) {
|
||||
req, err := lastResults.paginatedWebServicesListPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "webservices.Client", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "webservices.Client", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skiptoken string) (result PaginatedWebServicesListIterator, err error) {
|
||||
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, skiptoken)
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeys gets the access keys for the specified web service.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service.
|
||||
func (client Client) ListKeys(ctx context.Context, resourceGroupName string, webServiceName string) (result Keys, err error) {
|
||||
req, err := client.ListKeysPreparer(ctx, resourceGroupName, webServiceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListKeys", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListKeysSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListKeys", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListKeysResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListKeys", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeysPreparer prepares the ListKeys request.
|
||||
func (client Client) ListKeysPreparer(ctx context.Context, resourceGroupName string, webServiceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}/listKeys", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListKeysSender sends the ListKeys request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ListKeysSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListKeysResponder handles the response to the ListKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) ListKeysResponder(resp *http.Response) (result Keys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Patch modifies an existing web service resource. The PATCH API call is an asynchronous operation. To determine
|
||||
// whether it has completed successfully, you must perform a Get operation.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service. patchPayload is the payload to use to patch the web service.
|
||||
func (client Client) Patch(ctx context.Context, resourceGroupName string, webServiceName string, patchPayload WebService) (result WebServicesPatchFuture, err error) {
|
||||
req, err := client.PatchPreparer(ctx, resourceGroupName, webServiceName, patchPayload)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Patch", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PatchSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Patch", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PatchPreparer prepares the Patch request.
|
||||
func (client Client) PatchPreparer(ctx context.Context, resourceGroupName string, webServiceName string, patchPayload WebService) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
|
||||
autorest.WithJSON(patchPayload),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// PatchSender sends the Patch request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) PatchSender(req *http.Request) (future WebServicesPatchFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
return
|
||||
}
|
||||
|
||||
// PatchResponder handles the response to the Patch request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) PatchResponder(resp *http.Response) (result WebService, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Remove deletes the specified web service.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service.
|
||||
func (client Client) Remove(ctx context.Context, resourceGroupName string, webServiceName string) (result WebServicesRemoveFuture, err error) {
|
||||
req, err := client.RemovePreparer(ctx, resourceGroupName, webServiceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Remove", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.RemoveSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Remove", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// RemovePreparer prepares the Remove request.
|
||||
func (client Client) RemovePreparer(ctx context.Context, resourceGroupName string, webServiceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// RemoveSender sends the Remove request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) RemoveSender(req *http.Request) (future WebServicesRemoveFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
|
||||
return
|
||||
}
|
||||
|
||||
// RemoveResponder handles the response to the Remove request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) RemoveResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
// Package webservices implements the Azure ARM Webservices service API version 2017-01-01.
|
||||
//
|
||||
// These APIs allow end users to operate on Azure Machine Learning Web Services resources. They support the following
|
||||
// operations:<ul><li>Create or update a web service</li><li>Get a web service</li><li>Patch a web
|
||||
// service</li><li>Delete a web service</li><li>Get All Web Services in a Resource Group </li><li>Get All Web Services
|
||||
// in a Subscription</li><li>Get Web Services Keys</li></ul>
|
||||
package webservices
|
||||
|
||||
// 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 (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Webservices
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Webservices.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client.
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+941
@@ -0,0 +1,941 @@
|
||||
package webservices
|
||||
|
||||
// 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 (
|
||||
"encoding/json"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AssetType enumerates the values for asset type.
|
||||
type AssetType string
|
||||
|
||||
const (
|
||||
// AssetTypeModule ...
|
||||
AssetTypeModule AssetType = "Module"
|
||||
// AssetTypeResource ...
|
||||
AssetTypeResource AssetType = "Resource"
|
||||
)
|
||||
|
||||
// ColumnFormat enumerates the values for column format.
|
||||
type ColumnFormat string
|
||||
|
||||
const (
|
||||
// Byte ...
|
||||
Byte ColumnFormat = "Byte"
|
||||
// Char ...
|
||||
Char ColumnFormat = "Char"
|
||||
// Complex128 ...
|
||||
Complex128 ColumnFormat = "Complex128"
|
||||
// Complex64 ...
|
||||
Complex64 ColumnFormat = "Complex64"
|
||||
// DateTime ...
|
||||
DateTime ColumnFormat = "Date-time"
|
||||
// DateTimeOffset ...
|
||||
DateTimeOffset ColumnFormat = "Date-timeOffset"
|
||||
// Double ...
|
||||
Double ColumnFormat = "Double"
|
||||
// Duration ...
|
||||
Duration ColumnFormat = "Duration"
|
||||
// Float ...
|
||||
Float ColumnFormat = "Float"
|
||||
// Int16 ...
|
||||
Int16 ColumnFormat = "Int16"
|
||||
// Int32 ...
|
||||
Int32 ColumnFormat = "Int32"
|
||||
// Int64 ...
|
||||
Int64 ColumnFormat = "Int64"
|
||||
// Int8 ...
|
||||
Int8 ColumnFormat = "Int8"
|
||||
// Uint16 ...
|
||||
Uint16 ColumnFormat = "Uint16"
|
||||
// Uint32 ...
|
||||
Uint32 ColumnFormat = "Uint32"
|
||||
// Uint64 ...
|
||||
Uint64 ColumnFormat = "Uint64"
|
||||
// Uint8 ...
|
||||
Uint8 ColumnFormat = "Uint8"
|
||||
)
|
||||
|
||||
// ColumnType enumerates the values for column type.
|
||||
type ColumnType string
|
||||
|
||||
const (
|
||||
// Boolean ...
|
||||
Boolean ColumnType = "Boolean"
|
||||
// Integer ...
|
||||
Integer ColumnType = "Integer"
|
||||
// Number ...
|
||||
Number ColumnType = "Number"
|
||||
// String ...
|
||||
String ColumnType = "String"
|
||||
)
|
||||
|
||||
// DiagnosticsLevel enumerates the values for diagnostics level.
|
||||
type DiagnosticsLevel string
|
||||
|
||||
const (
|
||||
// All ...
|
||||
All DiagnosticsLevel = "All"
|
||||
// Error ...
|
||||
Error DiagnosticsLevel = "Error"
|
||||
// None ...
|
||||
None DiagnosticsLevel = "None"
|
||||
)
|
||||
|
||||
// InputPortType enumerates the values for input port type.
|
||||
type InputPortType string
|
||||
|
||||
const (
|
||||
// Dataset ...
|
||||
Dataset InputPortType = "Dataset"
|
||||
)
|
||||
|
||||
// OutputPortType enumerates the values for output port type.
|
||||
type OutputPortType string
|
||||
|
||||
const (
|
||||
// OutputPortTypeDataset ...
|
||||
OutputPortTypeDataset OutputPortType = "Dataset"
|
||||
)
|
||||
|
||||
// PackageType enumerates the values for package type.
|
||||
type PackageType string
|
||||
|
||||
const (
|
||||
// PackageTypeGraph ...
|
||||
PackageTypeGraph PackageType = "Graph"
|
||||
// PackageTypeWebServiceProperties ...
|
||||
PackageTypeWebServiceProperties PackageType = "WebServiceProperties"
|
||||
)
|
||||
|
||||
// ParameterType enumerates the values for parameter type.
|
||||
type ParameterType string
|
||||
|
||||
const (
|
||||
// ParameterTypeBoolean ...
|
||||
ParameterTypeBoolean ParameterType = "Boolean"
|
||||
// ParameterTypeColumnPicker ...
|
||||
ParameterTypeColumnPicker ParameterType = "ColumnPicker"
|
||||
// ParameterTypeCredential ...
|
||||
ParameterTypeCredential ParameterType = "Credential"
|
||||
// ParameterTypeDataGatewayName ...
|
||||
ParameterTypeDataGatewayName ParameterType = "DataGatewayName"
|
||||
// ParameterTypeDouble ...
|
||||
ParameterTypeDouble ParameterType = "Double"
|
||||
// ParameterTypeEnumerated ...
|
||||
ParameterTypeEnumerated ParameterType = "Enumerated"
|
||||
// ParameterTypeFloat ...
|
||||
ParameterTypeFloat ParameterType = "Float"
|
||||
// ParameterTypeInt ...
|
||||
ParameterTypeInt ParameterType = "Int"
|
||||
// ParameterTypeMode ...
|
||||
ParameterTypeMode ParameterType = "Mode"
|
||||
// ParameterTypeParameterRange ...
|
||||
ParameterTypeParameterRange ParameterType = "ParameterRange"
|
||||
// ParameterTypeScript ...
|
||||
ParameterTypeScript ParameterType = "Script"
|
||||
// ParameterTypeString ...
|
||||
ParameterTypeString ParameterType = "String"
|
||||
)
|
||||
|
||||
// ProvisioningState enumerates the values for provisioning state.
|
||||
type ProvisioningState string
|
||||
|
||||
const (
|
||||
// Failed ...
|
||||
Failed ProvisioningState = "Failed"
|
||||
// Provisioning ...
|
||||
Provisioning ProvisioningState = "Provisioning"
|
||||
// Succeeded ...
|
||||
Succeeded ProvisioningState = "Succeeded"
|
||||
// Unknown ...
|
||||
Unknown ProvisioningState = "Unknown"
|
||||
)
|
||||
|
||||
// AssetItem information about an asset associated with the web service.
|
||||
type AssetItem struct {
|
||||
// Name - Asset's friendly name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ID - Asset's Id.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Type - Asset's type. Possible values include: 'AssetTypeModule', 'AssetTypeResource'
|
||||
Type AssetType `json:"type,omitempty"`
|
||||
// LocationInfo - Access information for the asset.
|
||||
LocationInfo *BlobLocation `json:"locationInfo,omitempty"`
|
||||
// InputPorts - Information about the asset's input ports.
|
||||
InputPorts *map[string]*InputPort `json:"inputPorts,omitempty"`
|
||||
// OutputPorts - Information about the asset's output ports.
|
||||
OutputPorts *map[string]*OutputPort `json:"outputPorts,omitempty"`
|
||||
// Metadata - If the asset is a custom module, this holds the module's metadata.
|
||||
Metadata *map[string]*string `json:"metadata,omitempty"`
|
||||
// Parameters - If the asset is a custom module, this holds the module's parameters.
|
||||
Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// AsyncOperationErrorInfo the error detail information for async operation
|
||||
type AsyncOperationErrorInfo struct {
|
||||
// Code - The error code.
|
||||
Code *string `json:"code,omitempty"`
|
||||
// Target - The error target.
|
||||
Target *string `json:"target,omitempty"`
|
||||
// Message - The error message.
|
||||
Message *string `json:"message,omitempty"`
|
||||
// Details - An array containing error information.
|
||||
Details *[]AsyncOperationErrorInfo `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
// AsyncOperationStatus azure async operation status.
|
||||
type AsyncOperationStatus struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Async operation id.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Async operation name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ProvisioningState - Read Only: The provisioning state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
// StartTime - The date time that the async operation started.
|
||||
StartTime *date.Time `json:"startTime,omitempty"`
|
||||
// EndTime - The date time that the async operation finished.
|
||||
EndTime *date.Time `json:"endTime,omitempty"`
|
||||
// PercentComplete - Async operation progress.
|
||||
PercentComplete *float64 `json:"percentComplete,omitempty"`
|
||||
// ErrorInfo - If the async operation fails, this structure contains the error details.
|
||||
ErrorInfo *AsyncOperationErrorInfo `json:"errorInfo,omitempty"`
|
||||
}
|
||||
|
||||
// BlobLocation describes the access location for a blob.
|
||||
type BlobLocation struct {
|
||||
// URI - The URI from which the blob is accessible from. For example, aml://abc for system assets or https://xyz for user assets or payload.
|
||||
URI *string `json:"uri,omitempty"`
|
||||
// Credentials - Access credentials for the blob, if applicable (e.g. blob specified by storage account connection string + blob URI)
|
||||
Credentials *string `json:"credentials,omitempty"`
|
||||
}
|
||||
|
||||
// ColumnSpecification swagger 2.0 schema for a column within the data table representing a web service input or
|
||||
// output. See Swagger specification: http://swagger.io/specification/
|
||||
type ColumnSpecification struct {
|
||||
// Type - Data type of the column. Possible values include: 'Boolean', 'Integer', 'Number', 'String'
|
||||
Type ColumnType `json:"type,omitempty"`
|
||||
// Format - Additional format information for the data type. Possible values include: 'Byte', 'Char', 'Complex64', 'Complex128', 'DateTime', 'DateTimeOffset', 'Double', 'Duration', 'Float', 'Int8', 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'Uint32', 'Uint64'
|
||||
Format ColumnFormat `json:"format,omitempty"`
|
||||
// Enum - If the data type is categorical, this provides the list of accepted categories.
|
||||
Enum *[]map[string]interface{} `json:"enum,omitempty"`
|
||||
// XMsIsnullable - Flag indicating if the type supports null values or not.
|
||||
XMsIsnullable *bool `json:"x-ms-isnullable,omitempty"`
|
||||
// XMsIsordered - Flag indicating whether the categories are treated as an ordered set or not, if this is a categorical column.
|
||||
XMsIsordered *bool `json:"x-ms-isordered,omitempty"`
|
||||
}
|
||||
|
||||
// CommitmentPlan information about the machine learning commitment plan associated with the web service.
|
||||
type CommitmentPlan struct {
|
||||
// ID - Specifies the Azure Resource Manager ID of the commitment plan associated with the web service.
|
||||
ID *string `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
// DiagnosticsConfiguration diagnostics settings for an Azure ML web service.
|
||||
type DiagnosticsConfiguration struct {
|
||||
// Level - Specifies the verbosity of the diagnostic output. Valid values are: None - disables tracing; Error - collects only error (stderr) traces; All - collects all traces (stdout and stderr). Possible values include: 'None', 'Error', 'All'
|
||||
Level DiagnosticsLevel `json:"level,omitempty"`
|
||||
// Expiry - Specifies the date and time when the logging will cease. If null, diagnostic collection is not time limited.
|
||||
Expiry *date.Time `json:"expiry,omitempty"`
|
||||
}
|
||||
|
||||
// ExampleRequest sample input data for the service's input(s).
|
||||
type ExampleRequest struct {
|
||||
// Inputs - Sample input data for the web service's input(s) given as an input name to sample input values matrix map.
|
||||
Inputs *map[string][][]map[string]interface{} `json:"inputs,omitempty"`
|
||||
// GlobalParameters - Sample input data for the web service's global parameters
|
||||
GlobalParameters *map[string]*map[string]interface{} `json:"globalParameters,omitempty"`
|
||||
}
|
||||
|
||||
// GraphEdge defines an edge within the web service's graph.
|
||||
type GraphEdge struct {
|
||||
// SourceNodeID - The source graph node's identifier.
|
||||
SourceNodeID *string `json:"sourceNodeId,omitempty"`
|
||||
// SourcePortID - The identifier of the source node's port that the edge connects from.
|
||||
SourcePortID *string `json:"sourcePortId,omitempty"`
|
||||
// TargetNodeID - The destination graph node's identifier.
|
||||
TargetNodeID *string `json:"targetNodeId,omitempty"`
|
||||
// TargetPortID - The identifier of the destination node's port that the edge connects into.
|
||||
TargetPortID *string `json:"targetPortId,omitempty"`
|
||||
}
|
||||
|
||||
// GraphNode specifies a node in the web service graph. The node can either be an input, output or asset node, so only
|
||||
// one of the corresponding id properties is populated at any given time.
|
||||
type GraphNode struct {
|
||||
// AssetID - The id of the asset represented by this node.
|
||||
AssetID *string `json:"assetId,omitempty"`
|
||||
// InputID - The id of the input element represented by this node.
|
||||
InputID *string `json:"inputId,omitempty"`
|
||||
// OutputID - The id of the output element represented by this node.
|
||||
OutputID *string `json:"outputId,omitempty"`
|
||||
// Parameters - If applicable, parameters of the node. Global graph parameters map into these, with values set at runtime.
|
||||
Parameters *map[string]*Parameter `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// GraphPackage defines the graph of modules making up the machine learning solution.
|
||||
type GraphPackage struct {
|
||||
// Nodes - The set of nodes making up the graph, provided as a nodeId to GraphNode map
|
||||
Nodes *map[string]*GraphNode `json:"nodes,omitempty"`
|
||||
// Edges - The list of edges making up the graph.
|
||||
Edges *[]GraphEdge `json:"edges,omitempty"`
|
||||
// GraphParameters - The collection of global parameters for the graph, given as a global parameter name to GraphParameter map. Each parameter here has a 1:1 match with the global parameters values map declared at the WebServiceProperties level.
|
||||
GraphParameters *map[string]*GraphParameter `json:"graphParameters,omitempty"`
|
||||
}
|
||||
|
||||
// GraphParameter defines a global parameter in the graph.
|
||||
type GraphParameter struct {
|
||||
// Description - Description of this graph parameter.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// Type - Graph parameter's type. Possible values include: 'ParameterTypeString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeEnumerated', 'ParameterTypeScript', 'ParameterTypeMode', 'ParameterTypeCredential', 'ParameterTypeBoolean', 'ParameterTypeDouble', 'ParameterTypeColumnPicker', 'ParameterTypeParameterRange', 'ParameterTypeDataGatewayName'
|
||||
Type ParameterType `json:"type,omitempty"`
|
||||
// Links - Association links for this parameter to nodes in the graph.
|
||||
Links *[]GraphParameterLink `json:"links,omitempty"`
|
||||
}
|
||||
|
||||
// GraphParameterLink association link for a graph global parameter to a node in the graph.
|
||||
type GraphParameterLink struct {
|
||||
// NodeID - The graph node's identifier
|
||||
NodeID *string `json:"nodeId,omitempty"`
|
||||
// ParameterKey - The identifier of the node parameter that the global parameter maps to.
|
||||
ParameterKey *string `json:"parameterKey,omitempty"`
|
||||
}
|
||||
|
||||
// InputPort asset input port
|
||||
type InputPort struct {
|
||||
// Type - Port data type. Possible values include: 'Dataset'
|
||||
Type InputPortType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// Keys access keys for the web service calls.
|
||||
type Keys struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Primary - The primary access key.
|
||||
Primary *string `json:"primary,omitempty"`
|
||||
// Secondary - The secondary access key.
|
||||
Secondary *string `json:"secondary,omitempty"`
|
||||
}
|
||||
|
||||
// MachineLearningWorkspace information about the machine learning workspace containing the experiment that is source
|
||||
// for the web service.
|
||||
type MachineLearningWorkspace struct {
|
||||
// ID - Specifies the workspace ID of the machine learning workspace associated with the web service
|
||||
ID *string `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
// ModeValueInfo nested parameter definition.
|
||||
type ModeValueInfo struct {
|
||||
// InterfaceString - The interface string name for the nested parameter.
|
||||
InterfaceString *string `json:"interfaceString,omitempty"`
|
||||
// Parameters - The definition of the parameter.
|
||||
Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// ModuleAssetParameter parameter definition for a module asset.
|
||||
type ModuleAssetParameter struct {
|
||||
// Name - Parameter name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ParameterType - Parameter type.
|
||||
ParameterType *string `json:"parameterType,omitempty"`
|
||||
// ModeValuesInfo - Definitions for nested interface parameters if this is a complex module parameter.
|
||||
ModeValuesInfo *map[string]*ModeValueInfo `json:"modeValuesInfo,omitempty"`
|
||||
}
|
||||
|
||||
// OutputPort asset output port
|
||||
type OutputPort struct {
|
||||
// Type - Port data type. Possible values include: 'OutputPortTypeDataset'
|
||||
Type OutputPortType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// PaginatedWebServicesList paginated list of web services.
|
||||
type PaginatedWebServicesList struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - An array of web service objects.
|
||||
Value *[]WebService `json:"value,omitempty"`
|
||||
// NextLink - A continuation link (absolute URI) to the next page of results in the list.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// PaginatedWebServicesListIterator provides access to a complete listing of WebService values.
|
||||
type PaginatedWebServicesListIterator struct {
|
||||
i int
|
||||
page PaginatedWebServicesListPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *PaginatedWebServicesListIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter PaginatedWebServicesListIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter PaginatedWebServicesListIterator) Response() PaginatedWebServicesList {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter PaginatedWebServicesListIterator) Value() WebService {
|
||||
if !iter.page.NotDone() {
|
||||
return WebService{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (pwsl PaginatedWebServicesList) IsEmpty() bool {
|
||||
return pwsl.Value == nil || len(*pwsl.Value) == 0
|
||||
}
|
||||
|
||||
// paginatedWebServicesListPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (pwsl PaginatedWebServicesList) paginatedWebServicesListPreparer() (*http.Request, error) {
|
||||
if pwsl.NextLink == nil || len(to.String(pwsl.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(pwsl.NextLink)))
|
||||
}
|
||||
|
||||
// PaginatedWebServicesListPage contains a page of WebService values.
|
||||
type PaginatedWebServicesListPage struct {
|
||||
fn func(PaginatedWebServicesList) (PaginatedWebServicesList, error)
|
||||
pwsl PaginatedWebServicesList
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *PaginatedWebServicesListPage) Next() error {
|
||||
next, err := page.fn(page.pwsl)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.pwsl = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page PaginatedWebServicesListPage) NotDone() bool {
|
||||
return !page.pwsl.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page PaginatedWebServicesListPage) Response() PaginatedWebServicesList {
|
||||
return page.pwsl
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page PaginatedWebServicesListPage) Values() []WebService {
|
||||
if page.pwsl.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.pwsl.Value
|
||||
}
|
||||
|
||||
// Parameter web Service Parameter object for node and global parameter
|
||||
type Parameter struct {
|
||||
// Value - The parameter value
|
||||
Value *map[string]interface{} `json:"value,omitempty"`
|
||||
// CertificateThumbprint - If the parameter value in 'value' field is encrypted, the thumbprint of the certificate should be put here.
|
||||
CertificateThumbprint *string `json:"certificateThumbprint,omitempty"`
|
||||
}
|
||||
|
||||
// BasicProperties the set of properties specific to the Azure ML web service resource.
|
||||
type BasicProperties interface {
|
||||
AsPropertiesForGraph() (*PropertiesForGraph, bool)
|
||||
AsProperties() (*Properties, bool)
|
||||
}
|
||||
|
||||
// Properties the set of properties specific to the Azure ML web service resource.
|
||||
type Properties struct {
|
||||
// Title - The title of the web service.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Description - The description of the web service.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// CreatedOn - Read Only: The date and time when the web service was created.
|
||||
CreatedOn *date.Time `json:"createdOn,omitempty"`
|
||||
// ModifiedOn - Read Only: The date and time when the web service was last modified.
|
||||
ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
|
||||
// ProvisioningState - Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
// Keys - Contains the web service provisioning keys. If you do not specify provisioning keys, the Azure Machine Learning system generates them for you. Note: The keys are not returned from calls to GET operations.
|
||||
Keys *Keys `json:"keys,omitempty"`
|
||||
// ReadOnly - When set to true, indicates that the web service is read-only and can no longer be updated or patched, only removed. Default, is false. Note: Once set to true, you cannot change its value.
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
// SwaggerLocation - Read Only: Contains the URI of the swagger spec associated with this web service.
|
||||
SwaggerLocation *string `json:"swaggerLocation,omitempty"`
|
||||
// ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true.
|
||||
ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
|
||||
// RealtimeConfiguration - Contains the configuration settings for the web service endpoint.
|
||||
RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
|
||||
// Diagnostics - Settings controlling the diagnostics traces collection for the web service.
|
||||
Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
|
||||
// StorageAccount - Specifies the storage account that Azure Machine Learning uses to store information about the web service. Only the name of the storage account is returned from calls to GET operations. When updating the storage account information, you must ensure that all necessary assets are available in the new storage account or calls to your web service will fail.
|
||||
StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
|
||||
// MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service.
|
||||
MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"`
|
||||
// CommitmentPlan - Contains the commitment plan associated with this web service. Set at creation time. Once set, this value cannot be changed. Note: The commitment plan is not returned from calls to GET operations.
|
||||
CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
|
||||
// Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification.
|
||||
Input *ServiceInputOutputSpecification `json:"input,omitempty"`
|
||||
// Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification.
|
||||
Output *ServiceInputOutputSpecification `json:"output,omitempty"`
|
||||
// ExampleRequest - Defines sample input data for one or more of the service's inputs.
|
||||
ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
|
||||
// Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs.
|
||||
Assets *map[string]*AssetItem `json:"assets,omitempty"`
|
||||
// Parameters - The set of global parameters values defined for the web service, given as a global parameter name to default value map. If no default value is specified, the parameter is considered to be required.
|
||||
Parameters *map[string]*Parameter `json:"parameters,omitempty"`
|
||||
// PayloadsInBlobStorage - When set to true, indicates that the payload size is larger than 3 MB. Otherwise false. If the payload size exceed 3 MB, the payload is stored in a blob and the PayloadsLocation parameter contains the URI of the blob. Otherwise, this will be set to false and Assets, Input, Output, Package, Parameters, ExampleRequest are inline. The Payload sizes is determined by adding the size of the Assets, Input, Output, Package, Parameters, and the ExampleRequest.
|
||||
PayloadsInBlobStorage *bool `json:"payloadsInBlobStorage,omitempty"`
|
||||
// PayloadsLocation - The URI of the payload blob. This paramater contains a value only if the payloadsInBlobStorage parameter is set to true. Otherwise is set to null.
|
||||
PayloadsLocation *BlobLocation `json:"payloadsLocation,omitempty"`
|
||||
// PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph'
|
||||
PackageType PackageType `json:"packageType,omitempty"`
|
||||
}
|
||||
|
||||
func unmarshalBasicProperties(body []byte) (BasicProperties, error) {
|
||||
var m map[string]interface{}
|
||||
err := json.Unmarshal(body, &m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch m["packageType"] {
|
||||
case string(PackageTypeGraph):
|
||||
var pfg PropertiesForGraph
|
||||
err := json.Unmarshal(body, &pfg)
|
||||
return pfg, err
|
||||
default:
|
||||
var p Properties
|
||||
err := json.Unmarshal(body, &p)
|
||||
return p, err
|
||||
}
|
||||
}
|
||||
func unmarshalBasicPropertiesArray(body []byte) ([]BasicProperties, error) {
|
||||
var rawMessages []*json.RawMessage
|
||||
err := json.Unmarshal(body, &rawMessages)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pArray := make([]BasicProperties, len(rawMessages))
|
||||
|
||||
for index, rawMessage := range rawMessages {
|
||||
p, err := unmarshalBasicProperties(*rawMessage)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pArray[index] = p
|
||||
}
|
||||
return pArray, nil
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for Properties.
|
||||
func (p Properties) MarshalJSON() ([]byte, error) {
|
||||
p.PackageType = PackageTypeWebServiceProperties
|
||||
type Alias Properties
|
||||
return json.Marshal(&struct {
|
||||
Alias
|
||||
}{
|
||||
Alias: (Alias)(p),
|
||||
})
|
||||
}
|
||||
|
||||
// AsPropertiesForGraph is the BasicProperties implementation for Properties.
|
||||
func (p Properties) AsPropertiesForGraph() (*PropertiesForGraph, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// AsProperties is the BasicProperties implementation for Properties.
|
||||
func (p Properties) AsProperties() (*Properties, bool) {
|
||||
return &p, true
|
||||
}
|
||||
|
||||
// AsBasicProperties is the BasicProperties implementation for Properties.
|
||||
func (p Properties) AsBasicProperties() (BasicProperties, bool) {
|
||||
return &p, true
|
||||
}
|
||||
|
||||
// PropertiesForGraph properties specific to a Graph based web service.
|
||||
type PropertiesForGraph struct {
|
||||
// Title - The title of the web service.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Description - The description of the web service.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// CreatedOn - Read Only: The date and time when the web service was created.
|
||||
CreatedOn *date.Time `json:"createdOn,omitempty"`
|
||||
// ModifiedOn - Read Only: The date and time when the web service was last modified.
|
||||
ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
|
||||
// ProvisioningState - Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
// Keys - Contains the web service provisioning keys. If you do not specify provisioning keys, the Azure Machine Learning system generates them for you. Note: The keys are not returned from calls to GET operations.
|
||||
Keys *Keys `json:"keys,omitempty"`
|
||||
// ReadOnly - When set to true, indicates that the web service is read-only and can no longer be updated or patched, only removed. Default, is false. Note: Once set to true, you cannot change its value.
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
// SwaggerLocation - Read Only: Contains the URI of the swagger spec associated with this web service.
|
||||
SwaggerLocation *string `json:"swaggerLocation,omitempty"`
|
||||
// ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true.
|
||||
ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
|
||||
// RealtimeConfiguration - Contains the configuration settings for the web service endpoint.
|
||||
RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
|
||||
// Diagnostics - Settings controlling the diagnostics traces collection for the web service.
|
||||
Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
|
||||
// StorageAccount - Specifies the storage account that Azure Machine Learning uses to store information about the web service. Only the name of the storage account is returned from calls to GET operations. When updating the storage account information, you must ensure that all necessary assets are available in the new storage account or calls to your web service will fail.
|
||||
StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
|
||||
// MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service.
|
||||
MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"`
|
||||
// CommitmentPlan - Contains the commitment plan associated with this web service. Set at creation time. Once set, this value cannot be changed. Note: The commitment plan is not returned from calls to GET operations.
|
||||
CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
|
||||
// Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification.
|
||||
Input *ServiceInputOutputSpecification `json:"input,omitempty"`
|
||||
// Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification.
|
||||
Output *ServiceInputOutputSpecification `json:"output,omitempty"`
|
||||
// ExampleRequest - Defines sample input data for one or more of the service's inputs.
|
||||
ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
|
||||
// Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs.
|
||||
Assets *map[string]*AssetItem `json:"assets,omitempty"`
|
||||
// Parameters - The set of global parameters values defined for the web service, given as a global parameter name to default value map. If no default value is specified, the parameter is considered to be required.
|
||||
Parameters *map[string]*Parameter `json:"parameters,omitempty"`
|
||||
// PayloadsInBlobStorage - When set to true, indicates that the payload size is larger than 3 MB. Otherwise false. If the payload size exceed 3 MB, the payload is stored in a blob and the PayloadsLocation parameter contains the URI of the blob. Otherwise, this will be set to false and Assets, Input, Output, Package, Parameters, ExampleRequest are inline. The Payload sizes is determined by adding the size of the Assets, Input, Output, Package, Parameters, and the ExampleRequest.
|
||||
PayloadsInBlobStorage *bool `json:"payloadsInBlobStorage,omitempty"`
|
||||
// PayloadsLocation - The URI of the payload blob. This paramater contains a value only if the payloadsInBlobStorage parameter is set to true. Otherwise is set to null.
|
||||
PayloadsLocation *BlobLocation `json:"payloadsLocation,omitempty"`
|
||||
// PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph'
|
||||
PackageType PackageType `json:"packageType,omitempty"`
|
||||
// Package - The definition of the graph package making up this web service.
|
||||
Package *GraphPackage `json:"package,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for PropertiesForGraph.
|
||||
func (pfg PropertiesForGraph) MarshalJSON() ([]byte, error) {
|
||||
pfg.PackageType = PackageTypeGraph
|
||||
type Alias PropertiesForGraph
|
||||
return json.Marshal(&struct {
|
||||
Alias
|
||||
}{
|
||||
Alias: (Alias)(pfg),
|
||||
})
|
||||
}
|
||||
|
||||
// AsPropertiesForGraph is the BasicProperties implementation for PropertiesForGraph.
|
||||
func (pfg PropertiesForGraph) AsPropertiesForGraph() (*PropertiesForGraph, bool) {
|
||||
return &pfg, true
|
||||
}
|
||||
|
||||
// AsProperties is the BasicProperties implementation for PropertiesForGraph.
|
||||
func (pfg PropertiesForGraph) AsProperties() (*Properties, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// AsBasicProperties is the BasicProperties implementation for PropertiesForGraph.
|
||||
func (pfg PropertiesForGraph) AsBasicProperties() (BasicProperties, bool) {
|
||||
return &pfg, true
|
||||
}
|
||||
|
||||
// RealtimeConfiguration holds the available configuration options for an Azure ML web service endpoint.
|
||||
type RealtimeConfiguration struct {
|
||||
// MaxConcurrentCalls - Specifies the maximum concurrent calls that can be made to the web service. Minimum value: 4, Maximum value: 200.
|
||||
MaxConcurrentCalls *int32 `json:"maxConcurrentCalls,omitempty"`
|
||||
}
|
||||
|
||||
// Resource azure resource.
|
||||
type Resource struct {
|
||||
// ID - Specifies the resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Specifies the name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Specifies the location of the resource.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Specifies the type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - Contains resource tags defined as key/value pairs.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceInputOutputSpecification the swagger 2.0 schema describing the service's inputs or outputs. See Swagger
|
||||
// specification: http://swagger.io/specification/
|
||||
type ServiceInputOutputSpecification struct {
|
||||
// Title - The title of your Swagger schema.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Description - The description of the Swagger schema.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// Type - The type of the entity described in swagger. Always 'object'.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Properties - Specifies a collection that contains the column schema for each input or output of the web service. For more information, see the Swagger specification.
|
||||
Properties *map[string]*TableSpecification `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// StorageAccount access information for a storage account.
|
||||
type StorageAccount struct {
|
||||
// Name - Specifies the name of the storage account.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Key - Specifies the key used to access the storage account.
|
||||
Key *string `json:"key,omitempty"`
|
||||
}
|
||||
|
||||
// TableSpecification the swagger 2.0 schema describing a single service input or output. See Swagger specification:
|
||||
// http://swagger.io/specification/
|
||||
type TableSpecification struct {
|
||||
// Title - Swagger schema title.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Description - Swagger schema description.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// Type - The type of the entity described in swagger.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Format - The format, if 'type' is not 'object'
|
||||
Format *string `json:"format,omitempty"`
|
||||
// Properties - The set of columns within the data table.
|
||||
Properties *map[string]*ColumnSpecification `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// WebService instance of an Azure ML web service resource.
|
||||
type WebService struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Specifies the resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Specifies the name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Specifies the location of the resource.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Specifies the type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - Contains resource tags defined as key/value pairs.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// Properties - Contains the property payload that describes the web service.
|
||||
Properties BasicProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaler for WebService struct.
|
||||
func (ws *WebService) UnmarshalJSON(body []byte) error {
|
||||
var m map[string]*json.RawMessage
|
||||
err := json.Unmarshal(body, &m)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var v *json.RawMessage
|
||||
|
||||
v = m["properties"]
|
||||
if v != nil {
|
||||
properties, err := unmarshalBasicProperties(*m["properties"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Properties = properties
|
||||
}
|
||||
|
||||
v = m["id"]
|
||||
if v != nil {
|
||||
var ID string
|
||||
err = json.Unmarshal(*m["id"], &ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.ID = &ID
|
||||
}
|
||||
|
||||
v = m["name"]
|
||||
if v != nil {
|
||||
var name string
|
||||
err = json.Unmarshal(*m["name"], &name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Name = &name
|
||||
}
|
||||
|
||||
v = m["location"]
|
||||
if v != nil {
|
||||
var location string
|
||||
err = json.Unmarshal(*m["location"], &location)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Location = &location
|
||||
}
|
||||
|
||||
v = m["type"]
|
||||
if v != nil {
|
||||
var typeVar string
|
||||
err = json.Unmarshal(*m["type"], &typeVar)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Type = &typeVar
|
||||
}
|
||||
|
||||
v = m["tags"]
|
||||
if v != nil {
|
||||
var tags map[string]*string
|
||||
err = json.Unmarshal(*m["tags"], &tags)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ws.Tags = &tags
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// WebServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
|
||||
// operation.
|
||||
type WebServicesCreateOrUpdateFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future WebServicesCreateOrUpdateFuture) Result(client Client) (ws WebService, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return ws, autorest.NewError("webservices.WebServicesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ws, err = client.CreateOrUpdateResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ws, err = client.CreateOrUpdateResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// WebServicesCreateRegionalPropertiesFuture an abstraction for monitoring and retrieving the results of a long-running
|
||||
// operation.
|
||||
type WebServicesCreateRegionalPropertiesFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future WebServicesCreateRegionalPropertiesFuture) Result(client Client) (aos AsyncOperationStatus, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return aos, autorest.NewError("webservices.WebServicesCreateRegionalPropertiesFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
aos, err = client.CreateRegionalPropertiesResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
aos, err = client.CreateRegionalPropertiesResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// WebServicesPatchFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type WebServicesPatchFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future WebServicesPatchFuture) Result(client Client) (ws WebService, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return ws, autorest.NewError("webservices.WebServicesPatchFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ws, err = client.PatchResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ws, err = client.PatchResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// WebServicesRemoveFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type WebServicesRemoveFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future WebServicesRemoveFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, autorest.NewError("webservices.WebServicesRemoveFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.RemoveResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ar, err = client.RemoveResponder(resp)
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
package webservices
|
||||
|
||||
// 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.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v12.2.0-beta services"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v12.2.0-beta"
|
||||
}
|
||||
Generated
Vendored
+687
@@ -0,0 +1,687 @@
|
||||
package webservices
|
||||
|
||||
// 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/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Client is the these APIs allow end users to operate on Azure Machine Learning Web Services resources. They support
|
||||
// the following operations:<ul><li>Create or update a web service</li><li>Get a web service</li><li>Patch a web
|
||||
// service</li><li>Delete a web service</li><li>Get All Web Services in a Resource Group </li><li>Get All Web Services
|
||||
// in a Subscription</li><li>Get Web Services Keys</li></ul>
|
||||
type Client struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewClient creates an instance of the Client client.
|
||||
func NewClient(subscriptionID string) Client {
|
||||
return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewClientWithBaseURI creates an instance of the Client client.
|
||||
func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
|
||||
return Client{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate create or update a web service. This call will overwrite an existing web service. Note that there is
|
||||
// no warning or confirmation. This is a nonrecoverable operation. If your intent is to create a new web service, call
|
||||
// the Get operation first to verify that it does not exist.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service. createOrUpdatePayload is the payload that is used to create or update the web service.
|
||||
func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, webServiceName string, createOrUpdatePayload WebService) (result WebServicesCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: createOrUpdatePayload,
|
||||
Constraints: []validation.Constraint{{Target: "createOrUpdatePayload.Properties", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMaximum, Rule: 200, Chain: nil},
|
||||
{Target: "createOrUpdatePayload.Properties.RealtimeConfiguration.MaxConcurrentCalls", Name: validation.InclusiveMinimum, Rule: 4, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "createOrUpdatePayload.Properties.MachineLearningWorkspace", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.MachineLearningWorkspace.ID", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "createOrUpdatePayload.Properties.CommitmentPlan", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.CommitmentPlan.ID", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "createOrUpdatePayload.Properties.Input", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.Input.Type", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "createOrUpdatePayload.Properties.Input.Properties", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{Target: "createOrUpdatePayload.Properties.Output", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.Output.Type", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "createOrUpdatePayload.Properties.Output.Properties", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{Target: "createOrUpdatePayload.Properties.PayloadsLocation", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "createOrUpdatePayload.Properties.PayloadsLocation.URI", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "webservices.Client", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, webServiceName, createOrUpdatePayload)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, webServiceName string, createOrUpdatePayload WebService) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
|
||||
autorest.WithJSON(createOrUpdatePayload),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) CreateOrUpdateSender(req *http.Request) (future WebServicesCreateOrUpdateFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) CreateOrUpdateResponder(resp *http.Response) (result WebService, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// CreateRegionalProperties creates an encrypted credentials parameter blob for the specified region. To get the web
|
||||
// service from a region other than the region in which it has been created, you must first call Create Regional Web
|
||||
// Services Properties to create a copy of the encrypted credential parameter blob in that region. You only need to do
|
||||
// this before the first time that you get the web service in the new region.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service. region is the region for which encrypted credential parameters are created.
|
||||
func (client Client) CreateRegionalProperties(ctx context.Context, resourceGroupName string, webServiceName string, region string) (result WebServicesCreateRegionalPropertiesFuture, err error) {
|
||||
req, err := client.CreateRegionalPropertiesPreparer(ctx, resourceGroupName, webServiceName, region)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "CreateRegionalProperties", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateRegionalPropertiesSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "CreateRegionalProperties", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateRegionalPropertiesPreparer prepares the CreateRegionalProperties request.
|
||||
func (client Client) CreateRegionalPropertiesPreparer(ctx context.Context, resourceGroupName string, webServiceName string, region string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
"region": autorest.Encode("query", region),
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}/CreateRegionalBlob", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateRegionalPropertiesSender sends the CreateRegionalProperties request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) CreateRegionalPropertiesSender(req *http.Request) (future WebServicesCreateRegionalPropertiesFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
|
||||
return
|
||||
}
|
||||
|
||||
// CreateRegionalPropertiesResponder handles the response to the CreateRegionalProperties request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) CreateRegionalPropertiesResponder(resp *http.Response) (result AsyncOperationStatus, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets the Web Service Definition as specified by a subscription, resource group, and name. Note that the storage
|
||||
// credentials and web service keys are not returned by this call. To get the web service access keys, call List Keys.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service. region is the region for which encrypted credential parameters are valid.
|
||||
func (client Client) Get(ctx context.Context, resourceGroupName string, webServiceName string, region string) (result WebService, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, webServiceName, region)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, webServiceName string, region string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(region) > 0 {
|
||||
queryParameters["region"] = autorest.Encode("query", region)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) GetResponder(resp *http.Response) (result WebService, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup gets the web services in the specified resource group.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. skiptoken is continuation token
|
||||
// for pagination.
|
||||
func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result PaginatedWebServicesListPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, skiptoken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.pwsl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.pwsl, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client Client) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, skiptoken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skiptoken) > 0 {
|
||||
queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) ListByResourceGroupResponder(resp *http.Response) (result PaginatedWebServicesList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client Client) listByResourceGroupNextResults(lastResults PaginatedWebServicesList) (result PaginatedWebServicesList, err error) {
|
||||
req, err := lastResults.paginatedWebServicesListPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "webservices.Client", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "webservices.Client", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skiptoken string) (result PaginatedWebServicesListIterator, err error) {
|
||||
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, skiptoken)
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionID gets the web services in the specified subscription.
|
||||
//
|
||||
// skiptoken is continuation token for pagination.
|
||||
func (client Client) ListBySubscriptionID(ctx context.Context, skiptoken string) (result PaginatedWebServicesListPage, err error) {
|
||||
result.fn = client.listBySubscriptionIDNextResults
|
||||
req, err := client.ListBySubscriptionIDPreparer(ctx, skiptoken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListBySubscriptionID", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySubscriptionIDSender(req)
|
||||
if err != nil {
|
||||
result.pwsl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListBySubscriptionID", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.pwsl, err = client.ListBySubscriptionIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListBySubscriptionID", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request.
|
||||
func (client Client) ListBySubscriptionIDPreparer(ctx context.Context, skiptoken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skiptoken) > 0 {
|
||||
queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/webServices", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDSender sends the ListBySubscriptionID request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDResponder handles the response to the ListBySubscriptionID request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) ListBySubscriptionIDResponder(resp *http.Response) (result PaginatedWebServicesList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listBySubscriptionIDNextResults retrieves the next set of results, if any.
|
||||
func (client Client) listBySubscriptionIDNextResults(lastResults PaginatedWebServicesList) (result PaginatedWebServicesList, err error) {
|
||||
req, err := lastResults.paginatedWebServicesListPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "webservices.Client", "listBySubscriptionIDNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListBySubscriptionIDSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "webservices.Client", "listBySubscriptionIDNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListBySubscriptionIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "listBySubscriptionIDNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client Client) ListBySubscriptionIDComplete(ctx context.Context, skiptoken string) (result PaginatedWebServicesListIterator, err error) {
|
||||
result.page, err = client.ListBySubscriptionID(ctx, skiptoken)
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeys gets the access keys for the specified web service.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service.
|
||||
func (client Client) ListKeys(ctx context.Context, resourceGroupName string, webServiceName string) (result Keys, err error) {
|
||||
req, err := client.ListKeysPreparer(ctx, resourceGroupName, webServiceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListKeys", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListKeysSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListKeys", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListKeysResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "ListKeys", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeysPreparer prepares the ListKeys request.
|
||||
func (client Client) ListKeysPreparer(ctx context.Context, resourceGroupName string, webServiceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}/listKeys", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListKeysSender sends the ListKeys request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ListKeysSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListKeysResponder handles the response to the ListKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) ListKeysResponder(resp *http.Response) (result Keys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Patch modifies an existing web service resource. The PATCH API call is an asynchronous operation. To determine
|
||||
// whether it has completed successfully, you must perform a Get operation.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service. patchPayload is the payload to use to patch the web service.
|
||||
func (client Client) Patch(ctx context.Context, resourceGroupName string, webServiceName string, patchPayload WebService) (result WebServicesPatchFuture, err error) {
|
||||
req, err := client.PatchPreparer(ctx, resourceGroupName, webServiceName, patchPayload)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Patch", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PatchSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Patch", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PatchPreparer prepares the Patch request.
|
||||
func (client Client) PatchPreparer(ctx context.Context, resourceGroupName string, webServiceName string, patchPayload WebService) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
|
||||
autorest.WithJSON(patchPayload),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// PatchSender sends the Patch request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) PatchSender(req *http.Request) (future WebServicesPatchFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
return
|
||||
}
|
||||
|
||||
// PatchResponder handles the response to the Patch request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) PatchResponder(resp *http.Response) (result WebService, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Remove deletes the specified web service.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the web service is located. webServiceName is the name of
|
||||
// the web service.
|
||||
func (client Client) Remove(ctx context.Context, resourceGroupName string, webServiceName string) (result WebServicesRemoveFuture, err error) {
|
||||
req, err := client.RemovePreparer(ctx, resourceGroupName, webServiceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Remove", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.RemoveSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "webservices.Client", "Remove", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// RemovePreparer prepares the Remove request.
|
||||
func (client Client) RemovePreparer(ctx context.Context, resourceGroupName string, webServiceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"webServiceName": autorest.Encode("path", webServiceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-01-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// RemoveSender sends the Remove request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) RemoveSender(req *http.Request) (future WebServicesRemoveFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
|
||||
return
|
||||
}
|
||||
|
||||
// RemoveResponder handles the response to the Remove request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client Client) RemoveResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+539
@@ -0,0 +1,539 @@
|
||||
package experimentation
|
||||
|
||||
// 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/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AccountsClient is the these APIs allow end users to operate on Azure Machine Learning Team Account resources. They
|
||||
// support CRUD operations for Azure Machine Learning Team Accounts.
|
||||
type AccountsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewAccountsClient creates an instance of the AccountsClient client.
|
||||
func NewAccountsClient(subscriptionID string) AccountsClient {
|
||||
return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client.
|
||||
func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
|
||||
return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a team account with the specified parameters.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. parameters is the parameters for creating or updating a machine
|
||||
// learning team account.
|
||||
func (client AccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, parameters Account) (result Account, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.AccountProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountProperties.VsoAccountID", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.AccountProperties.KeyVaultID", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.AccountProperties.StorageAccount", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountProperties.StorageAccount.StorageAccountID", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.AccountProperties.StorageAccount.AccessKey", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.AccountsClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters Account) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AccountsClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes a machine learning team account.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account.
|
||||
func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.AccountsClient", "Delete")
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, accountName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Delete", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) DeleteSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets the properties of the specified machine learning team account.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account.
|
||||
func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.AccountsClient", "Get")
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, accountName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AccountsClient) GetResponder(resp *http.Response) (result Account, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List lists all the available machine learning team accounts under the specified subscription.
|
||||
func (client AccountsClient) List(ctx context.Context) (result AccountListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.alr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.alr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client AccountsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningExperimentation/accounts", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AccountsClient) ListResponder(resp *http.Response) (result AccountListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client AccountsClient) listNextResults(lastResults AccountListResult) (result AccountListResult, err error) {
|
||||
req, err := lastResults.accountListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "experimentation.AccountsClient", "listNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "experimentation.AccountsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AccountsClient) ListComplete(ctx context.Context) (result AccountListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup lists all the available machine learning team accounts under the specified resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs.
|
||||
func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResultPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.alr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.alr, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client AccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client AccountsClient) listByResourceGroupNextResults(lastResults AccountListResult) (result AccountListResult, err error) {
|
||||
req, err := lastResults.accountListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "experimentation.AccountsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "experimentation.AccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountListResultIterator, err error) {
|
||||
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
|
||||
return
|
||||
}
|
||||
|
||||
// Update updates a machine learning team account with the specified parameters.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. parameters is the parameters for updating a machine learning team
|
||||
// account.
|
||||
func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.AccountsClient", "Update")
|
||||
}
|
||||
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.UpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Update", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.AccountsClient", "Update", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+52
@@ -0,0 +1,52 @@
|
||||
// Package experimentation implements the Azure ARM Experimentation service API version 2017-05-01-preview.
|
||||
//
|
||||
// These APIs allow end users to operate on Azure Machine Learning Team Account resources. They support CRUD operations
|
||||
// for Azure Machine Learning Team Accounts.
|
||||
package experimentation
|
||||
|
||||
// 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 (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Experimentation
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Experimentation.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client.
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+570
@@ -0,0 +1,570 @@
|
||||
package experimentation
|
||||
|
||||
// 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 (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ProvisioningState enumerates the values for provisioning state.
|
||||
type ProvisioningState string
|
||||
|
||||
const (
|
||||
// Creating ...
|
||||
Creating ProvisioningState = "Creating"
|
||||
// Deleting ...
|
||||
Deleting ProvisioningState = "Deleting"
|
||||
// Failed ...
|
||||
Failed ProvisioningState = "Failed"
|
||||
// Succeeded ...
|
||||
Succeeded ProvisioningState = "Succeeded"
|
||||
// Updating ...
|
||||
Updating ProvisioningState = "Updating"
|
||||
)
|
||||
|
||||
// Account an object that represents a machine learning team account.
|
||||
type Account struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - The resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - The name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - The type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Location - The location of the resource. This cannot be changed after the resource is created.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Tags - The tags of the resource.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// AccountProperties - The properties of the machine learning team account.
|
||||
*AccountProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// AccountListResult the result of a request to list machine learning team accounts.
|
||||
type AccountListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - The list of machine learning team accounts. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning team accounts.
|
||||
Value *[]Account `json:"value,omitempty"`
|
||||
// NextLink - The URI that can be used to request the next list of machine learning team accounts.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// AccountListResultIterator provides access to a complete listing of Account values.
|
||||
type AccountListResultIterator struct {
|
||||
i int
|
||||
page AccountListResultPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *AccountListResultIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter AccountListResultIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter AccountListResultIterator) Response() AccountListResult {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter AccountListResultIterator) Value() Account {
|
||||
if !iter.page.NotDone() {
|
||||
return Account{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (alr AccountListResult) IsEmpty() bool {
|
||||
return alr.Value == nil || len(*alr.Value) == 0
|
||||
}
|
||||
|
||||
// accountListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (alr AccountListResult) accountListResultPreparer() (*http.Request, error) {
|
||||
if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(alr.NextLink)))
|
||||
}
|
||||
|
||||
// AccountListResultPage contains a page of Account values.
|
||||
type AccountListResultPage struct {
|
||||
fn func(AccountListResult) (AccountListResult, error)
|
||||
alr AccountListResult
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *AccountListResultPage) Next() error {
|
||||
next, err := page.fn(page.alr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.alr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page AccountListResultPage) NotDone() bool {
|
||||
return !page.alr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page AccountListResultPage) Response() AccountListResult {
|
||||
return page.alr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page AccountListResultPage) Values() []Account {
|
||||
if page.alr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.alr.Value
|
||||
}
|
||||
|
||||
// AccountProperties the properties of a machine learning team account.
|
||||
type AccountProperties struct {
|
||||
// VsoAccountID - The fully qualified arm id of the vso account to be used for this team account.
|
||||
VsoAccountID *string `json:"vsoAccountId,omitempty"`
|
||||
// AccountID - The immutable id associated with this team account.
|
||||
AccountID *string `json:"accountId,omitempty"`
|
||||
// Description - The description of this workspace.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// FriendlyName - The friendly name for this workspace. This will be the workspace name in the arm id when the workspace object gets created
|
||||
FriendlyName *string `json:"friendlyName,omitempty"`
|
||||
// KeyVaultID - The fully qualified arm id of the user key vault.
|
||||
KeyVaultID *string `json:"keyVaultId,omitempty"`
|
||||
// Seats - The no of users/seats who can access this team account. This property defines the charge on the team account.
|
||||
Seats *string `json:"seats,omitempty"`
|
||||
// DiscoveryURI - The uri for this machine learning team account.
|
||||
DiscoveryURI *string `json:"discoveryUri,omitempty"`
|
||||
// CreationDate - The creation date of the machine learning team account in ISO8601 format.
|
||||
CreationDate *date.Time `json:"creationDate,omitempty"`
|
||||
// StorageAccount - The properties of the storage account for the machine learning team account.
|
||||
StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"`
|
||||
// ProvisioningState - The current deployment state of team account resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'Creating', 'Succeeded', 'Updating', 'Deleting', 'Failed'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
}
|
||||
|
||||
// AccountPropertiesUpdateParameters the parameters for updating the properties of a machine learning team account.
|
||||
type AccountPropertiesUpdateParameters struct {
|
||||
// Description - The description of this workspace.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// FriendlyName - The friendly name for this workspace. This will be the workspace name in the arm id when the workspace object gets created
|
||||
FriendlyName *string `json:"friendlyName,omitempty"`
|
||||
// Seats - The no of users/seats who can access this team account. This property defines the charge on the team account.
|
||||
Seats *string `json:"seats,omitempty"`
|
||||
// StorageAccountKey - The key for storage account associated with this team account
|
||||
StorageAccountKey *string `json:"storageAccountKey,omitempty"`
|
||||
}
|
||||
|
||||
// AccountUpdateParameters the parameters for updating a machine learning team account.
|
||||
type AccountUpdateParameters struct {
|
||||
// Tags - The resource tags for the machine learning team account.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// AccountPropertiesUpdateParameters - The properties that the machine learning team account will be updated with.
|
||||
*AccountPropertiesUpdateParameters `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponse the error response send when an operation fails.
|
||||
type ErrorResponse struct {
|
||||
// Code - error code
|
||||
Code *string `json:"code,omitempty"`
|
||||
// Message - error message
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Operation azure Machine Learning team account REST API operation
|
||||
type Operation struct {
|
||||
// Name - Operation name: {provider}/{resource}/{operation}
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Display - Display name of operation
|
||||
Display *OperationDisplay `json:"display,omitempty"`
|
||||
}
|
||||
|
||||
// OperationDisplay display name of operation
|
||||
type OperationDisplay struct {
|
||||
// Provider - The resource provider name: Microsoft.MachineLearningExperimentation
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
// Resource - The resource on which the operation is performed.
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
// Operation - The operation that users can perform.
|
||||
Operation *string `json:"operation,omitempty"`
|
||||
// Description - The description for the operation.
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// OperationListResult an array of operations supported by the resource provider.
|
||||
type OperationListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - List of AML team account operations supported by the AML team account resource provider.
|
||||
Value *[]Operation `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// Project an object that represents a machine learning project.
|
||||
type Project struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - The resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - The name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - The type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Location - The location of the resource. This cannot be changed after the resource is created.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Tags - The tags of the resource.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// ProjectProperties - The properties of the Project.
|
||||
*ProjectProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// ProjectListResult the result of a request to list projects.
|
||||
type ProjectListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - The list of projects. Since this list may be incomplete, the nextLink field should be used to request the next list of projects.
|
||||
Value *[]Project `json:"value,omitempty"`
|
||||
// NextLink - The URI that can be used to request the next list of projects.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// ProjectListResultIterator provides access to a complete listing of Project values.
|
||||
type ProjectListResultIterator struct {
|
||||
i int
|
||||
page ProjectListResultPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *ProjectListResultIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter ProjectListResultIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter ProjectListResultIterator) Response() ProjectListResult {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter ProjectListResultIterator) Value() Project {
|
||||
if !iter.page.NotDone() {
|
||||
return Project{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (plr ProjectListResult) IsEmpty() bool {
|
||||
return plr.Value == nil || len(*plr.Value) == 0
|
||||
}
|
||||
|
||||
// projectListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (plr ProjectListResult) projectListResultPreparer() (*http.Request, error) {
|
||||
if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(plr.NextLink)))
|
||||
}
|
||||
|
||||
// ProjectListResultPage contains a page of Project values.
|
||||
type ProjectListResultPage struct {
|
||||
fn func(ProjectListResult) (ProjectListResult, error)
|
||||
plr ProjectListResult
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *ProjectListResultPage) Next() error {
|
||||
next, err := page.fn(page.plr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.plr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page ProjectListResultPage) NotDone() bool {
|
||||
return !page.plr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page ProjectListResultPage) Response() ProjectListResult {
|
||||
return page.plr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page ProjectListResultPage) Values() []Project {
|
||||
if page.plr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.plr.Value
|
||||
}
|
||||
|
||||
// ProjectProperties the properties of a machine learning project.
|
||||
type ProjectProperties struct {
|
||||
// Description - The description of this project.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// AccountID - The immutable id of the team account which contains this project.
|
||||
AccountID *string `json:"accountId,omitempty"`
|
||||
// WorkspaceID - The immutable id of the workspace which contains this project.
|
||||
WorkspaceID *string `json:"workspaceId,omitempty"`
|
||||
// ProjectID - The immutable id of this project.
|
||||
ProjectID *string `json:"projectId,omitempty"`
|
||||
// Gitrepo - The reference to git repo for this project.
|
||||
Gitrepo *string `json:"gitrepo,omitempty"`
|
||||
// FriendlyName - The friendly name for this project.
|
||||
FriendlyName *string `json:"friendlyName,omitempty"`
|
||||
// CreationDate - The creation date of the project in ISO8601 format.
|
||||
CreationDate *date.Time `json:"creationDate,omitempty"`
|
||||
// ProvisioningState - The current deployment state of project resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'Creating', 'Succeeded', 'Updating', 'Deleting', 'Failed'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
}
|
||||
|
||||
// ProjectPropertiesUpdateParameters the parameters for updating the properties of a project.
|
||||
type ProjectPropertiesUpdateParameters struct {
|
||||
// FriendlyName - The friendly name for this project.
|
||||
FriendlyName *string `json:"friendlyName,omitempty"`
|
||||
// Description - The description of this project.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// Gitrepo - The reference to git repo for this project.
|
||||
Gitrepo *string `json:"gitrepo,omitempty"`
|
||||
}
|
||||
|
||||
// ProjectUpdateParameters the parameters for updating a machine learning project.
|
||||
type ProjectUpdateParameters struct {
|
||||
// Tags - The resource tags for the machine learning project.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// ProjectPropertiesUpdateParameters - The properties that the project will be updated with.
|
||||
*ProjectPropertiesUpdateParameters `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// Resource an Azure resource.
|
||||
type Resource struct {
|
||||
// ID - The resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - The name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - The type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Location - The location of the resource. This cannot be changed after the resource is created.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Tags - The tags of the resource.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// StorageAccountProperties the properties of a storage account for a machine learning team account.
|
||||
type StorageAccountProperties struct {
|
||||
// StorageAccountID - The fully qualified arm Id of the storage account.
|
||||
StorageAccountID *string `json:"storageAccountId,omitempty"`
|
||||
// AccessKey - The access key to the storage account.
|
||||
AccessKey *string `json:"accessKey,omitempty"`
|
||||
}
|
||||
|
||||
// Workspace an object that represents a machine learning team account workspace.
|
||||
type Workspace struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - The resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - The name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - The type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Location - The location of the resource. This cannot be changed after the resource is created.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Tags - The tags of the resource.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// WorkspaceProperties - The properties of the machine learning team account workspace.
|
||||
*WorkspaceProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// WorkspaceListResult the result of a request to list machine learning team account workspaces.
|
||||
type WorkspaceListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - The list of machine learning team account workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning team accounts.
|
||||
Value *[]Workspace `json:"value,omitempty"`
|
||||
// NextLink - The URI that can be used to request the next list of machine learning workspaces.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// WorkspaceListResultIterator provides access to a complete listing of Workspace values.
|
||||
type WorkspaceListResultIterator struct {
|
||||
i int
|
||||
page WorkspaceListResultPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *WorkspaceListResultIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter WorkspaceListResultIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter WorkspaceListResultIterator) Response() WorkspaceListResult {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter WorkspaceListResultIterator) Value() Workspace {
|
||||
if !iter.page.NotDone() {
|
||||
return Workspace{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (wlr WorkspaceListResult) IsEmpty() bool {
|
||||
return wlr.Value == nil || len(*wlr.Value) == 0
|
||||
}
|
||||
|
||||
// workspaceListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (wlr WorkspaceListResult) workspaceListResultPreparer() (*http.Request, error) {
|
||||
if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(wlr.NextLink)))
|
||||
}
|
||||
|
||||
// WorkspaceListResultPage contains a page of Workspace values.
|
||||
type WorkspaceListResultPage struct {
|
||||
fn func(WorkspaceListResult) (WorkspaceListResult, error)
|
||||
wlr WorkspaceListResult
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *WorkspaceListResultPage) Next() error {
|
||||
next, err := page.fn(page.wlr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.wlr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page WorkspaceListResultPage) NotDone() bool {
|
||||
return !page.wlr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page WorkspaceListResultPage) Response() WorkspaceListResult {
|
||||
return page.wlr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page WorkspaceListResultPage) Values() []Workspace {
|
||||
if page.wlr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.wlr.Value
|
||||
}
|
||||
|
||||
// WorkspaceProperties the properties of a machine learning team account workspace.
|
||||
type WorkspaceProperties struct {
|
||||
// Description - The description of this workspace.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// AccountID - The immutable id of the team account which contains this workspace.
|
||||
AccountID *string `json:"accountId,omitempty"`
|
||||
// WorkspaceID - The immutable id of this workspace.
|
||||
WorkspaceID *string `json:"workspaceId,omitempty"`
|
||||
// FriendlyName - The friendly name for this workspace. This will be the workspace name in the arm id when the workspace object gets created
|
||||
FriendlyName *string `json:"friendlyName,omitempty"`
|
||||
// CreationDate - The creation date of the machine learning workspace in ISO8601 format.
|
||||
CreationDate *date.Time `json:"creationDate,omitempty"`
|
||||
// ProvisioningState - The current deployment state of team account workspace resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'Creating', 'Succeeded', 'Updating', 'Deleting', 'Failed'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
}
|
||||
|
||||
// WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning team account
|
||||
// workspace.
|
||||
type WorkspacePropertiesUpdateParameters struct {
|
||||
// FriendlyName - Friendly name of this workspace.
|
||||
FriendlyName *string `json:"friendlyName,omitempty"`
|
||||
// Description - Description for this workspace.
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// WorkspaceUpdateParameters the parameters for updating a machine learning team account workspace.
|
||||
type WorkspaceUpdateParameters struct {
|
||||
// Tags - The resource tags for the machine learning team account workspace.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// WorkspacePropertiesUpdateParameters - The properties that the machine learning workspace will be updated with.
|
||||
*WorkspacePropertiesUpdateParameters `json:"properties,omitempty"`
|
||||
}
|
||||
Generated
Vendored
+99
@@ -0,0 +1,99 @@
|
||||
package experimentation
|
||||
|
||||
// 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"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// OperationsClient is the these APIs allow end users to operate on Azure Machine Learning Team Account resources. They
|
||||
// support CRUD operations for Azure Machine Learning Team Accounts.
|
||||
type OperationsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewOperationsClient creates an instance of the OperationsClient client.
|
||||
func NewOperationsClient(subscriptionID string) OperationsClient {
|
||||
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
|
||||
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
|
||||
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List lists all of the available Azure Machine Learning Team Accounts REST API operations.
|
||||
func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.OperationsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.OperationsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.OperationsClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPath("/providers/Microsoft.MachineLearningExperimentation/operations"),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+503
@@ -0,0 +1,503 @@
|
||||
package experimentation
|
||||
|
||||
// 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/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ProjectsClient is the these APIs allow end users to operate on Azure Machine Learning Team Account resources. They
|
||||
// support CRUD operations for Azure Machine Learning Team Accounts.
|
||||
type ProjectsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewProjectsClient creates an instance of the ProjectsClient client.
|
||||
func NewProjectsClient(subscriptionID string) ProjectsClient {
|
||||
return NewProjectsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewProjectsClientWithBaseURI creates an instance of the ProjectsClient client.
|
||||
func NewProjectsClientWithBaseURI(baseURI string, subscriptionID string) ProjectsClient {
|
||||
return ProjectsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a project with the specified parameters.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. workspaceName is the name of the machine learning team account
|
||||
// workspace. projectName is the name of the machine learning project under a team account workspace. parameters is the
|
||||
// parameters for creating or updating a project.
|
||||
func (client ProjectsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, projectName string, parameters Project) (result Project, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: projectName,
|
||||
Constraints: []validation.Constraint{{Target: "projectName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "projectName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "projectName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.ProjectProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ProjectProperties.FriendlyName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.ProjectsClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, workspaceName, projectName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client ProjectsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, projectName string, parameters Project) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"projectName": autorest.Encode("path", projectName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces/{workspaceName}/projects/{projectName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ProjectsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ProjectsClient) CreateOrUpdateResponder(resp *http.Response) (result Project, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes a project.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. workspaceName is the name of the machine learning team account
|
||||
// workspace. projectName is the name of the machine learning project under a team account workspace.
|
||||
func (client ProjectsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, projectName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: projectName,
|
||||
Constraints: []validation.Constraint{{Target: "projectName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "projectName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "projectName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.ProjectsClient", "Delete")
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, workspaceName, projectName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Delete", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client ProjectsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, projectName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"projectName": autorest.Encode("path", projectName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces/{workspaceName}/projects/{projectName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ProjectsClient) DeleteSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ProjectsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets the properties of the specified machine learning project.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. workspaceName is the name of the machine learning team account
|
||||
// workspace. projectName is the name of the machine learning project under a team account workspace.
|
||||
func (client ProjectsClient) Get(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, projectName string) (result Project, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: projectName,
|
||||
Constraints: []validation.Constraint{{Target: "projectName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "projectName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "projectName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.ProjectsClient", "Get")
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, accountName, workspaceName, projectName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ProjectsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, projectName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"projectName": autorest.Encode("path", projectName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces/{workspaceName}/projects/{projectName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ProjectsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ProjectsClient) GetResponder(resp *http.Response) (result Project, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByWorkspace lists all the available machine learning projects under the specified workspace.
|
||||
//
|
||||
// accountName is the name of the machine learning team account. workspaceName is the name of the machine learning team
|
||||
// account workspace. resourceGroupName is the name of the resource group to which the machine learning team account
|
||||
// belongs.
|
||||
func (client ProjectsClient) ListByWorkspace(ctx context.Context, accountName string, workspaceName string, resourceGroupName string) (result ProjectListResultPage, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.ProjectsClient", "ListByWorkspace")
|
||||
}
|
||||
|
||||
result.fn = client.listByWorkspaceNextResults
|
||||
req, err := client.ListByWorkspacePreparer(ctx, accountName, workspaceName, resourceGroupName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "ListByWorkspace", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByWorkspaceSender(req)
|
||||
if err != nil {
|
||||
result.plr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "ListByWorkspace", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.plr, err = client.ListByWorkspaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "ListByWorkspace", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByWorkspacePreparer prepares the ListByWorkspace request.
|
||||
func (client ProjectsClient) ListByWorkspacePreparer(ctx context.Context, accountName string, workspaceName string, resourceGroupName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces{workspaceName}/projects", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ProjectsClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ProjectsClient) ListByWorkspaceResponder(resp *http.Response) (result ProjectListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByWorkspaceNextResults retrieves the next set of results, if any.
|
||||
func (client ProjectsClient) listByWorkspaceNextResults(lastResults ProjectListResult) (result ProjectListResult, err error) {
|
||||
req, err := lastResults.projectListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByWorkspaceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "listByWorkspaceNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByWorkspaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ProjectsClient) ListByWorkspaceComplete(ctx context.Context, accountName string, workspaceName string, resourceGroupName string) (result ProjectListResultIterator, err error) {
|
||||
result.page, err = client.ListByWorkspace(ctx, accountName, workspaceName, resourceGroupName)
|
||||
return
|
||||
}
|
||||
|
||||
// Update updates a project with the specified parameters.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. workspaceName is the name of the machine learning team account
|
||||
// workspace. projectName is the name of the machine learning project under a team account workspace. parameters is the
|
||||
// parameters for updating a machine learning team account.
|
||||
func (client ProjectsClient) Update(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, projectName string, parameters ProjectUpdateParameters) (result Project, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: projectName,
|
||||
Constraints: []validation.Constraint{{Target: "projectName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "projectName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "projectName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.ProjectsClient", "Update")
|
||||
}
|
||||
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, workspaceName, projectName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.UpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Update", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.ProjectsClient", "Update", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client ProjectsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, projectName string, parameters ProjectUpdateParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"projectName": autorest.Encode("path", projectName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces/{workspaceName}/projects/{projectName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ProjectsClient) UpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ProjectsClient) UpdateResponder(resp *http.Response) (result Project, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
package experimentation
|
||||
|
||||
// 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.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v12.2.0-beta services"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v12.2.0-beta"
|
||||
}
|
||||
Generated
Vendored
+475
@@ -0,0 +1,475 @@
|
||||
package experimentation
|
||||
|
||||
// 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/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// WorkspacesClient is the these APIs allow end users to operate on Azure Machine Learning Team Account resources. They
|
||||
// support CRUD operations for Azure Machine Learning Team Accounts.
|
||||
type WorkspacesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewWorkspacesClient creates an instance of the WorkspacesClient client.
|
||||
func NewWorkspacesClient(subscriptionID string) WorkspacesClient {
|
||||
return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient client.
|
||||
func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient {
|
||||
return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a machine learning workspace with the specified parameters.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. workspaceName is the name of the machine learning team account
|
||||
// workspace. parameters is the parameters for creating or updating a machine learning workspace.
|
||||
func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, parameters Workspace) (result Workspace, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.WorkspaceProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.FriendlyName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.WorkspacesClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, workspaceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, parameters Workspace) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces/{workspaceName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WorkspacesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes a machine learning workspace.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. workspaceName is the name of the machine learning team account
|
||||
// workspace.
|
||||
func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, workspaceName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.WorkspacesClient", "Delete")
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, workspaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Delete", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, workspaceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces/{workspaceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WorkspacesClient) DeleteSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets the properties of the specified machine learning workspace.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. workspaceName is the name of the machine learning team account
|
||||
// workspace.
|
||||
func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, accountName string, workspaceName string) (result Workspace, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.WorkspacesClient", "Get")
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, accountName, workspaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client WorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, workspaceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces/{workspaceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WorkspacesClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByAccounts lists all the available machine learning workspaces under the specified team account.
|
||||
//
|
||||
// accountName is the name of the machine learning team account. resourceGroupName is the name of the resource group to
|
||||
// which the machine learning team account belongs.
|
||||
func (client WorkspacesClient) ListByAccounts(ctx context.Context, accountName string, resourceGroupName string) (result WorkspaceListResultPage, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.WorkspacesClient", "ListByAccounts")
|
||||
}
|
||||
|
||||
result.fn = client.listByAccountsNextResults
|
||||
req, err := client.ListByAccountsPreparer(ctx, accountName, resourceGroupName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "ListByAccounts", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByAccountsSender(req)
|
||||
if err != nil {
|
||||
result.wlr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "ListByAccounts", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.wlr, err = client.ListByAccountsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "ListByAccounts", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByAccountsPreparer prepares the ListByAccounts request.
|
||||
func (client WorkspacesClient) ListByAccountsPreparer(ctx context.Context, accountName string, resourceGroupName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByAccountsSender sends the ListByAccounts request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WorkspacesClient) ListByAccountsSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByAccountsResponder handles the response to the ListByAccounts request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client WorkspacesClient) ListByAccountsResponder(resp *http.Response) (result WorkspaceListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByAccountsNextResults retrieves the next set of results, if any.
|
||||
func (client WorkspacesClient) listByAccountsNextResults(lastResults WorkspaceListResult) (result WorkspaceListResult, err error) {
|
||||
req, err := lastResults.workspaceListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "listByAccountsNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByAccountsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "listByAccountsNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByAccountsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "listByAccountsNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByAccountsComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client WorkspacesClient) ListByAccountsComplete(ctx context.Context, accountName string, resourceGroupName string) (result WorkspaceListResultIterator, err error) {
|
||||
result.page, err = client.ListByAccounts(ctx, accountName, resourceGroupName)
|
||||
return
|
||||
}
|
||||
|
||||
// Update updates a machine learning workspace with the specified parameters.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the machine learning team account belongs. accountName
|
||||
// is the name of the machine learning team account. workspaceName is the name of the machine learning team account
|
||||
// workspace. parameters is the parameters for updating a machine learning workspace.
|
||||
func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, parameters WorkspaceUpdateParameters) (result Workspace, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}},
|
||||
{TargetValue: workspaceName,
|
||||
Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.MinLength, Rule: 5, Chain: nil},
|
||||
{Target: "workspaceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "experimentation.WorkspacesClient", "Update")
|
||||
}
|
||||
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, workspaceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.UpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Update", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "experimentation.WorkspacesClient", "Update", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, workspaceName string, parameters WorkspaceUpdateParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"workspaceName": autorest.Encode("path", workspaceName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningExperimentation/accounts/{accountName}/workspaces/{workspaceName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WorkspacesClient) UpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
// Package compute implements the Azure ARM Compute service API version 2017-08-01-preview.
|
||||
//
|
||||
// These APIs allow end users to operate on Azure Machine Learning Compute resources. They support the following
|
||||
// operations:<ul><li>Create or update a cluster</li><li>Get a cluster</li><li>Patch a cluster</li><li>Delete a
|
||||
// cluster</li><li>Get keys for a cluster</li><li>Check if updates are available for system services in a
|
||||
// cluster</li><li>Update system services in a cluster</li><li>Get all clusters in a resource group</li><li>Get all
|
||||
// clusters in a subscription</li></ul>
|
||||
package compute
|
||||
|
||||
// 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 (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Compute
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Compute.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client.
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+102
@@ -0,0 +1,102 @@
|
||||
package compute
|
||||
|
||||
// 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"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// MachineLearningComputeClient is the these APIs allow end users to operate on Azure Machine Learning Compute
|
||||
// resources. They support the following operations:<ul><li>Create or update a cluster</li><li>Get a
|
||||
// cluster</li><li>Patch a cluster</li><li>Delete a cluster</li><li>Get keys for a cluster</li><li>Check if updates are
|
||||
// available for system services in a cluster</li><li>Update system services in a cluster</li><li>Get all clusters in a
|
||||
// resource group</li><li>Get all clusters in a subscription</li></ul>
|
||||
type MachineLearningComputeClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewMachineLearningComputeClient creates an instance of the MachineLearningComputeClient client.
|
||||
func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient {
|
||||
return NewMachineLearningComputeClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewMachineLearningComputeClientWithBaseURI creates an instance of the MachineLearningComputeClient client.
|
||||
func NewMachineLearningComputeClientWithBaseURI(baseURI string, subscriptionID string) MachineLearningComputeClient {
|
||||
return MachineLearningComputeClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// ListAvailableOperations gets all available operations.
|
||||
func (client MachineLearningComputeClient) ListAvailableOperations(ctx context.Context) (result AvailableOperations, err error) {
|
||||
req, err := client.ListAvailableOperationsPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.MachineLearningComputeClient", "ListAvailableOperations", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAvailableOperationsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.MachineLearningComputeClient", "ListAvailableOperations", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListAvailableOperationsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.MachineLearningComputeClient", "ListAvailableOperations", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAvailableOperationsPreparer prepares the ListAvailableOperations request.
|
||||
func (client MachineLearningComputeClient) ListAvailableOperationsPreparer(ctx context.Context) (*http.Request, error) {
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPath("/providers/Microsoft.MachineLearningCompute/operations"),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListAvailableOperationsSender sends the ListAvailableOperations request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client MachineLearningComputeClient) ListAvailableOperationsSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// ListAvailableOperationsResponder handles the response to the ListAvailableOperations request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client MachineLearningComputeClient) ListAvailableOperationsResponder(resp *http.Response) (result AvailableOperations, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+699
@@ -0,0 +1,699 @@
|
||||
package compute
|
||||
|
||||
// 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 (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AgentVMSizeTypes enumerates the values for agent vm size types.
|
||||
type AgentVMSizeTypes string
|
||||
|
||||
const (
|
||||
// StandardA0 ...
|
||||
StandardA0 AgentVMSizeTypes = "Standard_A0"
|
||||
// StandardA1 ...
|
||||
StandardA1 AgentVMSizeTypes = "Standard_A1"
|
||||
// StandardA10 ...
|
||||
StandardA10 AgentVMSizeTypes = "Standard_A10"
|
||||
// StandardA11 ...
|
||||
StandardA11 AgentVMSizeTypes = "Standard_A11"
|
||||
// StandardA2 ...
|
||||
StandardA2 AgentVMSizeTypes = "Standard_A2"
|
||||
// StandardA3 ...
|
||||
StandardA3 AgentVMSizeTypes = "Standard_A3"
|
||||
// StandardA4 ...
|
||||
StandardA4 AgentVMSizeTypes = "Standard_A4"
|
||||
// StandardA5 ...
|
||||
StandardA5 AgentVMSizeTypes = "Standard_A5"
|
||||
// StandardA6 ...
|
||||
StandardA6 AgentVMSizeTypes = "Standard_A6"
|
||||
// StandardA7 ...
|
||||
StandardA7 AgentVMSizeTypes = "Standard_A7"
|
||||
// StandardA8 ...
|
||||
StandardA8 AgentVMSizeTypes = "Standard_A8"
|
||||
// StandardA9 ...
|
||||
StandardA9 AgentVMSizeTypes = "Standard_A9"
|
||||
// StandardD1 ...
|
||||
StandardD1 AgentVMSizeTypes = "Standard_D1"
|
||||
// StandardD11 ...
|
||||
StandardD11 AgentVMSizeTypes = "Standard_D11"
|
||||
// StandardD11V2 ...
|
||||
StandardD11V2 AgentVMSizeTypes = "Standard_D11_v2"
|
||||
// StandardD12 ...
|
||||
StandardD12 AgentVMSizeTypes = "Standard_D12"
|
||||
// StandardD12V2 ...
|
||||
StandardD12V2 AgentVMSizeTypes = "Standard_D12_v2"
|
||||
// StandardD13 ...
|
||||
StandardD13 AgentVMSizeTypes = "Standard_D13"
|
||||
// StandardD13V2 ...
|
||||
StandardD13V2 AgentVMSizeTypes = "Standard_D13_v2"
|
||||
// StandardD14 ...
|
||||
StandardD14 AgentVMSizeTypes = "Standard_D14"
|
||||
// StandardD14V2 ...
|
||||
StandardD14V2 AgentVMSizeTypes = "Standard_D14_v2"
|
||||
// StandardD1V2 ...
|
||||
StandardD1V2 AgentVMSizeTypes = "Standard_D1_v2"
|
||||
// StandardD2 ...
|
||||
StandardD2 AgentVMSizeTypes = "Standard_D2"
|
||||
// StandardD2V2 ...
|
||||
StandardD2V2 AgentVMSizeTypes = "Standard_D2_v2"
|
||||
// StandardD3 ...
|
||||
StandardD3 AgentVMSizeTypes = "Standard_D3"
|
||||
// StandardD3V2 ...
|
||||
StandardD3V2 AgentVMSizeTypes = "Standard_D3_v2"
|
||||
// StandardD4 ...
|
||||
StandardD4 AgentVMSizeTypes = "Standard_D4"
|
||||
// StandardD4V2 ...
|
||||
StandardD4V2 AgentVMSizeTypes = "Standard_D4_v2"
|
||||
// StandardD5V2 ...
|
||||
StandardD5V2 AgentVMSizeTypes = "Standard_D5_v2"
|
||||
// StandardDS1 ...
|
||||
StandardDS1 AgentVMSizeTypes = "Standard_DS1"
|
||||
// StandardDS11 ...
|
||||
StandardDS11 AgentVMSizeTypes = "Standard_DS11"
|
||||
// StandardDS12 ...
|
||||
StandardDS12 AgentVMSizeTypes = "Standard_DS12"
|
||||
// StandardDS13 ...
|
||||
StandardDS13 AgentVMSizeTypes = "Standard_DS13"
|
||||
// StandardDS14 ...
|
||||
StandardDS14 AgentVMSizeTypes = "Standard_DS14"
|
||||
// StandardDS2 ...
|
||||
StandardDS2 AgentVMSizeTypes = "Standard_DS2"
|
||||
// StandardDS3 ...
|
||||
StandardDS3 AgentVMSizeTypes = "Standard_DS3"
|
||||
// StandardDS4 ...
|
||||
StandardDS4 AgentVMSizeTypes = "Standard_DS4"
|
||||
// StandardG1 ...
|
||||
StandardG1 AgentVMSizeTypes = "Standard_G1"
|
||||
// StandardG2 ...
|
||||
StandardG2 AgentVMSizeTypes = "Standard_G2"
|
||||
// StandardG3 ...
|
||||
StandardG3 AgentVMSizeTypes = "Standard_G3"
|
||||
// StandardG4 ...
|
||||
StandardG4 AgentVMSizeTypes = "Standard_G4"
|
||||
// StandardG5 ...
|
||||
StandardG5 AgentVMSizeTypes = "Standard_G5"
|
||||
// StandardGS1 ...
|
||||
StandardGS1 AgentVMSizeTypes = "Standard_GS1"
|
||||
// StandardGS2 ...
|
||||
StandardGS2 AgentVMSizeTypes = "Standard_GS2"
|
||||
// StandardGS3 ...
|
||||
StandardGS3 AgentVMSizeTypes = "Standard_GS3"
|
||||
// StandardGS4 ...
|
||||
StandardGS4 AgentVMSizeTypes = "Standard_GS4"
|
||||
// StandardGS5 ...
|
||||
StandardGS5 AgentVMSizeTypes = "Standard_GS5"
|
||||
)
|
||||
|
||||
// ClusterType enumerates the values for cluster type.
|
||||
type ClusterType string
|
||||
|
||||
const (
|
||||
// ACS ...
|
||||
ACS ClusterType = "ACS"
|
||||
// Local ...
|
||||
Local ClusterType = "Local"
|
||||
)
|
||||
|
||||
// OperationStatus enumerates the values for operation status.
|
||||
type OperationStatus string
|
||||
|
||||
const (
|
||||
// Canceled ...
|
||||
Canceled OperationStatus = "Canceled"
|
||||
// Creating ...
|
||||
Creating OperationStatus = "Creating"
|
||||
// Deleting ...
|
||||
Deleting OperationStatus = "Deleting"
|
||||
// Failed ...
|
||||
Failed OperationStatus = "Failed"
|
||||
// Succeeded ...
|
||||
Succeeded OperationStatus = "Succeeded"
|
||||
// Unknown ...
|
||||
Unknown OperationStatus = "Unknown"
|
||||
// Updating ...
|
||||
Updating OperationStatus = "Updating"
|
||||
)
|
||||
|
||||
// OrchestratorType enumerates the values for orchestrator type.
|
||||
type OrchestratorType string
|
||||
|
||||
const (
|
||||
// Kubernetes ...
|
||||
Kubernetes OrchestratorType = "Kubernetes"
|
||||
// None ...
|
||||
None OrchestratorType = "None"
|
||||
)
|
||||
|
||||
// Status enumerates the values for status.
|
||||
type Status string
|
||||
|
||||
const (
|
||||
// Disabled ...
|
||||
Disabled Status = "Disabled"
|
||||
// Enabled ...
|
||||
Enabled Status = "Enabled"
|
||||
)
|
||||
|
||||
// SystemServiceType enumerates the values for system service type.
|
||||
type SystemServiceType string
|
||||
|
||||
const (
|
||||
// SystemServiceTypeBatchFrontEnd ...
|
||||
SystemServiceTypeBatchFrontEnd SystemServiceType = "BatchFrontEnd"
|
||||
// SystemServiceTypeNone ...
|
||||
SystemServiceTypeNone SystemServiceType = "None"
|
||||
// SystemServiceTypeScoringFrontEnd ...
|
||||
SystemServiceTypeScoringFrontEnd SystemServiceType = "ScoringFrontEnd"
|
||||
)
|
||||
|
||||
// UpdatesAvailable enumerates the values for updates available.
|
||||
type UpdatesAvailable string
|
||||
|
||||
const (
|
||||
// No ...
|
||||
No UpdatesAvailable = "No"
|
||||
// Yes ...
|
||||
Yes UpdatesAvailable = "Yes"
|
||||
)
|
||||
|
||||
// AcsClusterProperties information about the container service backing the cluster
|
||||
type AcsClusterProperties struct {
|
||||
// ClusterFqdn - The FQDN of the cluster.
|
||||
ClusterFqdn *string `json:"clusterFqdn,omitempty"`
|
||||
// OrchestratorType - Type of orchestrator. It cannot be changed once the cluster is created. Possible values include: 'Kubernetes', 'None'
|
||||
OrchestratorType OrchestratorType `json:"orchestratorType,omitempty"`
|
||||
// OrchestratorProperties - Orchestrator specific properties
|
||||
OrchestratorProperties *KubernetesClusterProperties `json:"orchestratorProperties,omitempty"`
|
||||
// SystemServices - The system services deployed to the cluster
|
||||
SystemServices *[]SystemService `json:"systemServices,omitempty"`
|
||||
// MasterCount - The number of master nodes in the container service.
|
||||
MasterCount *int32 `json:"masterCount,omitempty"`
|
||||
// AgentCount - The number of agent nodes in the Container Service. This can be changed to scale the cluster.
|
||||
AgentCount *int32 `json:"agentCount,omitempty"`
|
||||
// AgentVMSize - The Azure VM size of the agent VM nodes. This cannot be changed once the cluster is created. This list is non exhaustive; refer to https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes for the possible VM sizes. Possible values include: 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5'
|
||||
AgentVMSize AgentVMSizeTypes `json:"agentVmSize,omitempty"`
|
||||
}
|
||||
|
||||
// AppInsightsCredentials appInsights credentials.
|
||||
type AppInsightsCredentials struct {
|
||||
// AppID - The AppInsights application ID.
|
||||
AppID *string `json:"appId,omitempty"`
|
||||
// InstrumentationKey - The AppInsights instrumentation key. This is not returned in response of GET/PUT on the resource. To see this please call listKeys API.
|
||||
InstrumentationKey *string `json:"instrumentationKey,omitempty"`
|
||||
}
|
||||
|
||||
// AppInsightsProperties properties of App Insights.
|
||||
type AppInsightsProperties struct {
|
||||
// ResourceID - ARM resource ID of the App Insights.
|
||||
ResourceID *string `json:"resourceId,omitempty"`
|
||||
}
|
||||
|
||||
// AutoScaleConfiguration autoScale configuration properties.
|
||||
type AutoScaleConfiguration struct {
|
||||
// Status - If auto-scale is enabled for all services. Each service can turn it off individually. Possible values include: 'Enabled', 'Disabled'
|
||||
Status Status `json:"status,omitempty"`
|
||||
// MinReplicas - The minimum number of replicas for each service.
|
||||
MinReplicas *int32 `json:"minReplicas,omitempty"`
|
||||
// MaxReplicas - The maximum number of replicas for each service.
|
||||
MaxReplicas *int32 `json:"maxReplicas,omitempty"`
|
||||
// TargetUtilization - The target utilization.
|
||||
TargetUtilization *float64 `json:"targetUtilization,omitempty"`
|
||||
// RefreshPeriodInSeconds - Refresh period in seconds.
|
||||
RefreshPeriodInSeconds *int32 `json:"refreshPeriodInSeconds,omitempty"`
|
||||
}
|
||||
|
||||
// AvailableOperations available operation list.
|
||||
type AvailableOperations struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - An array of available operations.
|
||||
Value *[]ResourceOperation `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// CheckSystemServicesUpdatesAvailableResponse information about updates available for system services in a cluster.
|
||||
type CheckSystemServicesUpdatesAvailableResponse struct {
|
||||
autorest.Response `json:"-"`
|
||||
// UpdatesAvailable - Yes if updates are available for the system services, No if not. Possible values include: 'Yes', 'No'
|
||||
UpdatesAvailable UpdatesAvailable `json:"updatesAvailable,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerRegistryCredentials information about the Azure Container Registry which contains the images deployed to
|
||||
// the cluster.
|
||||
type ContainerRegistryCredentials struct {
|
||||
// LoginServer - The ACR login server name. User name is the first part of the FQDN.
|
||||
LoginServer *string `json:"loginServer,omitempty"`
|
||||
// Password - The ACR primary password.
|
||||
Password *string `json:"password,omitempty"`
|
||||
// Password2 - The ACR secondary password.
|
||||
Password2 *string `json:"password2,omitempty"`
|
||||
// Username - The ACR login username.
|
||||
Username *string `json:"username,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerRegistryProperties properties of Azure Container Registry.
|
||||
type ContainerRegistryProperties struct {
|
||||
// ResourceID - ARM resource ID of the Azure Container Registry used to store Docker images for web services in the cluster. If not provided one will be created. This cannot be changed once the cluster is created.
|
||||
ResourceID *string `json:"resourceId,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerServiceCredentials information about the Azure Container Registry which contains the images deployed to the
|
||||
// cluster.
|
||||
type ContainerServiceCredentials struct {
|
||||
// AcsKubeConfig - The ACS kube config file.
|
||||
AcsKubeConfig *string `json:"acsKubeConfig,omitempty"`
|
||||
// ServicePrincipalConfiguration - Service principal configuration used by Kubernetes.
|
||||
ServicePrincipalConfiguration *ServicePrincipalProperties `json:"servicePrincipalConfiguration,omitempty"`
|
||||
// ImagePullSecretName - The ACR image pull secret name which was created in Kubernetes.
|
||||
ImagePullSecretName *string `json:"imagePullSecretName,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorDetail error detail information.
|
||||
type ErrorDetail struct {
|
||||
// Code - Error code.
|
||||
Code *string `json:"code,omitempty"`
|
||||
// Message - Error message.
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponse error response information.
|
||||
type ErrorResponse struct {
|
||||
// Code - Error code.
|
||||
Code *string `json:"code,omitempty"`
|
||||
// Message - Error message.
|
||||
Message *string `json:"message,omitempty"`
|
||||
// Details - An array of error detail objects.
|
||||
Details *[]ErrorDetail `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponseWrapper wrapper for error response to follow ARM guidelines.
|
||||
type ErrorResponseWrapper struct {
|
||||
// Error - The error response.
|
||||
Error *ErrorResponse `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// GlobalServiceConfiguration global configuration for services in the cluster.
|
||||
type GlobalServiceConfiguration struct {
|
||||
// AdditionalProperties - Unmatched properties from the message are deserialized this collection
|
||||
AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"`
|
||||
// Etag - The configuartion ETag for updates.
|
||||
Etag *string `json:"etag,omitempty"`
|
||||
// Ssl - The SSL configuration properties
|
||||
Ssl *SslConfiguration `json:"ssl,omitempty"`
|
||||
// ServiceAuth - Optional global authorization keys for all user services deployed in cluster. These are used if the service does not have auth keys.
|
||||
ServiceAuth *ServiceAuthConfiguration `json:"serviceAuth,omitempty"`
|
||||
// AutoScale - The auto-scale configuration
|
||||
AutoScale *AutoScaleConfiguration `json:"autoScale,omitempty"`
|
||||
}
|
||||
|
||||
// KubernetesClusterProperties kubernetes cluster specific properties
|
||||
type KubernetesClusterProperties struct {
|
||||
// ServicePrincipal - The Azure Service Principal used by Kubernetes
|
||||
ServicePrincipal *ServicePrincipalProperties `json:"servicePrincipal,omitempty"`
|
||||
}
|
||||
|
||||
// OperationalizationCluster instance of an Azure ML Operationalization Cluster resource.
|
||||
type OperationalizationCluster struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Specifies the resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Specifies the name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Specifies the location of the resource.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Specifies the type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - Contains resource tags defined as key/value pairs.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
// OperationalizationClusterProperties - Properties of an operationalization cluster.
|
||||
*OperationalizationClusterProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// OperationalizationClusterCredentials credentials to resources in the cluster.
|
||||
type OperationalizationClusterCredentials struct {
|
||||
autorest.Response `json:"-"`
|
||||
// StorageAccount - Credentials for the Storage Account.
|
||||
StorageAccount *StorageAccountCredentials `json:"storageAccount,omitempty"`
|
||||
// ContainerRegistry - Credentials for Azure Container Registry.
|
||||
ContainerRegistry *ContainerRegistryCredentials `json:"containerRegistry,omitempty"`
|
||||
// ContainerService - Credentials for Azure Container Service.
|
||||
ContainerService *ContainerServiceCredentials `json:"containerService,omitempty"`
|
||||
// AppInsights - Credentials for Azure AppInsights.
|
||||
AppInsights *AppInsightsCredentials `json:"appInsights,omitempty"`
|
||||
// ServiceAuthConfiguration - Global authorization keys for all user services deployed in cluster. These are used if the service does not have auth keys.
|
||||
ServiceAuthConfiguration *ServiceAuthConfiguration `json:"serviceAuthConfiguration,omitempty"`
|
||||
// SslConfiguration - The SSL configuration for the services.
|
||||
SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"`
|
||||
}
|
||||
|
||||
// OperationalizationClusterProperties properties of an operationalization cluster
|
||||
type OperationalizationClusterProperties struct {
|
||||
// Description - The description of the cluster.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// CreatedOn - The date and time when the cluster was created.
|
||||
CreatedOn *date.Time `json:"createdOn,omitempty"`
|
||||
// ModifiedOn - The date and time when the cluster was last modified.
|
||||
ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
|
||||
// ProvisioningState - The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
|
||||
ProvisioningState OperationStatus `json:"provisioningState,omitempty"`
|
||||
// ProvisioningErrors - List of provisioning errors reported by the resource provider.
|
||||
ProvisioningErrors *[]ErrorResponseWrapper `json:"provisioningErrors,omitempty"`
|
||||
// ClusterType - The cluster type. Possible values include: 'ACS', 'Local'
|
||||
ClusterType ClusterType `json:"clusterType,omitempty"`
|
||||
// StorageAccount - Storage Account properties.
|
||||
StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"`
|
||||
// ContainerRegistry - Container Registry properties.
|
||||
ContainerRegistry *ContainerRegistryProperties `json:"containerRegistry,omitempty"`
|
||||
// ContainerService - Parameters for the Azure Container Service cluster.
|
||||
ContainerService *AcsClusterProperties `json:"containerService,omitempty"`
|
||||
// AppInsights - AppInsights configuration.
|
||||
AppInsights *AppInsightsProperties `json:"appInsights,omitempty"`
|
||||
// GlobalServiceConfiguration - Contains global configuration for the web services in the cluster.
|
||||
GlobalServiceConfiguration *GlobalServiceConfiguration `json:"globalServiceConfiguration,omitempty"`
|
||||
}
|
||||
|
||||
// OperationalizationClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
|
||||
// long-running operation.
|
||||
type OperationalizationClustersCreateOrUpdateFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future OperationalizationClustersCreateOrUpdateFuture) Result(client OperationalizationClustersClient) (oc OperationalizationCluster, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return oc, autorest.NewError("compute.OperationalizationClustersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
oc, err = client.CreateOrUpdateResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
oc, err = client.CreateOrUpdateResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// OperationalizationClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
|
||||
// operation.
|
||||
type OperationalizationClustersDeleteFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future OperationalizationClustersDeleteFuture) Result(client OperationalizationClustersClient) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, autorest.NewError("compute.OperationalizationClustersDeleteFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.DeleteResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ar, err = client.DeleteResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// OperationalizationClustersUpdateSystemServicesFuture an abstraction for monitoring and retrieving the results of a
|
||||
// long-running operation.
|
||||
type OperationalizationClustersUpdateSystemServicesFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future OperationalizationClustersUpdateSystemServicesFuture) Result(client OperationalizationClustersClient) (ussr UpdateSystemServicesResponse, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return ussr, autorest.NewError("compute.OperationalizationClustersUpdateSystemServicesFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ussr, err = client.UpdateSystemServicesResponder(future.Response())
|
||||
return
|
||||
}
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req),
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ussr, err = client.UpdateSystemServicesResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// OperationalizationClusterUpdateParameters parameters for PATCH operation on an operationalization cluster
|
||||
type OperationalizationClusterUpdateParameters struct {
|
||||
// Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// PaginatedOperationalizationClustersList paginated list of operationalization clusters.
|
||||
type PaginatedOperationalizationClustersList struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - An array of cluster objects.
|
||||
Value *[]OperationalizationCluster `json:"value,omitempty"`
|
||||
// NextLink - A continuation link (absolute URI) to the next page of results in the list.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// PaginatedOperationalizationClustersListIterator provides access to a complete listing of OperationalizationCluster
|
||||
// values.
|
||||
type PaginatedOperationalizationClustersListIterator struct {
|
||||
i int
|
||||
page PaginatedOperationalizationClustersListPage
|
||||
}
|
||||
|
||||
// Next advances to the next value. If there was an error making
|
||||
// the request the iterator does not advance and the error is returned.
|
||||
func (iter *PaginatedOperationalizationClustersListIterator) Next() error {
|
||||
iter.i++
|
||||
if iter.i < len(iter.page.Values()) {
|
||||
return nil
|
||||
}
|
||||
err := iter.page.Next()
|
||||
if err != nil {
|
||||
iter.i--
|
||||
return err
|
||||
}
|
||||
iter.i = 0
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the enumeration should be started or is not yet complete.
|
||||
func (iter PaginatedOperationalizationClustersListIterator) NotDone() bool {
|
||||
return iter.page.NotDone() && iter.i < len(iter.page.Values())
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (iter PaginatedOperationalizationClustersListIterator) Response() PaginatedOperationalizationClustersList {
|
||||
return iter.page.Response()
|
||||
}
|
||||
|
||||
// Value returns the current value or a zero-initialized value if the
|
||||
// iterator has advanced beyond the end of the collection.
|
||||
func (iter PaginatedOperationalizationClustersListIterator) Value() OperationalizationCluster {
|
||||
if !iter.page.NotDone() {
|
||||
return OperationalizationCluster{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (pocl PaginatedOperationalizationClustersList) IsEmpty() bool {
|
||||
return pocl.Value == nil || len(*pocl.Value) == 0
|
||||
}
|
||||
|
||||
// paginatedOperationalizationClustersListPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (pocl PaginatedOperationalizationClustersList) paginatedOperationalizationClustersListPreparer() (*http.Request, error) {
|
||||
if pocl.NextLink == nil || len(to.String(pocl.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(pocl.NextLink)))
|
||||
}
|
||||
|
||||
// PaginatedOperationalizationClustersListPage contains a page of OperationalizationCluster values.
|
||||
type PaginatedOperationalizationClustersListPage struct {
|
||||
fn func(PaginatedOperationalizationClustersList) (PaginatedOperationalizationClustersList, error)
|
||||
pocl PaginatedOperationalizationClustersList
|
||||
}
|
||||
|
||||
// Next advances to the next page of values. If there was an error making
|
||||
// the request the page does not advance and the error is returned.
|
||||
func (page *PaginatedOperationalizationClustersListPage) Next() error {
|
||||
next, err := page.fn(page.pocl)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.pocl = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page PaginatedOperationalizationClustersListPage) NotDone() bool {
|
||||
return !page.pocl.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page PaginatedOperationalizationClustersListPage) Response() PaginatedOperationalizationClustersList {
|
||||
return page.pocl
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page PaginatedOperationalizationClustersListPage) Values() []OperationalizationCluster {
|
||||
if page.pocl.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.pocl.Value
|
||||
}
|
||||
|
||||
// Resource azure resource
|
||||
type Resource struct {
|
||||
// ID - Specifies the resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Specifies the name of the resource.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Location - Specifies the location of the resource.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Type - Specifies the type of the resource.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Tags - Contains resource tags defined as key/value pairs.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceOperation resource operation.
|
||||
type ResourceOperation struct {
|
||||
// Name - Name of this operation.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Display - Display of the operation.
|
||||
Display *ResourceOperationDisplay `json:"display,omitempty"`
|
||||
// Origin - The operation origin.
|
||||
Origin *string `json:"origin,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceOperationDisplay display of the operation.
|
||||
type ResourceOperationDisplay struct {
|
||||
// Provider - The resource provider name.
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
// Resource - The resource name.
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
// Operation - The operation.
|
||||
Operation *string `json:"operation,omitempty"`
|
||||
// Description - The description of the operation.
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceAuthConfiguration global service auth configuration properties. These are the data-plane authorization keys
|
||||
// and are used if a service doesn't define it's own.
|
||||
type ServiceAuthConfiguration struct {
|
||||
// PrimaryAuthKeyHash - The primary auth key hash. This is not returned in response of GET/PUT on the resource.. To see this please call listKeys API.
|
||||
PrimaryAuthKeyHash *string `json:"primaryAuthKeyHash,omitempty"`
|
||||
// SecondaryAuthKeyHash - The secondary auth key hash. This is not returned in response of GET/PUT on the resource.. To see this please call listKeys API.
|
||||
SecondaryAuthKeyHash *string `json:"secondaryAuthKeyHash,omitempty"`
|
||||
}
|
||||
|
||||
// ServicePrincipalProperties the Azure service principal used by Kubernetes for configuring load balancers
|
||||
type ServicePrincipalProperties struct {
|
||||
// ClientID - The service principal client ID
|
||||
ClientID *string `json:"clientId,omitempty"`
|
||||
// Secret - The service principal secret. This is not returned in response of GET/PUT on the resource. To see this please call listKeys.
|
||||
Secret *string `json:"secret,omitempty"`
|
||||
}
|
||||
|
||||
// SslConfiguration SSL configuration. If configured data-plane calls to user services will be exposed over SSL only.
|
||||
type SslConfiguration struct {
|
||||
// Status - SSL status. Allowed values are Enabled and Disabled. Possible values include: 'Enabled', 'Disabled'
|
||||
Status Status `json:"status,omitempty"`
|
||||
// Cert - The SSL cert data in PEM format.
|
||||
Cert *string `json:"cert,omitempty"`
|
||||
// Key - The SSL key data in PEM format. This is not returned in response of GET/PUT on the resource. To see this please call listKeys API.
|
||||
Key *string `json:"key,omitempty"`
|
||||
// Cname - The CName of the certificate.
|
||||
Cname *string `json:"cname,omitempty"`
|
||||
}
|
||||
|
||||
// StorageAccountCredentials access information for the storage account.
|
||||
type StorageAccountCredentials struct {
|
||||
// ResourceID - The ARM resource ID of the storage account.
|
||||
ResourceID *string `json:"resourceId,omitempty"`
|
||||
// PrimaryKey - The primary key of the storage account.
|
||||
PrimaryKey *string `json:"primaryKey,omitempty"`
|
||||
// SecondaryKey - The secondary key of the storage account.
|
||||
SecondaryKey *string `json:"secondaryKey,omitempty"`
|
||||
}
|
||||
|
||||
// StorageAccountProperties properties of Storage Account.
|
||||
type StorageAccountProperties struct {
|
||||
// ResourceID - ARM resource ID of the Azure Storage Account to store CLI specific files. If not provided one will be created. This cannot be changed once the cluster is created.
|
||||
ResourceID *string `json:"resourceId,omitempty"`
|
||||
}
|
||||
|
||||
// SystemService information about a system service deployed in the cluster
|
||||
type SystemService struct {
|
||||
// SystemServiceType - The system service type. Possible values include: 'SystemServiceTypeNone', 'SystemServiceTypeScoringFrontEnd', 'SystemServiceTypeBatchFrontEnd'
|
||||
SystemServiceType SystemServiceType `json:"systemServiceType,omitempty"`
|
||||
// PublicIPAddress - The public IP address of the system service
|
||||
PublicIPAddress *string `json:"publicIpAddress,omitempty"`
|
||||
// Version - The state of the system service
|
||||
Version *string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateSystemServicesResponse response of the update system services API
|
||||
type UpdateSystemServicesResponse struct {
|
||||
autorest.Response `json:"-"`
|
||||
// UpdateStatus - Update status. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
|
||||
UpdateStatus OperationStatus `json:"updateStatus,omitempty"`
|
||||
// UpdateStartedOn - The date and time when the last system services update was started.
|
||||
UpdateStartedOn *date.Time `json:"updateStartedOn,omitempty"`
|
||||
// UpdateCompletedOn - The date and time when the last system services update completed.
|
||||
UpdateCompletedOn *date.Time `json:"updateCompletedOn,omitempty"`
|
||||
}
|
||||
Generated
Vendored
+844
@@ -0,0 +1,844 @@
|
||||
package compute
|
||||
|
||||
// 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/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// OperationalizationClustersClient is the these APIs allow end users to operate on Azure Machine Learning Compute
|
||||
// resources. They support the following operations:<ul><li>Create or update a cluster</li><li>Get a
|
||||
// cluster</li><li>Patch a cluster</li><li>Delete a cluster</li><li>Get keys for a cluster</li><li>Check if updates are
|
||||
// available for system services in a cluster</li><li>Update system services in a cluster</li><li>Get all clusters in a
|
||||
// resource group</li><li>Get all clusters in a subscription</li></ul>
|
||||
type OperationalizationClustersClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewOperationalizationClustersClient creates an instance of the OperationalizationClustersClient client.
|
||||
func NewOperationalizationClustersClient(subscriptionID string) OperationalizationClustersClient {
|
||||
return NewOperationalizationClustersClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewOperationalizationClustersClientWithBaseURI creates an instance of the OperationalizationClustersClient client.
|
||||
func NewOperationalizationClustersClientWithBaseURI(baseURI string, subscriptionID string) OperationalizationClustersClient {
|
||||
return OperationalizationClustersClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CheckSystemServicesUpdatesAvailable checks if updates are available for system services in the cluster.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the cluster is located. clusterName is the name of the
|
||||
// cluster.
|
||||
func (client OperationalizationClustersClient) CheckSystemServicesUpdatesAvailable(ctx context.Context, resourceGroupName string, clusterName string) (result CheckSystemServicesUpdatesAvailableResponse, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
|
||||
{TargetValue: clusterName,
|
||||
Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z][-\w\._\(\)]+[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "compute.OperationalizationClustersClient", "CheckSystemServicesUpdatesAvailable")
|
||||
}
|
||||
|
||||
req, err := client.CheckSystemServicesUpdatesAvailablePreparer(ctx, resourceGroupName, clusterName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "CheckSystemServicesUpdatesAvailable", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CheckSystemServicesUpdatesAvailableSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "CheckSystemServicesUpdatesAvailable", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CheckSystemServicesUpdatesAvailableResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "CheckSystemServicesUpdatesAvailable", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CheckSystemServicesUpdatesAvailablePreparer prepares the CheckSystemServicesUpdatesAvailable request.
|
||||
func (client OperationalizationClustersClient) CheckSystemServicesUpdatesAvailablePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName}/checkSystemServicesUpdatesAvailable", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CheckSystemServicesUpdatesAvailableSender sends the CheckSystemServicesUpdatesAvailable request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) CheckSystemServicesUpdatesAvailableSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// CheckSystemServicesUpdatesAvailableResponder handles the response to the CheckSystemServicesUpdatesAvailable request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) CheckSystemServicesUpdatesAvailableResponder(resp *http.Response) (result CheckSystemServicesUpdatesAvailableResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdate create or update an operationalization cluster.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the cluster is located. clusterName is the name of the
|
||||
// cluster. parameters is parameters supplied to create or update an Operationalization cluster.
|
||||
func (client OperationalizationClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters OperationalizationCluster) (result OperationalizationClustersCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
|
||||
{TargetValue: clusterName,
|
||||
Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z][-\w\._\(\)]+[a-zA-Z0-9]$`, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.OrchestratorProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.OrchestratorProperties.ServicePrincipal", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.OrchestratorProperties.ServicePrincipal.ClientID", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.OperationalizationClusterProperties.ContainerService.OrchestratorProperties.ServicePrincipal.Secret", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.OperationalizationClusterProperties.ContainerService.MasterCount", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.MasterCount", Name: validation.InclusiveMaximum, Rule: 5, Chain: nil},
|
||||
{Target: "parameters.OperationalizationClusterProperties.ContainerService.MasterCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.OperationalizationClusterProperties.ContainerService.AgentCount", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.ContainerService.AgentCount", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.OperationalizationClusterProperties.ContainerService.AgentCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration.ServiceAuth", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration.ServiceAuth.PrimaryAuthKeyHash", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration.ServiceAuth.SecondaryAuthKeyHash", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration.AutoScale", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration.AutoScale.MinReplicas", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration.AutoScale.MinReplicas", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}},
|
||||
{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration.AutoScale.MaxReplicas", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.OperationalizationClusterProperties.GlobalServiceConfiguration.AutoScale.MaxReplicas", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}},
|
||||
}},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "compute.OperationalizationClustersClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client OperationalizationClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters OperationalizationCluster) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) CreateOrUpdateSender(req *http.Request) (future OperationalizationClustersCreateOrUpdateFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) CreateOrUpdateResponder(resp *http.Response) (result OperationalizationCluster, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes the specified cluster.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the cluster is located. clusterName is the name of the
|
||||
// cluster. deleteAll is if true, deletes all resources associated with this cluster.
|
||||
func (client OperationalizationClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, deleteAll *bool) (result OperationalizationClustersDeleteFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
|
||||
{TargetValue: clusterName,
|
||||
Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z][-\w\._\(\)]+[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "compute.OperationalizationClustersClient", "Delete")
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, deleteAll)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client OperationalizationClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, deleteAll *bool) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if deleteAll != nil {
|
||||
queryParameters["deleteAll"] = autorest.Encode("query", *deleteAll)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) DeleteSender(req *http.Request) (future OperationalizationClustersDeleteFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets the operationalization cluster resource view. Note that the credentials are not returned by this call. Call
|
||||
// ListKeys to get them.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the cluster is located. clusterName is the name of the
|
||||
// cluster.
|
||||
func (client OperationalizationClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result OperationalizationCluster, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
|
||||
{TargetValue: clusterName,
|
||||
Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z][-\w\._\(\)]+[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "compute.OperationalizationClustersClient", "Get")
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, clusterName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client OperationalizationClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) GetResponder(resp *http.Response) (result OperationalizationCluster, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup gets the clusters in the specified resource group.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the cluster is located. skiptoken is continuation token for
|
||||
// pagination.
|
||||
func (client OperationalizationClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result PaginatedOperationalizationClustersListPage, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "compute.OperationalizationClustersClient", "ListByResourceGroup")
|
||||
}
|
||||
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, skiptoken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.pocl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.pocl, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client OperationalizationClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, skiptoken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skiptoken) > 0 {
|
||||
queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) ListByResourceGroupResponder(resp *http.Response) (result PaginatedOperationalizationClustersList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client OperationalizationClustersClient) listByResourceGroupNextResults(lastResults PaginatedOperationalizationClustersList) (result PaginatedOperationalizationClustersList, err error) {
|
||||
req, err := lastResults.paginatedOperationalizationClustersListPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client OperationalizationClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skiptoken string) (result PaginatedOperationalizationClustersListIterator, err error) {
|
||||
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, skiptoken)
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionID gets the operationalization clusters in the specified subscription.
|
||||
//
|
||||
// skiptoken is continuation token for pagination.
|
||||
func (client OperationalizationClustersClient) ListBySubscriptionID(ctx context.Context, skiptoken string) (result PaginatedOperationalizationClustersListPage, err error) {
|
||||
result.fn = client.listBySubscriptionIDNextResults
|
||||
req, err := client.ListBySubscriptionIDPreparer(ctx, skiptoken)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListBySubscriptionID", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySubscriptionIDSender(req)
|
||||
if err != nil {
|
||||
result.pocl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListBySubscriptionID", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.pocl, err = client.ListBySubscriptionIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListBySubscriptionID", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request.
|
||||
func (client OperationalizationClustersClient) ListBySubscriptionIDPreparer(ctx context.Context, skiptoken string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(skiptoken) > 0 {
|
||||
queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningCompute/operationalizationClusters", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDSender sends the ListBySubscriptionID request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDResponder handles the response to the ListBySubscriptionID request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) ListBySubscriptionIDResponder(resp *http.Response) (result PaginatedOperationalizationClustersList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listBySubscriptionIDNextResults retrieves the next set of results, if any.
|
||||
func (client OperationalizationClustersClient) listBySubscriptionIDNextResults(lastResults PaginatedOperationalizationClustersList) (result PaginatedOperationalizationClustersList, err error) {
|
||||
req, err := lastResults.paginatedOperationalizationClustersListPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "listBySubscriptionIDNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListBySubscriptionIDSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "listBySubscriptionIDNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListBySubscriptionIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "listBySubscriptionIDNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionIDComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client OperationalizationClustersClient) ListBySubscriptionIDComplete(ctx context.Context, skiptoken string) (result PaginatedOperationalizationClustersListIterator, err error) {
|
||||
result.page, err = client.ListBySubscriptionID(ctx, skiptoken)
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeys gets the credentials for the specified cluster such as Storage, ACR and ACS credentials. This is a long
|
||||
// running operation because it fetches keys from dependencies.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the cluster is located. clusterName is the name of the
|
||||
// cluster.
|
||||
func (client OperationalizationClustersClient) ListKeys(ctx context.Context, resourceGroupName string, clusterName string) (result OperationalizationClusterCredentials, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
|
||||
{TargetValue: clusterName,
|
||||
Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z][-\w\._\(\)]+[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "compute.OperationalizationClustersClient", "ListKeys")
|
||||
}
|
||||
|
||||
req, err := client.ListKeysPreparer(ctx, resourceGroupName, clusterName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListKeys", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListKeysSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListKeys", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListKeysResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "ListKeys", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeysPreparer prepares the ListKeys request.
|
||||
func (client OperationalizationClustersClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName}/listKeys", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListKeysSender sends the ListKeys request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) ListKeysSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListKeysResponder handles the response to the ListKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) ListKeysResponder(resp *http.Response) (result OperationalizationClusterCredentials, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Update the PATCH operation can be used to update only the tags for a cluster. Use PUT operation to update other
|
||||
// properties.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the cluster is located. clusterName is the name of the
|
||||
// cluster. parameters is the parameters supplied to patch the cluster.
|
||||
func (client OperationalizationClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, parameters OperationalizationClusterUpdateParameters) (result OperationalizationCluster, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
|
||||
{TargetValue: clusterName,
|
||||
Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z][-\w\._\(\)]+[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "compute.OperationalizationClustersClient", "Update")
|
||||
}
|
||||
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.UpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "Update", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "Update", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client OperationalizationClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters OperationalizationClusterUpdateParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) UpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) UpdateResponder(resp *http.Response) (result OperationalizationCluster, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateSystemServices updates system services in a cluster.
|
||||
//
|
||||
// resourceGroupName is name of the resource group in which the cluster is located. clusterName is the name of the
|
||||
// cluster.
|
||||
func (client OperationalizationClustersClient) UpdateSystemServices(ctx context.Context, resourceGroupName string, clusterName string) (result OperationalizationClustersUpdateSystemServicesFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
|
||||
{TargetValue: clusterName,
|
||||
Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "clusterName", Name: validation.Pattern, Rule: `^[a-zA-Z][-\w\._\(\)]+[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "compute.OperationalizationClustersClient", "UpdateSystemServices")
|
||||
}
|
||||
|
||||
req, err := client.UpdateSystemServicesPreparer(ctx, resourceGroupName, clusterName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "UpdateSystemServices", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateSystemServicesSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersClient", "UpdateSystemServices", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateSystemServicesPreparer prepares the UpdateSystemServices request.
|
||||
func (client OperationalizationClustersClient) UpdateSystemServicesPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-08-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName}/updateSystemServices", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateSystemServicesSender sends the UpdateSystemServices request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationalizationClustersClient) UpdateSystemServicesSender(req *http.Request) (future OperationalizationClustersUpdateSystemServicesFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateSystemServicesResponder handles the response to the UpdateSystemServices request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationalizationClustersClient) UpdateSystemServicesResponder(resp *http.Response) (result UpdateSystemServicesResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
package compute
|
||||
|
||||
// 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.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v12.2.0-beta services"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v12.2.0-beta"
|
||||
}
|
||||
Reference in New Issue
Block a user