Joe Gregorio | 351b149 | 2011-05-08 23:32:46 -0700 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: class Resource</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | <p> |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 7 | <tr bgcolor="#ffc8d8"> |
| 8 | <td colspan=3 valign=bottom> <br> |
| 9 | <font color="#000000" face="helvetica, arial"><a name="Resource">class <strong>Resource</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 10 | |
| 11 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 12 | <td colspan=2><tt>A class for interacting with a resource.<br> </tt></td></tr> |
| 13 | <tr><td> </td> |
| 14 | <td width="100%">Methods defined here:<br> |
| 15 | <dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl> |
| 16 | |
| 17 | <dl><dt><a name="Resource-delete"><strong>delete</strong></a> = method(self, **kwargs)</dt><dd><tt>Delete a task from a TaskQueue.<br> |
| 18 | <br> |
| 19 | Args:<br> |
| 20 | task: string, The id of the task to delete. (required)<br> |
| 21 | taskqueue: string, The taskqueue to delete a task from. (required)<br> |
| 22 | project: string, The project under which the queue lies. (required)</tt></dd></dl> |
| 23 | |
| 24 | <dl><dt><a name="Resource-get"><strong>get</strong></a> = method(self, **kwargs)</dt><dd><tt>Get a particular task from a TaskQueue.<br> |
| 25 | <br> |
| 26 | Args:<br> |
| 27 | task: string, The task to get properties of. (required)<br> |
| 28 | taskqueue: string, The taskqueue in which the task belongs. (required)<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame^] | 29 | project: string, The project under which the queue lies. (required)<br> |
| 30 | <br> |
| 31 | Returns:<br> |
| 32 | An object of the form<br> |
| 33 | <br> |
| 34 | {<br> |
| 35 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 36 | "leaseTimestamp": "A String", # Time (in seconds since the epoch) at which the task lease will expire. This value is 0 if the task isnt currently leased out to a worker.<br> |
| 37 | "id": "A String", # Name of the task.<br> |
| 38 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 39 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 40 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 41 | }</tt></dd></dl> |
Joe Gregorio | 351b149 | 2011-05-08 23:32:46 -0700 | [diff] [blame] | 42 | |
| 43 | <dl><dt><a name="Resource-lease"><strong>lease</strong></a> = method(self, **kwargs)</dt><dd><tt>Lease 1 or more tasks from a TaskQueue.<br> |
| 44 | <br> |
| 45 | Args:<br> |
| 46 | body: object, The request body. (required)<br> |
| 47 | leaseSecs: integer, The lease in seconds. (required)<br> |
| 48 | taskqueue: string, The taskqueue to lease a task from. (required)<br> |
| 49 | project: string, The project under which the queue lies. (required)<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame^] | 50 | numTasks: integer, The number of tasks to lease. (required)<br> |
| 51 | <br> |
| 52 | Returns:<br> |
| 53 | An object of the form<br> |
| 54 | <br> |
| 55 | {<br> |
| 56 | "items": [ # The actual list of tasks returned as a result of the lease operation.<br> |
| 57 | {<br> |
| 58 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 59 | "leaseTimestamp": "A String", # Time (in seconds since the epoch) at which the task lease will expire. This value is 0 if the task isnt currently leased out to a worker.<br> |
| 60 | "id": "A String", # Name of the task.<br> |
| 61 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 62 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 63 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 64 | },<br> |
| 65 | ],<br> |
| 66 | "kind": "taskqueue#tasks", # The kind of object returned, a list of tasks.<br> |
| 67 | }</tt></dd></dl> |
Joe Gregorio | 351b149 | 2011-05-08 23:32:46 -0700 | [diff] [blame] | 68 | |
| 69 | <dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>List Tasks in a TaskQueue<br> |
| 70 | <br> |
| 71 | Args:<br> |
| 72 | taskqueue: string, The id of the taskqueue to list tasks from. (required)<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame^] | 73 | project: string, The project under which the queue lies. (required)<br> |
| 74 | <br> |
| 75 | Returns:<br> |
| 76 | An object of the form<br> |
| 77 | <br> |
| 78 | {<br> |
| 79 | "items": [ # The actual list of tasks currently active in the TaskQueue.<br> |
| 80 | {<br> |
| 81 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 82 | "leaseTimestamp": "A String", # Time (in seconds since the epoch) at which the task lease will expire. This value is 0 if the task isnt currently leased out to a worker.<br> |
| 83 | "id": "A String", # Name of the task.<br> |
| 84 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 85 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 86 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 87 | },<br> |
| 88 | ],<br> |
| 89 | "kind": "taskqueues#tasks", # The kind of object returned, a list of tasks.<br> |
| 90 | }</tt></dd></dl> |
Joe Gregorio | 351b149 | 2011-05-08 23:32:46 -0700 | [diff] [blame] | 91 | |
| 92 | <hr> |
| 93 | Data descriptors defined here:<br> |
| 94 | <dl><dt><strong>__dict__</strong></dt> |
| 95 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 96 | </dl> |
| 97 | <dl><dt><strong>__weakref__</strong></dt> |
| 98 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 99 | </dl> |
| 100 | </td></tr></table> |
| 101 | </body></html> |