Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the ServiceCorrelationDescription class.
 /// </summary>
 /// <param name="scheme">The service correlation scheme. Possible values include: 'Invalid', 'Affinity',
 /// 'AlignedAffinity', 'NonAlignedAffinity'</param>
 /// <param name="serviceName">The name of the service that the correlation relationship is established with.</param>
 public ServiceCorrelationDescription(
     ServiceCorrelationScheme?scheme,
     ServiceName serviceName)
 {
     scheme.ThrowIfNull(nameof(scheme));
     serviceName.ThrowIfNull(nameof(serviceName));
     this.Scheme      = scheme;
     this.ServiceName = serviceName;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the ResolvedServicePartition class.
 /// </summary>
 /// <param name="name">The full name of the service with 'fabric:' URI scheme.</param>
 /// <param name="partitionInformation">A representation of the resolved partition.</param>
 /// <param name="endpoints">List of resolved service endpoints of a service partition.</param>
 /// <param name="version">The version of this resolved service partition result. This version should be passed in the
 /// next time the ResolveService call is made via the PreviousRspVersion query parameter.</param>
 public ResolvedServicePartition(
     ServiceName name,
     PartitionInformation partitionInformation,
     IEnumerable <ResolvedServiceEndpoint> endpoints,
     string version)
 {
     name.ThrowIfNull(nameof(name));
     partitionInformation.ThrowIfNull(nameof(partitionInformation));
     endpoints.ThrowIfNull(nameof(endpoints));
     version.ThrowIfNull(nameof(version));
     this.Name = name;
     this.PartitionInformation = partitionInformation;
     this.Endpoints            = endpoints;
     this.Version = version;
 }
Ejemplo n.º 3
0
 /// <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 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;
 }