|
| 1 | +# This work is licensed under the GNU GPLv2 or later. |
| 2 | +# See the COPYING file in the top-level directory. |
| 3 | + |
| 4 | + |
| 5 | +class _BackendBase(object): |
| 6 | + """ |
| 7 | + Backends are thin wrappers around the different bugzilla API paradigms |
| 8 | + (XMLRPC, REST). This base class defines the public API for the rest of |
| 9 | + the code, but this is all internal to the library. |
| 10 | + """ |
| 11 | + def __init__(self, bugzillasession): |
| 12 | + self._bugzillasession = bugzillasession |
| 13 | + |
| 14 | + ################# |
| 15 | + # Internal APIs # |
| 16 | + ################# |
| 17 | + |
| 18 | + def get_xmlrpc_proxy(self): |
| 19 | + """ |
| 20 | + Provides the raw XMLRPC proxy to API users of Bugzilla._proxy |
| 21 | + """ |
| 22 | + raise NotImplementedError() |
| 23 | + |
| 24 | + |
| 25 | + ###################### |
| 26 | + # Bugzilla info APIs # |
| 27 | + ###################### |
| 28 | + |
| 29 | + def bugzilla_version(self): |
| 30 | + """ |
| 31 | + Fetch bugzilla version string |
| 32 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/bugzilla.html#version |
| 33 | + """ |
| 34 | + raise NotImplementedError() |
| 35 | + |
| 36 | + def bugzilla_extensions(self): |
| 37 | + """ |
| 38 | + Return info about Bugzilla extensions |
| 39 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/bugzilla.html#extensions |
| 40 | + """ |
| 41 | + raise NotImplementedError() |
| 42 | + |
| 43 | + |
| 44 | + ####################### |
| 45 | + # Bug attachment APIs # |
| 46 | + ####################### |
| 47 | + |
| 48 | + def bug_attachment_get(self, attachment_ids, paramdict): |
| 49 | + """ |
| 50 | + Fetch bug attachments IDs. One part of: |
| 51 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/attachment.html#get-attachment |
| 52 | + """ |
| 53 | + raise NotImplementedError() |
| 54 | + |
| 55 | + def bug_attachment_get_all(self, bug_ids, paramdict): |
| 56 | + """ |
| 57 | + Fetch all bug attachments IDs. One part of |
| 58 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/attachment.html#get-attachment |
| 59 | + """ |
| 60 | + raise NotImplementedError() |
| 61 | + |
| 62 | + def bug_attachment_create(self, paramdict): |
| 63 | + """ |
| 64 | + Create a bug attachment |
| 65 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/attachment.html#create-attachment |
| 66 | + """ |
| 67 | + raise NotImplementedError() |
| 68 | + |
| 69 | + def bug_attachment_update(self, paramdict): |
| 70 | + """ |
| 71 | + Update a bug attachment |
| 72 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/attachment.html#update-attachment |
| 73 | + """ |
| 74 | + raise NotImplementedError() |
| 75 | + |
| 76 | + |
| 77 | + ############ |
| 78 | + # bug APIs # |
| 79 | + ############ |
| 80 | + |
| 81 | + def bug_comments(self, paramdict): |
| 82 | + """ |
| 83 | + Fetch bug comments |
| 84 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/comment.html#get-comments |
| 85 | + """ |
| 86 | + raise NotImplementedError() |
| 87 | + |
| 88 | + def bug_create(self, paramdict): |
| 89 | + """ |
| 90 | + Create a new bug |
| 91 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#create-bug |
| 92 | + """ |
| 93 | + raise NotImplementedError() |
| 94 | + |
| 95 | + def bug_fields(self, paramdict): |
| 96 | + """ |
| 97 | + Query available bug field values |
| 98 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/field.html#fields |
| 99 | + """ |
| 100 | + raise NotImplementedError() |
| 101 | + |
| 102 | + def bug_get(self, paramdict): |
| 103 | + """ |
| 104 | + Lookup bug data by ID |
| 105 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#get-bug |
| 106 | + """ |
| 107 | + raise NotImplementedError() |
| 108 | + |
| 109 | + def bug_history(self, paramdict): |
| 110 | + """ |
| 111 | + Lookup bug history |
| 112 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#bug-history |
| 113 | + """ |
| 114 | + raise NotImplementedError() |
| 115 | + |
| 116 | + def bug_legal_values(self, paramdict): |
| 117 | + """ |
| 118 | + Old style fields querying |
| 119 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/field.html#legal-values |
| 120 | + """ |
| 121 | + raise NotImplementedError() |
| 122 | + |
| 123 | + def bug_search(self, paramdict): |
| 124 | + """ |
| 125 | + Search/query bugs |
| 126 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#search-bugs |
| 127 | + """ |
| 128 | + raise NotImplementedError() |
| 129 | + |
| 130 | + def bug_update(self, paramdict): |
| 131 | + """ |
| 132 | + Update bugs |
| 133 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#update-bug |
| 134 | + """ |
| 135 | + raise NotImplementedError() |
| 136 | + |
| 137 | + def bug_update_tags(self, paramdict): |
| 138 | + """ |
| 139 | + Update bug tags |
| 140 | + https://www.bugzilla.org/docs/4.4/en/html/api/Bugzilla/WebService/Bug.html#update_tags |
| 141 | + """ |
| 142 | + raise NotImplementedError() |
| 143 | + |
| 144 | + |
| 145 | + ################## |
| 146 | + # Component APIs # |
| 147 | + ################## |
| 148 | + |
| 149 | + def component_create(self, paramdict): |
| 150 | + """ |
| 151 | + Create component |
| 152 | + https://bugzilla.readthedocs.io/en/latest/api/core/v1/component.html#create-component |
| 153 | + """ |
| 154 | + raise NotImplementedError() |
| 155 | + |
| 156 | + def component_update(self, paramdict): |
| 157 | + """ |
| 158 | + Update component |
| 159 | + https://bugzilla.readthedocs.io/en/latest/api/core/v1/component.html#update-component |
| 160 | + """ |
| 161 | + raise NotImplementedError() |
| 162 | + |
| 163 | + |
| 164 | + ################ |
| 165 | + # Product APIs # |
| 166 | + ################ |
| 167 | + |
| 168 | + def product_get(self, paramdict): |
| 169 | + """ |
| 170 | + Fetch product details |
| 171 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/product.html#get-product |
| 172 | + """ |
| 173 | + raise NotImplementedError() |
| 174 | + |
| 175 | + def product_get_accessible(self): |
| 176 | + """ |
| 177 | + List accessible products |
| 178 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/product.html#list-products |
| 179 | + """ |
| 180 | + raise NotImplementedError() |
| 181 | + |
| 182 | + def product_get_enterable(self): |
| 183 | + """ |
| 184 | + List enterable products |
| 185 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/product.html#list-products |
| 186 | + """ |
| 187 | + raise NotImplementedError() |
| 188 | + |
| 189 | + def product_get_selectable(self): |
| 190 | + """ |
| 191 | + List selectable products |
| 192 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/product.html#list-products |
| 193 | + """ |
| 194 | + raise NotImplementedError() |
| 195 | + |
| 196 | + |
| 197 | + ############# |
| 198 | + # User APIs # |
| 199 | + ############# |
| 200 | + |
| 201 | + def user_create(self, paramdict): |
| 202 | + """ |
| 203 | + Create user |
| 204 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/user.html#create-user |
| 205 | + """ |
| 206 | + raise NotImplementedError() |
| 207 | + |
| 208 | + def user_get(self, paramdict): |
| 209 | + """ |
| 210 | + Get user info |
| 211 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/user.html#get-user |
| 212 | + """ |
| 213 | + raise NotImplementedError() |
| 214 | + |
| 215 | + def user_login(self, paramdict): |
| 216 | + """ |
| 217 | + Log in to bugzilla |
| 218 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/user.html#login |
| 219 | + """ |
| 220 | + raise NotImplementedError() |
| 221 | + |
| 222 | + def user_logout(self): |
| 223 | + """ |
| 224 | + Log out of bugzilla |
| 225 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/user.html#logout |
| 226 | + """ |
| 227 | + raise NotImplementedError() |
| 228 | + |
| 229 | + def user_update(self, paramdict): |
| 230 | + """ |
| 231 | + Update user |
| 232 | + http://bugzilla.readthedocs.io/en/latest/api/core/v1/user.html#update-user |
| 233 | + """ |
| 234 | + raise NotImplementedError() |
0 commit comments