Example #1
0
 def delete(self, params=None):
     """
     Delete this resource from the server, passing the specified query parameters. If this resource doesn't support
     ``DELETE``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method will only raise errors
     in case of user error.
     """
     r = self._session.delete(self.self, params=params)
     raise_on_error(r)
Example #2
0
 def delete(self, params=None):
     """
     Delete this resource from the server, passing the specified query parameters. If this resource doesn't support
     ``DELETE``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method will only raise errors
     in case of user error.
     """
     r = self._session.delete(self.self, params=params)
     raise_on_error(r)
Example #3
0
    def update(self, **kwargs):
        """
        Update this resource on the server. Keyword arguments are marshalled into a dict before being sent. If this
        resource doesn't support ``PUT``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method
        will only raise errors in case of user error.
        """
        data = {}
        for arg in kwargs:
            data[arg] = kwargs[arg]

        r = self._session.put(self.self, headers={'content-type':'application/json'}, data=json.dumps(data))
        raise_on_error(r)

        self._load(self.self)
Example #4
0
    def update(self, **kwargs):
        """
        Update this resource on the server. Keyword arguments are marshalled into a dict before being sent. If this
        resource doesn't support ``PUT``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method
        will only raise errors in case of user error.
        """
        data = {}
        for arg in kwargs:
            data[arg] = kwargs[arg]

        r = self._session.put(self.self,
                              headers={'content-type': 'application/json'},
                              data=json.dumps(data))
        raise_on_error(r)

        self._load(self.self)
Example #5
0
    def _load(self, url, headers=None, params=None):
        r = self._session.get(url, headers=headers, params=params)
        raise_on_error(r)

        self._parse_raw(json.loads(r.text))
Example #6
0
    def _load(self, url, headers=None, params=None):
        r = self._session.get(url, headers=headers, params=params)
        raise_on_error(r)

        self._parse_raw(json.loads(r.text))