vendor: update all dependencies to latest versions
This commit is contained in:
Generated
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
// Package servicefabric implements the Azure ARM Servicefabric service API version 2016-09-01.
|
||||
//
|
||||
//
|
||||
package servicefabric
|
||||
|
||||
// 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 Servicefabric
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Servicefabric.
|
||||
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
+552
@@ -0,0 +1,552 @@
|
||||
package servicefabric
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ClustersClient is the client for the Clusters methods of the Servicefabric service.
|
||||
type ClustersClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewClustersClient creates an instance of the ClustersClient client.
|
||||
func NewClustersClient(subscriptionID string) ClustersClient {
|
||||
return NewClustersClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewClustersClientWithBaseURI creates an instance of the ClustersClient client.
|
||||
func NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient {
|
||||
return ClustersClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Create create cluster resource
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the resource belongs or get created clusterName is the
|
||||
// name of the cluster resource parameters is put Request
|
||||
func (client ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster) (result ClustersCreateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.ClusterProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.Certificate", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.Certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "parameters.ClusterProperties.ReverseProxyCertificate", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.ReverseProxyCertificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "parameters.ClusterProperties.ManagementEndpoint", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.NodeTypes", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.StorageAccountName", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.ProtectedAccountKeyName", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.BlobEndpoint", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.QueueEndpoint", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.TableEndpoint", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeReplicaSetCheckTimeout", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckWaitDuration", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckStableDuration", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckRetryTimeout", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeTimeout", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeDomainTimeout", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicefabric.ClustersClient", "Create")
|
||||
}
|
||||
|
||||
req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreatePreparer prepares the Create request.
|
||||
func (client ClustersClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster) (*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 = "2016-09-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.ServiceFabric/clusters/{clusterName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateSender sends the Create request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ClustersClient) CreateSender(req *http.Request) (future ClustersCreateFuture, 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
|
||||
}
|
||||
|
||||
// CreateResponder handles the response to the Create request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ClustersClient) CreateResponder(resp *http.Response) (result Cluster, 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
|
||||
}
|
||||
|
||||
// Delete delete cluster resource
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the resource belongs or get created clusterName is the
|
||||
// name of the cluster resource
|
||||
func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result autorest.Response, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client ClustersClient) DeletePreparer(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 = "2016-09-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.ServiceFabric/clusters/{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 ClustersClient) 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 ClustersClient) 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 get cluster resource
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the resource belongs or get created clusterName is the
|
||||
// name of the cluster resource
|
||||
func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result Cluster, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, clusterName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ClustersClient) 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 = "2016-09-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.ServiceFabric/clusters/{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 ClustersClient) 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 ClustersClient) GetResponder(resp *http.Response) (result Cluster, 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 list cluster resource
|
||||
func (client ClustersClient) List(ctx context.Context) (result ClusterListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.clr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.clr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters", 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 ClustersClient) 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 ClustersClient) ListResponder(resp *http.Response) (result ClusterListResult, 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 ClustersClient) listNextResults(lastResults ClusterListResult) (result ClusterListResult, err error) {
|
||||
req, err := lastResults.clusterListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "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, "servicefabric.ClustersClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ClustersClient) ListComplete(ctx context.Context) (result ClusterListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroup list cluster resource by resource group
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the resource belongs or get created
|
||||
func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListResultPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.clr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.clr, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client ClustersClient) 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 = "2016-09-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.ServiceFabric/clusters", 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 ClustersClient) 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 ClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ClusterListResult, 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 ClustersClient) listByResourceGroupNextResults(lastResults ClusterListResult) (result ClusterListResult, err error) {
|
||||
req, err := lastResults.clusterListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "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, "servicefabric.ClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ClusterListResultIterator, err error) {
|
||||
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
|
||||
return
|
||||
}
|
||||
|
||||
// Update update cluster configuration
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to which the resource belongs or get created clusterName is the
|
||||
// name of the cluster resource parameters is the parameters which contains the property value and property name which
|
||||
// used to update the cluster configuration
|
||||
func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdateParameters) (result ClustersUpdateFuture, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdateParameters) (*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 = "2016-09-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.ServiceFabric/clusters/{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 ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, 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
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ClustersClient) UpdateResponder(resp *http.Response) (result Cluster, 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
+391
@@ -0,0 +1,391 @@
|
||||
package servicefabric
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ClusterVersionsClient is the client for the ClusterVersions methods of the Servicefabric service.
|
||||
type ClusterVersionsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewClusterVersionsClient creates an instance of the ClusterVersionsClient client.
|
||||
func NewClusterVersionsClient(subscriptionID string) ClusterVersionsClient {
|
||||
return NewClusterVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewClusterVersionsClientWithBaseURI creates an instance of the ClusterVersionsClient client.
|
||||
func NewClusterVersionsClientWithBaseURI(baseURI string, subscriptionID string) ClusterVersionsClient {
|
||||
return ClusterVersionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Get get cluster code versions by environment and version
|
||||
//
|
||||
// location is the location for the cluster code versions, this is different from cluster location environment is
|
||||
// cluster operating system, the default means all clusterVersion is the cluster code version
|
||||
func (client ClusterVersionsClient) Get(ctx context.Context, location string, environment string, clusterVersion string) (result ClusterCodeVersionsResult, err error) {
|
||||
req, err := client.GetPreparer(ctx, location, environment, clusterVersion)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ClusterVersionsClient) GetPreparer(ctx context.Context, location string, environment string, clusterVersion string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterVersion": autorest.Encode("path", clusterVersion),
|
||||
"environment": autorest.Encode("path", environment),
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}", 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 ClusterVersionsClient) 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 ClusterVersionsClient) GetResponder(resp *http.Response) (result ClusterCodeVersionsResult, 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 list cluster code versions by location
|
||||
//
|
||||
// location is the location for the cluster code versions, this is different from cluster location
|
||||
func (client ClusterVersionsClient) List(ctx context.Context, location string) (result ClusterCodeVersionsListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, location)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.ccvlr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.ccvlr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ClusterVersionsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions", 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 ClusterVersionsClient) 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 ClusterVersionsClient) ListResponder(resp *http.Response) (result ClusterCodeVersionsListResult, 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 ClusterVersionsClient) listNextResults(lastResults ClusterCodeVersionsListResult) (result ClusterCodeVersionsListResult, err error) {
|
||||
req, err := lastResults.clusterCodeVersionsListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "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, "servicefabric.ClusterVersionsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ClusterVersionsClient) ListComplete(ctx context.Context, location string) (result ClusterCodeVersionsListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx, location)
|
||||
return
|
||||
}
|
||||
|
||||
// ListByEnvironment list cluster code versions by environment
|
||||
//
|
||||
// location is the location for the cluster code versions, this is different from cluster location environment is
|
||||
// cluster operating system, the default means all
|
||||
func (client ClusterVersionsClient) ListByEnvironment(ctx context.Context, location string, environment string) (result ClusterCodeVersionsListResultPage, err error) {
|
||||
result.fn = client.listByEnvironmentNextResults
|
||||
req, err := client.ListByEnvironmentPreparer(ctx, location, environment)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByEnvironmentSender(req)
|
||||
if err != nil {
|
||||
result.ccvlr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.ccvlr, err = client.ListByEnvironmentResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByEnvironmentPreparer prepares the ListByEnvironment request.
|
||||
func (client ClusterVersionsClient) ListByEnvironmentPreparer(ctx context.Context, location string, environment string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"environment": autorest.Encode("path", environment),
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByEnvironmentSender sends the ListByEnvironment request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ClusterVersionsClient) ListByEnvironmentSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByEnvironmentResponder handles the response to the ListByEnvironment request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ClusterVersionsClient) ListByEnvironmentResponder(resp *http.Response) (result ClusterCodeVersionsListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByEnvironmentNextResults retrieves the next set of results, if any.
|
||||
func (client ClusterVersionsClient) listByEnvironmentNextResults(lastResults ClusterCodeVersionsListResult) (result ClusterCodeVersionsListResult, err error) {
|
||||
req, err := lastResults.clusterCodeVersionsListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "listByEnvironmentNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByEnvironmentSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "listByEnvironmentNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByEnvironmentResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "listByEnvironmentNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByEnvironmentComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ClusterVersionsClient) ListByEnvironmentComplete(ctx context.Context, location string, environment string) (result ClusterCodeVersionsListResultIterator, err error) {
|
||||
result.page, err = client.ListByEnvironment(ctx, location, environment)
|
||||
return
|
||||
}
|
||||
|
||||
// ListByVersion list cluster code versions by version
|
||||
//
|
||||
// location is the location for the cluster code versions, this is different from cluster location clusterVersion is
|
||||
// the cluster code version
|
||||
func (client ClusterVersionsClient) ListByVersion(ctx context.Context, location string, clusterVersion string) (result ClusterCodeVersionsListResultPage, err error) {
|
||||
result.fn = client.listByVersionNextResults
|
||||
req, err := client.ListByVersionPreparer(ctx, location, clusterVersion)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByVersion", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByVersionSender(req)
|
||||
if err != nil {
|
||||
result.ccvlr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByVersion", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.ccvlr, err = client.ListByVersionResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByVersion", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByVersionPreparer prepares the ListByVersion request.
|
||||
func (client ClusterVersionsClient) ListByVersionPreparer(ctx context.Context, location string, clusterVersion string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterVersion": autorest.Encode("path", clusterVersion),
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByVersionSender sends the ListByVersion request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ClusterVersionsClient) ListByVersionSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByVersionResponder handles the response to the ListByVersion request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ClusterVersionsClient) ListByVersionResponder(resp *http.Response) (result ClusterCodeVersionsListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByVersionNextResults retrieves the next set of results, if any.
|
||||
func (client ClusterVersionsClient) listByVersionNextResults(lastResults ClusterCodeVersionsListResult) (result ClusterCodeVersionsListResult, err error) {
|
||||
req, err := lastResults.clusterCodeVersionsListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "listByVersionNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByVersionSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "listByVersionNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByVersionResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "listByVersionNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByVersionComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ClusterVersionsClient) ListByVersionComplete(ctx context.Context, location string, clusterVersion string) (result ClusterCodeVersionsListResultIterator, err error) {
|
||||
result.page, err = client.ListByVersion(ctx, location, clusterVersion)
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+986
@@ -0,0 +1,986 @@
|
||||
package servicefabric
|
||||
|
||||
// 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/to"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ClusterState enumerates the values for cluster state.
|
||||
type ClusterState string
|
||||
|
||||
const (
|
||||
// AutoScale ...
|
||||
AutoScale ClusterState = "AutoScale"
|
||||
// BaselineUpgrade ...
|
||||
BaselineUpgrade ClusterState = "BaselineUpgrade"
|
||||
// Deploying ...
|
||||
Deploying ClusterState = "Deploying"
|
||||
// EnforcingClusterVersion ...
|
||||
EnforcingClusterVersion ClusterState = "EnforcingClusterVersion"
|
||||
// Ready ...
|
||||
Ready ClusterState = "Ready"
|
||||
// UpdatingInfrastructure ...
|
||||
UpdatingInfrastructure ClusterState = "UpdatingInfrastructure"
|
||||
// UpdatingUserCertificate ...
|
||||
UpdatingUserCertificate ClusterState = "UpdatingUserCertificate"
|
||||
// UpdatingUserConfiguration ...
|
||||
UpdatingUserConfiguration ClusterState = "UpdatingUserConfiguration"
|
||||
// UpgradeServiceUnreachable ...
|
||||
UpgradeServiceUnreachable ClusterState = "UpgradeServiceUnreachable"
|
||||
// WaitingForNodes ...
|
||||
WaitingForNodes ClusterState = "WaitingForNodes"
|
||||
)
|
||||
|
||||
// DurabilityLevel enumerates the values for durability level.
|
||||
type DurabilityLevel string
|
||||
|
||||
const (
|
||||
// Bronze ...
|
||||
Bronze DurabilityLevel = "Bronze"
|
||||
// Gold ...
|
||||
Gold DurabilityLevel = "Gold"
|
||||
// Silver ...
|
||||
Silver DurabilityLevel = "Silver"
|
||||
)
|
||||
|
||||
// Environment enumerates the values for environment.
|
||||
type Environment string
|
||||
|
||||
const (
|
||||
// Linux ...
|
||||
Linux Environment = "Linux"
|
||||
// Windows ...
|
||||
Windows Environment = "Windows"
|
||||
)
|
||||
|
||||
// ProvisioningState enumerates the values for provisioning state.
|
||||
type ProvisioningState string
|
||||
|
||||
const (
|
||||
// Canceled ...
|
||||
Canceled ProvisioningState = "Canceled"
|
||||
// Failed ...
|
||||
Failed ProvisioningState = "Failed"
|
||||
// Succeeded ...
|
||||
Succeeded ProvisioningState = "Succeeded"
|
||||
// Updating ...
|
||||
Updating ProvisioningState = "Updating"
|
||||
)
|
||||
|
||||
// ReliabilityLevel enumerates the values for reliability level.
|
||||
type ReliabilityLevel string
|
||||
|
||||
const (
|
||||
// ReliabilityLevelBronze ...
|
||||
ReliabilityLevelBronze ReliabilityLevel = "Bronze"
|
||||
// ReliabilityLevelGold ...
|
||||
ReliabilityLevelGold ReliabilityLevel = "Gold"
|
||||
// ReliabilityLevelSilver ...
|
||||
ReliabilityLevelSilver ReliabilityLevel = "Silver"
|
||||
)
|
||||
|
||||
// ReliabilityLevel1 enumerates the values for reliability level 1.
|
||||
type ReliabilityLevel1 string
|
||||
|
||||
const (
|
||||
// ReliabilityLevel1Bronze ...
|
||||
ReliabilityLevel1Bronze ReliabilityLevel1 = "Bronze"
|
||||
// ReliabilityLevel1Gold ...
|
||||
ReliabilityLevel1Gold ReliabilityLevel1 = "Gold"
|
||||
// ReliabilityLevel1Platinum ...
|
||||
ReliabilityLevel1Platinum ReliabilityLevel1 = "Platinum"
|
||||
// ReliabilityLevel1Silver ...
|
||||
ReliabilityLevel1Silver ReliabilityLevel1 = "Silver"
|
||||
)
|
||||
|
||||
// UpgradeMode enumerates the values for upgrade mode.
|
||||
type UpgradeMode string
|
||||
|
||||
const (
|
||||
// Automatic ...
|
||||
Automatic UpgradeMode = "Automatic"
|
||||
// Manual ...
|
||||
Manual UpgradeMode = "Manual"
|
||||
)
|
||||
|
||||
// UpgradeMode1 enumerates the values for upgrade mode 1.
|
||||
type UpgradeMode1 string
|
||||
|
||||
const (
|
||||
// UpgradeMode1Automatic ...
|
||||
UpgradeMode1Automatic UpgradeMode1 = "Automatic"
|
||||
// UpgradeMode1Manual ...
|
||||
UpgradeMode1Manual UpgradeMode1 = "Manual"
|
||||
)
|
||||
|
||||
// X509StoreName enumerates the values for x509 store name.
|
||||
type X509StoreName string
|
||||
|
||||
const (
|
||||
// AddressBook ...
|
||||
AddressBook X509StoreName = "AddressBook"
|
||||
// AuthRoot ...
|
||||
AuthRoot X509StoreName = "AuthRoot"
|
||||
// CertificateAuthority ...
|
||||
CertificateAuthority X509StoreName = "CertificateAuthority"
|
||||
// Disallowed ...
|
||||
Disallowed X509StoreName = "Disallowed"
|
||||
// My ...
|
||||
My X509StoreName = "My"
|
||||
// Root ...
|
||||
Root X509StoreName = "Root"
|
||||
// TrustedPeople ...
|
||||
TrustedPeople X509StoreName = "TrustedPeople"
|
||||
// TrustedPublisher ...
|
||||
TrustedPublisher X509StoreName = "TrustedPublisher"
|
||||
)
|
||||
|
||||
// AvailableOperationDisplay operation supported by ServiceFabric resource provider
|
||||
type AvailableOperationDisplay struct {
|
||||
// Provider - Provider name
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
// Resource - Resource name
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
// Operation - Operation name
|
||||
Operation *string `json:"operation,omitempty"`
|
||||
// Description - Operation description
|
||||
Description *string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// AzureActiveDirectory the settings to enable AAD authentication on the cluster
|
||||
type AzureActiveDirectory struct {
|
||||
// TenantID - Azure active directory tenant id
|
||||
TenantID *string `json:"tenantId,omitempty"`
|
||||
// ClusterApplication - Azure active directory cluster application id
|
||||
ClusterApplication *string `json:"clusterApplication,omitempty"`
|
||||
// ClientApplication - Azure active directory client application id
|
||||
ClientApplication *string `json:"clientApplication,omitempty"`
|
||||
}
|
||||
|
||||
// CertificateDescription certificate details
|
||||
type CertificateDescription struct {
|
||||
// Thumbprint - Thumbprint of the primary certificate
|
||||
Thumbprint *string `json:"thumbprint,omitempty"`
|
||||
// ThumbprintSecondary - Thumbprint of the secondary certificate
|
||||
ThumbprintSecondary *string `json:"thumbprintSecondary,omitempty"`
|
||||
// X509StoreName - The local certificate store location. Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher'
|
||||
X509StoreName X509StoreName `json:"x509StoreName,omitempty"`
|
||||
}
|
||||
|
||||
// ClientCertificateCommonName client certificate details using common name
|
||||
type ClientCertificateCommonName struct {
|
||||
// IsAdmin - Is this certificate used for admin access from the client, if false , it is used or query only access
|
||||
IsAdmin *bool `json:"isAdmin,omitempty"`
|
||||
// CertificateCommonName - Certificate common name to be granted access; be carefull using wild card common names
|
||||
CertificateCommonName *string `json:"certificateCommonName,omitempty"`
|
||||
// CertificateIssuerThumbprint - Certificate issuer thumbprint
|
||||
CertificateIssuerThumbprint *string `json:"certificateIssuerThumbprint,omitempty"`
|
||||
}
|
||||
|
||||
// ClientCertificateThumbprint client certificate details using thumbprint
|
||||
type ClientCertificateThumbprint struct {
|
||||
// IsAdmin - Is this certificate used for admin access from the client, if false, it is used or query only access
|
||||
IsAdmin *bool `json:"isAdmin,omitempty"`
|
||||
// CertificateThumbprint - Certificate thumbprint
|
||||
CertificateThumbprint *string `json:"certificateThumbprint,omitempty"`
|
||||
}
|
||||
|
||||
// Cluster the cluster resource
|
||||
type Cluster struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - Resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Resource name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - Resource type.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Location - Resource location.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Tags - Resource tags.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
*ClusterProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaler for Cluster struct.
|
||||
func (c *Cluster) 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 {
|
||||
var properties ClusterProperties
|
||||
err = json.Unmarshal(*m["properties"], &properties)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.ClusterProperties = &properties
|
||||
}
|
||||
|
||||
v = m["id"]
|
||||
if v != nil {
|
||||
var ID string
|
||||
err = json.Unmarshal(*m["id"], &ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.ID = &ID
|
||||
}
|
||||
|
||||
v = m["name"]
|
||||
if v != nil {
|
||||
var name string
|
||||
err = json.Unmarshal(*m["name"], &name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Name = &name
|
||||
}
|
||||
|
||||
v = m["type"]
|
||||
if v != nil {
|
||||
var typeVar string
|
||||
err = json.Unmarshal(*m["type"], &typeVar)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Type = &typeVar
|
||||
}
|
||||
|
||||
v = m["location"]
|
||||
if v != nil {
|
||||
var location string
|
||||
err = json.Unmarshal(*m["location"], &location)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Location = &location
|
||||
}
|
||||
|
||||
v = m["tags"]
|
||||
if v != nil {
|
||||
var tags map[string]*string
|
||||
err = json.Unmarshal(*m["tags"], &tags)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Tags = &tags
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ClusterCodeVersionsListResult the list results of the ServiceFabric runtime versions
|
||||
type ClusterCodeVersionsListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]ClusterCodeVersionsResult `json:"value,omitempty"`
|
||||
// NextLink - The URL to use for getting the next set of results.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterCodeVersionsListResultIterator provides access to a complete listing of ClusterCodeVersionsResult values.
|
||||
type ClusterCodeVersionsListResultIterator struct {
|
||||
i int
|
||||
page ClusterCodeVersionsListResultPage
|
||||
}
|
||||
|
||||
// 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 *ClusterCodeVersionsListResultIterator) 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 ClusterCodeVersionsListResultIterator) 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 ClusterCodeVersionsListResultIterator) Response() ClusterCodeVersionsListResult {
|
||||
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 ClusterCodeVersionsListResultIterator) Value() ClusterCodeVersionsResult {
|
||||
if !iter.page.NotDone() {
|
||||
return ClusterCodeVersionsResult{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (ccvlr ClusterCodeVersionsListResult) IsEmpty() bool {
|
||||
return ccvlr.Value == nil || len(*ccvlr.Value) == 0
|
||||
}
|
||||
|
||||
// clusterCodeVersionsListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (ccvlr ClusterCodeVersionsListResult) clusterCodeVersionsListResultPreparer() (*http.Request, error) {
|
||||
if ccvlr.NextLink == nil || len(to.String(ccvlr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(ccvlr.NextLink)))
|
||||
}
|
||||
|
||||
// ClusterCodeVersionsListResultPage contains a page of ClusterCodeVersionsResult values.
|
||||
type ClusterCodeVersionsListResultPage struct {
|
||||
fn func(ClusterCodeVersionsListResult) (ClusterCodeVersionsListResult, error)
|
||||
ccvlr ClusterCodeVersionsListResult
|
||||
}
|
||||
|
||||
// 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 *ClusterCodeVersionsListResultPage) Next() error {
|
||||
next, err := page.fn(page.ccvlr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.ccvlr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page ClusterCodeVersionsListResultPage) NotDone() bool {
|
||||
return !page.ccvlr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page ClusterCodeVersionsListResultPage) Response() ClusterCodeVersionsListResult {
|
||||
return page.ccvlr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page ClusterCodeVersionsListResultPage) Values() []ClusterCodeVersionsResult {
|
||||
if page.ccvlr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.ccvlr.Value
|
||||
}
|
||||
|
||||
// ClusterCodeVersionsResult the result of the ServiceFabric runtime versions
|
||||
type ClusterCodeVersionsResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// ID - The identification of the result
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - The name of the result
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - The result resource type
|
||||
Type *string `json:"type,omitempty"`
|
||||
*ClusterVersionDetails `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaler for ClusterCodeVersionsResult struct.
|
||||
func (ccvr *ClusterCodeVersionsResult) 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["id"]
|
||||
if v != nil {
|
||||
var ID string
|
||||
err = json.Unmarshal(*m["id"], &ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ccvr.ID = &ID
|
||||
}
|
||||
|
||||
v = m["name"]
|
||||
if v != nil {
|
||||
var name string
|
||||
err = json.Unmarshal(*m["name"], &name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ccvr.Name = &name
|
||||
}
|
||||
|
||||
v = m["type"]
|
||||
if v != nil {
|
||||
var typeVar string
|
||||
err = json.Unmarshal(*m["type"], &typeVar)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ccvr.Type = &typeVar
|
||||
}
|
||||
|
||||
v = m["properties"]
|
||||
if v != nil {
|
||||
var properties ClusterVersionDetails
|
||||
err = json.Unmarshal(*m["properties"], &properties)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ccvr.ClusterVersionDetails = &properties
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ClusterHealthPolicy defines a health policy used to evaluate the health of the cluster or of a cluster node.
|
||||
type ClusterHealthPolicy struct {
|
||||
// MaxPercentUnhealthyNodes - The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10.
|
||||
MaxPercentUnhealthyNodes *int32 `json:"maxPercentUnhealthyNodes,omitempty"`
|
||||
// MaxPercentUnhealthyApplications - The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10.
|
||||
MaxPercentUnhealthyApplications *int32 `json:"maxPercentUnhealthyApplications,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterListResult cluster list results
|
||||
type ClusterListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]Cluster `json:"value,omitempty"`
|
||||
// NextLink - The URL to use for getting the next set of results.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterListResultIterator provides access to a complete listing of Cluster values.
|
||||
type ClusterListResultIterator struct {
|
||||
i int
|
||||
page ClusterListResultPage
|
||||
}
|
||||
|
||||
// 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 *ClusterListResultIterator) 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 ClusterListResultIterator) 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 ClusterListResultIterator) Response() ClusterListResult {
|
||||
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 ClusterListResultIterator) Value() Cluster {
|
||||
if !iter.page.NotDone() {
|
||||
return Cluster{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (clr ClusterListResult) IsEmpty() bool {
|
||||
return clr.Value == nil || len(*clr.Value) == 0
|
||||
}
|
||||
|
||||
// clusterListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (clr ClusterListResult) clusterListResultPreparer() (*http.Request, error) {
|
||||
if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(clr.NextLink)))
|
||||
}
|
||||
|
||||
// ClusterListResultPage contains a page of Cluster values.
|
||||
type ClusterListResultPage struct {
|
||||
fn func(ClusterListResult) (ClusterListResult, error)
|
||||
clr ClusterListResult
|
||||
}
|
||||
|
||||
// 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 *ClusterListResultPage) Next() error {
|
||||
next, err := page.fn(page.clr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.clr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page ClusterListResultPage) NotDone() bool {
|
||||
return !page.clr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page ClusterListResultPage) Response() ClusterListResult {
|
||||
return page.clr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page ClusterListResultPage) Values() []Cluster {
|
||||
if page.clr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.clr.Value
|
||||
}
|
||||
|
||||
// ClusterProperties the cluster resource properties
|
||||
type ClusterProperties struct {
|
||||
// AvailableClusterVersions - The available cluster code version which the cluster can upgrade to, note that you must choose upgradeMode to manual to upgrade to
|
||||
AvailableClusterVersions *[]ClusterVersionDetails `json:"availableClusterVersions,omitempty"`
|
||||
// ClusterID - The unique identifier for the cluster resource
|
||||
ClusterID *string `json:"clusterId,omitempty"`
|
||||
// ClusterState - The state for the cluster. Possible values include: 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', 'UpdatingUserCertificate', 'UpdatingInfrastructure', 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', 'Ready'
|
||||
ClusterState ClusterState `json:"clusterState,omitempty"`
|
||||
// ClusterEndpoint - The endpoint for the cluster connecting to servicefabric resource provider
|
||||
ClusterEndpoint *string `json:"clusterEndpoint,omitempty"`
|
||||
// ClusterCodeVersion - The ServiceFabric code version running in your cluster
|
||||
ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"`
|
||||
// Certificate - This primay certificate will be used as cluster node to node security, SSL certificate for cluster management endpoint and default admin client
|
||||
Certificate *CertificateDescription `json:"certificate,omitempty"`
|
||||
// ReliabilityLevel - Cluster reliability level indicates replica set size of system service. Possible values include: 'ReliabilityLevel1Bronze', 'ReliabilityLevel1Silver', 'ReliabilityLevel1Gold', 'ReliabilityLevel1Platinum'
|
||||
ReliabilityLevel ReliabilityLevel `json:"reliabilityLevel,omitempty"`
|
||||
// UpgradeMode - Cluster upgrade mode indicates if fabric upgrade is initiated automatically by the system or not. Possible values include: 'UpgradeMode1Automatic', 'UpgradeMode1Manual'
|
||||
UpgradeMode UpgradeMode `json:"upgradeMode,omitempty"`
|
||||
// ClientCertificateThumbprints - The client thumbprint details ,it is used for client access for cluster operation
|
||||
ClientCertificateThumbprints *[]ClientCertificateThumbprint `json:"clientCertificateThumbprints,omitempty"`
|
||||
// ClientCertificateCommonNames - List of client certificates to whitelist based on common names
|
||||
ClientCertificateCommonNames *[]ClientCertificateCommonName `json:"clientCertificateCommonNames,omitempty"`
|
||||
// FabricSettings - List of custom fabric settings to configure the cluster.
|
||||
FabricSettings *[]SettingsSectionDescription `json:"fabricSettings,omitempty"`
|
||||
// ReverseProxyCertificate - The server certificate used by reverse proxy
|
||||
ReverseProxyCertificate *CertificateDescription `json:"reverseProxyCertificate,omitempty"`
|
||||
// ManagementEndpoint - The http management endpoint of the cluster
|
||||
ManagementEndpoint *string `json:"managementEndpoint,omitempty"`
|
||||
// NodeTypes - The list of nodetypes that make up the cluster
|
||||
NodeTypes *[]NodeTypeDescription `json:"nodeTypes,omitempty"`
|
||||
// AzureActiveDirectory - The settings to enable AAD authentication on the cluster
|
||||
AzureActiveDirectory *AzureActiveDirectory `json:"azureActiveDirectory,omitempty"`
|
||||
// ProvisioningState - The provisioning state of the cluster resource. Possible values include: 'Updating', 'Succeeded', 'Failed', 'Canceled'
|
||||
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
|
||||
// VMImage - The name of VM image VMSS has been configured with. Generic names such as Windows or Linux can be used.
|
||||
VMImage *string `json:"vmImage,omitempty"`
|
||||
// DiagnosticsStorageAccountConfig - The storage diagnostics account configuration details
|
||||
DiagnosticsStorageAccountConfig *DiagnosticsStorageAccountConfig `json:"diagnosticsStorageAccountConfig,omitempty"`
|
||||
// UpgradeDescription - The policy to use when upgrading the cluster.
|
||||
UpgradeDescription *ClusterUpgradePolicy `json:"upgradeDescription,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterPropertiesUpdateParameters the cluster resource properties can be updated
|
||||
type ClusterPropertiesUpdateParameters struct {
|
||||
// ReliabilityLevel - This level is used to set the number of replicas of the system services. Possible values include: 'ReliabilityLevelBronze', 'ReliabilityLevelSilver', 'ReliabilityLevelGold'
|
||||
ReliabilityLevel ReliabilityLevel `json:"reliabilityLevel,omitempty"`
|
||||
// UpgradeMode - Cluster upgrade mode indicates if fabric upgrade is initiated automatically by the system or not. Possible values include: 'Automatic', 'Manual'
|
||||
UpgradeMode UpgradeMode `json:"upgradeMode,omitempty"`
|
||||
// ClusterCodeVersion - The ServiceFabric code version, if set it, please make sure you have set upgradeMode to Manual, otherwise ,it will fail, if you are using PUT new cluster, you can get the version by using ClusterVersions_List, if you are updating existing cluster, you can get the availableClusterVersions from Clusters_Get
|
||||
ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"`
|
||||
// Certificate - This primay certificate will be used as cluster node to node security, SSL certificate for cluster management endpoint and default admin client, the certificate should exist in the virtual machine scale sets or Azure key vault, before you add it. It will override original value
|
||||
Certificate *CertificateDescription `json:"certificate,omitempty"`
|
||||
// ClientCertificateThumbprints - The client thumbprint details, it is used for client access for cluster operation, it will override existing collection
|
||||
ClientCertificateThumbprints *[]ClientCertificateThumbprint `json:"clientCertificateThumbprints,omitempty"`
|
||||
// ClientCertificateCommonNames - List of client certificates to whitelist based on common names.
|
||||
ClientCertificateCommonNames *[]ClientCertificateCommonName `json:"clientCertificateCommonNames,omitempty"`
|
||||
// FabricSettings - List of custom fabric settings to configure the cluster, Note, it will overwrite existing collection
|
||||
FabricSettings *[]SettingsSectionDescription `json:"fabricSettings,omitempty"`
|
||||
// ReverseProxyCertificate - Certificate for the reverse proxy
|
||||
ReverseProxyCertificate *CertificateDescription `json:"reverseProxyCertificate,omitempty"`
|
||||
// NodeTypes - The list of nodetypes that make up the cluster, it will override
|
||||
NodeTypes *[]NodeTypeDescription `json:"nodeTypes,omitempty"`
|
||||
// UpgradeDescription - The policy to use when upgrading the cluster.
|
||||
UpgradeDescription *ClusterUpgradePolicy `json:"upgradeDescription,omitempty"`
|
||||
}
|
||||
|
||||
// ClustersCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type ClustersCreateFuture 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 ClustersCreateFuture) Result(client ClustersClient) (c Cluster, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return c, autorest.NewError("servicefabric.ClustersCreateFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
c, err = client.CreateResponder(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
|
||||
}
|
||||
c, err = client.CreateResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type ClustersUpdateFuture 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 ClustersUpdateFuture) Result(client ClustersClient) (c Cluster, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !done {
|
||||
return c, autorest.NewError("servicefabric.ClustersUpdateFuture", "Result", "asynchronous operation has not completed")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
c, err = client.UpdateResponder(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
|
||||
}
|
||||
c, err = client.UpdateResponder(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// ClusterUpdateParameters cluster update request
|
||||
type ClusterUpdateParameters struct {
|
||||
*ClusterPropertiesUpdateParameters `json:"properties,omitempty"`
|
||||
// Tags - Cluster update parameters
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaler for ClusterUpdateParameters struct.
|
||||
func (cup *ClusterUpdateParameters) 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 {
|
||||
var properties ClusterPropertiesUpdateParameters
|
||||
err = json.Unmarshal(*m["properties"], &properties)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cup.ClusterPropertiesUpdateParameters = &properties
|
||||
}
|
||||
|
||||
v = m["tags"]
|
||||
if v != nil {
|
||||
var tags map[string]*string
|
||||
err = json.Unmarshal(*m["tags"], &tags)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cup.Tags = &tags
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ClusterUpgradeDeltaHealthPolicy delta health policy for the cluster
|
||||
type ClusterUpgradeDeltaHealthPolicy struct {
|
||||
// MaxPercentDeltaUnhealthyNodes - Additional unhealthy nodes percentage
|
||||
MaxPercentDeltaUnhealthyNodes *int32 `json:"maxPercentDeltaUnhealthyNodes,omitempty"`
|
||||
// MaxPercentUpgradeDomainDeltaUnhealthyNodes - Additional unhealthy nodes percentage per upgrade domain
|
||||
MaxPercentUpgradeDomainDeltaUnhealthyNodes *int32 `json:"maxPercentUpgradeDomainDeltaUnhealthyNodes,omitempty"`
|
||||
// MaxPercentDeltaUnhealthyApplications - Additional unhealthy applications percentage
|
||||
MaxPercentDeltaUnhealthyApplications *int32 `json:"maxPercentDeltaUnhealthyApplications,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterUpgradePolicy cluster upgrade policy
|
||||
type ClusterUpgradePolicy struct {
|
||||
// OverrideUserUpgradePolicy - Use the user defined upgrade policy or not
|
||||
OverrideUserUpgradePolicy *bool `json:"overrideUserUpgradePolicy,omitempty"`
|
||||
// ForceRestart - Force node to restart or not
|
||||
ForceRestart *bool `json:"forceRestart,omitempty"`
|
||||
// UpgradeReplicaSetCheckTimeout - Timeout for replica set upgrade to complete,it represents .Net TimeSpan
|
||||
UpgradeReplicaSetCheckTimeout *string `json:"upgradeReplicaSetCheckTimeout,omitempty"`
|
||||
// HealthCheckWaitDuration - The length of time to wait after completing an upgrade domain before performing health checks, it represents .Net TimeSpan
|
||||
HealthCheckWaitDuration *string `json:"healthCheckWaitDuration,omitempty"`
|
||||
// HealthCheckStableDuration - The length of time that health checks must pass continuously,it represents .Net TimeSpan
|
||||
HealthCheckStableDuration *string `json:"healthCheckStableDuration,omitempty"`
|
||||
// HealthCheckRetryTimeout - The length of time that health checks can fail continuously,it represents .Net TimeSpan
|
||||
HealthCheckRetryTimeout *string `json:"healthCheckRetryTimeout,omitempty"`
|
||||
// UpgradeTimeout - The upgrade timeout,it represents .Net TimeSpan
|
||||
UpgradeTimeout *string `json:"upgradeTimeout,omitempty"`
|
||||
// UpgradeDomainTimeout - The timeout for any upgrade domain,it represents .Net TimeSpan
|
||||
UpgradeDomainTimeout *string `json:"upgradeDomainTimeout,omitempty"`
|
||||
// HealthPolicy - Cluster health Policy
|
||||
HealthPolicy *ClusterHealthPolicy `json:"healthPolicy,omitempty"`
|
||||
// DeltaHealthPolicy - Delta health policy
|
||||
DeltaHealthPolicy *ClusterUpgradeDeltaHealthPolicy `json:"deltaHealthPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterVersionDetails the detail of the ServiceFabric runtime version result
|
||||
type ClusterVersionDetails struct {
|
||||
// CodeVersion - The ServiceFabric runtime version of the cluster
|
||||
CodeVersion *string `json:"codeVersion,omitempty"`
|
||||
// SupportExpiryUtc - The date of expiry of support of the version
|
||||
SupportExpiryUtc *string `json:"supportExpiryUtc,omitempty"`
|
||||
// Environment - Cluster operating system. Possible values include: 'Windows', 'Linux'
|
||||
Environment Environment `json:"environment,omitempty"`
|
||||
}
|
||||
|
||||
// DiagnosticsStorageAccountConfig diagnostics storage account config
|
||||
type DiagnosticsStorageAccountConfig struct {
|
||||
// StorageAccountName - Diagnostics storage account name
|
||||
StorageAccountName *string `json:"storageAccountName,omitempty"`
|
||||
// ProtectedAccountKeyName - Protected Diagnostics storage key name
|
||||
ProtectedAccountKeyName *string `json:"protectedAccountKeyName,omitempty"`
|
||||
// BlobEndpoint - Diagnostics storage account blob endpoint
|
||||
BlobEndpoint *string `json:"blobEndpoint,omitempty"`
|
||||
// QueueEndpoint - Diagnostics storage account queue endpoint
|
||||
QueueEndpoint *string `json:"queueEndpoint,omitempty"`
|
||||
// TableEndpoint - Diagnostics storage account table endpoint
|
||||
TableEndpoint *string `json:"tableEndpoint,omitempty"`
|
||||
}
|
||||
|
||||
// EndpointRangeDescription port range details
|
||||
type EndpointRangeDescription struct {
|
||||
// StartPort - Starting port of a range of ports
|
||||
StartPort *int32 `json:"startPort,omitempty"`
|
||||
// EndPort - End port of a range of ports
|
||||
EndPort *int32 `json:"endPort,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorModel the structure of the error
|
||||
type ErrorModel struct {
|
||||
// Error - The error detail
|
||||
Error *ErrorModelError `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorModelError the error detail
|
||||
type ErrorModelError struct {
|
||||
// Code - The error code
|
||||
Code *string `json:"code,omitempty"`
|
||||
// Message - The error message
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// NodeTypeDescription describes a node type in the cluster, each node type represents sub set of nodes in the cluster
|
||||
type NodeTypeDescription struct {
|
||||
// Name - Name of the node type
|
||||
Name *string `json:"name,omitempty"`
|
||||
// PlacementProperties - The placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run
|
||||
PlacementProperties *map[string]*string `json:"placementProperties,omitempty"`
|
||||
// Capacities - The capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much of a resource a node has
|
||||
Capacities *map[string]*string `json:"capacities,omitempty"`
|
||||
// ClientConnectionEndpointPort - The TCP cluster management endpoint port
|
||||
ClientConnectionEndpointPort *int32 `json:"clientConnectionEndpointPort,omitempty"`
|
||||
// HTTPGatewayEndpointPort - The HTTP cluster management endpoint port
|
||||
HTTPGatewayEndpointPort *int32 `json:"httpGatewayEndpointPort,omitempty"`
|
||||
// DurabilityLevel - Nodetype durability Level. Possible values include: 'Bronze', 'Silver', 'Gold'
|
||||
DurabilityLevel DurabilityLevel `json:"durabilityLevel,omitempty"`
|
||||
// ApplicationPorts - Ports used by applications
|
||||
ApplicationPorts *EndpointRangeDescription `json:"applicationPorts,omitempty"`
|
||||
// EphemeralPorts - System assgined application ports
|
||||
EphemeralPorts *EndpointRangeDescription `json:"ephemeralPorts,omitempty"`
|
||||
// IsPrimary - Mark this as the primary node type
|
||||
IsPrimary *bool `json:"isPrimary,omitempty"`
|
||||
// VMInstanceCount - The number of node instances in the node type
|
||||
VMInstanceCount *int32 `json:"vmInstanceCount,omitempty"`
|
||||
// ReverseProxyEndpointPort - Endpoint used by reverse proxy
|
||||
ReverseProxyEndpointPort *int32 `json:"reverseProxyEndpointPort,omitempty"`
|
||||
}
|
||||
|
||||
// OperationListResult result of the request to list ServiceFabric operations. It contains a list of operations and a
|
||||
// URL link to get the next set of results.
|
||||
type OperationListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
// Value - List of ServiceFabric operations supported by the Microsoft.ServiceFabric resource provider.
|
||||
Value *[]OperationResult `json:"value,omitempty"`
|
||||
// NextLink - URL to get the next set of operation list results if there are any.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// OperationListResultIterator provides access to a complete listing of OperationResult values.
|
||||
type OperationListResultIterator struct {
|
||||
i int
|
||||
page OperationListResultPage
|
||||
}
|
||||
|
||||
// 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 *OperationListResultIterator) 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 OperationListResultIterator) 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 OperationListResultIterator) Response() OperationListResult {
|
||||
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 OperationListResultIterator) Value() OperationResult {
|
||||
if !iter.page.NotDone() {
|
||||
return OperationResult{}
|
||||
}
|
||||
return iter.page.Values()[iter.i]
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the ListResult contains no values.
|
||||
func (olr OperationListResult) IsEmpty() bool {
|
||||
return olr.Value == nil || len(*olr.Value) == 0
|
||||
}
|
||||
|
||||
// operationListResultPreparer prepares a request to retrieve the next set of results.
|
||||
// It returns nil if no more results exist.
|
||||
func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) {
|
||||
if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(olr.NextLink)))
|
||||
}
|
||||
|
||||
// OperationListResultPage contains a page of OperationResult values.
|
||||
type OperationListResultPage struct {
|
||||
fn func(OperationListResult) (OperationListResult, error)
|
||||
olr OperationListResult
|
||||
}
|
||||
|
||||
// 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 *OperationListResultPage) Next() error {
|
||||
next, err := page.fn(page.olr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
page.olr = next
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotDone returns true if the page enumeration should be started or is not yet complete.
|
||||
func (page OperationListResultPage) NotDone() bool {
|
||||
return !page.olr.IsEmpty()
|
||||
}
|
||||
|
||||
// Response returns the raw server response from the last page request.
|
||||
func (page OperationListResultPage) Response() OperationListResult {
|
||||
return page.olr
|
||||
}
|
||||
|
||||
// Values returns the slice of values for the current page or nil if there are no values.
|
||||
func (page OperationListResultPage) Values() []OperationResult {
|
||||
if page.olr.IsEmpty() {
|
||||
return nil
|
||||
}
|
||||
return *page.olr.Value
|
||||
}
|
||||
|
||||
// OperationResult available operation list result
|
||||
type OperationResult struct {
|
||||
// Name - Result name
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Display - Dispaly of the result
|
||||
Display *AvailableOperationDisplay `json:"display,omitempty"`
|
||||
// Origin - Origin result
|
||||
Origin *string `json:"origin,omitempty"`
|
||||
// NextLink - The URL to use for getting the next set of results.
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// Resource the resource model definition.
|
||||
type Resource struct {
|
||||
// ID - Resource ID.
|
||||
ID *string `json:"id,omitempty"`
|
||||
// Name - Resource name.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Type - Resource type.
|
||||
Type *string `json:"type,omitempty"`
|
||||
// Location - Resource location.
|
||||
Location *string `json:"location,omitempty"`
|
||||
// Tags - Resource tags.
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// SettingsParameterDescription serviceFabric settings under sections
|
||||
type SettingsParameterDescription struct {
|
||||
// Name - The name of settings property
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Value - The value of the property
|
||||
Value *string `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// SettingsSectionDescription serviceFabric section settings
|
||||
type SettingsSectionDescription struct {
|
||||
// Name - The name of settings section
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Parameters - Collection of settings in the section, each setting is a tuple consisting of setting name and value
|
||||
Parameters *[]SettingsParameterDescription `json:"parameters,omitempty"`
|
||||
}
|
||||
Generated
Vendored
+126
@@ -0,0 +1,126 @@
|
||||
package servicefabric
|
||||
|
||||
// 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 client for the Operations methods of the Servicefabric service.
|
||||
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 ServiceFabric REST API operations.
|
||||
func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.olr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.olr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.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 = "2016-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPath("/providers/Microsoft.ServiceFabric/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
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client OperationsClient) listNextResults(lastResults OperationListResult) (result OperationListResult, err error) {
|
||||
req, err := lastResults.operationListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "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, "servicefabric.OperationsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx)
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
package servicefabric
|
||||
|
||||
// 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
+390
@@ -0,0 +1,390 @@
|
||||
package servicefabric
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ApplicationClient is the azure Service Fabric Resource Provider API Client
|
||||
type ApplicationClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewApplicationClient creates an instance of the ApplicationClient client.
|
||||
func NewApplicationClient() ApplicationClient {
|
||||
return NewApplicationClientWithBaseURI(DefaultBaseURI)
|
||||
}
|
||||
|
||||
// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client.
|
||||
func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient {
|
||||
return ApplicationClient{NewWithBaseURI(baseURI)}
|
||||
}
|
||||
|
||||
// Delete deletes an application resource with the specified name.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource.
|
||||
func (client ApplicationClient) Delete(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string) (result ApplicationDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client ApplicationClient) DeletePreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}", 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 ApplicationClient) DeleteSender(req *http.Request) (future ApplicationDeleteFuture, 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 ApplicationClient) 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 returns an application resource with the specified name.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource.
|
||||
func (client ApplicationClient) Get(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string) (result ApplicationResource, err error) {
|
||||
req, err := client.GetPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ApplicationClient) GetPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}", 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 ApplicationClient) 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 ApplicationClient) GetResponder(resp *http.Response) (result ApplicationResource, 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 returns all application resources in the specified cluster.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource
|
||||
func (client ApplicationClient) List(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string) (result ApplicationResourceList, err error) {
|
||||
req, err := client.ListPreparer(ctx, subscriptionID, resourceGroupName, clusterName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ApplicationClient) ListPreparer(ctx context.Context, subscriptionID string, 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", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications", 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 ApplicationClient) 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 ApplicationClient) ListResponder(resp *http.Response) (result ApplicationResourceList, 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 updates an application resource with the specified name.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource. parameters
|
||||
// is the application resource for patch operations.
|
||||
func (client ApplicationClient) Patch(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResourceUpdate) (result ApplicationPatchFuture, err error) {
|
||||
req, err := client.PatchPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Patch", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PatchSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Patch", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PatchPreparer prepares the Patch request.
|
||||
func (client ApplicationClient) PatchPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResourceUpdate) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
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 ApplicationClient) PatchSender(req *http.Request) (future ApplicationPatchFuture, 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
|
||||
}
|
||||
|
||||
// PatchResponder handles the response to the Patch request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ApplicationClient) PatchResponder(resp *http.Response) (result ApplicationResourceUpdate, 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
|
||||
}
|
||||
|
||||
// Put creates or updates an application resource with the specified name.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource. parameters
|
||||
// is the application resource.
|
||||
func (client ApplicationClient) Put(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource) (result ApplicationPutFuture, err error) {
|
||||
req, err := client.PutPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Put", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PutSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationClient", "Put", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PutPreparer prepares the Put request.
|
||||
func (client ApplicationClient) PutPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// PutSender sends the Put request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ApplicationClient) PutSender(req *http.Request) (future ApplicationPutFuture, 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
|
||||
}
|
||||
|
||||
// PutResponder handles the response to the Put request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ApplicationClient) PutResponder(resp *http.Response) (result ApplicationResource, 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
+317
@@ -0,0 +1,317 @@
|
||||
package servicefabric
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ApplicationTypeClient is the azure Service Fabric Resource Provider API Client
|
||||
type ApplicationTypeClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewApplicationTypeClient creates an instance of the ApplicationTypeClient client.
|
||||
func NewApplicationTypeClient() ApplicationTypeClient {
|
||||
return NewApplicationTypeClientWithBaseURI(DefaultBaseURI)
|
||||
}
|
||||
|
||||
// NewApplicationTypeClientWithBaseURI creates an instance of the ApplicationTypeClient client.
|
||||
func NewApplicationTypeClientWithBaseURI(baseURI string) ApplicationTypeClient {
|
||||
return ApplicationTypeClient{NewWithBaseURI(baseURI)}
|
||||
}
|
||||
|
||||
// Delete deletes the application type name resource.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationTypeName is the name of the application type name
|
||||
// resource
|
||||
func (client ApplicationTypeClient) Delete(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string) (result ApplicationTypeDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationTypeName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client ApplicationTypeClient) DeletePreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationTypeName": autorest.Encode("path", applicationTypeName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", 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 ApplicationTypeClient) DeleteSender(req *http.Request) (future ApplicationTypeDeleteFuture, 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 ApplicationTypeClient) 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 returns an application type name resource.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationTypeName is the name of the application type name
|
||||
// resource
|
||||
func (client ApplicationTypeClient) Get(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string) (result ApplicationTypeResource, err error) {
|
||||
req, err := client.GetPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationTypeName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ApplicationTypeClient) GetPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationTypeName": autorest.Encode("path", applicationTypeName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", 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 ApplicationTypeClient) 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 ApplicationTypeClient) GetResponder(resp *http.Response) (result ApplicationTypeResource, 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 returns all application type names in the specified cluster.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource
|
||||
func (client ApplicationTypeClient) List(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string) (result ApplicationTypeResourceList, err error) {
|
||||
req, err := client.ListPreparer(ctx, subscriptionID, resourceGroupName, clusterName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ApplicationTypeClient) ListPreparer(ctx context.Context, subscriptionID string, 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", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applicationTypes", 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 ApplicationTypeClient) 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 ApplicationTypeClient) ListResponder(resp *http.Response) (result ApplicationTypeResourceList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Put creates the application type name resource.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationTypeName is the name of the application type name
|
||||
// resource parameters is the application type name resource.
|
||||
func (client ApplicationTypeClient) Put(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeResource) (result ApplicationTypeResource, err error) {
|
||||
req, err := client.PutPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationTypeName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "Put", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.PutSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "Put", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PutResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ApplicationTypeClient", "Put", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PutPreparer prepares the Put request.
|
||||
func (client ApplicationTypeClient) PutPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeResource) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationTypeName": autorest.Encode("path", applicationTypeName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// PutSender sends the Put request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ApplicationTypeClient) PutSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// PutResponder handles the response to the Put request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ApplicationTypeClient) PutResponder(resp *http.Response) (result ApplicationTypeResource, 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
+49
@@ -0,0 +1,49 @@
|
||||
// Package servicefabric implements the Azure ARM Servicefabric service API version 2017-07-01-preview.
|
||||
//
|
||||
// Azure Service Fabric Resource Provider API Client
|
||||
package servicefabric
|
||||
|
||||
// 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 Servicefabric
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Servicefabric.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New() BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client.
|
||||
func NewWithBaseURI(baseURI string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+498
@@ -0,0 +1,498 @@
|
||||
package servicefabric
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ClustersClient is the azure Service Fabric Resource Provider API Client
|
||||
type ClustersClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewClustersClient creates an instance of the ClustersClient client.
|
||||
func NewClustersClient() ClustersClient {
|
||||
return NewClustersClientWithBaseURI(DefaultBaseURI)
|
||||
}
|
||||
|
||||
// NewClustersClientWithBaseURI creates an instance of the ClustersClient client.
|
||||
func NewClustersClientWithBaseURI(baseURI string) ClustersClient {
|
||||
return ClustersClient{NewWithBaseURI(baseURI)}
|
||||
}
|
||||
|
||||
// Create create cluster resource
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. clusterName is the name of the cluster resource subscriptionID
|
||||
// is the customer subscription identifier parameters is the cluster resource.
|
||||
func (client ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters Cluster) (result ClustersCreateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.ClusterProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.Certificate", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.Certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "parameters.ClusterProperties.ReverseProxyCertificate", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.ReverseProxyCertificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "parameters.ClusterProperties.ManagementEndpoint", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.NodeTypes", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.StorageAccountName", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.ProtectedAccountKeyName", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.BlobEndpoint", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.QueueEndpoint", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.DiagnosticsStorageAccountConfig.TableEndpoint", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeReplicaSetCheckTimeout", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckWaitDuration", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckStableDuration", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthCheckRetryTimeout", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeTimeout", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.UpgradeDomainTimeout", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil},
|
||||
{Target: "parameters.ClusterProperties.UpgradeDescription.DeltaHealthPolicy.MaxPercentDeltaUnhealthyApplications", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicefabric.ClustersClient", "Create")
|
||||
}
|
||||
|
||||
req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, subscriptionID, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreatePreparer prepares the Create request.
|
||||
func (client ClustersClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters Cluster) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CreateSender sends the Create request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ClustersClient) CreateSender(req *http.Request) (future ClustersCreateFuture, 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
|
||||
}
|
||||
|
||||
// CreateResponder handles the response to the Create request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ClustersClient) CreateResponder(resp *http.Response) (result Cluster, 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
|
||||
}
|
||||
|
||||
// Delete delete cluster resource
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. clusterName is the name of the cluster resource subscriptionID
|
||||
// is the customer subscription identifier
|
||||
func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (result autorest.Response, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, subscriptionID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{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 ClustersClient) 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 ClustersClient) 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 get cluster resource
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. clusterName is the name of the cluster resource subscriptionID
|
||||
// is the customer subscription identifier
|
||||
func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (result Cluster, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, subscriptionID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{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 ClustersClient) 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 ClustersClient) GetResponder(resp *http.Response) (result Cluster, 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 list cluster resource
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier
|
||||
func (client ClustersClient) List(ctx context.Context, subscriptionID string) (result ClusterListResult, err error) {
|
||||
req, err := client.ListPreparer(ctx, subscriptionID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ClustersClient) ListPreparer(ctx context.Context, subscriptionID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters", 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 ClustersClient) 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 ClustersClient) ListResponder(resp *http.Response) (result ClusterListResult, 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 list cluster resource by resource group
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. subscriptionID is the customer subscription identifier
|
||||
func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, subscriptionID string) (result ClusterListResult, err error) {
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, subscriptionID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client ClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, subscriptionID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters", 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 ClustersClient) 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 ClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ClusterListResult, 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 update cluster configuration
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. clusterName is the name of the cluster resource subscriptionID
|
||||
// is the customer subscription identifier parameters is the parameters which contains the property value and property
|
||||
// name which used to update the cluster configuration.
|
||||
func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters ClusterUpdateParameters) (result ClustersUpdateFuture, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, subscriptionID, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters ClusterUpdateParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{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 ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, 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
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ClustersClient) UpdateResponder(resp *http.Response) (result Cluster, 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
+309
@@ -0,0 +1,309 @@
|
||||
package servicefabric
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ClusterVersionsClient is the azure Service Fabric Resource Provider API Client
|
||||
type ClusterVersionsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewClusterVersionsClient creates an instance of the ClusterVersionsClient client.
|
||||
func NewClusterVersionsClient() ClusterVersionsClient {
|
||||
return NewClusterVersionsClientWithBaseURI(DefaultBaseURI)
|
||||
}
|
||||
|
||||
// NewClusterVersionsClientWithBaseURI creates an instance of the ClusterVersionsClient client.
|
||||
func NewClusterVersionsClientWithBaseURI(baseURI string) ClusterVersionsClient {
|
||||
return ClusterVersionsClient{NewWithBaseURI(baseURI)}
|
||||
}
|
||||
|
||||
// Get get cluster code versions by location
|
||||
//
|
||||
// location is the location for the cluster code versions, this is different from cluster location subscriptionID is
|
||||
// the customer subscription identifier clusterVersion is the cluster code version
|
||||
func (client ClusterVersionsClient) Get(ctx context.Context, location string, subscriptionID string, clusterVersion string) (result ClusterCodeVersionsListResult, err error) {
|
||||
req, err := client.GetPreparer(ctx, location, subscriptionID, clusterVersion)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ClusterVersionsClient) GetPreparer(ctx context.Context, location string, subscriptionID string, clusterVersion string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterVersion": autorest.Encode("path", clusterVersion),
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}", 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 ClusterVersionsClient) 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 ClusterVersionsClient) GetResponder(resp *http.Response) (result ClusterCodeVersionsListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// GetByEnvironment get cluster code versions by environment
|
||||
//
|
||||
// location is the location for the cluster code versions, this is different from cluster location environment is
|
||||
// cluster operating system, the default means all subscriptionID is the customer subscription identifier
|
||||
// clusterVersion is the cluster code version
|
||||
func (client ClusterVersionsClient) GetByEnvironment(ctx context.Context, location string, environment string, subscriptionID string, clusterVersion string) (result ClusterCodeVersionsListResult, err error) {
|
||||
req, err := client.GetByEnvironmentPreparer(ctx, location, environment, subscriptionID, clusterVersion)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "GetByEnvironment", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetByEnvironmentSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "GetByEnvironment", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetByEnvironmentResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "GetByEnvironment", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetByEnvironmentPreparer prepares the GetByEnvironment request.
|
||||
func (client ClusterVersionsClient) GetByEnvironmentPreparer(ctx context.Context, location string, environment string, subscriptionID string, clusterVersion string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"clusterVersion": autorest.Encode("path", clusterVersion),
|
||||
"environment": autorest.Encode("path", environment),
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetByEnvironmentSender sends the GetByEnvironment request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ClusterVersionsClient) GetByEnvironmentSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetByEnvironmentResponder handles the response to the GetByEnvironment request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ClusterVersionsClient) GetByEnvironmentResponder(resp *http.Response) (result ClusterCodeVersionsListResult, 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 list cluster code versions by location
|
||||
//
|
||||
// location is the location for the cluster code versions, this is different from cluster location subscriptionID is
|
||||
// the customer subscription identifier
|
||||
func (client ClusterVersionsClient) List(ctx context.Context, location string, subscriptionID string) (result ClusterCodeVersionsListResult, err error) {
|
||||
req, err := client.ListPreparer(ctx, location, subscriptionID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ClusterVersionsClient) ListPreparer(ctx context.Context, location string, subscriptionID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions", 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 ClusterVersionsClient) 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 ClusterVersionsClient) ListResponder(resp *http.Response) (result ClusterCodeVersionsListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByEnvironment list cluster code versions by environment
|
||||
//
|
||||
// location is the location for the cluster code versions, this is different from cluster location environment is
|
||||
// cluster operating system, the default means all subscriptionID is the customer subscription identifier
|
||||
func (client ClusterVersionsClient) ListByEnvironment(ctx context.Context, location string, environment string, subscriptionID string) (result ClusterCodeVersionsListResult, err error) {
|
||||
req, err := client.ListByEnvironmentPreparer(ctx, location, environment, subscriptionID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByEnvironmentSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListByEnvironmentResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByEnvironmentPreparer prepares the ListByEnvironment request.
|
||||
func (client ClusterVersionsClient) ListByEnvironmentPreparer(ctx context.Context, location string, environment string, subscriptionID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"environment": autorest.Encode("path", environment),
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByEnvironmentSender sends the ListByEnvironment request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ClusterVersionsClient) ListByEnvironmentSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByEnvironmentResponder handles the response to the ListByEnvironment request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ClusterVersionsClient) ListByEnvironmentResponder(resp *http.Response) (result ClusterCodeVersionsListResult, 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
+3358
File diff suppressed because it is too large
Load Diff
Generated
Vendored
+126
@@ -0,0 +1,126 @@
|
||||
package servicefabric
|
||||
|
||||
// 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 azure Service Fabric Resource Provider API Client
|
||||
type OperationsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewOperationsClient creates an instance of the OperationsClient client.
|
||||
func NewOperationsClient() OperationsClient {
|
||||
return NewOperationsClientWithBaseURI(DefaultBaseURI)
|
||||
}
|
||||
|
||||
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
|
||||
func NewOperationsClientWithBaseURI(baseURI string) OperationsClient {
|
||||
return OperationsClient{NewWithBaseURI(baseURI)}
|
||||
}
|
||||
|
||||
// List sends the list request.
|
||||
func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.olr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.olr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.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-07-01-preview"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPath("/providers/Microsoft.ServiceFabric/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
|
||||
}
|
||||
|
||||
// listNextResults retrieves the next set of results, if any.
|
||||
func (client OperationsClient) listNextResults(lastResults OperationListResult) (result OperationListResult, err error) {
|
||||
req, err := lastResults.operationListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "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, "servicefabric.OperationsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) {
|
||||
result.page, err = client.List(ctx)
|
||||
return
|
||||
}
|
||||
Generated
Vendored
+399
@@ -0,0 +1,399 @@
|
||||
package servicefabric
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ServiceClient is the azure Service Fabric Resource Provider API Client
|
||||
type ServiceClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewServiceClient creates an instance of the ServiceClient client.
|
||||
func NewServiceClient() ServiceClient {
|
||||
return NewServiceClientWithBaseURI(DefaultBaseURI)
|
||||
}
|
||||
|
||||
// NewServiceClientWithBaseURI creates an instance of the ServiceClient client.
|
||||
func NewServiceClientWithBaseURI(baseURI string) ServiceClient {
|
||||
return ServiceClient{NewWithBaseURI(baseURI)}
|
||||
}
|
||||
|
||||
// Delete deletes a service resource with the specified name.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource. serviceName
|
||||
// is the name of the service resource in the format of {applicationName}~{serviceName}.
|
||||
func (client ServiceClient) Delete(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, serviceName string) (result ServiceDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName, serviceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client ServiceClient) DeletePreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, serviceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"serviceName": autorest.Encode("path", serviceName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", 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 ServiceClient) DeleteSender(req *http.Request) (future ServiceDeleteFuture, 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 ServiceClient) 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 returns a service resource with the specified name.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource. serviceName
|
||||
// is the name of the service resource in the format of {applicationName}~{serviceName}.
|
||||
func (client ServiceClient) Get(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, serviceName string) (result ServiceResource, err error) {
|
||||
req, err := client.GetPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName, serviceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ServiceClient) GetPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, serviceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"serviceName": autorest.Encode("path", serviceName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", 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 ServiceClient) 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 ServiceClient) GetResponder(resp *http.Response) (result ServiceResource, 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 returns all service resources in the specified application.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource.
|
||||
func (client ServiceClient) List(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string) (result ServiceResourceList, err error) {
|
||||
req, err := client.ListPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ServiceClient) ListPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services", 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 ServiceClient) 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 ServiceClient) ListResponder(resp *http.Response) (result ServiceResourceList, 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 updates a service resource with the specified name.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource. serviceName
|
||||
// is the name of the service resource in the format of {applicationName}~{serviceName}. parameters is the service
|
||||
// resource for patch operations.
|
||||
func (client ServiceClient) Patch(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResourceUpdate) (result ServicePatchFuture, err error) {
|
||||
req, err := client.PatchPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName, serviceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Patch", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PatchSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Patch", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PatchPreparer prepares the Patch request.
|
||||
func (client ServiceClient) PatchPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResourceUpdate) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"serviceName": autorest.Encode("path", serviceName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
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 ServiceClient) PatchSender(req *http.Request) (future ServicePatchFuture, 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
|
||||
}
|
||||
|
||||
// PatchResponder handles the response to the Patch request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ServiceClient) PatchResponder(resp *http.Response) (result ServiceResourceUpdate, 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
|
||||
}
|
||||
|
||||
// Put creates or updates a service resource with the specified name.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationName is the name of the application resource. serviceName
|
||||
// is the name of the service resource in the format of {applicationName}~{serviceName}. parameters is the service
|
||||
// resource.
|
||||
func (client ServiceClient) Put(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource) (result ServicePutFuture, err error) {
|
||||
req, err := client.PutPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationName, serviceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Put", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PutSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.ServiceClient", "Put", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PutPreparer prepares the Put request.
|
||||
func (client ServiceClient) PutPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationName": autorest.Encode("path", applicationName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"serviceName": autorest.Encode("path", serviceName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// PutSender sends the Put request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ServiceClient) PutSender(req *http.Request) (future ServicePutFuture, 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
|
||||
}
|
||||
|
||||
// PutResponder handles the response to the Put request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ServiceClient) PutResponder(resp *http.Response) (result ServiceResource, 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 servicefabric
|
||||
|
||||
// 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
+332
@@ -0,0 +1,332 @@
|
||||
package servicefabric
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// VersionClient is the azure Service Fabric Resource Provider API Client
|
||||
type VersionClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVersionClient creates an instance of the VersionClient client.
|
||||
func NewVersionClient() VersionClient {
|
||||
return NewVersionClientWithBaseURI(DefaultBaseURI)
|
||||
}
|
||||
|
||||
// NewVersionClientWithBaseURI creates an instance of the VersionClient client.
|
||||
func NewVersionClientWithBaseURI(baseURI string) VersionClient {
|
||||
return VersionClient{NewWithBaseURI(baseURI)}
|
||||
}
|
||||
|
||||
// Delete unprovisions an application type version resource.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationTypeName is the name of the application type name
|
||||
// resource version is the application type version.
|
||||
func (client VersionClient) Delete(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string, version string) (result VersionDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationTypeName, version)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client VersionClient) DeletePreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string, version string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationTypeName": autorest.Encode("path", applicationTypeName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
"version": autorest.Encode("path", version),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", 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 VersionClient) DeleteSender(req *http.Request) (future VersionDeleteFuture, 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 VersionClient) 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 returns an application type version resource.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationTypeName is the name of the application type name
|
||||
// resource version is the application type version.
|
||||
func (client VersionClient) Get(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string, version string) (result VersionResource, err error) {
|
||||
req, err := client.GetPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationTypeName, version)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client VersionClient) GetPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string, version string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationTypeName": autorest.Encode("path", applicationTypeName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
"version": autorest.Encode("path", version),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", 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 VersionClient) 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 VersionClient) GetResponder(resp *http.Response) (result VersionResource, 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 returns all versions for the specified application type.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationTypeName is the name of the application type name
|
||||
// resource
|
||||
func (client VersionClient) List(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string) (result VersionResourceList, err error) {
|
||||
req, err := client.ListPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationTypeName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client VersionClient) ListPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationTypeName": autorest.Encode("path", applicationTypeName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions", 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 VersionClient) 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 VersionClient) ListResponder(resp *http.Response) (result VersionResourceList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Put provisions an application type version resource.
|
||||
//
|
||||
// subscriptionID is the customer subscription identifier resourceGroupName is the name of the resource group.
|
||||
// clusterName is the name of the cluster resource applicationTypeName is the name of the application type name
|
||||
// resource version is the application type version. parameters is the application type version resource.
|
||||
func (client VersionClient) Put(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters VersionResource) (result VersionPutFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.VersionProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.VersionProperties.AppPackageURL", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicefabric.VersionClient", "Put")
|
||||
}
|
||||
|
||||
req, err := client.PutPreparer(ctx, subscriptionID, resourceGroupName, clusterName, applicationTypeName, version, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "Put", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PutSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicefabric.VersionClient", "Put", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PutPreparer prepares the Put request.
|
||||
func (client VersionClient) PutPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters VersionResource) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applicationTypeName": autorest.Encode("path", applicationTypeName),
|
||||
"clusterName": autorest.Encode("path", clusterName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", subscriptionID),
|
||||
"version": autorest.Encode("path", version),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-07-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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// PutSender sends the Put request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VersionClient) PutSender(req *http.Request) (future VersionPutFuture, 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
|
||||
}
|
||||
|
||||
// PutResponder handles the response to the Put request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VersionClient) PutResponder(resp *http.Response) (result VersionResource, 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
|
||||
}
|
||||
Reference in New Issue
Block a user