/// <summary> /// Initializes a new instance of the DeployedServicePackageHealthState class. /// </summary> /// <param name="aggregatedHealthState">The health state of a Service Fabric entity such as Cluster, Node, Application, /// Service, Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'</param> /// <param name="nodeName">Name of the node on which the service package is deployed.</param> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="serviceManifestName">Name of the manifest describing the service package.</param> /// <param name="servicePackageActivationId">The ActivationId of a deployed service package. If /// ServicePackageActivationMode specified at the time of creating the service /// is 'SharedProcess' (or if it is not specified, in which case it defaults to 'SharedProcess'), then value of /// ServicePackageActivationId /// is always an empty string. /// </param> public DeployedServicePackageHealthState( HealthState?aggregatedHealthState = default(HealthState?), NodeName nodeName = default(NodeName), ApplicationName applicationName = default(ApplicationName), string serviceManifestName = default(string), string servicePackageActivationId = default(string)) : base( aggregatedHealthState) { this.NodeName = nodeName; this.ApplicationName = applicationName; this.ServiceManifestName = serviceManifestName; this.ServicePackageActivationId = servicePackageActivationId; }
/// <summary> /// Initializes a new instance of the ApplicationHealthStateChunk class. /// </summary> /// <param name="healthState">The health state of a Service Fabric entity such as Cluster, Node, Application, Service, /// Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'</param> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="applicationTypeName">The application type name as defined in the application manifest.</param> /// <param name="serviceHealthStateChunks">The list of service health state chunks in the cluster that respect the /// filters in the cluster health chunk query description. /// </param> /// <param name="deployedApplicationHealthStateChunks">The list of deployed application health state chunks in the /// cluster that respect the filters in the cluster health chunk query description. /// </param> public ApplicationHealthStateChunk( HealthState?healthState = default(HealthState?), ApplicationName applicationName = default(ApplicationName), string applicationTypeName = default(string), ServiceHealthStateChunkList serviceHealthStateChunks = default(ServiceHealthStateChunkList), DeployedApplicationHealthStateChunkList deployedApplicationHealthStateChunks = default(DeployedApplicationHealthStateChunkList)) : base( healthState) { this.ApplicationName = applicationName; this.ApplicationTypeName = applicationTypeName; this.ServiceHealthStateChunks = serviceHealthStateChunks; this.DeployedApplicationHealthStateChunks = deployedApplicationHealthStateChunks; }
/// <summary> /// Initializes a new instance of the DeployedApplicationHealthEvaluation class. /// </summary> /// <param name="aggregatedHealthState">The health state of a Service Fabric entity such as Cluster, Node, Application, /// Service, Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'</param> /// <param name="description">Description of the health evaluation, which represents a summary of the evaluation /// process.</param> /// <param name="nodeName">Name of the node where the application is deployed to.</param> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="unhealthyEvaluations">List of unhealthy evaluations that led to the current aggregated health state /// of the deployed application. /// The types of the unhealthy evaluations can be DeployedServicePackagesHealthEvaluation or EventHealthEvaluation. /// </param> public DeployedApplicationHealthEvaluation( HealthState?aggregatedHealthState = default(HealthState?), string description = default(string), NodeName nodeName = default(NodeName), ApplicationName applicationName = default(ApplicationName), IEnumerable <HealthEvaluationWrapper> unhealthyEvaluations = default(IEnumerable <HealthEvaluationWrapper>)) : base( Common.HealthEvaluationKind.DeployedApplication, aggregatedHealthState, description) { this.NodeName = nodeName; this.ApplicationName = applicationName; this.UnhealthyEvaluations = unhealthyEvaluations; }
/// <summary> /// Initializes a new instance of the ApplicationDescription class. /// </summary> /// <param name="name">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="typeName">The application type name as defined in the application manifest.</param> /// <param name="typeVersion">The version of the application type as defined in the application manifest.</param> /// <param name="parameters">List of application parameters with overridden values from their default values specified /// in the application manifest.</param> /// <param name="applicationCapacity">Describes capacity information for services of this application. This description /// can be used for describing the following. /// - Reserving the capacity for the services on the nodes /// - Limiting the total number of nodes that services of this application can run on /// - Limiting the custom capacity metrics to limit the total consumption of this metric by the services of this /// application /// </param> public ApplicationDescription( ApplicationName name, string typeName, string typeVersion, IReadOnlyDictionary <string, string> parameters = default(IReadOnlyDictionary <string, string>), ApplicationCapacityDescription applicationCapacity = default(ApplicationCapacityDescription)) { name.ThrowIfNull(nameof(name)); typeName.ThrowIfNull(nameof(typeName)); typeVersion.ThrowIfNull(nameof(typeVersion)); this.Name = name; this.TypeName = typeName; this.TypeVersion = typeVersion; this.Parameters = parameters; this.ApplicationCapacity = applicationCapacity; }
/// <summary> /// Initializes a new instance of the StatelessServiceDescription class. /// </summary> /// <param name="serviceName">The full name of the service with 'fabric:' URI scheme.</param> /// <param name="serviceTypeName">Name of the service type as specified in the service manifest.</param> /// <param name="partitionDescription">The partition description as an object.</param> /// <param name="instanceCount">The instance count.</param> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="initializationData">The initialization data as an array of bytes. Initialization data is passed to /// service instances or replicas when they are created.</param> /// <param name="placementConstraints">The placement constraints as a string. Placement constraints are boolean /// expressions on node properties and allow for restricting a service to particular nodes based on the service /// requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == /// blue)".</param> /// <param name="correlationScheme">The correlation scheme.</param> /// <param name="serviceLoadMetrics">The service load metrics.</param> /// <param name="servicePlacementPolicies">The service placement policies.</param> /// <param name="defaultMoveCost">The move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', /// 'High', 'VeryHigh' /// /// Specifies the move cost for the service. /// </param> /// <param name="isDefaultMoveCostSpecified">Indicates if the DefaultMoveCost property is specified.</param> /// <param name="servicePackageActivationMode">The activation mode of service package to be used for a service. /// Possible values include: 'SharedProcess', 'ExclusiveProcess' /// /// The activation mode of service package to be used for a Service Fabric service. This is specified at the time of /// creating the Service. /// </param> /// <param name="serviceDnsName">The DNS name of the service. It requires the DNS system service to be enabled in /// Service Fabric cluster.</param> /// <param name="scalingPolicies">Scaling policies for this service.</param> /// <param name="minInstanceCount">MinInstanceCount is the minimum number of instances that must be up to meet the /// EnsureAvailability safety check during operations like upgrade or deactivate node. /// The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). /// Note, if InstanceCount is set to -1, during MinInstanceCount computation -1 is first converted into the number of /// nodes on which the instances are allowed to be placed according to the placement constraints on the service. /// </param> /// <param name="minInstancePercentage">MinInstancePercentage is the minimum percentage of InstanceCount that must be /// up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. /// The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). /// Note, if InstanceCount is set to -1, during MinInstancePercentage computation, -1 is first converted into the /// number of nodes on which the instances are allowed to be placed according to the placement constraints on the /// service. /// </param> /// <param name="flags">Flags indicating whether other properties are set. Each of the associated properties /// corresponds to a flag, specified below, which, if set, indicate that the property is specified. /// This property can be a combination of those flags obtained using bitwise 'OR' operator. /// For example, if the provided value is 1 then the flags for InstanceCloseDelayDuration is set. /// /// - None - Does not indicate any other properties are set. The value is zero. /// - InstanceCloseDelayDuration - Indicates the InstanceCloseDelayDuration property is set. The value is 1. /// </param> /// <param name="instanceCloseDelayDurationSeconds">Duration in seconds, to wait before a stateless instance is closed, /// to allow the active requests to drain gracefully. This would be effective when the instance is closing during the /// application/cluster upgrade and disabling node. /// The endpoint exposed on this instance is removed prior to starting the delay, which prevents new connections to /// this instance. /// In addition, clients that have subscribed to service endpoint change /// events(https://docs.microsoft.com/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), /// can do /// the following upon receiving the endpoint removal notification: /// - Stop sending new requests to this instance. /// - Close existing connections after in-flight requests have completed. /// - Connect to a different instance of the service partition for future requests. /// Note, the default value of InstanceCloseDelayDuration is 0, which indicates that there won't be any delay or /// removal of the endpoint prior to closing the instance. /// </param> public StatelessServiceDescription( ServiceName serviceName, string serviceTypeName, PartitionSchemeDescription partitionDescription, int?instanceCount, ApplicationName applicationName = default(ApplicationName), byte[] initializationData = default(byte[]), string placementConstraints = default(string), IEnumerable <ServiceCorrelationDescription> correlationScheme = default(IEnumerable <ServiceCorrelationDescription>), IEnumerable <ServiceLoadMetricDescription> serviceLoadMetrics = default(IEnumerable <ServiceLoadMetricDescription>), IEnumerable <ServicePlacementPolicyDescription> servicePlacementPolicies = default(IEnumerable <ServicePlacementPolicyDescription>), MoveCost?defaultMoveCost = default(MoveCost?), bool?isDefaultMoveCostSpecified = default(bool?), ServicePackageActivationMode?servicePackageActivationMode = default(ServicePackageActivationMode?), string serviceDnsName = default(string), IEnumerable <ScalingPolicyDescription> scalingPolicies = default(IEnumerable <ScalingPolicyDescription>), int?minInstanceCount = default(int?), int?minInstancePercentage = default(int?), int?flags = default(int?), long?instanceCloseDelayDurationSeconds = default(long?)) : base( serviceName, serviceTypeName, partitionDescription, Common.ServiceKind.Stateless, applicationName, initializationData, placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, isDefaultMoveCostSpecified, servicePackageActivationMode, serviceDnsName, scalingPolicies) { instanceCount.ThrowIfNull(nameof(instanceCount)); instanceCount?.ThrowIfLessThan("instanceCount", -1); instanceCloseDelayDurationSeconds?.ThrowIfOutOfInclusiveRange("instanceCloseDelayDurationSeconds", 0, 4294967295); this.InstanceCount = instanceCount; this.MinInstanceCount = minInstanceCount; this.MinInstancePercentage = minInstancePercentage; this.Flags = flags; this.InstanceCloseDelayDurationSeconds = instanceCloseDelayDurationSeconds; }
/// <summary> /// Initializes a new instance of the DeployedApplicationHealth class. /// </summary> /// <param name="aggregatedHealthState">The health state of a Service Fabric entity such as Cluster, Node, Application, /// Service, Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'</param> /// <param name="healthEvents">The list of health events reported on the entity.</param> /// <param name="unhealthyEvaluations">The unhealthy evaluations that show why the current aggregated health state was /// returned by Health Manager.</param> /// <param name="healthStatistics">Shows the health statistics for all children types of the queried entity.</param> /// <param name="name">Name of the application deployed on the node whose health information is described by this /// object.</param> /// <param name="nodeName">Name of the node where this application is deployed.</param> /// <param name="deployedServicePackageHealthStates">Deployed service package health states for the current deployed /// application as found in the health store.</param> public DeployedApplicationHealth( HealthState?aggregatedHealthState = default(HealthState?), IEnumerable <HealthEvent> healthEvents = default(IEnumerable <HealthEvent>), IEnumerable <HealthEvaluationWrapper> unhealthyEvaluations = default(IEnumerable <HealthEvaluationWrapper>), HealthStatistics healthStatistics = default(HealthStatistics), ApplicationName name = default(ApplicationName), NodeName nodeName = default(NodeName), IEnumerable <DeployedServicePackageHealthState> deployedServicePackageHealthStates = default(IEnumerable <DeployedServicePackageHealthState>)) : base( aggregatedHealthState, healthEvents, unhealthyEvaluations, healthStatistics) { this.Name = name; this.NodeName = nodeName; this.DeployedServicePackageHealthStates = deployedServicePackageHealthStates; }
/// <summary> /// Initializes a new instance of the DeployedServicePackageHealth class. /// </summary> /// <param name="aggregatedHealthState">The HealthState representing the aggregated health state of the entity computed /// by Health Manager. /// The health evaluation of the entity reflects all events reported on the entity and its children (if any). /// The aggregation is done by applying the desired health policy. /// . Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' /// /// The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc. /// </param> /// <param name="healthEvents">The list of health events reported on the entity.</param> /// <param name="unhealthyEvaluations">The unhealthy evaluations that show why the current aggregated health state was /// returned by Health Manager.</param> /// <param name="healthStatistics">Shows the health statistics for all children types of the queried entity.</param> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="serviceManifestName">Name of the service manifest.</param> /// <param name="nodeName">Name of the node where this service package is deployed.</param> public DeployedServicePackageHealth( HealthState?aggregatedHealthState = default(HealthState?), IEnumerable <HealthEvent> healthEvents = default(IEnumerable <HealthEvent>), IEnumerable <HealthEvaluationWrapper> unhealthyEvaluations = default(IEnumerable <HealthEvaluationWrapper>), HealthStatistics healthStatistics = default(HealthStatistics), ApplicationName applicationName = default(ApplicationName), string serviceManifestName = default(string), NodeName nodeName = default(NodeName)) : base( aggregatedHealthState, healthEvents, unhealthyEvaluations, healthStatistics) { this.ApplicationName = applicationName; this.ServiceManifestName = serviceManifestName; this.NodeName = nodeName; }
/// <summary> /// Initializes a new instance of the ServiceFromTemplateDescription class. /// </summary> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="serviceName">The full name of the service with 'fabric:' URI scheme.</param> /// <param name="serviceTypeName">Name of the service type as specified in the service manifest.</param> /// <param name="initializationData">The initialization data for the newly created service instance.</param> /// <param name="servicePackageActivationMode">The activation mode of service package to be used for a service. /// Possible values include: 'SharedProcess', 'ExclusiveProcess' /// /// The activation mode of service package to be used for a Service Fabric service. This is specified at the time of /// creating the Service. /// </param> /// <param name="serviceDnsName">The DNS name of the service. It requires the DNS system service to be enabled in /// Service Fabric cluster.</param> public ServiceFromTemplateDescription( ApplicationName applicationName, ServiceName serviceName, string serviceTypeName, byte[] initializationData = default(byte[]), ServicePackageActivationMode?servicePackageActivationMode = default(ServicePackageActivationMode?), string serviceDnsName = default(string)) { applicationName.ThrowIfNull(nameof(applicationName)); serviceName.ThrowIfNull(nameof(serviceName)); serviceTypeName.ThrowIfNull(nameof(serviceTypeName)); this.ApplicationName = applicationName; this.ServiceName = serviceName; this.ServiceTypeName = serviceTypeName; this.InitializationData = initializationData; this.ServicePackageActivationMode = servicePackageActivationMode; this.ServiceDnsName = serviceDnsName; }
/// <summary> /// Initializes a new instance of the ApplicationInfo class. /// </summary> /// <param name="id">The identity of the application. This is an encoded representation of the application name. This /// is used in the REST APIs to identify the application resource. /// Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the application /// name is "fabric:/myapp/app1", /// the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in previous versions. /// </param> /// <param name="name">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="typeName">The application type name as defined in the application manifest.</param> /// <param name="typeVersion">The version of the application type as defined in the application manifest.</param> /// <param name="status">The status of the application. /// . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'</param> /// <param name="parameters">List of application parameters with overridden values from their default values specified /// in the application manifest.</param> /// <param name="healthState">The health state of a Service Fabric entity such as Cluster, Node, Application, Service, /// Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'</param> /// <param name="applicationDefinitionKind">The mechanism used to define a Service Fabric application. /// . Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'</param> public ApplicationInfo( string id = default(string), ApplicationName name = default(ApplicationName), string typeName = default(string), string typeVersion = default(string), ApplicationStatus?status = default(ApplicationStatus?), IReadOnlyDictionary <string, string> parameters = default(IReadOnlyDictionary <string, string>), HealthState?healthState = default(HealthState?), ApplicationDefinitionKind?applicationDefinitionKind = default(ApplicationDefinitionKind?)) { this.Id = id; this.Name = name; this.TypeName = typeName; this.TypeVersion = typeVersion; this.Status = status; this.Parameters = parameters; this.HealthState = healthState; this.ApplicationDefinitionKind = applicationDefinitionKind; }
/// <summary> /// Initializes a new instance of the DeployedApplicationInfo class. /// </summary> /// <param name="id">The identity of the application. This is an encoded representation of the application name. This /// is used in the REST APIs to identify the application resource. /// Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the application /// name is "fabric:/myapp/app1", /// the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in previous versions. /// </param> /// <param name="name">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="typeName">The application type name as defined in the application manifest.</param> /// <param name="status">The status of the application deployed on the node. Following are the possible values. /// . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'</param> /// <param name="workDirectory">The work directory of the application on the node. The work directory can be used to /// store application data.</param> /// <param name="logDirectory">The log directory of the application on the node. The log directory can be used to store /// application logs.</param> /// <param name="tempDirectory">The temp directory of the application on the node. The code packages belonging to the /// application are forked with this directory set as their temporary directory.</param> /// <param name="healthState">The health state of a Service Fabric entity such as Cluster, Node, Application, Service, /// Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'</param> public DeployedApplicationInfo( string id = default(string), ApplicationName name = default(ApplicationName), string typeName = default(string), DeployedApplicationStatus?status = default(DeployedApplicationStatus?), string workDirectory = default(string), string logDirectory = default(string), string tempDirectory = default(string), HealthState?healthState = default(HealthState?)) { this.Id = id; this.Name = name; this.TypeName = typeName; this.Status = status; this.WorkDirectory = workDirectory; this.LogDirectory = logDirectory; this.TempDirectory = tempDirectory; this.HealthState = healthState; }
/// <summary> /// Initializes a new instance of the ServiceDescription class. /// </summary> /// <param name="serviceName">The full name of the service with 'fabric:' URI scheme.</param> /// <param name="serviceTypeName">Name of the service type as specified in the service manifest.</param> /// <param name="partitionDescription">The partition description as an object.</param> /// <param name="serviceKind">The kind of service (Stateless or Stateful).</param> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="initializationData">The initialization data as an array of bytes. Initialization data is passed to /// service instances or replicas when they are created.</param> /// <param name="placementConstraints">The placement constraints as a string. Placement constraints are boolean /// expressions on node properties and allow for restricting a service to particular nodes based on the service /// requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == /// blue)".</param> /// <param name="correlationScheme">The correlation scheme.</param> /// <param name="serviceLoadMetrics">The service load metrics.</param> /// <param name="servicePlacementPolicies">The service placement policies.</param> /// <param name="defaultMoveCost">The move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', /// 'High', 'VeryHigh' /// /// Specifies the move cost for the service. /// </param> /// <param name="isDefaultMoveCostSpecified">Indicates if the DefaultMoveCost property is specified.</param> /// <param name="servicePackageActivationMode">The activation mode of service package to be used for a service. /// Possible values include: 'SharedProcess', 'ExclusiveProcess' /// /// The activation mode of service package to be used for a Service Fabric service. This is specified at the time of /// creating the Service. /// </param> /// <param name="serviceDnsName">The DNS name of the service. It requires the DNS system service to be enabled in /// Service Fabric cluster.</param> /// <param name="scalingPolicies">Scaling policies for this service.</param> /// <param name="tagsRequiredToPlace">Tags for placement of this service.</param> /// <param name="tagsRequiredToRun">Tags for running of this service.</param> protected ServiceDescription( ServiceName serviceName, string serviceTypeName, PartitionSchemeDescription partitionDescription, ServiceKind?serviceKind, ApplicationName applicationName = default(ApplicationName), byte[] initializationData = default(byte[]), string placementConstraints = default(string), IEnumerable <ServiceCorrelationDescription> correlationScheme = default(IEnumerable <ServiceCorrelationDescription>), IEnumerable <ServiceLoadMetricDescription> serviceLoadMetrics = default(IEnumerable <ServiceLoadMetricDescription>), IEnumerable <ServicePlacementPolicyDescription> servicePlacementPolicies = default(IEnumerable <ServicePlacementPolicyDescription>), MoveCost?defaultMoveCost = default(MoveCost?), bool?isDefaultMoveCostSpecified = default(bool?), ServicePackageActivationMode?servicePackageActivationMode = default(ServicePackageActivationMode?), string serviceDnsName = default(string), IEnumerable <ScalingPolicyDescription> scalingPolicies = default(IEnumerable <ScalingPolicyDescription>), NodeTagsDescription tagsRequiredToPlace = default(NodeTagsDescription), NodeTagsDescription tagsRequiredToRun = default(NodeTagsDescription)) { serviceName.ThrowIfNull(nameof(serviceName)); serviceTypeName.ThrowIfNull(nameof(serviceTypeName)); partitionDescription.ThrowIfNull(nameof(partitionDescription)); serviceKind.ThrowIfNull(nameof(serviceKind)); this.ServiceName = serviceName; this.ServiceTypeName = serviceTypeName; this.PartitionDescription = partitionDescription; this.ServiceKind = serviceKind; this.ApplicationName = applicationName; this.InitializationData = initializationData; this.PlacementConstraints = placementConstraints; this.CorrelationScheme = correlationScheme; this.ServiceLoadMetrics = serviceLoadMetrics; this.ServicePlacementPolicies = servicePlacementPolicies; this.DefaultMoveCost = defaultMoveCost; this.IsDefaultMoveCostSpecified = isDefaultMoveCostSpecified; this.ServicePackageActivationMode = servicePackageActivationMode; this.ServiceDnsName = serviceDnsName; this.ScalingPolicies = scalingPolicies; this.TagsRequiredToPlace = tagsRequiredToPlace; this.TagsRequiredToRun = tagsRequiredToRun; }
/// <summary> /// Initializes a new instance of the ApplicationInfo class. /// </summary> /// <param name="id">The identity of the application. This is an encoded representation of the application name. This /// is used in the REST APIs to identify the application resource. /// Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the application /// name is "fabric:/myapp/app1", /// the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in previous versions. /// </param> /// <param name="name">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="typeName">The application type name as defined in the application manifest.</param> /// <param name="typeVersion">The version of the application type as defined in the application manifest.</param> /// <param name="status">The status of the application. /// . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'</param> /// <param name="parameters">List of application parameters with overridden values from their default values specified /// in the application manifest.</param> /// <param name="healthState">The health state of a Service Fabric entity such as Cluster, Node, Application, Service, /// Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'</param> /// <param name="applicationDefinitionKind">The mechanism used to define a Service Fabric application. /// . Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'</param> /// <param name="managedApplicationIdentity">Managed application identity description.</param> /// <param name="applicationMetadata">Metadata associated with a specific application.</param> public ApplicationInfo( string id = default(string), ApplicationName name = default(ApplicationName), string typeName = default(string), string typeVersion = default(string), ApplicationStatus?status = default(ApplicationStatus?), IReadOnlyDictionary <string, string> parameters = default(IReadOnlyDictionary <string, string>), HealthState?healthState = default(HealthState?), ApplicationDefinitionKind?applicationDefinitionKind = default(ApplicationDefinitionKind?), ManagedApplicationIdentityDescription managedApplicationIdentity = default(ManagedApplicationIdentityDescription), ApplicationMetadata applicationMetadata = default(ApplicationMetadata)) { this.Id = id; this.Name = name; this.TypeName = typeName; this.TypeVersion = typeVersion; this.Status = status; this.Parameters = parameters; this.HealthState = healthState; this.ApplicationDefinitionKind = applicationDefinitionKind; this.ManagedApplicationIdentity = managedApplicationIdentity; this.ApplicationMetadata = applicationMetadata; }
/// <summary> /// Initializes a new instance of the StatelessServiceDescription class. /// </summary> /// <param name="serviceName">The full name of the service with 'fabric:' URI scheme.</param> /// <param name="serviceTypeName">Name of the service type as specified in the service manifest.</param> /// <param name="partitionDescription">The partition description as an object.</param> /// <param name="instanceCount">The instance count.</param> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="initializationData">The initialization data as an array of bytes. Initialization data is passed to /// service instances or replicas when they are created.</param> /// <param name="placementConstraints">The placement constraints as a string. Placement constraints are boolean /// expressions on node properties and allow for restricting a service to particular nodes based on the service /// requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == /// blue)".</param> /// <param name="correlationScheme">The correlation scheme.</param> /// <param name="serviceLoadMetrics">The service load metrics.</param> /// <param name="servicePlacementPolicies">The service placement policies.</param> /// <param name="defaultMoveCost">Specifies the move cost for the service. Possible values include: 'Zero', 'Low', /// 'Medium', 'High'</param> /// <param name="isDefaultMoveCostSpecified">Indicates if the DefaultMoveCost property is specified.</param> /// <param name="servicePackageActivationMode">The activation mode of service package to be used for a Service Fabric /// service. This is specified at the time of creating the Service. Possible values include: 'SharedProcess', /// 'ExclusiveProcess'</param> /// <param name="serviceDnsName">The DNS name of the service. It requires the DNS system service to be enabled in /// Service Fabric cluster.</param> /// <param name="scalingPolicies">Scaling policies for this service.</param> public StatelessServiceDescription( ServiceName serviceName, string serviceTypeName, PartitionSchemeDescription partitionDescription, int?instanceCount, ApplicationName applicationName = default(ApplicationName), byte[] initializationData = default(byte[]), string placementConstraints = default(string), IEnumerable <ServiceCorrelationDescription> correlationScheme = default(IEnumerable <ServiceCorrelationDescription>), IEnumerable <ServiceLoadMetricDescription> serviceLoadMetrics = default(IEnumerable <ServiceLoadMetricDescription>), IEnumerable <ServicePlacementPolicyDescription> servicePlacementPolicies = default(IEnumerable <ServicePlacementPolicyDescription>), MoveCost?defaultMoveCost = default(MoveCost?), bool?isDefaultMoveCostSpecified = default(bool?), ServicePackageActivationMode?servicePackageActivationMode = default(ServicePackageActivationMode?), string serviceDnsName = default(string), IEnumerable <ScalingPolicyDescription> scalingPolicies = default(IEnumerable <ScalingPolicyDescription>)) : base( serviceName, serviceTypeName, partitionDescription, Common.ServiceKind.Stateless, applicationName, initializationData, placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, isDefaultMoveCostSpecified, servicePackageActivationMode, serviceDnsName, scalingPolicies) { instanceCount.ThrowIfNull(nameof(instanceCount)); instanceCount?.ThrowIfLessThan("instanceCount", -1); this.InstanceCount = instanceCount; }
/// <summary> /// Initializes a new instance of the StatefulServiceDescription class. /// </summary> /// <param name="serviceName">The full name of the service with 'fabric:' URI scheme.</param> /// <param name="serviceTypeName">Name of the service type as specified in the service manifest.</param> /// <param name="partitionDescription">The partition description as an object.</param> /// <param name="targetReplicaSetSize">The target replica set size as a number.</param> /// <param name="minReplicaSetSize">The minimum replica set size as a number.</param> /// <param name="hasPersistedState">A flag indicating whether this is a persistent service which stores states on the /// local disk. If it is then the value of this property is true, if not it is false.</param> /// <param name="applicationName">The name of the application, including the 'fabric:' URI scheme.</param> /// <param name="initializationData">The initialization data as an array of bytes. Initialization data is passed to /// service instances or replicas when they are created.</param> /// <param name="placementConstraints">The placement constraints as a string. Placement constraints are boolean /// expressions on node properties and allow for restricting a service to particular nodes based on the service /// requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == /// blue)".</param> /// <param name="correlationScheme">The correlation scheme.</param> /// <param name="serviceLoadMetrics">The service load metrics.</param> /// <param name="servicePlacementPolicies">The service placement policies.</param> /// <param name="defaultMoveCost">The move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', /// 'High', 'VeryHigh' /// /// Specifies the move cost for the service. /// </param> /// <param name="isDefaultMoveCostSpecified">Indicates if the DefaultMoveCost property is specified.</param> /// <param name="servicePackageActivationMode">The activation mode of service package to be used for a service. /// Possible values include: 'SharedProcess', 'ExclusiveProcess' /// /// The activation mode of service package to be used for a Service Fabric service. This is specified at the time of /// creating the Service. /// </param> /// <param name="serviceDnsName">The DNS name of the service. It requires the DNS system service to be enabled in /// Service Fabric cluster.</param> /// <param name="scalingPolicies">Scaling policies for this service.</param> /// <param name="tagsRequiredToPlace">Tags for placement of this service.</param> /// <param name="tagsRequiredToRun">Tags for running of this service.</param> /// <param name="flags">Flags indicating whether other properties are set. Each of the associated properties /// corresponds to a flag, specified below, which, if set, indicate that the property is specified. /// This property can be a combination of those flags obtained using bitwise 'OR' operator. /// For example, if the provided value is 6 then the flags for QuorumLossWaitDuration (2) and /// StandByReplicaKeepDuration(4) are set. /// /// - None - Does not indicate any other properties are set. The value is zero. /// - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration property is set. The value is 1. /// - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is set. The value is 2. /// - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration property is set. The value is 4. /// - ServicePlacementTimeLimit - Indicates the ServicePlacementTimeLimit property is set. The value is 8. /// - DropSourceReplicaOnMove - Indicates the DropSourceReplicaOnMove property is set. The value is 16. /// </param> /// <param name="replicaRestartWaitDurationSeconds">The duration, in seconds, between when a replica goes down and when /// a new replica is created.</param> /// <param name="quorumLossWaitDurationSeconds">The maximum duration, in seconds, for which a partition is allowed to /// be in a state of quorum loss.</param> /// <param name="standByReplicaKeepDurationSeconds">The definition on how long StandBy replicas should be maintained /// before being removed.</param> /// <param name="servicePlacementTimeLimitSeconds">The duration for which replicas can stay InBuild before reporting /// that build is stuck.</param> /// <param name="dropSourceReplicaOnMove">Indicates whether to drop source Secondary replica even if the target replica /// has not finished build. If desired behavior is to drop it as soon as possible the value of this property is true, /// if not it is false.</param> /// <param name="replicaLifecycleDescription">Defines how replicas of this service will behave during ther /// lifecycle.</param> /// <param name="auxiliaryReplicaCount">The auxiliary replica count as a number. To use Auxiliary replicas, the /// following must be true: AuxiliaryReplicaCount < (TargetReplicaSetSize+1)/2 and TargetReplicaSetSize >=3.</param> public StatefulServiceDescription( ServiceName serviceName, string serviceTypeName, PartitionSchemeDescription partitionDescription, int?targetReplicaSetSize, int?minReplicaSetSize, bool?hasPersistedState, ApplicationName applicationName = default(ApplicationName), byte[] initializationData = default(byte[]), string placementConstraints = default(string), IEnumerable <ServiceCorrelationDescription> correlationScheme = default(IEnumerable <ServiceCorrelationDescription>), IEnumerable <ServiceLoadMetricDescription> serviceLoadMetrics = default(IEnumerable <ServiceLoadMetricDescription>), IEnumerable <ServicePlacementPolicyDescription> servicePlacementPolicies = default(IEnumerable <ServicePlacementPolicyDescription>), MoveCost?defaultMoveCost = default(MoveCost?), bool?isDefaultMoveCostSpecified = default(bool?), ServicePackageActivationMode?servicePackageActivationMode = default(ServicePackageActivationMode?), string serviceDnsName = default(string), IEnumerable <ScalingPolicyDescription> scalingPolicies = default(IEnumerable <ScalingPolicyDescription>), NodeTagsDescription tagsRequiredToPlace = default(NodeTagsDescription), NodeTagsDescription tagsRequiredToRun = default(NodeTagsDescription), int?flags = default(int?), long?replicaRestartWaitDurationSeconds = default(long?), long?quorumLossWaitDurationSeconds = default(long?), long?standByReplicaKeepDurationSeconds = default(long?), long?servicePlacementTimeLimitSeconds = default(long?), bool?dropSourceReplicaOnMove = default(bool?), ReplicaLifecycleDescription replicaLifecycleDescription = default(ReplicaLifecycleDescription), int?auxiliaryReplicaCount = default(int?)) : base( serviceName, serviceTypeName, partitionDescription, Common.ServiceKind.Stateful, applicationName, initializationData, placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, isDefaultMoveCostSpecified, servicePackageActivationMode, serviceDnsName, scalingPolicies, tagsRequiredToPlace, tagsRequiredToRun) { targetReplicaSetSize.ThrowIfNull(nameof(targetReplicaSetSize)); minReplicaSetSize.ThrowIfNull(nameof(minReplicaSetSize)); hasPersistedState.ThrowIfNull(nameof(hasPersistedState)); targetReplicaSetSize?.ThrowIfLessThan("targetReplicaSetSize", 1); minReplicaSetSize?.ThrowIfLessThan("minReplicaSetSize", 1); replicaRestartWaitDurationSeconds?.ThrowIfOutOfInclusiveRange("replicaRestartWaitDurationSeconds", 0, 4294967295); quorumLossWaitDurationSeconds?.ThrowIfOutOfInclusiveRange("quorumLossWaitDurationSeconds", 0, 4294967295); standByReplicaKeepDurationSeconds?.ThrowIfOutOfInclusiveRange("standByReplicaKeepDurationSeconds", 0, 4294967295); servicePlacementTimeLimitSeconds?.ThrowIfOutOfInclusiveRange("servicePlacementTimeLimitSeconds", 0, 4294967295); auxiliaryReplicaCount?.ThrowIfLessThan("auxiliaryReplicaCount", 0); this.TargetReplicaSetSize = targetReplicaSetSize; this.MinReplicaSetSize = minReplicaSetSize; this.HasPersistedState = hasPersistedState; this.Flags = flags; this.ReplicaRestartWaitDurationSeconds = replicaRestartWaitDurationSeconds; this.QuorumLossWaitDurationSeconds = quorumLossWaitDurationSeconds; this.StandByReplicaKeepDurationSeconds = standByReplicaKeepDurationSeconds; this.ServicePlacementTimeLimitSeconds = servicePlacementTimeLimitSeconds; this.DropSourceReplicaOnMove = dropSourceReplicaOnMove; this.ReplicaLifecycleDescription = replicaLifecycleDescription; this.AuxiliaryReplicaCount = auxiliaryReplicaCount; }