Class: Google::Apis::CloudtasksV2beta2::Task
- Inherits:
-
Object
- Object
- Google::Apis::CloudtasksV2beta2::Task
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/cloudtasks_v2beta2/classes.rb,
lib/google/apis/cloudtasks_v2beta2/representations.rb,
lib/google/apis/cloudtasks_v2beta2/representations.rb
Overview
A unit of scheduled work.
Instance Attribute Summary collapse
-
#app_engine_http_request ⇒ Google::Apis::CloudtasksV2beta2::AppEngineHttpRequest
App Engine HTTP request.
-
#create_time ⇒ String
Output only.
-
#http_request ⇒ Google::Apis::CloudtasksV2beta2::HttpRequest
HTTP request.
-
#name ⇒ String
Optionally caller-specified in CreateTask.
-
#pull_message ⇒ Google::Apis::CloudtasksV2beta2::PullMessage
The pull message contains data that can be used by the caller of LeaseTasks to process the task.
-
#schedule_time ⇒ String
The time when the task is scheduled to be attempted.
-
#status ⇒ Google::Apis::CloudtasksV2beta2::TaskStatus
Status of the task.
-
#view ⇒ String
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Task
constructor
A new instance of Task.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Task
Returns a new instance of Task.
1936 1937 1938 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1936 def initialize(**args) update!(**args) end |
Instance Attribute Details
#app_engine_http_request ⇒ Google::Apis::CloudtasksV2beta2::AppEngineHttpRequest
App Engine HTTP request. The message defines the HTTP request that is sent to
an App Engine app when the task is dispatched. This proto can only be used for
tasks in a queue which has app_engine_http_target set. Using
AppEngineHttpRequest requires appengine.applications.get Google IAM permission for
the project and the following scope: https://www.googleapis.com/auth/cloud-
platform The task will be delivered to the App Engine app which belongs to
the same project as the queue. For more information, see How Requests are
Routed and how routing is affected by dispatch files. Traffic is encrypted
during transport and never leaves Google datacenters. Because this traffic is
carried over a communication mechanism internal to Google, you cannot
explicitly set the protocol (for example, HTTP or HTTPS). The request to the
handler, however, will appear to have used the HTTP protocol. The
AppEngineRouting used to construct the URL that the task is delivered to can
be set at the queue-level or task-level: * If set, app_engine_routing_override
is used for all tasks in the queue, no matter what the setting is for the task-
level app_engine_routing. The url that the task will be sent to is: * url =
host + relative_url Tasks can be dispatched to secure app handlers,
unsecure app handlers, and URIs restricted with login: admin. Because tasks are
not run as any user, they cannot be dispatched to URIs restricted with login:
required Task dispatches also do not follow redirects. The task attempt has
succeeded if the app's request handler returns an HTTP response code in the
range [200 - 299]. The task attempt has failed if the app's handler
returns a non-2xx response code or Cloud Tasks does not receive response
before the deadline. Failed tasks will be retried according to the retry
configuration. 503 (Service Unavailable) is considered an App Engine system
error instead of an application error and will cause Cloud Tasks' traffic
congestion control to temporarily throttle the queue's dispatches. Unlike
other types of task targets, a 429 (Too Many Requests) response from an app
handler does not cause traffic congestion control to throttle the queue.
Corresponds to the JSON property appEngineHttpRequest
1878 1879 1880 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1878 def app_engine_http_request @app_engine_http_request end |
#create_time ⇒ String
Output only. The time that the task was created. create_time will be
truncated to the nearest second.
Corresponds to the JSON property createTime
1884 1885 1886 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1884 def create_time @create_time end |
#http_request ⇒ Google::Apis::CloudtasksV2beta2::HttpRequest
HTTP request. The task will be pushed to the worker as an HTTP request. An
HTTP request embodies a url, an http method, headers, body and authorization
for the http task.
Corresponds to the JSON property httpRequest
1891 1892 1893 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1891 def http_request @http_request end |
#name ⇒ String
Optionally caller-specified in CreateTask. The task name. The task name must
have the following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/
QUEUE_ID/tasks/TASK_ID * PROJECT_ID can contain letters ([A-Za-z]), numbers
([0-9]), hyphens (-), colons (:), or periods (.). For more information, see
Identifying projects * LOCATION_ID is the canonical ID
for the task's location. The list of available locations can be obtained by
calling ListLocations. For more information, see https://cloud.google.com/
about/locations/. * QUEUE_ID can contain letters ([A-Za-z]), numbers ([0-9]),
or hyphens (-). The maximum length is 100 characters. * TASK_ID can contain
only letters ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). The
maximum length is 500 characters.
Corresponds to the JSON property name
1907 1908 1909 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1907 def name @name end |
#pull_message ⇒ Google::Apis::CloudtasksV2beta2::PullMessage
The pull message contains data that can be used by the caller of LeaseTasks to
process the task. This proto can only be used for tasks in a queue which has
pull_target set.
Corresponds to the JSON property pullMessage
1914 1915 1916 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1914 def @pull_message end |
#schedule_time ⇒ String
The time when the task is scheduled to be attempted. For App Engine queues,
this is when the task will be attempted or retried. For pull queues, this is
the time when the task is available to be leased; if a task is currently
leased, this is the time when the current lease expires, that is, the time
that the task was leased plus the lease_duration. schedule_time will be
truncated to the nearest microsecond.
Corresponds to the JSON property scheduleTime
1924 1925 1926 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1924 def schedule_time @schedule_time end |
#status ⇒ Google::Apis::CloudtasksV2beta2::TaskStatus
Status of the task.
Corresponds to the JSON property status
1929 1930 1931 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1929 def status @status end |
#view ⇒ String
Output only. The view specifies which subset of the Task has been returned.
Corresponds to the JSON property view
1934 1935 1936 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1934 def view @view end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 |
# File 'lib/google/apis/cloudtasks_v2beta2/classes.rb', line 1941 def update!(**args) @app_engine_http_request = args[:app_engine_http_request] if args.key?(:app_engine_http_request) @create_time = args[:create_time] if args.key?(:create_time) @http_request = args[:http_request] if args.key?(:http_request) @name = args[:name] if args.key?(:name) @pull_message = args[:pull_message] if args.key?(:pull_message) @schedule_time = args[:schedule_time] if args.key?(:schedule_time) @status = args[:status] if args.key?(:status) @view = args[:view] if args.key?(:view) end |