Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [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 | project: string, The project under which the queue lies. (required)<br> |
| 21 | pp: string, A parameter<br> |
| 22 | task: string, The id of the task to delete. (required)<br> |
| 23 | trace: string, A parameter<br> |
| 24 | taskqueue: string, The taskqueue to delete a task from. (required)<br> |
| 25 | strict: string, A parameter<br> |
| 26 | userip: string, A parameter</tt></dd></dl> |
| 27 | |
| 28 | <dl><dt><a name="Resource-get"><strong>get</strong></a> = method(self, **kwargs)</dt><dd><tt>Get a particular task from a TaskQueue.<br> |
| 29 | <br> |
| 30 | Args:<br> |
| 31 | project: string, The project under which the queue lies. (required)<br> |
| 32 | pp: string, A parameter<br> |
| 33 | task: string, The task to get properties of. (required)<br> |
| 34 | trace: string, A parameter<br> |
| 35 | taskqueue: string, The taskqueue in which the task belongs. (required)<br> |
| 36 | strict: string, A parameter<br> |
| 37 | userip: string, A parameter<br> |
| 38 | <br> |
| 39 | Returns:<br> |
| 40 | An object of the form<br> |
| 41 | <br> |
| 42 | {<br> |
| 43 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 44 | "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> |
| 45 | "id": "A String", # Name of the task.<br> |
| 46 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 47 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 48 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 49 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 50 | }</tt></dd></dl> |
| 51 | |
| 52 | <dl><dt><a name="Resource-insert"><strong>insert</strong></a> = method(self, **kwargs)</dt><dd><tt>Insert a new task in a TaskQueue<br> |
| 53 | <br> |
| 54 | Args:<br> |
| 55 | body: object, The request body. (required)<br> |
| 56 | The object takes the form of:<br> |
| 57 | <br> |
| 58 | {<br> |
| 59 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 60 | "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> |
| 61 | "id": "A String", # Name of the task.<br> |
| 62 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 63 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 64 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 65 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 66 | }<br> |
| 67 | <br> |
| 68 | project: string, The project under which the queue lies (required)<br> |
| 69 | pp: string, A parameter<br> |
| 70 | trace: string, A parameter<br> |
| 71 | taskqueue: string, The taskqueue to insert the task into (required)<br> |
| 72 | strict: string, A parameter<br> |
| 73 | userip: string, A parameter<br> |
| 74 | <br> |
| 75 | Returns:<br> |
| 76 | An object of the form<br> |
| 77 | <br> |
| 78 | {<br> |
| 79 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 80 | "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> |
| 81 | "id": "A String", # Name of the task.<br> |
| 82 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 83 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 84 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 85 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 86 | }</tt></dd></dl> |
| 87 | |
| 88 | <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> |
| 89 | <br> |
| 90 | Args:<br> |
| 91 | groupByTag: boolean, When true, all returned tasks will have the same tag<br> |
| 92 | project: string, The project under which the queue lies. (required)<br> |
| 93 | pp: string, A parameter<br> |
| 94 | leaseSecs: integer, The lease in seconds. (required)<br> |
| 95 | taskqueue: string, The taskqueue to lease a task from. (required)<br> |
| 96 | strict: string, A parameter<br> |
| 97 | userip: string, A parameter<br> |
| 98 | tag: string, The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag<br> |
| 99 | trace: string, A parameter<br> |
| 100 | numTasks: integer, The number of tasks to lease. (required)<br> |
| 101 | <br> |
| 102 | Returns:<br> |
| 103 | An object of the form<br> |
| 104 | <br> |
| 105 | {<br> |
| 106 | "items": [ # The actual list of tasks returned as a result of the lease operation.<br> |
| 107 | {<br> |
| 108 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 109 | "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> |
| 110 | "id": "A String", # Name of the task.<br> |
| 111 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 112 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 113 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 114 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 115 | },<br> |
| 116 | ],<br> |
| 117 | "kind": "taskqueue#tasks", # The kind of object returned, a list of tasks.<br> |
| 118 | }</tt></dd></dl> |
| 119 | |
| 120 | <dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>List Tasks in a TaskQueue<br> |
| 121 | <br> |
| 122 | Args:<br> |
| 123 | project: string, The project under which the queue lies. (required)<br> |
| 124 | pp: string, A parameter<br> |
| 125 | trace: string, A parameter<br> |
| 126 | taskqueue: string, The id of the taskqueue to list tasks from. (required)<br> |
| 127 | strict: string, A parameter<br> |
| 128 | userip: string, A parameter<br> |
| 129 | <br> |
| 130 | Returns:<br> |
| 131 | An object of the form<br> |
| 132 | <br> |
| 133 | {<br> |
| 134 | "items": [ # The actual list of tasks currently active in the TaskQueue.<br> |
| 135 | {<br> |
| 136 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 137 | "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> |
| 138 | "id": "A String", # Name of the task.<br> |
| 139 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 140 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 141 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 142 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 143 | },<br> |
| 144 | ],<br> |
| 145 | "kind": "taskqueues#tasks", # The kind of object returned, a list of tasks.<br> |
| 146 | }</tt></dd></dl> |
| 147 | |
| 148 | <dl><dt><a name="Resource-patch"><strong>patch</strong></a> = method(self, **kwargs)</dt><dd><tt>Update tasks that are leased out of a TaskQueue. This method supports patch semantics.<br> |
| 149 | <br> |
| 150 | Args:<br> |
| 151 | body: object, The request body. (required)<br> |
| 152 | The object takes the form of:<br> |
| 153 | <br> |
| 154 | {<br> |
| 155 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 156 | "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> |
| 157 | "id": "A String", # Name of the task.<br> |
| 158 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 159 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 160 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 161 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 162 | }<br> |
| 163 | <br> |
| 164 | project: string, The project under which the queue lies. (required)<br> |
| 165 | pp: string, A parameter<br> |
| 166 | task: string, A parameter (required)<br> |
| 167 | newLeaseSeconds: integer, The new lease in seconds. (required)<br> |
| 168 | trace: string, A parameter<br> |
| 169 | taskqueue: string, A parameter (required)<br> |
| 170 | strict: string, A parameter<br> |
| 171 | userip: string, A parameter<br> |
| 172 | <br> |
| 173 | Returns:<br> |
| 174 | An object of the form<br> |
| 175 | <br> |
| 176 | {<br> |
| 177 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 178 | "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> |
| 179 | "id": "A String", # Name of the task.<br> |
| 180 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 181 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 182 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 183 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 184 | }</tt></dd></dl> |
| 185 | |
| 186 | <dl><dt><a name="Resource-update"><strong>update</strong></a> = method(self, **kwargs)</dt><dd><tt>Update tasks that are leased out of a TaskQueue.<br> |
| 187 | <br> |
| 188 | Args:<br> |
| 189 | body: object, The request body. (required)<br> |
| 190 | The object takes the form of:<br> |
| 191 | <br> |
| 192 | {<br> |
| 193 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 194 | "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> |
| 195 | "id": "A String", # Name of the task.<br> |
| 196 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 197 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 198 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 199 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 200 | }<br> |
| 201 | <br> |
| 202 | project: string, The project under which the queue lies. (required)<br> |
| 203 | pp: string, A parameter<br> |
| 204 | task: string, A parameter (required)<br> |
| 205 | newLeaseSeconds: integer, The new lease in seconds. (required)<br> |
| 206 | trace: string, A parameter<br> |
| 207 | taskqueue: string, A parameter (required)<br> |
| 208 | strict: string, A parameter<br> |
| 209 | userip: string, A parameter<br> |
| 210 | <br> |
| 211 | Returns:<br> |
| 212 | An object of the form<br> |
| 213 | <br> |
| 214 | {<br> |
| 215 | "kind": "taskqueues#task", # The kind of object returned, in this case set to task.<br> |
| 216 | "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> |
| 217 | "id": "A String", # Name of the task.<br> |
| 218 | "tag": "A String", # Tag for the task, could be used later to lease tasks grouped by a specific tag.<br> |
| 219 | "payloadBase64": "A String", # A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded.<br> |
| 220 | "queueName": "A String", # Name of the queue that the task is in.<br> |
| 221 | "enqueueTimestamp": "A String", # Time (in seconds since the epoch) at which the task was enqueued.<br> |
| 222 | }</tt></dd></dl> |
| 223 | |
| 224 | <hr> |
| 225 | Data descriptors defined here:<br> |
| 226 | <dl><dt><strong>__dict__</strong></dt> |
| 227 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 228 | </dl> |
| 229 | <dl><dt><strong>__weakref__</strong></dt> |
| 230 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 231 | </dl> |
| 232 | </td></tr></table> |
| 233 | </body></html> |