Ejemplo n.º 1
0
 def create(self, request):
     """Create a modern site"""
     response = SPSiteCreationResponse()
     qry = ServiceOperationQuery(self, "Create", None, request, "request",
                                 response)
     self.context.add_query(qry)
     return response
Ejemplo n.º 2
0
 def get_status(self, url):
     """Get the status of a SharePoint site"""
     response = SPSiteCreationResponse()
     qry = ServiceOperationQuery(self, "Status", None, {'url': url}, None,
                                 response)
     self.context.add_query(qry)
     self.context.get_pending_request(
     ).beforeExecute += self._construct_status_request
     return response
    def get_status(self, site_url):
        """Get the status of a SharePoint site"""
        response = SPSiteCreationResponse()
        qry = ServiceOperationQuery(self, "Status", None, {'url': site_url}, None, response)
        self.context.add_query(qry)

        def _construct_status_request(request):
            request.method = HttpMethod.Get
            request.url += "?url='{0}'".format(site_url)

        self.context.before_execute(_construct_status_request)
        return response