How to use the boto.compat.json.dumps function in boto

To help you get started, we’ve selected a few boto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ansible / awx / awx / lib / site-packages / boto / opsworks / layer1.py View on Github external
if use_custom_cookbooks is not None:
            params['UseCustomCookbooks'] = use_custom_cookbooks
        if use_opsworks_security_groups is not None:
            params['UseOpsworksSecurityGroups'] = use_opsworks_security_groups
        if custom_cookbooks_source is not None:
            params['CustomCookbooksSource'] = custom_cookbooks_source
        if default_ssh_key_name is not None:
            params['DefaultSshKeyName'] = default_ssh_key_name
        if clone_permissions is not None:
            params['ClonePermissions'] = clone_permissions
        if clone_app_ids is not None:
            params['CloneAppIds'] = clone_app_ids
        if default_root_device_type is not None:
            params['DefaultRootDeviceType'] = default_root_device_type
        return self.make_request(action='CloneStack',
                                 body=json.dumps(params))
github boto / boto / boto / cloudsearch2 / search.py View on Github external
params['q'] = self.q

        if self.parser:
            params['q.parser'] = self.parser

        if self.fq:
            params['fq'] = self.fq

        if self.expr:
            for k, v in six.iteritems(self.expr):
                params['expr.%s' % k] = v

        if self.facet:
            for k, v in six.iteritems(self.facet):
                if not isinstance(v, six.string_types):
                    v = json.dumps(v)
                params['facet.%s' % k] = v

        if self.highlight:
            for k, v in six.iteritems(self.highlight):
                params['highlight.%s' % k] = v

        if self.options:
            params['q.options'] = self.options

        if self.return_fields:
            params['return'] = ','.join(self.return_fields)

        if self.partial is not None:
            params['partial'] = self.partial

        if self.sort:
github ansible / awx / awx / lib / site-packages / boto / dynamodb / layer1.py View on Github external
:type return_values: str
        :param return_values: Controls the return of attribute
            name-value pairs before then were changed.  Possible
            values are: None or 'ALL_OLD'. If 'ALL_OLD' is
            specified and the item is overwritten, the content
            of the old item is returned.
        """
        data = {'TableName': table_name,
                'Key': key,
                'AttributeUpdates': attribute_updates}
        if expected:
            data['Expected'] = expected
        if return_values:
            data['ReturnValues'] = return_values
        json_input = json.dumps(data)
        return self.make_request('UpdateItem', json_input,
                                 object_hook=object_hook)
github cloudera / hue / desktop / core / ext-py / boto-2.46.1 / boto / opsworks / layer1.py View on Github external
Reboots a specified instance. For more information, see
        `Starting, Stopping, and Rebooting Instances`_.

        **Required Permissions**: To use this action, an IAM user must
        have a Manage permissions level for the stack, or an attached
        policy that explicitly grants permissions. For more
        information on user permissions, see `Managing User
        Permissions`_.

        :type instance_id: string
        :param instance_id: The instance ID.

        """
        params = {'InstanceId': instance_id, }
        return self.make_request(action='RebootInstance',
                                 body=json.dumps(params))
github boto / boto / boto / kms / layer1.py View on Github external
def update_key_description(self, key_id, description):
        """
        

        :type key_id: string
        :param key_id:

        :type description: string
        :param description:

        """
        params = {'KeyId': key_id, 'Description': description, }
        return self.make_request(action='UpdateKeyDescription',
                                 body=json.dumps(params))
github ansible / awx / awx / lib / site-packages / boto / kinesis / layer1.py View on Github external
range for a given shard constitutes a set of ordered contiguous
            positive integers. The value for `NewStartingHashKey` must be in
            the range of hash keys being mapped into the shard. The
            `NewStartingHashKey` hash key value and all higher hash key values
            in hash key range are distributed to one of the child shards. All
            the lower hash key values in the range are distributed to the other
            child shard.

        """
        params = {
            'StreamName': stream_name,
            'ShardToSplit': shard_to_split,
            'NewStartingHashKey': new_starting_hash_key,
        }
        return self.make_request(action='SplitShard',
                                 body=json.dumps(params))
github cloudera / hue / desktop / core / ext-py / boto-2.46.1 / boto / opsworks / layer1.py View on Github external
:type stack_id: string
        :param stack_id: The stack ID that the instances are registered with.
            The operation returns descriptions of all registered Amazon RDS
            instances.

        :type rds_db_instance_arns: list
        :param rds_db_instance_arns: An array containing the ARNs of the
            instances to be described.

        """
        params = {'StackId': stack_id, }
        if rds_db_instance_arns is not None:
            params['RdsDbInstanceArns'] = rds_db_instance_arns
        return self.make_request(action='DescribeRdsDbInstances',
                                 body=json.dumps(params))
github boto / boto / boto / cognito / identity / layer1.py View on Github external
the database. The service will return a pagination token as a part
            of the response. This token can be used to call the API again and
            get results starting from the 11th match.

        """
        params = {'IdentityPoolId': identity_pool_id, }
        if identity_id is not None:
            params['IdentityId'] = identity_id
        if developer_user_identifier is not None:
            params['DeveloperUserIdentifier'] = developer_user_identifier
        if max_results is not None:
            params['MaxResults'] = max_results
        if next_token is not None:
            params['NextToken'] = next_token
        return self.make_request(action='LookupDeveloperIdentity',
                                 body=json.dumps(params))
github boto / boto / boto / cloudsearch / document.py View on Github external
def get_sdf(self):
        """
        Generate the working set of documents in Search Data Format (SDF)

        :rtype: string
        :returns: JSON-formatted string of the documents in SDF
        """

        return self._sdf if self._sdf else json.dumps(self.documents_batch)
github cloudera / hue / desktop / core / ext-py / boto-2.46.1 / boto / cognito / sync / layer1.py View on Github external
Cognito. This is the ID of the pool to modify.

        :type push_sync: dict
        :param push_sync: Configuration options to be applied to the identity
            pool.

        """

        uri = '/identitypools/{0}/configuration'.format(identity_pool_id)
        params = {}
        headers = {}
        query_params = {}
        if push_sync is not None:
            params['PushSync'] = push_sync
        return self.make_request('POST', uri, expected_status=200,
                                 data=json.dumps(params), headers=headers,
                                 params=query_params)