/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the pi-2018-02-27.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net; using Amazon.PI.Model; using Amazon.PI.Model.Internal.MarshallTransformations; using Amazon.PI.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.PI { /// /// Implementation for accessing PI /// /// Amazon RDS Performance Insights /// /// Amazon RDS Performance Insights enables you to monitor and explore different dimensions /// of database load based on data captured from a running DB instance. The guide provides /// detailed information about Performance Insights data types, parameters and errors. /// /// /// /// When Performance Insights is enabled, the Amazon RDS Performance Insights API provides /// visibility into the performance of your DB instance. Amazon CloudWatch provides the /// authoritative source for Amazon Web Services service-vended monitoring metrics. Performance /// Insights offers a domain-specific view of DB load. /// /// /// /// DB load is measured as average active sessions. Performance Insights provides the /// data to API consumers as a two-dimensional time-series dataset. The time dimension /// provides DB load data for each time point in the queried time range. Each time point /// decomposes overall load in relation to the requested dimensions, measured at that /// time point. Examples include SQL, Wait event, User, and Host. /// /// /// public partial class AmazonPIClient : AmazonServiceClient, IAmazonPI { private static IServiceMetadata serviceMetadata = new AmazonPIMetadata(); private IPIPaginatorFactory _paginators; /// /// Paginators for the service /// public IPIPaginatorFactory Paginators { get { if (this._paginators == null) { this._paginators = new PIPaginatorFactory(this); } return this._paginators; } } #region Constructors /// /// Constructs AmazonPIClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// public AmazonPIClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonPIConfig()) { } /// /// Constructs AmazonPIClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The region to connect. public AmazonPIClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonPIConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonPIClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The AmazonPIClient Configuration Object public AmazonPIClient(AmazonPIConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonPIClient with AWS Credentials /// /// AWS Credentials public AmazonPIClient(AWSCredentials credentials) : this(credentials, new AmazonPIConfig()) { } /// /// Constructs AmazonPIClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonPIClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonPIConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonPIClient with AWS Credentials and an /// AmazonPIClient Configuration object. /// /// AWS Credentials /// The AmazonPIClient Configuration Object public AmazonPIClient(AWSCredentials credentials, AmazonPIConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonPIClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonPIClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonPIConfig()) { } /// /// Constructs AmazonPIClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonPIClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonPIConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonPIClient with AWS Access Key ID, AWS Secret Key and an /// AmazonPIClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonPIClient Configuration Object public AmazonPIClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonPIConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonPIClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonPIClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonPIConfig()) { } /// /// Constructs AmazonPIClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The region to connect. public AmazonPIClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonPIConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonPIClient with AWS Access Key ID, AWS Secret Key and an /// AmazonPIClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonPIClient Configuration Object public AmazonPIClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonPIConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// /// Creates the signer for the service. /// protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// /// Customize the pipeline /// /// protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline) { pipeline.RemoveHandler(); pipeline.AddHandlerAfter(new AmazonPIEndpointResolver()); } /// /// Capture metadata for the service. /// protected override IServiceMetadata ServiceMetadata { get { return serviceMetadata; } } #endregion #region Dispose /// /// Disposes the service client. /// protected override void Dispose(bool disposing) { base.Dispose(disposing); } #endregion #region DescribeDimensionKeys /// /// For a specific time period, retrieve the top N dimension keys for a metric. /// /// /// /// /// Each response element returns a maximum of 500 bytes. For larger elements, such as /// SQL statements, only the first 500 bytes are returned. /// /// /// /// Container for the necessary parameters to execute the DescribeDimensionKeys service method. /// /// The response from the DescribeDimensionKeys service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for DescribeDimensionKeys Operation public virtual DescribeDimensionKeysResponse DescribeDimensionKeys(DescribeDimensionKeysRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDimensionKeysRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDimensionKeysResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// For a specific time period, retrieve the top N dimension keys for a metric. /// /// /// /// /// Each response element returns a maximum of 500 bytes. For larger elements, such as /// SQL statements, only the first 500 bytes are returned. /// /// /// /// Container for the necessary parameters to execute the DescribeDimensionKeys service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the DescribeDimensionKeys service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for DescribeDimensionKeys Operation public virtual Task DescribeDimensionKeysAsync(DescribeDimensionKeysRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDimensionKeysRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDimensionKeysResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetDimensionKeyDetails /// /// Get the attributes of the specified dimension group for a DB instance or data source. /// For example, if you specify a SQL ID, GetDimensionKeyDetails retrieves /// the full text of the dimension db.sql.statement associated with this /// ID. This operation is useful because GetResourceMetrics and DescribeDimensionKeys /// don't support retrieval of large SQL statement text. /// /// Container for the necessary parameters to execute the GetDimensionKeyDetails service method. /// /// The response from the GetDimensionKeyDetails service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for GetDimensionKeyDetails Operation public virtual GetDimensionKeyDetailsResponse GetDimensionKeyDetails(GetDimensionKeyDetailsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetDimensionKeyDetailsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetDimensionKeyDetailsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Get the attributes of the specified dimension group for a DB instance or data source. /// For example, if you specify a SQL ID, GetDimensionKeyDetails retrieves /// the full text of the dimension db.sql.statement associated with this /// ID. This operation is useful because GetResourceMetrics and DescribeDimensionKeys /// don't support retrieval of large SQL statement text. /// /// Container for the necessary parameters to execute the GetDimensionKeyDetails service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetDimensionKeyDetails service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for GetDimensionKeyDetails Operation public virtual Task GetDimensionKeyDetailsAsync(GetDimensionKeyDetailsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetDimensionKeyDetailsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetDimensionKeyDetailsResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetResourceMetadata /// /// Retrieve the metadata for different features. For example, the metadata might indicate /// that a feature is turned on or off on a specific DB instance. /// /// Container for the necessary parameters to execute the GetResourceMetadata service method. /// /// The response from the GetResourceMetadata service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for GetResourceMetadata Operation public virtual GetResourceMetadataResponse GetResourceMetadata(GetResourceMetadataRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetResourceMetadataRequestMarshaller.Instance; options.ResponseUnmarshaller = GetResourceMetadataResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Retrieve the metadata for different features. For example, the metadata might indicate /// that a feature is turned on or off on a specific DB instance. /// /// Container for the necessary parameters to execute the GetResourceMetadata service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetResourceMetadata service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for GetResourceMetadata Operation public virtual Task GetResourceMetadataAsync(GetResourceMetadataRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetResourceMetadataRequestMarshaller.Instance; options.ResponseUnmarshaller = GetResourceMetadataResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetResourceMetrics /// /// Retrieve Performance Insights metrics for a set of data sources over a time period. /// You can provide specific dimension groups and dimensions, and provide aggregation /// and filtering criteria for each group. /// /// /// /// Each response element returns a maximum of 500 bytes. For larger elements, such as /// SQL statements, only the first 500 bytes are returned. /// /// /// /// Container for the necessary parameters to execute the GetResourceMetrics service method. /// /// The response from the GetResourceMetrics service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for GetResourceMetrics Operation public virtual GetResourceMetricsResponse GetResourceMetrics(GetResourceMetricsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetResourceMetricsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetResourceMetricsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Retrieve Performance Insights metrics for a set of data sources over a time period. /// You can provide specific dimension groups and dimensions, and provide aggregation /// and filtering criteria for each group. /// /// /// /// Each response element returns a maximum of 500 bytes. For larger elements, such as /// SQL statements, only the first 500 bytes are returned. /// /// /// /// Container for the necessary parameters to execute the GetResourceMetrics service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetResourceMetrics service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for GetResourceMetrics Operation public virtual Task GetResourceMetricsAsync(GetResourceMetricsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetResourceMetricsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetResourceMetricsResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region ListAvailableResourceDimensions /// /// Retrieve the dimensions that can be queried for each specified metric type on a specified /// DB instance. /// /// Container for the necessary parameters to execute the ListAvailableResourceDimensions service method. /// /// The response from the ListAvailableResourceDimensions service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for ListAvailableResourceDimensions Operation public virtual ListAvailableResourceDimensionsResponse ListAvailableResourceDimensions(ListAvailableResourceDimensionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAvailableResourceDimensionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAvailableResourceDimensionsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Retrieve the dimensions that can be queried for each specified metric type on a specified /// DB instance. /// /// Container for the necessary parameters to execute the ListAvailableResourceDimensions service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the ListAvailableResourceDimensions service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for ListAvailableResourceDimensions Operation public virtual Task ListAvailableResourceDimensionsAsync(ListAvailableResourceDimensionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAvailableResourceDimensionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAvailableResourceDimensionsResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region ListAvailableResourceMetrics /// /// Retrieve metrics of the specified types that can be queried for a specified DB instance. /// /// Container for the necessary parameters to execute the ListAvailableResourceMetrics service method. /// /// The response from the ListAvailableResourceMetrics service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for ListAvailableResourceMetrics Operation public virtual ListAvailableResourceMetricsResponse ListAvailableResourceMetrics(ListAvailableResourceMetricsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAvailableResourceMetricsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAvailableResourceMetricsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Retrieve metrics of the specified types that can be queried for a specified DB instance. /// /// Container for the necessary parameters to execute the ListAvailableResourceMetrics service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the ListAvailableResourceMetrics service method, as returned by PI. /// /// The request failed due to an unknown error. /// /// /// One of the arguments provided is invalid for this request. /// /// /// The user is not authorized to perform this request. /// /// REST API Reference for ListAvailableResourceMetrics Operation public virtual Task ListAvailableResourceMetricsAsync(ListAvailableResourceMetricsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAvailableResourceMetricsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAvailableResourceMetricsResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }