/// <summary> /// Gets the logs from the container. /// </summary> /// <remarks> /// Gets the logs for the container of the specified code package of the /// service replica. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Azure resource group name /// </param> /// <param name='applicationResourceName'> /// The identity of the application. /// </param> /// <param name='serviceResourceName'> /// The identity of the service. /// </param> /// <param name='replicaName'> /// Service Fabric replica name. /// </param> /// <param name='codePackageName'> /// The name of code package of the service. /// </param> /// <param name='tail'> /// Number of lines to show from the end of the logs. Default is 100. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<ContainerLogs> GetContainerLogsAsync(this ICodePackageOperations operations, string resourceGroupName, string applicationResourceName, string serviceResourceName, string replicaName, string codePackageName, int? tail = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetContainerLogsWithHttpMessagesAsync(resourceGroupName, applicationResourceName, serviceResourceName, replicaName, codePackageName, tail, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); Secret = new SecretOperations(this); SecretValue = new SecretValueOperations(this); Volume = new VolumeOperations(this); Network = new NetworkOperations(this); Gateway = new GatewayOperations(this); Application = new ApplicationOperations(this); Service = new ServiceOperations(this); ServiceReplica = new ServiceReplicaOperations(this); CodePackage = new CodePackageOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2018-09-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <SecretResourcePropertiesBase>("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <SecretResourcePropertiesBase>("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ApplicationScopedVolumeCreationParameters>("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ApplicationScopedVolumeCreationParameters>("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <NetworkResourcePropertiesBase>("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <NetworkResourcePropertiesBase>("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <AutoScalingTrigger>("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <AutoScalingTrigger>("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <AutoScalingMechanism>("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <AutoScalingMechanism>("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <DiagnosticsSinkProperties>("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <DiagnosticsSinkProperties>("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <AutoScalingMetric>("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <AutoScalingMetric>("kind")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Gets the logs from the container. /// </summary> /// <remarks> /// Gets the logs for the container of the specified code package of the /// service replica. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Azure resource group name /// </param> /// <param name='applicationResourceName'> /// The identity of the application. /// </param> /// <param name='serviceResourceName'> /// The identity of the service. /// </param> /// <param name='replicaName'> /// Service Fabric replica name. /// </param> /// <param name='codePackageName'> /// The name of code package of the service. /// </param> /// <param name='tail'> /// Number of lines to show from the end of the logs. Default is 100. /// </param> public static ContainerLogs GetContainerLogs(this ICodePackageOperations operations, string resourceGroupName, string applicationResourceName, string serviceResourceName, string replicaName, string codePackageName, int? tail = default(int?)) { return operations.GetContainerLogsAsync(resourceGroupName, applicationResourceName, serviceResourceName, replicaName, codePackageName, tail).GetAwaiter().GetResult(); }