FabricClient.ServiceManagementClient.CreateServiceFromTemplateAsync Method

Definition

Overloads

CreateServiceFromTemplateAsync(ServiceFromTemplateDescription)

Instantiates a service from the template specified in the Application Manifest.

CreateServiceFromTemplateAsync(ServiceFromTemplateDescription, TimeSpan, CancellationToken)

Instantiates a service from the template specified in the Application Manifest.

CreateServiceFromTemplateAsync(Uri, Uri, String, Byte[])

Instantiates a service from the template specified in the Application Manifest.

CreateServiceFromTemplateAsync(Uri, Uri, String, Byte[], TimeSpan, CancellationToken)

Instantiates a service from the template specified in the Application Manifest. Also takes in timeout interval, which is the maximum of time the system will allow this operation to continue before returning System.TimeoutException and cancellation-token that the operation is observing.

CreateServiceFromTemplateAsync(ServiceFromTemplateDescription)

Instantiates a service from the template specified in the Application Manifest.

public System.Threading.Tasks.Task CreateServiceFromTemplateAsync (System.Fabric.Description.ServiceFromTemplateDescription serviceFromTemplateDescription);
member this.CreateServiceFromTemplateAsync : System.Fabric.Description.ServiceFromTemplateDescription -> System.Threading.Tasks.Task
Public Function CreateServiceFromTemplateAsync (serviceFromTemplateDescription As ServiceFromTemplateDescription) As Task

Parameters

serviceFromTemplateDescription
ServiceFromTemplateDescription

Describes the Service to be created from service template specified in application manifest.

Returns

System.Threading.Tasks.Task

The instantiated service.

Exceptions

The FabricClient object is in a closed state. Dispose of the FabricClient object you are using and instantiate a new FabricClient object.

ServiceTemplateNotFound: The service template does not exist.

System.TimeoutException

The request timed out but may have already been accepted for processing by the system.

System.OperationCanceledException

The request was canceled before the timeout expired but may have already been accepted for processing by the system.

Remarks

Service Fabric name will be implicitly created if it does not already exist.

Applies to

CreateServiceFromTemplateAsync(ServiceFromTemplateDescription, TimeSpan, CancellationToken)

Instantiates a service from the template specified in the Application Manifest.

public System.Threading.Tasks.Task CreateServiceFromTemplateAsync (System.Fabric.Description.ServiceFromTemplateDescription serviceFromTemplateDescription, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
member this.CreateServiceFromTemplateAsync : System.Fabric.Description.ServiceFromTemplateDescription * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function CreateServiceFromTemplateAsync (serviceFromTemplateDescription As ServiceFromTemplateDescription, timeout As TimeSpan, cancellationToken As CancellationToken) As Task

Parameters

serviceFromTemplateDescription
ServiceFromTemplateDescription

Describes a service to be created from service template specified in application manifest.

timeout
System.TimeSpan

The maximum amount of time the system will allow this operation to continue before returning System.TimeoutException.

cancellationToken
System.Threading.CancellationToken

The System.Threading.CancellationToken that the operation is observing. It can be used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task

The instantiated service.

Exceptions

The FabricClient object is in a closed state. Dispose of the FabricClient object you are using and instantiate a new FabricClient object.

ServiceTemplateNotFound: The service template does not exist.

System.TimeoutException

The request timed out but may have already been accepted for processing by the system.

System.OperationCanceledException

The request was canceled before the timeout expired but may have already been accepted for processing by the system.

Remarks

Service Fabric name will be implicitly created if it does not already exist.

Applies to

CreateServiceFromTemplateAsync(Uri, Uri, String, Byte[])

Instantiates a service from the template specified in the Application Manifest.

public System.Threading.Tasks.Task CreateServiceFromTemplateAsync (Uri applicationName, Uri serviceName, string serviceTypeName, byte[] initializationData);
member this.CreateServiceFromTemplateAsync : Uri * Uri * string * byte[] -> System.Threading.Tasks.Task
Public Function CreateServiceFromTemplateAsync (applicationName As Uri, serviceName As Uri, serviceTypeName As String, initializationData As Byte()) As Task

Parameters

applicationName
System.Uri

The Service Fabric Name of the application under which the service will be created.

serviceName
System.Uri

The Service Fabric Name of the service.

serviceTypeName
System.String

The name of the service type. This has to be same as the ServiceTypeName specified in the service manifest.

initializationData
System.Byte[]

The initialization data represents the custom data provided by the creator of the service. Service Fabric does not parse this data. This data would be available in every instance or replica in StatefulServiceContext or StatelessServiceContext. It cannot be changed after the service is created.

Returns

System.Threading.Tasks.Task

The instantiated service.

Exceptions

The FabricClient object is in a closed state. Dispose of the FabricClient object you are using and instantiate a new FabricClient object.

ServiceTemplateNotFound: The service template does not exist

System.TimeoutException

The request timed out but may have already been accepted for processing by the system.

System.OperationCanceledException

The request was canceled before the timeout expired but may have already been accepted for processing by the system.

System.ArgumentNullException

When applicationName or serviceName are null.

System.ArgumentException

When serviceTypeName is null or white-space.

Remarks

Service Fabric name will be implicitly created if it does not already exist.

The default timeout is one minute for which the system will allow this operation to continue before returning System.TimeoutException.

Applies to

CreateServiceFromTemplateAsync(Uri, Uri, String, Byte[], TimeSpan, CancellationToken)

Instantiates a service from the template specified in the Application Manifest. Also takes in timeout interval, which is the maximum of time the system will allow this operation to continue before returning System.TimeoutException and cancellation-token that the operation is observing.

public System.Threading.Tasks.Task CreateServiceFromTemplateAsync (Uri applicationName, Uri serviceName, string serviceTypeName, byte[] initializationData, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
member this.CreateServiceFromTemplateAsync : Uri * Uri * string * byte[] * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function CreateServiceFromTemplateAsync (applicationName As Uri, serviceName As Uri, serviceTypeName As String, initializationData As Byte(), timeout As TimeSpan, cancellationToken As CancellationToken) As Task

Parameters

applicationName
System.Uri

The Service Fabric Name of the application under which the service will be created.

serviceName
System.Uri

The Service Fabric Name of the service.

serviceTypeName
System.String

The name of the service type. This has to be same as the ServiceTypeName specified in the service manifest.

initializationData
System.Byte[]

The initialization data represents the custom data provided by the creator of the service. Service Fabric does not parse this data. This data would be available in every instance or replica in StatefulServiceContext or StatelessServiceContext. It cannot be changed after the service is created.

timeout
System.TimeSpan

The maximum amount of time the system will allow this operation to continue before returning System.TimeoutException.

cancellationToken
System.Threading.CancellationToken

The System.Threading.CancellationToken that the operation is observing. It can be used to propagate notification that the operation should be canceled.

Returns

System.Threading.Tasks.Task

The instantiated service.

Exceptions

The FabricClient object is in a closed state. Dispose of the FabricClient object you are using and instantiate a new FabricClient object.

ServiceTemplateNotFound: The service template does not exist.

System.TimeoutException

The request timed out but may have already been accepted for processing by the system.

System.OperationCanceledException

The request was canceled before the timeout expired but may have already been accepted for processing by the system.

System.ArgumentNullException

When applicationName or serviceName are null.

System.ArgumentException

When serviceTypeName is null or white-space.

Remarks

Service Fabric name will be implicitly created if it does not already exist.

Applies to