Commit Graph

2036 Commits

Author SHA1 Message Date
Andrii Piasetskyi
e749858041 Added DataPipeline Tags. Implemented delete_pipeline. Added tests for delete_pipeline 2017-04-21 21:24:52 +03:00
Steve Pulec
df84675ae6 Merge pull request #897 from gjtempleton/TaskDraining
ContainerInstance deregistration
2017-04-15 23:47:47 -04:00
Steve Pulec
e9bf74d8e3 Merge pull request #904 from ambrusadrianz/master
Fixed S3 copyObject compatibility with the Java AWS SDK
2017-04-15 23:46:21 -04:00
Steve Pulec
a83a235637 Merge pull request #903 from mvantellingen/ecs-deployments
Add deployments to the ecs services (describe_services)
2017-04-15 23:46:02 -04:00
Steve Pulec
cc123dafb9 Merge pull request #902 from mvantellingen/ecs-revision
Return the revision in ecs.register_task_definition
2017-04-15 23:45:42 -04:00
Steve Pulec
de28e7ff78 Merge pull request #901 from niamster/i821
s3: handle WebsiteRedirectLocation
2017-04-15 23:44:38 -04:00
GuyTempleton
47bc23f481
Move agent_connected assignation 2017-04-15 16:31:19 +01:00
Ambrus Adrian
121a68be49 Fixed compatibility issue with the Java AWS SDK
Issue is described here: https://github.com/spulec/moto/issues/900
2017-04-15 01:06:28 +03:00
Michael van Tellingen
0ae6e404d0 Add deployments to the ecs services (describe_services) 2017-04-14 18:40:47 +02:00
Michael van Tellingen
18ed73292c Return the revision in ecs.register_task_definition
This matches boto, see
http://boto3.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.register_task_definition
2017-04-14 18:16:24 +02:00
Dmytro Milinevskyy
6e61ee4caa s3: handle WebsiteRedirectLocation
spulec/moto#821
2017-04-14 13:32:52 +02:00
Steve Pulec
34c711189f Cleanup IAM user create format. Closes #898. 2017-04-13 21:39:07 -04:00
Steve Pulec
d35e143a20 Merge pull request #899 from smarlowucf/master
Add list user policies endpoint to iam backend.
2017-04-13 21:18:43 -04:00
Sean Marlow
9a2f2fcd4b
Add list user policies endpoint to iam backend.
- Add response and endpoint methods.
- Add test covering put, get, delete and list user policy.
2017-04-13 15:09:23 -06:00
GuyTempleton
69b86b2c7a
Fix indentation of ContainerInstance response object 2017-04-13 18:41:29 +01:00
GuyTempleton
f3aff0f356
Switch ContainerInstance model to snake case 2017-04-13 17:53:23 +01:00
GuyTempleton
acb6c3ce01
Implement container instance deregistration 2017-04-13 17:46:15 +01:00
GuyTempleton
71e8f6ef5b
First cut of container instance deregistration 2017-04-13 08:54:25 +01:00
Steve Pulec
30b1de507c Make ELB created_time dynamic. Closes #887. 2017-04-12 22:25:07 -04:00
Steve Pulec
b62015b27d Add Iam User CreateDate. Closes #886. 2017-04-12 22:19:48 -04:00
Steve Pulec
bf935c210b Fix cloudwatch events delete_rule. Closes #884. 2017-04-12 22:15:23 -04:00
Steve Pulec
23f6f941b1 Merge pull request #895 from gjtempleton/ECSContainerResources
Container Instance Resource implementation
2017-04-12 20:53:06 -04:00
Steve Pulec
a664af465a Merge pull request #892 from whummer/fix/local-domain-names
Fix domain handling for local domain names in S3 API
2017-04-12 20:42:15 -04:00
Steve Pulec
03c4d9fe20 Fix standalone server headers not having HTTP_AUTHORIZATION. Closes #874. 2017-04-12 20:40:55 -04:00
Steve Pulec
11edde2eaa Merge pull request #891 from whummer/fix/sqs-wait-time-seconds
Fix SQS message polling to abort after wait_seconds_timeout
2017-04-12 20:27:54 -04:00
Steve Pulec
42f6487c88 Merge pull request #881 from smarlowucf/master
Add mfa device endpoints to iam backend.
2017-04-12 20:23:49 -04:00
Steve Pulec
be7dc36891 Merge pull request #875 from jvgutierrez/eni-az-filter
Implement availability-zone filter for DescribeNetworkInterfaces
2017-04-12 20:22:16 -04:00
GuyTempleton
880f3fb950
Container Instance Resource implementation 2017-04-12 13:30:32 +01:00
Waldemar Hummer
b8a41c5605 fix domain handling for local domain names in S3 API 2017-04-08 15:28:51 +10:00
Waldemar Hummer
a5727bf64a fix SQS message polling to abort after wait_seconds_timeout 2017-04-06 21:40:03 +10:00
Sean Marlow
8b9d685f1c
Add mfa device endpoints to iam backend.
- Add mfa device class
- Add mfa devices dictionary to user class
- Add responses, endpoints and tests
2017-03-27 13:13:40 -06:00
Valentín Gutiérrez
6e209bb14c Implement availability-zone filter for DescribeNetworkInterfaces 2017-03-22 14:36:20 +01:00
Steve Pulec
bba197e29f Make IAM ARNs more dynamic. Closes #663. 2017-03-19 11:58:24 -04:00
Steve Pulec
2d05f8a79a Add functionality for iam get-user with current user. Closes #480. 2017-03-19 11:09:30 -04:00
Steve Pulec
a0a205328d Cleanup SQS body encoding. Closes #458, #460. 2017-03-19 11:03:55 -04:00
Steve Pulec
f9b7a0a539 Merge pull request #872 from 2rs2ts/allow-updating-cf-tags
Allow CloudFormation stack tags to be updated
2017-03-18 14:49:48 -04:00
Andrew Garrett
6f4cb512ac Allow CloudFormation stack tags to be updated
Limitations:

* does not update the tags of the resources in the stack. that can be
implemented later.
* does not support the supposed feature of clearing tags by passing an
empty value that boto3 mentions in its documentation. I could not find
anything in the request body to indicate when an empty value was passed.
2017-03-17 23:57:57 +00:00
Steve Pulec
a6e762340d Merge pull request #867 from 2rs2ts/flexible-route53-hostedzoneid-lookup
Be flexible with Route53 Hosted Zone IDs with /hostedzone/ prefix
2017-03-16 22:55:13 -04:00
Andrew Garrett
f2b7ba03b4 Forgot that lstrip works on character sets, not substrings
I suppose this is one way to do it. I could have also split and taken
the last element. Not sure which is best. 🤔
2017-03-17 02:45:58 +00:00
Steve Pulec
c207963a86 Cleanup SNS exceptions. Closes #751. 2017-03-16 22:28:30 -04:00
Steve Pulec
e7a3f3408e Add Lambda header for invoking error. Closes #770. 2017-03-16 22:00:57 -04:00
Steve Pulec
e3bff8b926 Fix cloudformation NoValue parsing to not add attribute. Closes #870 2017-03-16 21:20:01 -04:00
Steve Pulec
042524fe80 Merge pull request #871 from mike-lerch/cpu-100-empty-queue
Prevent 100% cpu usage while SQS long polling on an empty queue
2017-03-16 20:05:18 -04:00
michael_lerch
83084bf2af Prevent 100% cpu usage while SQS long polling on an empty queue
While using moto server with a test SQS client, I noticed significant CPU usage while the client was long polling. I narrowed this down to the `receive_messages` call of the SQS service sitting in a `while True:` statement with no work to be done, thus looping forever.

To produce this issue, I do:
```
$ python3 -m venv venv
$ . ./venv/bin/activate
(venv) $ pip install moto moto[server] boto3
Collecting moto
  Downloading moto-0.4.31-py2.py3-none-any.whl (303kB)
  --snip--
(venv) $ moto_server sqs &
[1] 31727
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
(venv) $ python3
Python 3.6.0 (default, Dec 24 2016, 08:01:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto3
>>> client = boto3.client('sqs', region_name='us-east-1', endpoint_url='http://127.0.0.1:5000');
>>> client.create_queue(QueueName='testing')
127.0.0.1 - - [16/Mar/2017 13:34:20] "POST / HTTP/1.1" 200 -
{'QueueUrl': 'http://sqs.us-east-1.amazonaws.com/123456789012/testing', 'ResponseMetadata': {'RequestId': '7a62c49f-347e-4fc4-9331-6e8e7a96aa73', 'HTTPStatusCode': 200, 'HTTPHeaders': {'content-type': 'text/html; charset=utf-8', 'content-length': '343', 'server': 'Werkzeug/0.12.1 Python/3.6.0', 'date': 'Thu, 16 Mar 2017 20:34:20 GMT'}, 'RetryAttempts': 0}}
>>> client.receive_message(QueueUrl='http://sqs.us-east-1.amazonaws.com/123456789012/testing', MaxNumberOfMessages=10, WaitTimeSeconds=10)
```

At this point the moto server will run at 100% cpu for 10 seconds until the request times out waiting for a message. If multiple clients are continuously reconnected (as in mocking a normal sqs worker setup) the server will sit at 100% cpu indefinitely.

This pull request adds a simple sleep statement to the SQS `receive_messages` call when there are no messages to process. In doing so, the loop will be limited to executing once per 0.001 seconds when the queue is empty. The CPU usage is nearly 0% after this change.
2017-03-16 13:43:45 -07:00
Steve Pulec
a5da348fba Fix lint. 2017-03-15 23:43:48 -04:00
Steve Pulec
25e2af0320 Fix camelcase_to_underscore. Closes #767. 2017-03-15 23:39:36 -04:00
Steve Pulec
446843e756 Fix py3 s3 prefix decoding. 2017-03-15 23:13:09 -04:00
Steve Pulec
e25d1499c2 Update cloudformation for new list types. 2017-03-15 23:02:10 -04:00
Steve Pulec
3899eee648 Fix S3 filtering by unicode prefix. Closes #838 2017-03-15 22:53:27 -04:00
Steve Pulec
8a803cdbaf Better EC2 duplicate SG error. 2017-03-15 22:45:28 -04:00