Changeset 2082a78beb17f79bf82cda8b6f185dab85593bbe for src
- Timestamp:
- 09/16/09 15:07:59 (9 years ago)
- git-parent:
- Files:
-
- src/noit_check_rest.c (modified) (1 diff)
- src/noit_rest.c (modified) (3 diffs)
- src/noit_rest.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/noit_check_rest.c
r7f8de6f r2082a78 604 604 noit_check_rest_init() { 605 605 assert(noit_http_rest_register( 606 "GET", 607 "/checks/", 608 "^show(/.*)(?<=/)(" UUID_REGEX ")$", 606 "GET", "/checks/", "^show(/.*)(?<=/)(" UUID_REGEX ")$", 609 607 rest_show_check 610 608 ) == 0); 611 609 assert(noit_http_rest_register( 612 "POST", 613 "/checks/", 614 "^set(/.*)(?<=/)(" UUID_REGEX ")$", 610 "PUT", "/checks/", "^set(/.*)(?<=/)(" UUID_REGEX ")$", 615 611 rest_set_check 616 612 ) == 0); 617 613 assert(noit_http_rest_register( 618 "DELETE", 619 "/checks/", 620 "^delete(/.*)(?<=/)(" UUID_REGEX ")$", 614 "DELETE", "/checks/", "^delete(/.*)(?<=/)(" UUID_REGEX ")$", 621 615 rest_delete_check 622 616 ) == 0); src/noit_rest.c
r7f8de6f r2082a78 214 214 215 215 switch(ac->cmd) { 216 case NOIT_CONTROL_DELETE: 217 primer = "DELE"; 218 break; 219 case NOIT_CONTROL_GET: 220 primer = "GET "; 221 break; 222 case NOIT_CONTROL_HEAD: 223 primer = "HEAD"; 224 break; 216 225 case NOIT_CONTROL_POST: 217 226 primer = "POST"; 218 227 break; 219 case NOIT_CONTROL_GET: 220 primer = "GET "; 221 break; 222 case NOIT_CONTROL_HEAD: 223 primer = "HEAD"; 224 break; 225 case NOIT_CONTROL_DELETE: 226 primer = "DELE"; 228 case NOIT_CONTROL_PUT: 229 primer = "PUT "; 227 230 break; 228 231 default: … … 237 240 eventer_name_callback("http_rest_api/1.0", noit_http_rest_handler); 238 241 noit_control_dispatch_delegate(noit_control_dispatch, 242 NOIT_CONTROL_DELETE, 243 noit_http_rest_handler); 244 noit_control_dispatch_delegate(noit_control_dispatch, 239 245 NOIT_CONTROL_GET, 240 246 noit_http_rest_handler); … … 246 252 noit_http_rest_handler); 247 253 noit_control_dispatch_delegate(noit_control_dispatch, 248 NOIT_CONTROL_ DELETE,249 noit_http_rest_handler); 250 } 251 254 NOIT_CONTROL_PUT, 255 noit_http_rest_handler); 256 } 257 src/noit_rest.h
r7f8de6f r2082a78 42 42 #define NOIT_CONTROL_POST 0x504f5354 /* "POST" */ 43 43 #define NOIT_CONTROL_DELETE 0x44454c45 /* "DELE" */ 44 #define NOIT_CONTROL_PUT 0x50555420 /* "PUT " */ 44 45 45 46 typedef struct noit_http_rest_closure noit_http_rest_closure_t;