lib/iron_titan/models/job.rb in iron_titan-0.2.17 vs lib/iron_titan/models/job.rb in iron_titan-0.3.0

- old
+ new

@@ -1,11 +1,11 @@ =begin Titan API The ultimate, language agnostic, container based job processing framework. -OpenAPI spec version: 0.2.17 +OpenAPI spec version: 0.3.0 Generated by: https://github.com/swagger-api/swagger-codegen.git =end @@ -21,30 +21,30 @@ attr_accessor :payload # Number of seconds to wait before queueing the job for consumption for the first time. Must be a positive integer. Jobs with a delay start in state \"delayed\" and transition to \"running\" after delay seconds. attr_accessor :delay - # Maximum runtime in seconds. If a consumer retrieves the job, but does not change it's status within timeout seconds, the job is considered failed, with reason timeout (Titan may allow a small grace period). The consumer should also kill the job after timeout seconds. If a consumer tries to change status after Titan has already timed out the job, the consumer will be ignored. + # Maximum runtime in seconds. If a consumer retrieves the\njob, but does not change it's status within timeout seconds, the job\nis considered failed, with reason timeout (Titan may allow a small\ngrace period). The consumer should also kill the job after timeout\nseconds. If a consumer tries to change status after Titan has already\ntimed out the job, the consumer will be ignored.\n attr_accessor :timeout # Priority of the job. Higher has more priority. 3 levels from 0-2. Jobs at same priority are processed in FIFO order. attr_accessor :priority - # Number of automatic retries this job is allowed. A retry will be attempted if a task fails. Max 25.\nAutomatic retries are performed by titan when a task reaches a failed state and has `max_retries` > 0. A retry is performed by queueing a new job with the same image id and payload. The new job's max_retries is one less than the original. The new job's `retry_of` field is set to the original Job ID. Titan will delay the new job for retries_delay seconds before queueing it. Cancelled or successful tasks are never automatically retried. + # \"Number of automatic retries this job is allowed. A retry will be attempted if a task fails. Max 25. Automatic retries are performed by titan when a task reaches a failed state and has `max_retries` > 0. A retry is performed by queueing a new job with the same image id and payload. The new job's max_retries is one less than the original. The new job's `retry_of` field is set to the original Job ID. Titan will delay the new job for retries_delay seconds before queueing it. Cancelled or successful tasks are never automatically retried.\"\n attr_accessor :max_retries # Time in seconds to wait before retrying the job. Must be a non-negative integer. attr_accessor :retries_delay # Unique identifier representing a specific job. attr_accessor :id - # States and valid transitions.\n\n +---------+\n +---------> delayed <----------------+\n +----+----+ |\n | |\n | |\n +----v----+ |\n +---------> queued <----------------+\n +----+----+ *\n | *\n | retry * creates new job\n +----v----+ *\n | running | *\n +--+-+-+--+ |\n +---------|-|-|-----+-------------+\n +---|---------+ | +-----|---------+ |\n | | | | | |\n+-----v---^-+ +--v-------^+ +--v---^-+\n| success | | cancelled | | error |\n+-----------+ +-----------+ +--------+\n\n* delayed - has a delay.\n* queued - Ready to be consumed when it's turn comes.\n* running - Currently consumed by a runner which will attempt to process it.\n* success - (or complete? success/error is common javascript terminology)\n* error - Something went wrong. In this case more information can be obtained\n by inspecting the \"reason\" field.\n - timeout\n - killed - forcibly killed by worker due to resource restrictions or access\n violations.\n - bad_exit - exited with non-zero status due to program termination/crash.\n* cancelled - cancelled via API. More information in the reason field.\n - client_request - Request was cancelled by a client. See \"details\" for any\n details. + # States and valid transitions.\n\n +---------+\n +---------> delayed <----------------+\n +----+----+ |\n | |\n | |\n +----v----+ |\n +---------> queued <----------------+\n +----+----+ *\n | *\n | retry * creates new job\n +----v----+ *\n | running | *\n +--+-+-+--+ |\n +---------|-|-|-----+-------------+\n +---|---------+ | +-----|---------+ |\n | | | | | |\n+-----v---^-+ +--v-------^+ +--v---^-+\n| success | | cancelled | | error |\n+-----------+ +-----------+ +--------+\n\n* delayed - has a delay.\n* queued - Ready to be consumed when it's turn comes.\n* running - Currently consumed by a runner which will attempt to process it.\n* success - (or complete? success/error is common javascript terminology)\n* error - Something went wrong. In this case more information can be obtained\n by inspecting the \"reason\" field.\n - timeout\n - killed - forcibly killed by worker due to resource restrictions or access\n violations.\n - bad_exit - exited with non-zero status due to program termination/crash.\n* cancelled - cancelled via API. More information in the reason field.\n - client_request - Request was cancelled by a client. \n attr_accessor :status - # Image to execute to run this Job. Get details via the /image/{id} endpoint. - attr_accessor :image_id + # Group this job belongs to. + attr_accessor :group_name attr_accessor :reason # Time when job was submitted. Always in UTC. attr_accessor :created_at @@ -56,10 +56,13 @@ attr_accessor :completed_at # If this field is set, then this job is a retry of the ID in this field. attr_accessor :retry_of + # If this field is set, then this job was retried by the job referenced in this field. + attr_accessor :retry_id + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'image' => :'image', @@ -78,22 +81,24 @@ :'id' => :'id', :'status' => :'status', - :'image_id' => :'image_id', + :'group_name' => :'group_name', :'reason' => :'reason', :'created_at' => :'created_at', :'started_at' => :'started_at', :'completed_at' => :'completed_at', - :'retry_of' => :'retry_of' + :'retry_of' => :'retry_of', + :'retry_id' => :'retry_id' + } end # Attribute type mapping. def self.swagger_types @@ -105,16 +110,17 @@ :'priority' => :'Integer', :'max_retries' => :'Integer', :'retries_delay' => :'Integer', :'id' => :'String', :'status' => :'String', - :'image_id' => :'String', + :'group_name' => :'String', :'reason' => :'Reason', :'created_at' => :'DateTime', :'started_at' => :'DateTime', :'completed_at' => :'DateTime', - :'retry_of' => :'String' + :'retry_of' => :'String', + :'retry_id' => :'String' } end def initialize(attributes = {}) @@ -168,12 +174,12 @@ if attributes[:'status'] self.status = attributes[:'status'] end - if attributes[:'image_id'] - self.image_id = attributes[:'image_id'] + if attributes[:'group_name'] + self.group_name = attributes[:'group_name'] end if attributes[:'reason'] self.reason = attributes[:'reason'] end @@ -192,10 +198,14 @@ if attributes[:'retry_of'] self.retry_of = attributes[:'retry_of'] end + if attributes[:'retry_id'] + self.retry_id = attributes[:'retry_id'] + end + end # Custom attribute writer method checking allowed values (enum). def status=(status) allowed_values = ["delayed", "queued", "running", "success", "error", "cancelled"] @@ -216,25 +226,26 @@ priority == o.priority && max_retries == o.max_retries && retries_delay == o.retries_delay && id == o.id && status == o.status && - image_id == o.image_id && + group_name == o.group_name && reason == o.reason && created_at == o.created_at && started_at == o.started_at && completed_at == o.completed_at && - retry_of == o.retry_of + retry_of == o.retry_of && + retry_id == o.retry_id end # @see the `==` method def eql?(o) self == o end # Calculate hash code according to all attributes. def hash - [image, payload, delay, timeout, priority, max_retries, retries_delay, id, status, image_id, reason, created_at, started_at, completed_at, retry_of].hash + [image, payload, delay, timeout, priority, max_retries, retries_delay, id, status, group_name, reason, created_at, started_at, completed_at, retry_of, retry_id].hash end # build the object from hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash)