Example #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, ModifyDBInstanceResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("DBInstance", targetDepth))
                    {
                        var unmarshaller = DBInstanceUnmarshaller.Instance;
                        response.DBInstance = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return;
        }
Example #2
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            ModifyDBInstanceResponse response = new ModifyDBInstanceResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("ModifyDBInstanceResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
        /// <summary>
        /// <para> Modify settings for a DB Instance. You can change one or more database configuration parameters by specifying these parameters and
        /// the new values in the request. </para>
        /// </summary>
        ///
        /// <param name="modifyDBInstanceRequest">Container for the necessary parameters to execute the ModifyDBInstance service method on
        ///           AmazonRDS.</param>
        ///
        /// <returns>The response from the ModifyDBInstance service method, as returned by AmazonRDS.</returns>
        ///
        /// <exception cref="DBParameterGroupNotFoundException"/>
        /// <exception cref="DBInstanceNotFoundException"/>
        /// <exception cref="InvalidDBInstanceStateException"/>
        /// <exception cref="DBSecurityGroupNotFoundException"/>
        /// <exception cref="InvalidDBSecurityGroupStateException"/>
        /// <exception cref="InsufficientDBInstanceCapacityException"/>
        public ModifyDBInstanceResponse ModifyDBInstance(ModifyDBInstanceRequest modifyDBInstanceRequest)
        {
            IRequest <ModifyDBInstanceRequest> request  = new ModifyDBInstanceRequestMarshaller().Marshall(modifyDBInstanceRequest);
            ModifyDBInstanceResponse           response = Invoke <ModifyDBInstanceRequest, ModifyDBInstanceResponse> (request, this.signer, ModifyDBInstanceResponseUnmarshaller.GetInstance());

            return(response);
        }
Example #4
0
    private async Task <string> RenameOldInstance(DBInstance instance)
    {
        string newName = instance.DBInstanceIdentifier + "-old";

        _logger.Info($"Renaming {instance.DBInstanceIdentifier} to {newName}");
        ModifyDBInstanceRequest modifyDBInstanceRequest = new ModifyDBInstanceRequest()
        {
            DBInstanceIdentifier    = instance.DBInstanceIdentifier,
            NewDBInstanceIdentifier = newName,
            ApplyImmediately        = true
        };

        ModifyDBInstanceResponse modifyResponse = await _rdsClient.ModifyDBInstanceAsync(modifyDBInstanceRequest);

        await WaitForDBToHaveName(instance.DbiResourceId, newName);

        _logger.Info("Rename successful.");
        return(newName);
    }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            ModifyDBInstanceResponse response = new ModifyDBInstanceResponse();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("ModifyDBInstanceResult", 2))
                    {
                        response.ModifyDBInstanceResult = ModifyDBInstanceResultUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
            }


            return(response);
        }