From c495150e9ab4bb1828fad1f28f142ce106ee186f Mon Sep 17 00:00:00 2001 From: lstolyarov Date: Sun, 11 Jun 2017 14:32:27 +0100 Subject: [PATCH] Adding azure service fabric resource --- azurerm/config.go | 9 + azurerm/provider.go | 2 + azurerm/resource_arm_service_fabric.go | 359 +++++++++++ .../arm/servicefabric/client.go | 53 ++ .../arm/servicefabric/clusters.go | 572 ++++++++++++++++++ .../arm/servicefabric/clusterversions.go | 134 ++++ .../arm/servicefabric/models.go | 439 ++++++++++++++ .../arm/servicefabric/operations.go | 123 ++++ .../arm/servicefabric/version.go | 29 + 9 files changed, 1720 insertions(+) create mode 100644 azurerm/resource_arm_service_fabric.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/client.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/clusters.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/clusterversions.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/models.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/operations.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/version.go diff --git a/azurerm/config.go b/azurerm/config.go index 8fdb95d19a7aa..d47cf870bb118 100644 --- a/azurerm/config.go +++ b/azurerm/config.go @@ -19,6 +19,7 @@ import ( "github.com/Azure/azure-sdk-for-go/arm/resources/resources" "github.com/Azure/azure-sdk-for-go/arm/scheduler" "github.com/Azure/azure-sdk-for-go/arm/servicebus" + "github.com/Azure/azure-sdk-for-go/arm/servicefabric" "github.com/Azure/azure-sdk-for-go/arm/sql" "github.com/Azure/azure-sdk-for-go/arm/storage" "github.com/Azure/azure-sdk-for-go/arm/trafficmanager" @@ -104,6 +105,8 @@ type ArmClient struct { keyVaultClient keyvault.VaultsClient sqlElasticPoolsClient sql.ElasticPoolsClient + + serviceFabricClient servicefabric.ClustersClient } func withRequestLogging() autorest.SendDecorator { @@ -476,6 +479,12 @@ func (c *Config) getArmClient() (*ArmClient, error) { sqlepc.Sender = autorest.CreateSender(withRequestLogging()) client.sqlElasticPoolsClient = sqlepc + cc := servicefabric.NewClustersClientWithBaseURI(endpoint, c.SubscriptionID) + setUserAgent(&cc.Client) + cc.Authorizer = auth + cc.Sender = autorest.CreateSender(withRequestLogging()) + client.serviceFabricClient = cc + return &client, nil } diff --git a/azurerm/provider.go b/azurerm/provider.go index 05c10505cfd91..2b1474e591f66 100644 --- a/azurerm/provider.go +++ b/azurerm/provider.go @@ -120,6 +120,8 @@ func Provider() terraform.ResourceProvider { "azurerm_virtual_network": resourceArmVirtualNetwork(), "azurerm_virtual_network_peering": resourceArmVirtualNetworkPeering(), + "azurerm_service_fabric": resourceArmServiceFabric(), + // These resources use the Riviera SDK "azurerm_dns_a_record": resourceArmDnsARecord(), "azurerm_dns_aaaa_record": resourceArmDnsAAAARecord(), diff --git a/azurerm/resource_arm_service_fabric.go b/azurerm/resource_arm_service_fabric.go new file mode 100644 index 0000000000000..0d1af019ee903 --- /dev/null +++ b/azurerm/resource_arm_service_fabric.go @@ -0,0 +1,359 @@ +package azurerm + +import ( + "fmt" + "log" + "net/http" + + "github.com/Azure/azure-sdk-for-go/arm/servicefabric" + "github.com/hashicorp/terraform/helper/schema" + "github.com/jen20/riviera/azure" +) + +func resourceArmServiceFabric() *schema.Resource { + return &schema.Resource{ + Create: resourceArmServiceFabricCreate, + Read: resourceArmServiceFabricRead, + Update: resourceArmServiceFabricUpdate, + Delete: resourceArmServiceFabricDelete, + + Schema: map[string]*schema.Schema{ + "resource_group_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "cluster_name": { + Type: schema.TypeString, + Required: true, + }, + "reliability_level": { + Type: schema.TypeString, + Required: true, + }, + "upgrade_mode": { + Type: schema.TypeString, + Required: true, + }, + "management_endpoint": { + Type: schema.TypeString, + Required: true, + }, + "node_name": { + Type: schema.TypeString, + Required: true, + }, + "instance_count": { + Type: schema.TypeInt, + Required: true, + }, + "client_endpoint_port": { + Type: schema.TypeInt, + Required: true, + }, + "http_endpoint_port": { + Type: schema.TypeInt, + Required: true, + }, + "storage_account_name": { + Type: schema.TypeString, + Required: true, + }, + "protected_account_key_name": { + Type: schema.TypeString, + Required: true, + }, + "blob_endpoint": { + Type: schema.TypeString, + Required: true, + }, + "queue_endpoint": { + Type: schema.TypeString, + Required: true, + }, + "table_endpoint": { + Type: schema.TypeString, + Required: true, + }, + "vm_image": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "certificate_thumbprint": { + Type: schema.TypeString, + Optional: true, + }, + "certificate_store_value": { + Type: schema.TypeString, + Optional: true, + }, + "cluster_protection_level": { + Type: schema.TypeString, + Optional: true, + }, + "admin_certificate_thumbprint": { + Type: schema.TypeString, + Optional: true, + }, + "location": locationSchema(), + "tags": tagsSchema(), + "cluster_endpoint": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func resourceArmServiceFabricCreate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*ArmClient) + ServiceFabricClient := client.serviceFabricClient + + log.Printf("[INFO] preparing arguments for Azure ARM Service Fabric creation.") + + resGroup := d.Get("resource_group_name").(string) + clusterName := d.Get("cluster_name").(string) + reliabilityLevel := d.Get("reliability_level").(string) + upgradeMode := d.Get("upgrade_mode").(string) + managementEndpoint := d.Get("management_endpoint").(string) + nodeName := d.Get("node_name").(string) + instanceCount := azure.Int32(int32(d.Get("instance_count").(int))) + isPrimary := true + clientEndpointPort := azure.Int32(int32(d.Get("client_endpoint_port").(int))) + httpEndpointPort := azure.Int32(int32(d.Get("http_endpoint_port").(int))) + vmImage := d.Get("vm_image").(string) + location := d.Get("location").(string) + tags := d.Get("tags").(map[string]interface{}) + + storageAccountName := d.Get("storage_account_name").(string) + protectedAccountKeyName := d.Get("protected_account_key_name").(string) + blobEndpoint := d.Get("blob_endpoint").(string) + queueEndpoint := d.Get("queue_endpoint").(string) + tableEndpoint := d.Get("table_endpoint").(string) + + log.Printf("[INFO] clusterName is %s.", clusterName) + + nodeTypeDescription := servicefabric.NodeTypeDescription{ + Name: &nodeName, + VMInstanceCount: instanceCount, + IsPrimary: &isPrimary, + ClientConnectionEndpointPort: clientEndpointPort, + HTTPGatewayEndpointPort: httpEndpointPort, + } + + log.Printf("[INFO] instanceCount is %s.", instanceCount) + + nodeTypes := make([]servicefabric.NodeTypeDescription, 0) + nodeTypes = append(nodeTypes, nodeTypeDescription) + + diagnosticsStorageAccountConfig := servicefabric.DiagnosticsStorageAccountConfig{ + StorageAccountName: &storageAccountName, + ProtectedAccountKeyName: &protectedAccountKeyName, + BlobEndpoint: &blobEndpoint, + QueueEndpoint: &queueEndpoint, + TableEndpoint: &tableEndpoint, + } + + clusterProperties := servicefabric.ClusterProperties{ + ReliabilityLevel: servicefabric.ReliabilityLevel(reliabilityLevel), + UpgradeMode: servicefabric.UpgradeMode(upgradeMode), + ManagementEndpoint: &managementEndpoint, + NodeTypes: &nodeTypes, + VMImage: &vmImage, + DiagnosticsStorageAccountConfig: &diagnosticsStorageAccountConfig, + } + + if v, ok := d.GetOk("certificate_thumbprint"); ok { + certificate := servicefabric.CertificateDescription{} + certificateThumbprint := v.(string) + certificate.Thumbprint = &certificateThumbprint + + if v, ok := d.GetOk("certificate_store_value"); ok { + certificateStoreValue := v.(string) + certificate.X509StoreName = servicefabric.X509StoreName(certificateStoreValue) + } + + clusterProperties.Certificate = &certificate + } + + if v, ok := d.GetOk("admin_certificate_thumbprint"); ok { + clientCertificate := servicefabric.ClientCertificateThumbprint{} + adminCertificateThumbprint := v.(string) + isAdmin := true + clientCertificate.CertificateThumbprint = &adminCertificateThumbprint + clientCertificate.IsAdmin = &isAdmin + + clientCertificateArray := make([]servicefabric.ClientCertificateThumbprint, 0) + clientCertificateArray = append(clientCertificateArray, clientCertificate) + + clusterProperties.ClientCertificateThumbprints = &clientCertificateArray + } + + if v, ok := d.GetOk("cluster_protection_level"); ok { + fabricSettingsParameters := servicefabric.SettingsParameterDescription{} + + clusterProtectionLevelName := "ClusterProtectionLevel" + + clusterProtectionLevel := v.(string) + fabricSettingsParameters.Name = &clusterProtectionLevelName + fabricSettingsParameters.Value = &clusterProtectionLevel + + fabricSettingsParametersArray := make([]servicefabric.SettingsParameterDescription, 0) + fabricSettingsParametersArray = append(fabricSettingsParametersArray, fabricSettingsParameters) + + fabricSettingsName := "Security" + + fabricSettings := servicefabric.SettingsSectionDescription{ + Name: &fabricSettingsName, + Parameters: &fabricSettingsParametersArray, + } + + fabricSettingsArray := make([]servicefabric.SettingsSectionDescription, 0) + fabricSettingsArray = append(fabricSettingsArray, fabricSettings) + clusterProperties.FabricSettings = &fabricSettingsArray + } + + cluster := servicefabric.Cluster{ + Location: &location, + ClusterProperties: &clusterProperties, + Tags: expandTags(tags), + } + + log.Printf("[INFO] creating Service Fabric") + + _, error := ServiceFabricClient.Create(resGroup, clusterName, cluster, make(chan struct{})) + err := <-error + if err != nil { + return err + } + + log.Printf("[INFO] reading Service Fabric") + + read, err := ServiceFabricClient.Get(resGroup, clusterName) + if err != nil { + return err + } + if read.ID == nil { + return fmt.Errorf("Cannot read Service Fabric %s (resource group %s) ID", clusterName, resGroup) + } + + d.SetId(*read.ID) + + return resourceArmServiceFabricRead(d, meta) +} + +func resourceArmServiceFabricUpdate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*ArmClient) + ServiceFabricClient := client.serviceFabricClient + + log.Printf("[INFO] preparing arguments for Azure ARM Service Fabric creation.") + + resGroup := d.Get("resource_group_name").(string) + clusterName := d.Get("cluster_name").(string) + reliabilityLevel := d.Get("reliability_level").(string) + upgradeMode := d.Get("upgrade_mode").(string) + nodeName := d.Get("node_name").(string) + instanceCount := azure.Int32(int32(d.Get("instance_count").(int))) + clientEndpointPort := azure.Int32(int32(d.Get("client_endpoint_port").(int))) + httpEndpointPort := azure.Int32(int32(d.Get("http_endpoint_port").(int))) + tags := d.Get("tags").(map[string]interface{}) + isPrimary := true + + log.Printf("[INFO] clusterName is %s.", clusterName) + + nodeTypeDescription := servicefabric.NodeTypeDescription{ + Name: &nodeName, + VMInstanceCount: instanceCount, + IsPrimary: &isPrimary, + ClientConnectionEndpointPort: clientEndpointPort, + HTTPGatewayEndpointPort: httpEndpointPort, + } + + log.Printf("[INFO] instanceCount is %s.", instanceCount) + + nodeTypes := make([]servicefabric.NodeTypeDescription, 0) + + nodeTypes = append(nodeTypes, nodeTypeDescription) + + clusterProperties := servicefabric.ClusterPropertiesUpdateParameters{ + ReliabilityLevel: servicefabric.ReliabilityLevel(reliabilityLevel), + UpgradeMode: servicefabric.UpgradeMode(upgradeMode), + NodeTypes: &nodeTypes, + } + + clusterUpdateParameters := servicefabric.ClusterUpdateParameters{ + ClusterPropertiesUpdateParameters: &clusterProperties, + Tags: expandTags(tags), + } + + log.Printf("[INFO] creating Service Fabric") + + _, error := ServiceFabricClient.Update(resGroup, clusterName, clusterUpdateParameters, make(chan struct{})) + err := <-error + if err != nil { + return err + } + + log.Printf("[INFO] reading Service Fabric") + + read, err := ServiceFabricClient.Get(resGroup, clusterName) + if err != nil { + return err + } + if read.ID == nil { + return fmt.Errorf("Cannot read Service Fabric %s (resource group %s) ID", clusterName, resGroup) + } + + d.SetId(*read.ID) + + return resourceArmServiceFabricRead(d, meta) +} + +func resourceArmServiceFabricRead(d *schema.ResourceData, meta interface{}) error { + ServiceFabricClient := meta.(*ArmClient).serviceFabricClient + + id, err := parseAzureResourceID(d.Id()) + if err != nil { + return err + } + + log.Printf("[DEBUG] Reading service fabric cluster %s", id) + + resGroup := id.ResourceGroup + clusterName := id.Path["clusters"] + + resp, err := ServiceFabricClient.Get(resGroup, clusterName) + if err != nil { + if resp.StatusCode == http.StatusNotFound { + d.SetId("") + return nil + } + return fmt.Errorf("Error making Read request on Azure Service Fabric %s: %s", clusterName, err) + } + + clusterEndpoint := resp.ClusterProperties.ClusterEndpoint + + d.Set("cluster_name", clusterName) + d.Set("resource_group_name", resGroup) + d.Set("cluster_endpoint", clusterEndpoint) + + return nil +} + +func resourceArmServiceFabricDelete(d *schema.ResourceData, meta interface{}) error { + ServiceFabricClient := meta.(*ArmClient).serviceFabricClient + + id, err := parseAzureResourceID(d.Id()) + if err != nil { + return err + } + resGroup := id.ResourceGroup + name := id.Path["clusters"] + + log.Printf("[DEBUG] Deleting service fabric cluster %s: %s", resGroup, name) + + _, err = ServiceFabricClient.Delete(resGroup, name) + + return err +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/client.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/client.go new file mode 100755 index 0000000000000..271143e26117a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/client.go @@ -0,0 +1,53 @@ +// 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 1.0.1.0 +// 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" +) + +// ManagementClient is the base client for Servicefabric. +type ManagementClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the ManagementClient client. +func New(subscriptionID string) ManagementClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the ManagementClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient { + return ManagementClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/clusters.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/clusters.go new file mode 100755 index 0000000000000..fda64c3012c28 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/clusters.go @@ -0,0 +1,572 @@ +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 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ClustersClient is the client for the Clusters methods of the Servicefabric +// service. +type ClustersClient struct { + ManagementClient +} + +// 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 This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will be +// used to cancel polling and any outstanding HTTP requests. +// +// 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(resourceGroupName string, clusterName string, parameters Cluster, cancel <-chan struct{}) (<-chan Cluster, <-chan error) { + resultChan := make(chan Cluster, 1) + errChan := make(chan error, 1) + 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 { + errChan <- validation.NewErrorWithValidationError(err, "servicefabric.ClustersClient", "Create") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result Cluster + defer func() { + resultChan <- result + errChan <- err + close(resultChan) + close(errChan) + }() + req, err := client.CreatePreparer(resourceGroupName, clusterName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreatePreparer prepares the Create request. +func (client ClustersClient) CreatePreparer(resourceGroupName string, clusterName string, parameters Cluster, cancel <-chan struct{}) (*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{Cancel: cancel}) +} + +// 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) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// 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(resourceGroupName string, clusterName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(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(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{}) +} + +// 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) +} + +// 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(resourceGroupName string, clusterName string) (result Cluster, err error) { + req, err := client.GetPreparer(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(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{}) +} + +// 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) +} + +// 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() (result ClusterListResult, err error) { + req, err := client.ListPreparer() + 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() (*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{}) +} + +// 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) +} + +// 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", "List", 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", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", resp, "Failure responding to next results request") + } + + 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(resourceGroupName string) (result ClusterListResult, err error) { + req, err := client.ListByResourceGroupPreparer(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.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(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{}) +} + +// 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) +} + +// 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", "ListByResourceGroup", 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", "ListByResourceGroup", resp, "Failure sending next results request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", resp, "Failure responding to next results request") + } + + return +} + +// Update update cluster configuration This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel +// will be used to cancel polling and any outstanding HTTP requests. +// +// 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(resourceGroupName string, clusterName string, parameters ClusterUpdateParameters, cancel <-chan struct{}) (<-chan Cluster, <-chan error) { + resultChan := make(chan Cluster, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result Cluster + defer func() { + resultChan <- result + errChan <- err + close(resultChan) + close(errChan) + }() + req, err := client.UpdatePreparer(resourceGroupName, clusterName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// UpdatePreparer prepares the Update request. +func (client ClustersClient) UpdatePreparer(resourceGroupName string, clusterName string, parameters ClusterUpdateParameters, cancel <-chan struct{}) (*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{Cancel: cancel}) +} + +// 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) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// 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 +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/clusterversions.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/clusterversions.go new file mode 100755 index 0000000000000..496d6f89bab93 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/clusterversions.go @@ -0,0 +1,134 @@ +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 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ClusterVersionsClient is the client for the ClusterVersions methods of the +// Servicefabric service. +type ClusterVersionsClient struct { + ManagementClient +} + +// 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)} +} + +// List list cluster code versions by location +// +// 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) List(location string, environment string) (result ClusterCodeVersionsListResult, err error) { + req, err := client.ListPreparer(location, environment) + 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(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{}) +} + +// 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) +} + +// 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", "List", 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", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", resp, "Failure responding to next results request") + } + + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/models.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/models.go new file mode 100755 index 0000000000000..044756515c26f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/models.go @@ -0,0 +1,439 @@ +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 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/to" + "net/http" +) + +// ClusterState enumerates the values for cluster state. +type ClusterState string + +const ( + // AutoScale specifies the auto scale state for cluster state. + AutoScale ClusterState = "AutoScale" + // BaselineUpgrade specifies the baseline upgrade state for cluster state. + BaselineUpgrade ClusterState = "BaselineUpgrade" + // Deploying specifies the deploying state for cluster state. + Deploying ClusterState = "Deploying" + // EnforcingClusterVersion specifies the enforcing cluster version state + // for cluster state. + EnforcingClusterVersion ClusterState = "EnforcingClusterVersion" + // Ready specifies the ready state for cluster state. + Ready ClusterState = "Ready" + // UpdatingInfrastructure specifies the updating infrastructure state for + // cluster state. + UpdatingInfrastructure ClusterState = "UpdatingInfrastructure" + // UpdatingUserCertificate specifies the updating user certificate state + // for cluster state. + UpdatingUserCertificate ClusterState = "UpdatingUserCertificate" + // UpdatingUserConfiguration specifies the updating user configuration + // state for cluster state. + UpdatingUserConfiguration ClusterState = "UpdatingUserConfiguration" + // UpgradeServiceUnreachable specifies the upgrade service unreachable + // state for cluster state. + UpgradeServiceUnreachable ClusterState = "UpgradeServiceUnreachable" + // WaitingForNodes specifies the waiting for nodes state for cluster state. + WaitingForNodes ClusterState = "WaitingForNodes" +) + +// DurabilityLevel enumerates the values for durability level. +type DurabilityLevel string + +const ( + // Bronze specifies the bronze state for durability level. + Bronze DurabilityLevel = "Bronze" + // Gold specifies the gold state for durability level. + Gold DurabilityLevel = "Gold" + // Silver specifies the silver state for durability level. + Silver DurabilityLevel = "Silver" +) + +// Environment enumerates the values for environment. +type Environment string + +const ( + // Linux specifies the linux state for environment. + Linux Environment = "Linux" + // Windows specifies the windows state for environment. + Windows Environment = "Windows" +) + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Canceled specifies the canceled state for provisioning state. + Canceled ProvisioningState = "Canceled" + // Failed specifies the failed state for provisioning state. + Failed ProvisioningState = "Failed" + // Succeeded specifies the succeeded state for provisioning state. + Succeeded ProvisioningState = "Succeeded" + // Updating specifies the updating state for provisioning state. + Updating ProvisioningState = "Updating" +) + +// ReliabilityLevel enumerates the values for reliability level. +type ReliabilityLevel string + +const ( + // ReliabilityLevelBronze specifies the reliability level bronze state for + // reliability level. + ReliabilityLevelBronze ReliabilityLevel = "Bronze" + // ReliabilityLevelGold specifies the reliability level gold state for + // reliability level. + ReliabilityLevelGold ReliabilityLevel = "Gold" + // ReliabilityLevelSilver specifies the reliability level silver state for + // reliability level. + ReliabilityLevelSilver ReliabilityLevel = "Silver" +) + +// ReliabilityLevel1 enumerates the values for reliability level 1. +type ReliabilityLevel1 string + +const ( + // ReliabilityLevel1Bronze specifies the reliability level 1 bronze state + // for reliability level 1. + ReliabilityLevel1Bronze ReliabilityLevel1 = "Bronze" + // ReliabilityLevel1Gold specifies the reliability level 1 gold state for + // reliability level 1. + ReliabilityLevel1Gold ReliabilityLevel1 = "Gold" + // ReliabilityLevel1Platinum specifies the reliability level 1 platinum + // state for reliability level 1. + ReliabilityLevel1Platinum ReliabilityLevel1 = "Platinum" + // ReliabilityLevel1Silver specifies the reliability level 1 silver state + // for reliability level 1. + ReliabilityLevel1Silver ReliabilityLevel1 = "Silver" +) + +// UpgradeMode enumerates the values for upgrade mode. +type UpgradeMode string + +const ( + // Automatic specifies the automatic state for upgrade mode. + Automatic UpgradeMode = "Automatic" + // Manual specifies the manual state for upgrade mode. + Manual UpgradeMode = "Manual" +) + +// UpgradeMode1 enumerates the values for upgrade mode 1. +type UpgradeMode1 string + +const ( + // UpgradeMode1Automatic specifies the upgrade mode 1 automatic state for + // upgrade mode 1. + UpgradeMode1Automatic UpgradeMode1 = "Automatic" + // UpgradeMode1Manual specifies the upgrade mode 1 manual state for upgrade + // mode 1. + UpgradeMode1Manual UpgradeMode1 = "Manual" +) + +// X509StoreName enumerates the values for x509 store name. +type X509StoreName string + +const ( + // AddressBook specifies the address book state for x509 store name. + AddressBook X509StoreName = "AddressBook" + // AuthRoot specifies the auth root state for x509 store name. + AuthRoot X509StoreName = "AuthRoot" + // CertificateAuthority specifies the certificate authority state for x509 + // store name. + CertificateAuthority X509StoreName = "CertificateAuthority" + // Disallowed specifies the disallowed state for x509 store name. + Disallowed X509StoreName = "Disallowed" + // My specifies the my state for x509 store name. + My X509StoreName = "My" + // Root specifies the root state for x509 store name. + Root X509StoreName = "Root" + // TrustedPeople specifies the trusted people state for x509 store name. + TrustedPeople X509StoreName = "TrustedPeople" + // TrustedPublisher specifies the trusted publisher state for x509 store + // name. + TrustedPublisher X509StoreName = "TrustedPublisher" +) + +// AvailableOperationDisplay is operation supported by ServiceFabric resource +// provider +type AvailableOperationDisplay struct { + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` + Operation *string `json:"operation,omitempty"` + Description *string `json:"description,omitempty"` +} + +// AzureActiveDirectory is the settings to enable AAD authentication on the +// cluster +type AzureActiveDirectory struct { + TenantID *string `json:"tenantId,omitempty"` + ClusterApplication *string `json:"clusterApplication,omitempty"` + ClientApplication *string `json:"clientApplication,omitempty"` +} + +// CertificateDescription is certificate details +type CertificateDescription struct { + Thumbprint *string `json:"thumbprint,omitempty"` + ThumbprintSecondary *string `json:"thumbprintSecondary,omitempty"` + X509StoreName X509StoreName `json:"x509StoreName,omitempty"` +} + +// ClientCertificateCommonName is client certificate details using common name +type ClientCertificateCommonName struct { + IsAdmin *bool `json:"isAdmin,omitempty"` + CertificateCommonName *string `json:"certificateCommonName,omitempty"` + CertificateIssuerThumbprint *string `json:"certificateIssuerThumbprint,omitempty"` +} + +// ClientCertificateThumbprint is client certificate details using thumbprint +type ClientCertificateThumbprint struct { + IsAdmin *bool `json:"isAdmin,omitempty"` + CertificateThumbprint *string `json:"certificateThumbprint,omitempty"` +} + +// Cluster is the cluster resource +type Cluster struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *ClusterProperties `json:"properties,omitempty"` +} + +// ClusterCodeVersionsListResult is the list results of the ServiceFabric +// runtime versions +type ClusterCodeVersionsListResult struct { + autorest.Response `json:"-"` + Value *[]ClusterCodeVersionsResult `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ClusterCodeVersionsListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client ClusterCodeVersionsListResult) ClusterCodeVersionsListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// ClusterCodeVersionsResult is the result of the ServiceFabric runtime +// versions +type ClusterCodeVersionsResult struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + *ClusterVersionDetails `json:"properties,omitempty"` +} + +// ClusterHealthPolicy is defines a health policy used to evaluate the health +// of the cluster or of a cluster node. +type ClusterHealthPolicy struct { + MaxPercentUnhealthyNodes *int32 `json:"maxPercentUnhealthyNodes,omitempty"` + MaxPercentUnhealthyApplications *int32 `json:"maxPercentUnhealthyApplications,omitempty"` +} + +// ClusterListResult is cluster list results +type ClusterListResult struct { + autorest.Response `json:"-"` + Value *[]Cluster `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ClusterListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client ClusterListResult) ClusterListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// ClusterProperties is the cluster resource properties +type ClusterProperties struct { + AvailableClusterVersions *[]ClusterVersionDetails `json:"availableClusterVersions,omitempty"` + ClusterID *string `json:"clusterId,omitempty"` + ClusterState ClusterState `json:"clusterState,omitempty"` + ClusterEndpoint *string `json:"clusterEndpoint,omitempty"` + ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"` + Certificate *CertificateDescription `json:"certificate,omitempty"` + ReliabilityLevel ReliabilityLevel `json:"reliabilityLevel,omitempty"` + UpgradeMode UpgradeMode `json:"upgradeMode,omitempty"` + ClientCertificateThumbprints *[]ClientCertificateThumbprint `json:"clientCertificateThumbprints,omitempty"` + ClientCertificateCommonNames *[]ClientCertificateCommonName `json:"clientCertificateCommonNames,omitempty"` + FabricSettings *[]SettingsSectionDescription `json:"fabricSettings,omitempty"` + ReverseProxyCertificate *CertificateDescription `json:"reverseProxyCertificate,omitempty"` + ManagementEndpoint *string `json:"managementEndpoint,omitempty"` + NodeTypes *[]NodeTypeDescription `json:"nodeTypes,omitempty"` + AzureActiveDirectory *AzureActiveDirectory `json:"azureActiveDirectory,omitempty"` + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + VMImage *string `json:"vmImage,omitempty"` + DiagnosticsStorageAccountConfig *DiagnosticsStorageAccountConfig `json:"diagnosticsStorageAccountConfig,omitempty"` + UpgradeDescription *ClusterUpgradePolicy `json:"upgradeDescription,omitempty"` +} + +// ClusterPropertiesUpdateParameters is the cluster resource properties can be +// updated +type ClusterPropertiesUpdateParameters struct { + ReliabilityLevel ReliabilityLevel `json:"reliabilityLevel,omitempty"` + UpgradeMode UpgradeMode `json:"upgradeMode,omitempty"` + ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"` + Certificate *CertificateDescription `json:"certificate,omitempty"` + ClientCertificateThumbprints *[]ClientCertificateThumbprint `json:"clientCertificateThumbprints,omitempty"` + ClientCertificateCommonNames *[]ClientCertificateCommonName `json:"clientCertificateCommonNames,omitempty"` + FabricSettings *[]SettingsSectionDescription `json:"fabricSettings,omitempty"` + ReverseProxyCertificate *CertificateDescription `json:"reverseProxyCertificate,omitempty"` + NodeTypes *[]NodeTypeDescription `json:"nodeTypes,omitempty"` + UpgradeDescription *ClusterUpgradePolicy `json:"upgradeDescription,omitempty"` +} + +// ClusterUpdateParameters is cluster update request +type ClusterUpdateParameters struct { + *ClusterPropertiesUpdateParameters `json:"properties,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` +} + +// ClusterUpgradeDeltaHealthPolicy is delta health policy for the cluster +type ClusterUpgradeDeltaHealthPolicy struct { + MaxPercentDeltaUnhealthyNodes *int32 `json:"maxPercentDeltaUnhealthyNodes,omitempty"` + MaxPercentUpgradeDomainDeltaUnhealthyNodes *int32 `json:"maxPercentUpgradeDomainDeltaUnhealthyNodes,omitempty"` + MaxPercentDeltaUnhealthyApplications *int32 `json:"maxPercentDeltaUnhealthyApplications,omitempty"` +} + +// ClusterUpgradePolicy is cluster upgrade policy +type ClusterUpgradePolicy struct { + OverrideUserUpgradePolicy *bool `json:"overrideUserUpgradePolicy,omitempty"` + ForceRestart *bool `json:"forceRestart,omitempty"` + UpgradeReplicaSetCheckTimeout *string `json:"upgradeReplicaSetCheckTimeout,omitempty"` + HealthCheckWaitDuration *string `json:"healthCheckWaitDuration,omitempty"` + HealthCheckStableDuration *string `json:"healthCheckStableDuration,omitempty"` + HealthCheckRetryTimeout *string `json:"healthCheckRetryTimeout,omitempty"` + UpgradeTimeout *string `json:"upgradeTimeout,omitempty"` + UpgradeDomainTimeout *string `json:"upgradeDomainTimeout,omitempty"` + HealthPolicy *ClusterHealthPolicy `json:"healthPolicy,omitempty"` + DeltaHealthPolicy *ClusterUpgradeDeltaHealthPolicy `json:"deltaHealthPolicy,omitempty"` +} + +// ClusterVersionDetails is the detail of the ServiceFabric runtime version +// result +type ClusterVersionDetails struct { + CodeVersion *string `json:"codeVersion,omitempty"` + SupportExpiryUtc *string `json:"supportExpiryUtc,omitempty"` + Environment Environment `json:"environment,omitempty"` +} + +// DiagnosticsStorageAccountConfig is diagnostics storage account config +type DiagnosticsStorageAccountConfig struct { + StorageAccountName *string `json:"storageAccountName,omitempty"` + ProtectedAccountKeyName *string `json:"protectedAccountKeyName,omitempty"` + BlobEndpoint *string `json:"blobEndpoint,omitempty"` + QueueEndpoint *string `json:"queueEndpoint,omitempty"` + TableEndpoint *string `json:"tableEndpoint,omitempty"` +} + +// EndpointRangeDescription is port range details +type EndpointRangeDescription struct { + StartPort *int32 `json:"startPort,omitempty"` + EndPort *int32 `json:"endPort,omitempty"` +} + +// ErrorModel is the structure of the error +type ErrorModel struct { + Error *ErrorModelError `json:"error,omitempty"` +} + +// ErrorModelError is the error detail +type ErrorModelError struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NodeTypeDescription is describes a node type in the cluster, each node type +// represents sub set of nodes in the cluster +type NodeTypeDescription struct { + Name *string `json:"name,omitempty"` + PlacementProperties *map[string]*string `json:"placementProperties,omitempty"` + Capacities *map[string]*string `json:"capacities,omitempty"` + ClientConnectionEndpointPort *int32 `json:"clientConnectionEndpointPort,omitempty"` + HTTPGatewayEndpointPort *int32 `json:"httpGatewayEndpointPort,omitempty"` + DurabilityLevel DurabilityLevel `json:"durabilityLevel,omitempty"` + ApplicationPorts *EndpointRangeDescription `json:"applicationPorts,omitempty"` + EphemeralPorts *EndpointRangeDescription `json:"ephemeralPorts,omitempty"` + IsPrimary *bool `json:"isPrimary,omitempty"` + VMInstanceCount *int32 `json:"vmInstanceCount,omitempty"` + ReverseProxyEndpointPort *int32 `json:"reverseProxyEndpointPort,omitempty"` +} + +// OperationListResult is 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 *[]OperationResult `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client OperationListResult) OperationListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// OperationResult is available operation list result +type OperationResult struct { + Name *string `json:"name,omitempty"` + Display *AvailableOperationDisplay `json:"display,omitempty"` + Origin *string `json:"origin,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// Resource is the resource model definition. +type Resource struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` +} + +// SettingsParameterDescription is serviceFabric settings under sections +type SettingsParameterDescription struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// SettingsSectionDescription is serviceFabric section settings +type SettingsSectionDescription struct { + Name *string `json:"name,omitempty"` + Parameters *[]SettingsParameterDescription `json:"parameters,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/operations.go new file mode 100755 index 0000000000000..5024912b7e6de --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/operations.go @@ -0,0 +1,123 @@ +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 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the +// Servicefabric service. +type OperationsClient struct { + ManagementClient +} + +// 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() (result OperationListResult, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, 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() (*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{}) +} + +// 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) +} + +// 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", "List", 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", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", resp, "Failure responding to next results request") + } + + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/version.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/version.go new file mode 100755 index 0000000000000..585f817586853 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/servicefabric/version.go @@ -0,0 +1,29 @@ +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 1.0.1.0 +// 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/v10.0.2-beta arm-servicefabric/2016-09-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return "v10.0.2-beta" +}