Esempio n. 1
0
        /// <summary>
        /// Paid container software products sold through AWS Marketplace must integrate with
        /// the AWS Marketplace Metering Service and call the RegisterUsage operation for software
        /// entitlement and metering. Calling RegisterUsage from containers running outside of
        /// ECS is not currently supported. Free and BYOL products for ECS aren't required to
        /// call RegisterUsage, but you may choose to do so if you would like to receive usage
        /// data in your seller reports. The sections below explain the behavior of RegisterUsage.
        /// RegisterUsage performs two primary functions: metering and entitlement.
        ///
        ///  <ul> <li>
        /// <para>
        ///  <i>Entitlement</i>: RegisterUsage allows you to verify that the customer running
        /// your paid software is subscribed to your product on AWS Marketplace, enabling you
        /// to guard against unauthorized use. Your container image that integrates with RegisterUsage
        /// is only required to guard against unauthorized use at container startup, as such a
        /// CustomerNotSubscribedException/PlatformNotSupportedException will only be thrown on
        /// the initial call to RegisterUsage. Subsequent calls from the same Amazon ECS task
        /// instance (e.g. task-id) will not throw a CustomerNotSubscribedException, even if the
        /// customer unsubscribes while the Amazon ECS task is still running.
        /// </para>
        ///  </li> <li>
        /// <para>
        ///  <i>Metering</i>: RegisterUsage meters software use per ECS task, per hour, with usage
        /// prorated to the second. A minimum of 1 minute of usage applies to tasks that are short
        /// lived. For example, if a customer has a 10 node ECS cluster and creates an ECS service
        /// configured as a Daemon Set, then ECS will launch a task on all 10 cluster nodes and
        /// the customer will be charged: (10 * hourly_rate). Metering for software use is automatically
        /// handled by the AWS Marketplace Metering Control Plane -- your software is not required
        /// to perform any metering specific actions, other than call RegisterUsage once for metering
        /// of software use to commence. The AWS Marketplace Metering Control Plane will also
        /// continue to bill customers for running ECS tasks, regardless of the customers subscription
        /// state, removing the need for your software to perform entitlement checks at runtime.
        /// </para>
        ///  </li> </ul>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the RegisterUsage service method.</param>
        ///
        /// <returns>The response from the RegisterUsage service method, as returned by AWSMarketplaceMetering.</returns>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.CustomerNotEntitledException">
        /// Exception thrown when the customer does not have a valid subscription for the product.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.DisabledApiException">
        /// The API is disabled in the Region.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.InternalServiceErrorException">
        /// An internal error has occurred. Retry your request. If the problem persists, post
        /// a message with details on the AWS forums.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.InvalidProductCodeException">
        /// The product code passed does not match the product code used for publishing the product.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.InvalidPublicKeyVersionException">
        /// Public Key version is invalid.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.InvalidRegionException">
        /// RegisterUsage must be called in the same AWS Region the ECS task was launched in.
        /// This prevents a container from hardcoding a Region (e.g. withRegion(“us-east-1”) when
        /// calling RegisterUsage.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.PlatformNotSupportedException">
        /// AWS Marketplace does not support metering usage from the underlying platform. Currently,
        /// only Amazon ECS is supported.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.ThrottlingException">
        /// The calls to the API are throttled.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage">REST API Reference for RegisterUsage Operation</seealso>
        public virtual RegisterUsageResponse RegisterUsage(RegisterUsageRequest request)
        {
            var marshaller   = RegisterUsageRequestMarshaller.Instance;
            var unmarshaller = RegisterUsageResponseUnmarshaller.Instance;

            return(Invoke <RegisterUsageRequest, RegisterUsageResponse>(request, marshaller, unmarshaller));
        }
Esempio n. 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the RegisterUsage operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the RegisterUsage operation on AmazonAWSMarketplaceMeteringClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRegisterUsage
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage">REST API Reference for RegisterUsage Operation</seealso>
        public virtual IAsyncResult BeginRegisterUsage(RegisterUsageRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = RegisterUsageRequestMarshaller.Instance;
            var unmarshaller = RegisterUsageResponseUnmarshaller.Instance;

            return(BeginInvoke <RegisterUsageRequest>(request, marshaller, unmarshaller,
                                                      callback, state));
        }
Esempio n. 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the RegisterUsage operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the RegisterUsage operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage">REST API Reference for RegisterUsage Operation</seealso>
        public virtual Task <RegisterUsageResponse> RegisterUsageAsync(RegisterUsageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = RegisterUsageRequestMarshaller.Instance;
            var unmarshaller = RegisterUsageResponseUnmarshaller.Instance;

            return(InvokeAsync <RegisterUsageRequest, RegisterUsageResponse>(request, marshaller,
                                                                             unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Paid container software products sold through AWS Marketplace must integrate with
        /// the AWS Marketplace Metering Service and call the RegisterUsage operation for software
        /// entitlement and metering. Free and BYOL products for Amazon ECS or Amazon EKS aren't
        /// required to call RegisterUsage, but you may choose to do so if you would like to receive
        /// usage data in your seller reports. The sections below explain the behavior of RegisterUsage.
        /// RegisterUsage performs two primary functions: metering and entitlement.
        /// 
        ///  <ul> <li> 
        /// <para>
        ///  <i>Entitlement</i>: RegisterUsage allows you to verify that the customer running
        /// your paid software is subscribed to your product on AWS Marketplace, enabling you
        /// to guard against unauthorized use. Your container image that integrates with RegisterUsage
        /// is only required to guard against unauthorized use at container startup, as such a
        /// CustomerNotSubscribedException/PlatformNotSupportedException will only be thrown on
        /// the initial call to RegisterUsage. Subsequent calls from the same Amazon ECS task
        /// instance (e.g. task-id) or Amazon EKS pod will not throw a CustomerNotSubscribedException,
        /// even if the customer unsubscribes while the Amazon ECS task or Amazon EKS pod is still
        /// running.
        /// </para>
        ///  </li> <li> 
        /// <para>
        ///  <i>Metering</i>: RegisterUsage meters software use per ECS task, per hour, or per
        /// pod for Amazon EKS with usage prorated to the second. A minimum of 1 minute of usage
        /// applies to tasks that are short lived. For example, if a customer has a 10 node Amazon
        /// ECS or Amazon EKS cluster and a service configured as a Daemon Set, then Amazon ECS
        /// or Amazon EKS will launch a task on all 10 cluster nodes and the customer will be
        /// charged: (10 * hourly_rate). Metering for software use is automatically handled by
        /// the AWS Marketplace Metering Control Plane -- your software is not required to perform
        /// any metering specific actions, other than call RegisterUsage once for metering of
        /// software use to commence. The AWS Marketplace Metering Control Plane will also continue
        /// to bill customers for running ECS tasks and Amazon EKS pods, regardless of the customers
        /// subscription state, removing the need for your software to perform entitlement checks
        /// at runtime.
        /// </para>
        ///  </li> </ul>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the RegisterUsage service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// 
        /// <returns>The response from the RegisterUsage service method, as returned by AWSMarketplaceMetering.</returns>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.CustomerNotEntitledException">
        /// Exception thrown when the customer does not have a valid subscription for the product.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.DisabledApiException">
        /// The API is disabled in the Region.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.InternalServiceErrorException">
        /// An internal error has occurred. Retry your request. If the problem persists, post
        /// a message with details on the AWS forums.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.InvalidProductCodeException">
        /// The product code passed does not match the product code used for publishing the product.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.InvalidPublicKeyVersionException">
        /// Public Key version is invalid.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.InvalidRegionException">
        /// RegisterUsage must be called in the same AWS Region the ECS task was launched in.
        /// This prevents a container from hardcoding a Region (e.g. withRegion(“us-east-1”) when
        /// calling RegisterUsage.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.PlatformNotSupportedException">
        /// AWS Marketplace does not support metering usage from the underlying platform. Currently,
        /// only Amazon ECS is supported.
        /// </exception>
        /// <exception cref="Amazon.AWSMarketplaceMetering.Model.ThrottlingException">
        /// The calls to the API are throttled.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage">REST API Reference for RegisterUsage Operation</seealso>
        public virtual Task<RegisterUsageResponse> RegisterUsageAsync(RegisterUsageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = RegisterUsageRequestMarshaller.Instance;
            options.ResponseUnmarshaller = RegisterUsageResponseUnmarshaller.Instance;

            return InvokeAsync<RegisterUsageResponse>(request, options, cancellationToken);
        }
        internal virtual RegisterUsageResponse RegisterUsage(RegisterUsageRequest request)
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = RegisterUsageRequestMarshaller.Instance;
            options.ResponseUnmarshaller = RegisterUsageResponseUnmarshaller.Instance;

            return Invoke<RegisterUsageResponse>(request, options);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the RegisterUsage operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the RegisterUsage operation on AmazonAWSMarketplaceMeteringClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRegisterUsage
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage">REST API Reference for RegisterUsage Operation</seealso>
        public virtual IAsyncResult BeginRegisterUsage(RegisterUsageRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = RegisterUsageRequestMarshaller.Instance;
            options.ResponseUnmarshaller = RegisterUsageResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }