/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            RegisterApplicationRevisionResponse response = new RegisterApplicationRevisionResponse();


            return(response);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>  
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            RegisterApplicationRevisionResponse response = new RegisterApplicationRevisionResponse();


            return response;
        }
Пример #3
0
        /// <summary>
        /// Registers with AWS CodeDeploy a revision for the specified application.
        /// </summary>
        /// <param name="applicationName">The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account.</param>
        /// <param name="settings">The <see cref="DeploySettings"/> used during the request to AWS.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        public async Task <bool> RegisterApplicationRevision(string applicationName, DeploySettings settings, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (String.IsNullOrEmpty(applicationName))
            {
                throw new ArgumentNullException("applicationName");
            }



            // Create Request
            AmazonCodeDeployClient             client  = this.CreateClient(settings);
            RegisterApplicationRevisionRequest request = new RegisterApplicationRevisionRequest();

            request.ApplicationName = applicationName;

            request.Revision = new RevisionLocation()
            {
                RevisionType = RevisionLocationType.S3,

                S3Location = new S3Location()
                {
                    BundleType = BundleType.Zip,

                    Bucket  = settings.S3Bucket,
                    Key     = settings.S3Key,
                    Version = settings.S3Version
                }
            };



            // Check Response
            RegisterApplicationRevisionResponse response = await client.RegisterApplicationRevisionAsync(request, cancellationToken);

            if (response.HttpStatusCode == HttpStatusCode.OK)
            {
                _Log.Verbose("Successfully deployed application '{0}'", applicationName);
                return(true);
            }
            else
            {
                _Log.Error("Failed to deploy application '{0}'", applicationName);
                return(false);
            }
        }