示例#1
0
 def set_iteminfo(self, new_info):
     """
     Sets the item info (description, summary, tags, etc.) for the service.  Note that this will completely 
     overwrite the existing item info, so make sure all attributes are included.
     """
     r = create_operation_request(
                 self._url_base, self.name, self._type, "iteminfo/edit", self.folder)
     r.data = {"serviceItemInfo": dumps(new_info)}
     return send_session_request(self._session, r).json()
示例#2
0
    def set_properties(self, new_properties):
        """
        Sets the properties of the service. Note that this will completely overwrite the existing service properties,
        so make sure all attributes are included.
        """
        r = create_operation_request(
                    self._url_base, self.name, self._type, "edit", self.folder)
        r.data = {"service": dumps(new_properties)}
        response = send_session_request(self._session, r).json()

        #self._properties set after HTTP request incase exception is thrown
        self._properties = deepcopy(new_properties)
        return response
示例#3
0
 def get_iteminfo(self):
     """
     Gets the item info (description, summary, tags, etc.) of the service.
     """
     return send_session_request(self._session, create_operation_request(
                 self._url_base, self.name, self._type, "iteminfo", self.folder)).json()
示例#4
0
 def get_status(self):
     """
     Gets the current status of the ArcGIS Service.
     """
     return send_session_request(self._session, create_operation_request(
                 self._url_base, self.name, self._type, "status", self.folder)).json()
示例#5
0
 def get_statistics(self):
     """
     Gets statistics for the ArcGIS Service.
     """
     return send_session_request(self._session, create_operation_request(
                 self._url_base, self.name, self._type, "statistics", self.folder)).json()
示例#6
0
 def start_service(self):
     """
     Starts the ArcGIS Service.
     """
     return send_session_request(self._session, create_operation_request(
                 self._url_base, self.name, self._type, "start", self.folder)).json()