(self, url_data)
return create_service
Returns POST service with response json.

        :return: a JSON-serializable dictionary matching the format of the JSON
                 response for fastly_client.create_service()
                 ("/service") request.
Returns POST service with response json.
Returns POST service with response json .
def create_service(self, url_data):
        """
        Returns POST service with response json.

        :return: a JSON-serializable dictionary matching the format of the JSON
                 response for fastly_client.create_service()
                 ("/service") request.
        """
        data = {key: value[0] for key, value in url_data}

        publish_key = uuid.uuid4().hex
        service_id = uuid.uuid4().hex
        service_name = data['name']

        self.fastly_cache[service_name] = {
            'service_details': {
                u'comment': '',
                u'locked': False,
                u'updated_at': u'2014-11-13T14:29:10+00:00',
                u'created_at': u'2014-11-13T14:29:10+00:00',
                u'testing': None,
                u'number': 1,
                u'staging': None,
                u'active': None,
                u'service_id': service_id,
                u'deleted_at': None,
                u'inherit_service_id': None,
                u'deployed': None},
            'service_name': service_name
        }
        self.fastly_cache[service_id] = self.fastly_cache[service_name]

        create_service = {
            u'comment': '',
            u'publish_key': publish_key,
            u'name': service_name,
            u'versions': [{u'comment': '', u'locked': u'0',
                           u'service': service_id,
                           u'updated_at': u'2014-11-12T18:43:21',
                           u'created_at': u'2014-11-12T18:43:21',
                           u'testing': None, u'number': u'1',
                           u'staging': None,
                           u'active': None,
                           u'service_id': service_id,
                           u'deleted_at': None,
                           u'inherit_service_id': None,
                           u'deployed': None,
                           u'backend': 0}],
            u'created_at': u'2014-11-12T18:43:21+00:00',
            u'updated_at': u'2014-11-12T18:43:21+00:00',
            u'customer_id': data['customer_id'],
            u'id': service_id}
        return create_service
def create_service ( self , url_data ) : data = { key : value [ 0 ] for key , value in url_data } publish_key = uuid . uuid4 ( ) . hex service_id = uuid . uuid4 ( ) . hex service_name = data [ 'name' ] self . fastly_cache [ service_name ] = { 'service_details' : { u'comment' : '' , u'locked' : False , u'updated_at' : u'2014-11-13T14:29:10+00:00' , u'created_at' : u'2014-11-13T14:29:10+00:00' , u'testing' : None , u'number' : 1 , u'staging' : None , u'active' : None , u'service_id' : service_id , u'deleted_at' : None , u'inherit_service_id' : None , u'deployed' : None } , 'service_name' : service_name } self . fastly_cache [ service_id ] = self . fastly_cache [ service_name ] create_service = { u'comment' : '' , u'publish_key' : publish_key , u'name' : service_name , u'versions' : [ { u'comment' : '' , u'locked' : u'0' , u'service' : service_id , u'updated_at' : u'2014-11-12T18:43:21' , u'created_at' : u'2014-11-12T18:43:21' , u'testing' : None , u'number' : u'1' , u'staging' : None , u'active' : None , u'service_id' : service_id , u'deleted_at' : None , u'inherit_service_id' : None , u'deployed' : None , u'backend' : 0 } ] , u'created_at' : u'2014-11-12T18:43:21+00:00' , u'updated_at' : u'2014-11-12T18:43:21+00:00' , u'customer_id' : data [ 'customer_id' ] , u'id' : service_id } return create_service