Class ServiceHostConfiguration
A class representing a configuration for the service environment for the application.
Inherited Members
Namespace: Unity.Cloud.Common
Syntax
public sealed class ServiceHostConfigurationFields
k_DefaultEnvironment
Declaration
public const ServiceEnvironment k_DefaultEnvironment = ServiceEnvironment.ProductionField Value
| Type | Description | 
|---|---|
| ServiceEnvironment | 
Properties
SystemOverrideEnvironmentVariableName
The environment variable key for the service environment override.
Declaration
public static string SystemOverrideEnvironmentVariableName { get; }Property Value
| Type | Description | 
|---|---|
| String | 
SystemOverrideProviderVariableName
The environment variable key for the service domain provider override.
Declaration
public static string SystemOverrideProviderVariableName { get; }Property Value
| Type | Description | 
|---|---|
| String | 
Methods
GetServiceAddress(ServiceEnvironment, ServiceDomainProvider, String, Int32, ServiceProtocol, String)
Returns the service address for the specified inputs.
Declaration
public string GetServiceAddress(ServiceEnvironment environmentOverride, ServiceDomainProvider serviceDomainProviderOverride, string subdomain, int port, ServiceProtocol protocol, string serviceName)Parameters
| Type | Name | Description | 
|---|---|---|
| ServiceEnvironment | environmentOverride | The service environment override. | 
| ServiceDomainProvider | serviceDomainProviderOverride | The service domain provider. | 
| String | subdomain | The service subdomain. | 
| Int32 | port | The service port. | 
| ServiceProtocol | protocol | The web protocol. | 
| String | serviceName | The service's name. | 
Returns
| Type | Description | 
|---|---|
| String | The service address. | 
Exceptions
| Type | Condition | 
|---|---|
| ArgumentOutOfRangeException | 
GetServiceAddress(ServiceEnvironment, ServiceDomainProvider, ServiceProtocol, String)
Returns the service address for the specified inputs.
Declaration
public string GetServiceAddress(ServiceEnvironment environmentOverride, ServiceDomainProvider serviceDomainProviderOverride, ServiceProtocol protocol = ServiceProtocol.Http, string serviceName = "project")Parameters
| Type | Name | Description | 
|---|---|---|
| ServiceEnvironment | environmentOverride | The service environment override. | 
| ServiceDomainProvider | serviceDomainProviderOverride | The service domain provider. | 
| ServiceProtocol | protocol | The web protocol. | 
| String | serviceName | The service's name. | 
Returns
| Type | Description | 
|---|---|
| String | The service address. | 
GetServiceAddress(ServiceProtocol, String)
Returns the service address for the specified inputs.
Declaration
public string GetServiceAddress(ServiceProtocol protocol = ServiceProtocol.Http, string serviceName = "project")Parameters
| Type | Name | Description | 
|---|---|---|
| ServiceProtocol | protocol | The web protocol. | 
| String | serviceName | The service's name. | 
Returns
| Type | Description | 
|---|---|
| String | The service address. | 
GetServiceDomain()
Will return the domain for the resolved ServiceDomainProvider.
Declaration
public string GetServiceDomain()Returns
| Type | Description | 
|---|---|
| String | The domain for the specified provider. | 
GetServiceDomain(ServiceDomainProvider)
Will return the domain for a given ServiceDomainProvider.
Declaration
public string GetServiceDomain(ServiceDomainProvider serviceDomainProvider)Parameters
| Type | Name | Description | 
|---|---|---|
| ServiceDomainProvider | serviceDomainProvider | The service domain provider. | 
Returns
| Type | Description | 
|---|---|
| String | The domain for the specified provider. | 
Exceptions
| Type | Condition | 
|---|---|
| NotSupportedException | Thrown if the ServiceDomainProvider is not mapped to a domain. | 
ResolveEnvironment(Nullable<ServiceEnvironment>)
Resolves the ServiceEnvironment, prioritizing the override set via the Environment Variable.
Declaration
public (ServiceEnvironment environment, string url) ResolveEnvironment(ServiceEnvironment? environmentOverride = null)Parameters
| Type | Name | Description | 
|---|---|---|
| Nullable<ServiceEnvironment> | environmentOverride | The service environment override. | 
Returns
| Type | Description | 
|---|---|
| (T1, T2)<ServiceEnvironment, String> | The resolved environment and url. | 
Exceptions
| Type | Condition | 
|---|---|
| NotSupportedException | 
ResolveProvider(Nullable<ServiceDomainProvider>)
Resolves the ServiceDomainProvider, prioritizing the override set via the Environment Variable.
Declaration
public ServiceDomainProvider ResolveProvider(ServiceDomainProvider? providerOverride = null)Parameters
| Type | Name | Description | 
|---|---|---|
| Nullable<ServiceDomainProvider> | providerOverride | The service environment override. | 
Returns
| Type | Description | 
|---|---|
| ServiceDomainProvider | The resolved environment and url. | 
Exceptions
| Type | Condition | 
|---|---|
| NotSupportedException |