Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the ClusterInner class.
 /// </summary>
 /// <param name="managementEndpoint">The http management endpoint of
 /// the cluster</param>
 /// <param name="nodeTypes">The list of nodetypes that make up the
 /// cluster</param>
 /// <param name="availableClusterVersions">The available cluster code
 /// version which the cluster can upgrade to, note that you must choose
 /// upgradeMode to manual to upgrade to</param>
 /// <param name="clusterId">The unique identifier for the cluster
 /// resource</param>
 /// <param name="clusterState">The state for the cluster. Possible
 /// values include: 'WaitingForNodes', 'Deploying', 'BaselineUpgrade',
 /// 'UpdatingUserConfiguration', 'UpdatingUserCertificate',
 /// 'UpdatingInfrastructure', 'EnforcingClusterVersion',
 /// 'UpgradeServiceUnreachable', 'AutoScale', 'Ready'</param>
 /// <param name="clusterEndpoint">The endpoint for the cluster
 /// connecting to servicefabric resource provider</param>
 /// <param name="clusterCodeVersion">The ServiceFabric code version
 /// running in your cluster</param>
 /// <param name="certificate">This primay certificate will be used as
 /// cluster node to node security, SSL certificate for cluster
 /// management endpoint and default admin client</param>
 /// <param name="reliabilityLevel">Cluster reliability level indicates
 /// replica set size of system service. Possible values include:
 /// 'Bronze', 'Silver', 'Gold', 'Platinum'</param>
 /// <param name="upgradeMode">Cluster upgrade mode indicates if fabric
 /// upgrade is initiated automatically by the system or not. Possible
 /// values include: 'Automatic', 'Manual'</param>
 /// <param name="clientCertificateThumbprints">The client thumbprint
 /// details ,it is used for client access for cluster operation</param>
 /// <param name="clientCertificateCommonNames"> List of client
 /// certificates to whitelist based on common names</param>
 /// <param name="fabricSettings">List of custom fabric settings to
 /// configure the cluster.</param>
 /// <param name="reverseProxyCertificate">The server certificate used
 /// by reverse proxy</param>
 /// <param name="azureActiveDirectory">The settings to enable AAD
 /// authentication on the cluster</param>
 /// <param name="provisioningState">The provisioning state of the
 /// cluster resource. Possible values include: 'Updating', 'Succeeded',
 /// 'Failed', 'Canceled'</param>
 /// <param name="vmImage">The name of VM image VMSS has been configured
 /// with. Generic names such as Windows or Linux can be used.</param>
 /// <param name="diagnosticsStorageAccountConfig">The storage
 /// diagnostics account configuration details</param>
 /// <param name="upgradeDescription">The policy to use when upgrading
 /// the cluster.</param>
 public ClusterInner(string managementEndpoint, IList <NodeTypeDescription> nodeTypes, string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), IList <ClusterVersionDetails> availableClusterVersions = default(IList <ClusterVersionDetails>), string clusterId = default(string), string clusterState = default(string), string clusterEndpoint = default(string), string clusterCodeVersion = default(string), CertificateDescription certificate = default(CertificateDescription), string reliabilityLevel = default(string), string upgradeMode = default(string), IList <ClientCertificateThumbprint> clientCertificateThumbprints = default(IList <ClientCertificateThumbprint>), IList <ClientCertificateCommonName> clientCertificateCommonNames = default(IList <ClientCertificateCommonName>), IList <SettingsSectionDescription> fabricSettings = default(IList <SettingsSectionDescription>), CertificateDescription reverseProxyCertificate = default(CertificateDescription), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), string provisioningState = default(string), string vmImage = default(string), DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig = default(DiagnosticsStorageAccountConfig), ClusterUpgradePolicy upgradeDescription = default(ClusterUpgradePolicy))
     : base(location, id, name, type, tags)
 {
     AvailableClusterVersions = availableClusterVersions;
     ClusterId                    = clusterId;
     ClusterState                 = clusterState;
     ClusterEndpoint              = clusterEndpoint;
     ClusterCodeVersion           = clusterCodeVersion;
     Certificate                  = certificate;
     ReliabilityLevel             = reliabilityLevel;
     UpgradeMode                  = upgradeMode;
     ClientCertificateThumbprints = clientCertificateThumbprints;
     ClientCertificateCommonNames = clientCertificateCommonNames;
     FabricSettings               = fabricSettings;
     ReverseProxyCertificate      = reverseProxyCertificate;
     ManagementEndpoint           = managementEndpoint;
     NodeTypes                    = nodeTypes;
     AzureActiveDirectory         = azureActiveDirectory;
     ProvisioningState            = provisioningState;
     VmImage = vmImage;
     DiagnosticsStorageAccountConfig = diagnosticsStorageAccountConfig;
     UpgradeDescription = upgradeDescription;
     CustomInit();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ManagementEndpoint == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ManagementEndpoint");
     }
     if (NodeTypes == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "NodeTypes");
     }
     if (Certificate != null)
     {
         Certificate.Validate();
     }
     if (ClientCertificateThumbprints != null)
     {
         foreach (var element in ClientCertificateThumbprints)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (ClientCertificateCommonNames != null)
     {
         foreach (var element1 in ClientCertificateCommonNames)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (FabricSettings != null)
     {
         foreach (var element2 in FabricSettings)
         {
             if (element2 != null)
             {
                 element2.Validate();
             }
         }
     }
     if (ReverseProxyCertificate != null)
     {
         ReverseProxyCertificate.Validate();
     }
     if (NodeTypes != null)
     {
         foreach (var element3 in NodeTypes)
         {
             if (element3 != null)
             {
                 element3.Validate();
             }
         }
     }
     if (DiagnosticsStorageAccountConfig != null)
     {
         DiagnosticsStorageAccountConfig.Validate();
     }
     if (UpgradeDescription != null)
     {
         UpgradeDescription.Validate();
     }
 }