Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pyrax/cloudcdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ def delete_assets(self, url=None, all=False):
class CloudCDNServiceManager(BaseManager):

def create(self, name, flavor_id, domains, origins,
restrictions=None, caching=None):
restrictions=None, caching=None, log_delivery=False):

body = {"name": name,
"flavor_id": flavor_id,
"domains": domains,
"origins": origins,
"restrictions": restrictions or [],
"caching": caching or []}
"caching": caching or [],
"log_delivery": {"enabled": bool(log_delivery)}}
resp, resp_body = self.api.method_post("/%s" % self.uri_base,
body=body)

Expand Down Expand Up @@ -150,7 +151,7 @@ def get_service(self, service_id):
return self._services_manager.get(service_id)

def create_service(self, name, flavor_id, domains, origins,
restrictions=None, caching=None):
restrictions=None, caching=None, log_delivery=False):
"""Create a new CDN service.

Arguments:
Expand All @@ -168,7 +169,8 @@ def create_service(self, name, flavor_id, domains, origins,

"""
return self._services_manager.create(name, flavor_id, domains, origins,
restrictions, caching)
restrictions, caching,
log_delivery)

def patch_service(self, service_id, changes):
"""Update a CDN service with a patch
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cloud_cdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_get_service(self, mock_get):
@mock.patch("pyrax.cloudcdn.CloudCDNServiceManager.create")
def test_create_service(self, mock_create):
sot = CloudCDNClient(mock.MagicMock())
args = (1, 2, 3, 4, 5, 6)
args = (1, 2, 3, 4, 5, 6, 7)
sot.create_service(*args)
mock_create.assert_called_once_with(*args)

Expand Down