internal HostNameSslState(string name, SslState?sslState, string virtualIP, string thumbprint, bool?toUpdate, HostType?hostType) { Name = name; SslState = sslState; VirtualIP = virtualIP; Thumbprint = thumbprint; ToUpdate = toUpdate; HostType = hostType; }
/// <summary> /// Initializes a new instance of the HostNameSslState class. /// </summary> /// <param name="name">Hostname.</param> /// <param name="sslState">SSL type. Possible values include: /// 'Disabled', 'SniEnabled', 'IpBasedEnabled'</param> /// <param name="virtualIP">Virtual IP address assigned to the hostname /// if IP based SSL is enabled.</param> /// <param name="thumbprint">SSL certificate thumbprint.</param> /// <param name="toUpdate">Set to <code>true</code> to /// update existing hostname.</param> /// <param name="hostType">Indicates whether the hostname is a standard /// or repository hostname. Possible values include: 'Standard', /// 'Repository'</param> public HostNameSslState(string name = default(string), SslState?sslState = default(SslState?), string virtualIP = default(string), string thumbprint = default(string), bool?toUpdate = default(bool?), HostType?hostType = default(HostType?)) { Name = name; SslState = sslState; VirtualIP = virtualIP; Thumbprint = thumbprint; ToUpdate = toUpdate; HostType = hostType; CustomInit(); }
internal CustomLocationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, SystemAssignedServiceIdentity identity, CustomLocationPropertiesAuthentication authentication, IList <string> clusterExtensionIds, string displayName, string hostResourceId, HostType?hostType, string @namespace, string provisioningState) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; Authentication = authentication; ClusterExtensionIds = clusterExtensionIds; DisplayName = displayName; HostResourceId = hostResourceId; HostType = hostType; Namespace = @namespace; ProvisioningState = provisioningState; }
public static HostType GetHostType() { if (_hostType.HasValue) { return(_hostType.Value); } HostType hostType = HostType.Unidentified; try { if (Environment.GetEnvironmentVariable(RequestTracingConstants.AzureFunctionEnvironmentVariable) != null) { hostType = HostType.AzureFunction; } else if (Environment.GetEnvironmentVariable(RequestTracingConstants.AzureWebAppEnvironmentVariable) != null) { hostType = HostType.AzureWebApp; } else if (Environment.GetEnvironmentVariable(RequestTracingConstants.KubernetesEnvironmentVariable) != null) { hostType = HostType.Kubernetes; } else if (Environment.GetEnvironmentVariable(RequestTracingConstants.ServiceFabricEnvironmentVariable) != null) { hostType = HostType.ServiceFabric; } else { try { string processName = Process.GetCurrentProcess().ProcessName; if (processName != null && processName.Equals(RequestTracingConstants.IISExpressProcessName, StringComparison.OrdinalIgnoreCase)) { hostType = HostType.IISExpress; } } catch (InvalidOperationException) { } catch (PlatformNotSupportedException) { } catch (NotSupportedException) { } } } catch (SecurityException) { } _hostType = hostType; return(hostType); }
/// <summary> /// Serializes the enum value. /// </summary> /// <param name="writer">The <see cref="T: Newtonsoft.Json.JsonWriter" /> to write to.</param> /// <param name="value">The object to serialize to JSON.</param> public static void Serialize(JsonWriter writer, HostType?value) { switch (value) { case HostType.Invalid: writer.WriteStringValue("Invalid"); break; case HostType.ExeHost: writer.WriteStringValue("ExeHost"); break; case HostType.ContainerHost: writer.WriteStringValue("ContainerHost"); break; default: throw new ArgumentException($"Invalid value {value.ToString()} for enum type HostType"); } }
/// <summary> /// Initializes a new instance of the DeployedCodePackageInfo class. /// </summary> /// <param name="name">The name of the code package.</param> /// <param name="version">The version of the code package specified in service manifest.</param> /// <param name="serviceManifestName">The name of service manifest that specified this code 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> /// <param name="hostType">Specifies the type of host for main entry point of a code package as specified in service /// manifest. Possible values include: 'Invalid', 'ExeHost', 'ContainerHost'</param> /// <param name="hostIsolationMode">Specifies the isolation mode of main entry point of a code package when it's host /// type is ContainerHost. This is specified as part of container host policies in application manifest while importing /// service manifest. Possible values include: 'None', 'Process', 'HyperV'</param> /// <param name="status">Specifies the status of a deployed application or service package on a Service Fabric node. /// . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating', /// 'RanToCompletion', 'Failed'</param> /// <param name="runFrequencyInterval">The interval at which code package is run. This is used for periodic code /// package.</param> /// <param name="setupEntryPoint">Information about setup or main entry point of a code package deployed on a Service /// Fabric node.</param> /// <param name="mainEntryPoint">Information about setup or main entry point of a code package deployed on a Service /// Fabric node.</param> public DeployedCodePackageInfo( string name = default(string), string version = default(string), string serviceManifestName = default(string), string servicePackageActivationId = default(string), HostType?hostType = default(HostType?), HostIsolationMode?hostIsolationMode = default(HostIsolationMode?), DeploymentStatus?status = default(DeploymentStatus?), string runFrequencyInterval = default(string), CodePackageEntryPoint setupEntryPoint = default(CodePackageEntryPoint), CodePackageEntryPoint mainEntryPoint = default(CodePackageEntryPoint)) { this.Name = name; this.Version = version; this.ServiceManifestName = serviceManifestName; this.ServicePackageActivationId = servicePackageActivationId; this.HostType = hostType; this.HostIsolationMode = hostIsolationMode; this.Status = status; this.RunFrequencyInterval = runFrequencyInterval; this.SetupEntryPoint = setupEntryPoint; this.MainEntryPoint = mainEntryPoint; }
internal static string ToSerializedValue(this HostType?value) => value == null ? null : ((HostType)value).ToSerializedValue();