Beispiel #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()
Beispiel #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
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()