o ckF[[C@sXddlZddlmZddlmZddlmZddlmZddl m Z GdddeZ dS) N)json)AWSQueryConnection) RegionInfo)JSONResponseError) exceptionscsReZdZdZdZdZdZdZdZe Z ide j de j d e jd e jd e jd e jd e jde jde jde jde jde jde jde jde jde jde je je je jdZ fddZ!ddZ"ddZ#dd Z$ !d6d"d#Z% !d6d$d%Z&d6d&d'Z'd6d(d)Z( ! ! !d7d*d+Z)d,d-Z*d.d/Z+d0d1Z,d2d3Z-d4d5Z.Z/S)8ConfigServiceConnectionaM AWS Config AWS Config provides a way to keep track of the configurations of all the AWS resources associated with your AWS account. You can use AWS Config to get the current and historical configurations of each AWS resource and also to get information about the relationship between the resources. An AWS resource can be an Amazon Compute Cloud (Amazon EC2) instance, an Elastic Block Store (EBS) volume, an Elastic network Interface (ENI), or a security group. For a complete list of resources currently supported by AWS Config, see `Supported AWS Resources`_. You can access and manage AWS Config through the AWS Management Console, the AWS Command Line Interface (AWS CLI), the AWS Config API, or the AWS SDKs for AWS Config This reference guide contains documentation for the AWS Config API and the AWS CLI commands that you can use to manage AWS Config. The AWS Config API uses the Signature Version 4 protocol for signing requests. For more information about how to sign a request with this protocol, see `Signature Version 4 Signing Process`_. For detailed information about AWS Config features and their associated actions or commands, as well as how to work with AWS Management Console, see `What Is AWS Config?`_ in the AWS Config Developer Guide . z 2014-11-12z us-east-1zconfig.us-east-1.amazonaws.com ConfigServiceStarlingDoveServiceInvalidLimitExceptionNoSuchBucketExceptionInvalidSNSTopicARNExceptionResourceNotDiscoveredException,MaxNumberOfDeliveryChannelsExceededException(LastDeliveryChannelDeleteFailedException#InsufficientDeliveryPolicyExceptionInvalidRoleExceptionInvalidTimeRangeExceptionNoSuchDeliveryChannelException$NoSuchConfigurationRecorderExceptionInvalidS3KeyPrefixException#InvalidDeliveryChannelNameException'NoRunningConfigurationRecorderExceptionValidationException)NoAvailableConfigurationRecorderExceptionInvalidNextTokenException))InvalidConfigurationRecorderNameException#NoAvailableDeliveryChannelException2MaxNumberOfConfigurationRecordersExceededExceptionc s^|dd}|st||j|j}d|vs|ddur|j|d<tt|jdi|||_dS)Nregionhost) poprDefaultRegionNameDefaultRegionEndpointendpointsuperr__init__r)selfkwargsr __class__r ;/usr/lib/python3/dist-packages/boto/configservice/layer1.pyr&[s   z ConfigServiceConnection.__init__cCsdgS)Nzhmac-v4r )r'r r r+_required_auth_capabilitygsz1ConfigServiceConnection._required_auth_capabilitycCd|i}|jdt|dS)a Deletes the specified delivery channel. The delivery channel cannot be deleted if it is the only delivery channel and the configuration recorder is still running. To delete the delivery channel, stop the running configuration recorder using the StopConfigurationRecorder action. :type delivery_channel_name: string :param delivery_channel_name: The name of the delivery channel to delete. DeliveryChannelNameDeleteDeliveryChannelactionbody make_requestrdumpsr'delivery_channel_nameparamsr r r+delete_delivery_channeljsz/ConfigServiceConnection.delete_delivery_channelcCr-)a Schedules delivery of a configuration snapshot to the Amazon S3 bucket in the specified delivery channel. After the delivery has started, AWS Config sends following notifications using an Amazon SNS topic that you have specified. + Notification of starting the delivery. + Notification of delivery completed, if the delivery was successfully completed. + Notification of delivery failure, if the delivery failed to complete. :type delivery_channel_name: string :param delivery_channel_name: The name of the delivery channel through which the snapshot is delivered. deliveryChannelNameDeliverConfigSnapshotr0r3r6r r r+deliver_config_snapshot}sz/ConfigServiceConnection.deliver_config_snapshotNcC(i}|dur ||d<|jdt|dS)a( Returns the current status of the specified configuration recorder. If a configuration recorder is not specified, this action returns the status of all configuration recorder associated with the account. :type configuration_recorder_names: list :param configuration_recorder_names: The name(s) of the configuration recorder. If the name is not specified, the action returns the current status of all the configuration recorders associated with the account. NConfigurationRecorderNames#DescribeConfigurationRecorderStatusr0r3r'configuration_recorder_namesr8r r r+&describe_configuration_recorder_statuss z>ConfigServiceConnection.describe_configuration_recorder_statuscCr=)a Returns the name of one or more specified configuration recorders. If the recorder name is not specified, this action returns the names of all the configuration recorders associated with the account. :type configuration_recorder_names: list :param configuration_recorder_names: A list of configuration recorder names. Nr>DescribeConfigurationRecordersr0r3r@r r r+ describe_configuration_recorderss  z8ConfigServiceConnection.describe_configuration_recorderscCr=)ab Returns the current status of the specified delivery channel. If a delivery channel is not specified, this action returns the current status of all delivery channels associated with the account. :type delivery_channel_names: list :param delivery_channel_names: A list of delivery channel names. NDeliveryChannelNamesDescribeDeliveryChannelStatusr0r3r'delivery_channel_namesr8r r r+ describe_delivery_channel_statuss  z8ConfigServiceConnection.describe_delivery_channel_statuscCr=)aK Returns details about the specified delivery channel. If a delivery channel is not specified, this action returns the details of all delivery channels associated with the account. :type delivery_channel_names: list :param delivery_channel_names: A list of delivery channel names. NrEDescribeDeliveryChannelsr0r3rGr r r+describe_delivery_channelss  z2ConfigServiceConnection.describe_delivery_channelsc Csn||d}|dur ||d<|dur||d<|dur||d<|dur%||d<|dur-||d<|jdt|d S) ab Returns a list of configuration items for the specified resource. The list contains details about each state of the resource during the specified time interval. You can specify a `limit` on the number of results returned on the page. If a limit is specified, a `nextToken` is returned as part of the result that you can use to continue this request. :type resource_type: string :param resource_type: The resource type. :type resource_id: string :param resource_id: The ID of the resource (for example., `sg-xxxxxx`). :type later_time: timestamp :param later_time: The time stamp that indicates a later time. If not specified, current time is taken. :type earlier_time: timestamp :param earlier_time: The time stamp that indicates an earlier time. If not specified, the action returns paginated results that contain configuration items that start from when the first configuration item was recorded. :type chronological_order: string :param chronological_order: The chronological order for configuration items listed. By default the results are listed in reverse chronological order. :type limit: integer :param limit: The maximum number of configuration items returned in each page. The default is 10. You cannot specify a limit greater than 100. :type next_token: string :param next_token: An optional parameter used for pagination of the results. ) resourceType resourceIdN laterTime earlierTimechronologicalOrderlimit nextTokenGetResourceConfigHistoryr0r3) r' resource_type resource_id later_time earlier_timechronological_orderrQ next_tokenr8r r r+get_resource_config_historys ,z3ConfigServiceConnection.get_resource_config_historycCr-)a Creates a new configuration recorder to record the resource configurations. You can use this action to change the role ( `roleARN`) of an existing recorder. To change the role, call the action on the existing configuration recorder and specify a role. :type configuration_recorder: dict :param configuration_recorder: The configuration recorder object that records each configuration change made to the resources. The format should follow: {'name': 'myrecorder', 'roleARN': 'arn:aws:iam::123456789012:role/trusted-aws-config'} ConfigurationRecorderPutConfigurationRecorderr0r3)r'configuration_recorderr8r r r+put_configuration_recordersz2ConfigServiceConnection.put_configuration_recordercCr-)a_ Creates a new delivery channel object to deliver the configuration information to an Amazon S3 bucket, and to an Amazon SNS topic. You can use this action to change the Amazon S3 bucket or an Amazon SNS topic of the existing delivery channel. To change the Amazon S3 bucket or an Amazon SNS topic, call this action and specify the changed values for the S3 bucket and the SNS topic. If you specify a different value for either the S3 bucket or the SNS topic, this action will keep the existing value for the parameter that is not changed. :type delivery_channel: dict :param delivery_channel: The configuration delivery channel object that delivers the configuration information to an Amazon S3 bucket, and to an Amazon SNS topic. DeliveryChannelPutDeliveryChannelr0r3)r'delivery_channelr8r r r+put_delivery_channel/sz,ConfigServiceConnection.put_delivery_channelcCr-)a Starts recording configurations of all the resources associated with the account. You must have created at least one delivery channel to successfully start the configuration recorder. :type configuration_recorder_name: string :param configuration_recorder_name: The name of the recorder object that records each configuration change made to the resources. ConfigurationRecorderNameStartConfigurationRecorderr0r3r'configuration_recorder_namer8r r r+start_configuration_recorderGs z4ConfigServiceConnection.start_configuration_recordercCr-)a4 Stops recording configurations of all the resources associated with the account. :type configuration_recorder_name: string :param configuration_recorder_name: The name of the recorder object that records each configuration change made to the resources. rcStopConfigurationRecorderr0r3rer r r+stop_configuration_recorderZs  z3ConfigServiceConnection.stop_configuration_recorderc Csd|j|f|jjdtt|d}|jdddi||d}|j|ddd}|d }t j ||j d kr@|r>t |SdSt |}|d d}|j||j} | |j |j|d ) Nz%s.%szapplication/x-amz-json-1.1)z X-Amz-TargetHostz Content-TypezContent-LengthPOST/)methodpath auth_pathr8headersdata )senderoverride_num_retrieszutf-8__type)r2) TargetPrefixrr$strlenbuild_base_http_request_mexereaddecodebotologdebugstatusrloadsget_faults ResponseErrorreason) r'r1r2rp http_requestresponse response_body json_body fault_nameexception_classr r r+r4js0        z$ConfigServiceConnection.make_request)N)NNNNN)0__name__ __module__ __qualname____doc__ APIVersionr"r# ServiceNamerwrrrr r r r rrrrrrrrrrrrrrrrrr&r,r9r<rBrDrIrKrZr^rbrgrir4 __classcell__r r r)r+rs           <r) r~ boto.compatrboto.connectionrboto.regioninforboto.exceptionrboto.configservicerrr r r r+s