You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::IoTJobsDataPlane::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-iotjobsdataplane/lib/aws-sdk-iotjobsdataplane/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



153
154
155
# File 'gems/aws-sdk-iotjobsdataplane/lib/aws-sdk-iotjobsdataplane/client.rb', line 153

def initialize(*args)
  super
end

Instance Method Details

#describe_job_execution(params = {}) ⇒ Types::DescribeJobExecutionResponse

Gets details of a job execution.

Examples:

Request syntax with placeholder values


resp = client.describe_job_execution({
  job_id: "DescribeJobExecutionJobId", # required
  thing_name: "ThingName", # required
  include_job_document: false,
  execution_number: 1,
})

Response structure


resp.execution.job_id #=> String
resp.execution.thing_name #=> String
resp.execution.status #=> String, one of "QUEUED", "IN_PROGRESS", "SUCCEEDED", "FAILED", "REJECTED", "REMOVED", "CANCELED"
resp.execution.status_details #=> Hash
resp.execution.status_details["DetailsKey"] #=> String
resp.execution.queued_at #=> Integer
resp.execution.started_at #=> Integer
resp.execution.last_updated_at #=> Integer
resp.execution.version_number #=> Integer
resp.execution.execution_number #=> Integer
resp.execution.job_document #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :job_id (required, String)

    The unique identifier assigned to this job when it was created.

  • :thing_name (required, String)

    The thing name associated with the device the job execution is running on.

  • :include_job_document (Boolean)

    Optional. When set to true, the response contains the job document. The default is false.

  • :execution_number (Integer)

    Optional. A number that identifies a particular job execution on a particular device. If not specified, the latest job execution is returned.

Returns:



206
207
208
209
# File 'gems/aws-sdk-iotjobsdataplane/lib/aws-sdk-iotjobsdataplane/client.rb', line 206

def describe_job_execution(params = {}, options = {})
  req = build_request(:describe_job_execution, params)
  req.send_request(options)
end

#get_pending_job_executions(params = {}) ⇒ Types::GetPendingJobExecutionsResponse

Gets the list of all jobs for a thing that are not in a terminal status.

Examples:

Request syntax with placeholder values


resp = client.get_pending_job_executions({
  thing_name: "ThingName", # required
})

Response structure


resp.in_progress_jobs #=> Array
resp.in_progress_jobs[0].job_id #=> String
resp.in_progress_jobs[0].queued_at #=> Integer
resp.in_progress_jobs[0].started_at #=> Integer
resp.in_progress_jobs[0].last_updated_at #=> Integer
resp.in_progress_jobs[0].version_number #=> Integer
resp.in_progress_jobs[0].execution_number #=> Integer
resp.queued_jobs #=> Array
resp.queued_jobs[0].job_id #=> String
resp.queued_jobs[0].queued_at #=> Integer
resp.queued_jobs[0].started_at #=> Integer
resp.queued_jobs[0].last_updated_at #=> Integer
resp.queued_jobs[0].version_number #=> Integer
resp.queued_jobs[0].execution_number #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the thing that is executing the job.

Returns:



247
248
249
250
# File 'gems/aws-sdk-iotjobsdataplane/lib/aws-sdk-iotjobsdataplane/client.rb', line 247

def get_pending_job_executions(params = {}, options = {})
  req = build_request(:get_pending_job_executions, params)
  req.send_request(options)
end

#start_next_pending_job_execution(params = {}) ⇒ Types::StartNextPendingJobExecutionResponse

Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for a thing.

Examples:

Request syntax with placeholder values


resp = client.start_next_pending_job_execution({
  thing_name: "ThingName", # required
  status_details: {
    "DetailsKey" => "DetailsValue",
  },
})

Response structure


resp.execution.job_id #=> String
resp.execution.thing_name #=> String
resp.execution.status #=> String, one of "QUEUED", "IN_PROGRESS", "SUCCEEDED", "FAILED", "REJECTED", "REMOVED", "CANCELED"
resp.execution.status_details #=> Hash
resp.execution.status_details["DetailsKey"] #=> String
resp.execution.queued_at #=> Integer
resp.execution.started_at #=> Integer
resp.execution.last_updated_at #=> Integer
resp.execution.version_number #=> Integer
resp.execution.execution_number #=> Integer
resp.execution.job_document #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the thing associated with the device.

  • :status_details (Hash<String,String>)

    A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged.

Returns:



291
292
293
294
# File 'gems/aws-sdk-iotjobsdataplane/lib/aws-sdk-iotjobsdataplane/client.rb', line 291

def start_next_pending_job_execution(params = {}, options = {})
  req = build_request(:start_next_pending_job_execution, params)
  req.send_request(options)
end

#update_job_execution(params = {}) ⇒ Types::UpdateJobExecutionResponse

Updates the status of a job execution.

Examples:

Request syntax with placeholder values


resp = client.update_job_execution({
  job_id: "JobId", # required
  thing_name: "ThingName", # required
  status: "QUEUED", # required, accepts QUEUED, IN_PROGRESS, SUCCEEDED, FAILED, REJECTED, REMOVED, CANCELED
  status_details: {
    "DetailsKey" => "DetailsValue",
  },
  expected_version: 1,
  include_job_execution_state: false,
  include_job_document: false,
  execution_number: 1,
})

Response structure


resp.execution_state.status #=> String, one of "QUEUED", "IN_PROGRESS", "SUCCEEDED", "FAILED", "REJECTED", "REMOVED", "CANCELED"
resp.execution_state.status_details #=> Hash
resp.execution_state.status_details["DetailsKey"] #=> String
resp.execution_state.version_number #=> Integer
resp.job_document #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :job_id (required, String)

    The unique identifier assigned to this job when it was created.

  • :thing_name (required, String)

    The name of the thing associated with the device.

  • :status (required, String)

    The new status for the job execution (IN_PROGRESS, FAILED, SUCCESS, or REJECTED). This must be specified on every update.

  • :status_details (Hash<String,String>)

    Optional. A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged.

  • :expected_version (Integer)

    Optional. The expected current version of the job execution. Each time you update the job execution, its version is incremented. If the version of the job execution stored in Jobs does not match, the update is rejected with a VersionMismatch error, and an ErrorResponse that contains the current job execution status data is returned. (This makes it unnecessary to perform a separate DescribeJobExecution request in order to obtain the job execution status data.)

  • :include_job_execution_state (Boolean)

    Optional. When included and set to true, the response contains the JobExecutionState data. The default is false.

  • :include_job_document (Boolean)

    Optional. When set to true, the response contains the job document. The default is false.

  • :execution_number (Integer)

    Optional. A number that identifies a particular job execution on a particular device.

Returns:



363
364
365
366
# File 'gems/aws-sdk-iotjobsdataplane/lib/aws-sdk-iotjobsdataplane/client.rb', line 363

def update_job_execution(params = {}, options = {})
  req = build_request(:update_job_execution, params)
  req.send_request(options)
end