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

Class: Aws::IoTThingsGraph::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for AWS IoT Things Graph. To construct a client, you need to configure a :region and :credentials.

iotthingsgraph = Aws::IoTThingsGraph::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::IoTThingsGraph::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

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

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::IoTThingsGraph::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#associate_entity_to_thing(options = {}) ⇒ Struct

Associates a device with a concrete thing that is in the user's registry.

A thing can be associated with only one device at a time. If you associate a thing with a new device id, its previous association will be removed.

Examples:

Request syntax with placeholder values


resp = client.associate_entity_to_thing({
  thing_name: "ThingName", # required
  entity_id: "Urn", # required
  namespace_version: 1,
})

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing to which the entity is to be associated.

  • :entity_id (required, String)

    The ID of the device to be associated with the thing.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME

  • :namespace_version (Integer)

    The version of the user\'s namespace. Defaults to the latest version of the user\'s namespace.

Returns:

  • (Struct)

    Returns an empty response.

#create_flow_template(options = {}) ⇒ Types::CreateFlowTemplateResponse

Creates a workflow template. Workflows can be created only in the user's namespace. (The public namespace contains only entities.) The workflow can contain only entities in the specified namespace. The workflow is validated against the entities in the latest version of the user's namespace unless another namespace version is specified in the request.

Examples:

Request syntax with placeholder values


resp = client.create_flow_template({
  definition: { # required
    language: "GRAPHQL", # required, accepts GRAPHQL
    text: "DefinitionText", # required
  },
  compatible_namespace_version: 1,
})

Response structure


resp.summary.id #=> String
resp.summary.arn #=> String
resp.summary.revision_number #=> Integer
resp.summary.created_at #=> Time

Options Hash (options):

  • :definition (required, Types::DefinitionDocument)

    The workflow DefinitionDocument.

  • :compatible_namespace_version (Integer)

    The namespace version in which the workflow is to be created.

    If no value is specified, the latest version is used by default.

Returns:

#create_system_instance(options = {}) ⇒ Types::CreateSystemInstanceResponse

Creates a system instance.

This action validates the system instance, prepares the deployment-related resources. For Greengrass deployments, it updates the Greengrass group that is specified by the greengrassGroupName parameter. It also adds a file to the S3 bucket specified by the s3BucketName parameter. You need to call DeploySystemInstance after running this action.

For Greengrass deployments, since this action modifies and adds resources to a Greengrass group and an S3 bucket on the caller's behalf, the calling identity must have write permissions to both the specified Greengrass group and S3 bucket. Otherwise, the call will fail with an authorization error.

For cloud deployments, this action requires a flowActionsRoleArn value. This is an IAM role that has permissions to access AWS services, such as AWS Lambda and AWS IoT, that the flow uses when it executes.

If the definition document doesn't specify a version of the user's namespace, the latest version will be used by default.

Examples:

Request syntax with placeholder values


resp = client.create_system_instance({
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  definition: { # required
    language: "GRAPHQL", # required, accepts GRAPHQL
    text: "DefinitionText", # required
  },
  target: "GREENGRASS", # required, accepts GREENGRASS, CLOUD
  greengrass_group_name: "GroupName",
  s3_bucket_name: "S3BucketName",
  metrics_configuration: {
    cloud_metric_enabled: false,
    metric_rule_role_arn: "RoleArn",
  },
  flow_actions_role_arn: "RoleArn",
})

Response structure


resp.summary.id #=> String
resp.summary.arn #=> String
resp.summary.status #=> String, one of "NOT_DEPLOYED", "BOOTSTRAP", "DEPLOY_IN_PROGRESS", "DEPLOYED_IN_TARGET", "UNDEPLOY_IN_PROGRESS", "FAILED", "PENDING_DELETE", "DELETED_IN_TARGET"
resp.summary.target #=> String, one of "GREENGRASS", "CLOUD"
resp.summary.greengrass_group_name #=> String
resp.summary.created_at #=> Time
resp.summary.updated_at #=> Time
resp.summary.greengrass_group_id #=> String
resp.summary.greengrass_group_version_id #=> String

Options Hash (options):

  • :tags (Array<Types::Tag>)

    Metadata, consisting of key-value pairs, that can be used to categorize your system instances.

  • :definition (required, Types::DefinitionDocument)

    A document that defines an entity.

  • :target (required, String)

    The target type of the deployment. Valid values are GREENGRASS and CLOUD.

  • :greengrass_group_name (String)

    The name of the Greengrass group where the system instance will be deployed. This value is required if the value of the target parameter is GREENGRASS.

  • :s3_bucket_name (String)

    The name of the Amazon Simple Storage Service bucket that will be used to store and deploy the system instance\'s resource file. This value is required if the value of the target parameter is GREENGRASS.

  • :metrics_configuration (Types::MetricsConfiguration)

    An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.

  • :flow_actions_role_arn (String)

    The ARN of the IAM role that AWS IoT Things Graph will assume when it executes the flow. This role must have read and write access to AWS Lambda and AWS IoT and any other AWS services that the flow uses when it executes. This value is required if the value of the target parameter is CLOUD.

Returns:

#create_system_template(options = {}) ⇒ Types::CreateSystemTemplateResponse

Creates a system. The system is validated against the entities in the latest version of the user's namespace unless another namespace version is specified in the request.

Examples:

Request syntax with placeholder values


resp = client.create_system_template({
  definition: { # required
    language: "GRAPHQL", # required, accepts GRAPHQL
    text: "DefinitionText", # required
  },
  compatible_namespace_version: 1,
})

Response structure


resp.summary.id #=> String
resp.summary.arn #=> String
resp.summary.revision_number #=> Integer
resp.summary.created_at #=> Time

Options Hash (options):

  • :definition (required, Types::DefinitionDocument)

    The DefinitionDocument used to create the system.

  • :compatible_namespace_version (Integer)

    The namespace version in which the system is to be created.

    If no value is specified, the latest version is used by default.

Returns:

#delete_flow_template(options = {}) ⇒ Struct

Deletes a workflow. Any new system or deployment that contains this workflow will fail to update or deploy. Existing deployments that contain the workflow will continue to run (since they use a snapshot of the workflow taken at the time of deployment).

Examples:

Request syntax with placeholder values


resp = client.delete_flow_template({
  id: "Urn", # required
})

Options Hash (options):

  • :id (required, String)

    The ID of the workflow to be deleted.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME

Returns:

  • (Struct)

    Returns an empty response.

#delete_namespace(options = {}) ⇒ Types::DeleteNamespaceResponse

Deletes the specified namespace. This action deletes all of the entities in the namespace. Delete the systems and flows that use entities in the namespace before performing this action.

Examples:

Request syntax with placeholder values


resp = client.delete_namespace()

Response structure


resp.namespace_arn #=> String
resp.namespace_name #=> String

Returns:

#delete_system_instance(options = {}) ⇒ Struct

Deletes a system instance. Only system instances that have never been deployed, or that have been undeployed can be deleted.

Users can create a new system instance that has the same ID as a deleted system instance.

Examples:

Request syntax with placeholder values


resp = client.delete_system_instance({
  id: "Urn",
})

Options Hash (options):

  • :id (String)

    The ID of the system instance to be deleted.

Returns:

  • (Struct)

    Returns an empty response.

#delete_system_template(options = {}) ⇒ Struct

Deletes a system. New deployments can't contain the system after its deletion. Existing deployments that contain the system will continue to work because they use a snapshot of the system that is taken when it is deployed.

Examples:

Request syntax with placeholder values


resp = client.delete_system_template({
  id: "Urn", # required
})

Options Hash (options):

  • :id (required, String)

    The ID of the system to be deleted.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME

Returns:

  • (Struct)

    Returns an empty response.

#deploy_system_instance(options = {}) ⇒ Types::DeploySystemInstanceResponse

Greengrass and Cloud Deployments

Deploys the system instance to the target specified in CreateSystemInstance.

Greengrass Deployments

If the system or any workflows and entities have been updated before this action is called, then the deployment will create a new Amazon Simple Storage Service resource file and then deploy it.

Since this action creates a Greengrass deployment on the caller's behalf, the calling identity must have write permissions to the specified Greengrass group. Otherwise, the call will fail with an authorization error.

For information about the artifacts that get added to your Greengrass core device when you use this API, see AWS IoT Things Graph and AWS IoT Greengrass.

Examples:

Request syntax with placeholder values


resp = client.deploy_system_instance({
  id: "Urn",
})

Response structure


resp.summary.id #=> String
resp.summary.arn #=> String
resp.summary.status #=> String, one of "NOT_DEPLOYED", "BOOTSTRAP", "DEPLOY_IN_PROGRESS", "DEPLOYED_IN_TARGET", "UNDEPLOY_IN_PROGRESS", "FAILED", "PENDING_DELETE", "DELETED_IN_TARGET"
resp.summary.target #=> String, one of "GREENGRASS", "CLOUD"
resp.summary.greengrass_group_name #=> String
resp.summary.created_at #=> Time
resp.summary.updated_at #=> Time
resp.summary.greengrass_group_id #=> String
resp.summary.greengrass_group_version_id #=> String
resp.greengrass_deployment_id #=> String

Options Hash (options):

  • :id (String)

    The ID of the system instance. This value is returned by the CreateSystemInstance action.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME

Returns:

#deprecate_flow_template(options = {}) ⇒ Struct

Deprecates the specified workflow. This action marks the workflow for deletion. Deprecated flows can't be deployed, but existing deployments will continue to run.

Examples:

Request syntax with placeholder values


resp = client.deprecate_flow_template({
  id: "Urn", # required
})

Options Hash (options):

  • :id (required, String)

    The ID of the workflow to be deleted.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME

Returns:

  • (Struct)

    Returns an empty response.

#deprecate_system_template(options = {}) ⇒ Struct

Deprecates the specified system.

Examples:

Request syntax with placeholder values


resp = client.deprecate_system_template({
  id: "Urn", # required
})

Options Hash (options):

  • :id (required, String)

    The ID of the system to delete.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME

Returns:

  • (Struct)

    Returns an empty response.

#describe_namespace(options = {}) ⇒ Types::DescribeNamespaceResponse

Gets the latest version of the user's namespace and the public version that it is tracking.

Examples:

Request syntax with placeholder values


resp = client.describe_namespace({
  namespace_name: "NamespaceName",
})

Response structure


resp.namespace_arn #=> String
resp.namespace_name #=> String
resp.tracking_namespace_name #=> String
resp.tracking_namespace_version #=> Integer
resp.namespace_version #=> Integer

Options Hash (options):

  • :namespace_name (String)

    The name of the user\'s namespace. Set this to aws to get the public namespace.

Returns:

#dissociate_entity_from_thing(options = {}) ⇒ Struct

Dissociates a device entity from a concrete thing. The action takes only the type of the entity that you need to dissociate because only one entity of a particular type can be associated with a thing.

Examples:

Request syntax with placeholder values


resp = client.dissociate_entity_from_thing({
  thing_name: "ThingName", # required
  entity_type: "DEVICE", # required, accepts DEVICE, SERVICE, DEVICE_MODEL, CAPABILITY, STATE, ACTION, EVENT, PROPERTY, MAPPING, ENUM
})

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing to disassociate.

  • :entity_type (required, String)

    The entity type from which to disassociate the thing.

Returns:

  • (Struct)

    Returns an empty response.

#get_entities(options = {}) ⇒ Types::GetEntitiesResponse

Gets definitions of the specified entities. Uses the latest version of the user's namespace by default. This API returns the following TDM entities.

  • Properties

  • States

  • Events

  • Actions

  • Capabilities

  • Mappings

  • Devices

  • Device Models

  • Services

This action doesn't return definitions for systems, flows, and deployments.

Examples:

Request syntax with placeholder values


resp = client.get_entities({
  ids: ["Urn"], # required
  namespace_version: 1,
})

Response structure


resp.descriptions #=> Array
resp.descriptions[0].id #=> String
resp.descriptions[0].arn #=> String
resp.descriptions[0].type #=> String, one of "DEVICE", "SERVICE", "DEVICE_MODEL", "CAPABILITY", "STATE", "ACTION", "EVENT", "PROPERTY", "MAPPING", "ENUM"
resp.descriptions[0].created_at #=> Time
resp.descriptions[0].definition.language #=> String, one of "GRAPHQL"
resp.descriptions[0].definition.text #=> String

Options Hash (options):

  • :ids (required, Array<String>)

    An array of entity IDs.

    The IDs should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME

  • :namespace_version (Integer)

    The version of the user\'s namespace. Defaults to the latest version of the user\'s namespace.

Returns:

#get_flow_template(options = {}) ⇒ Types::GetFlowTemplateResponse

Gets the latest version of the DefinitionDocument and FlowTemplateSummary for the specified workflow.

Examples:

Request syntax with placeholder values


resp = client.get_flow_template({
  id: "Urn", # required
  revision_number: 1,
})

Response structure


resp.description.summary.id #=> String
resp.description.summary.arn #=> String
resp.description.summary.revision_number #=> Integer
resp.description.summary.created_at #=> Time
resp.description.definition.language #=> String, one of "GRAPHQL"
resp.description.definition.text #=> String
resp.description.validated_namespace_version #=> Integer

Options Hash (options):

  • :id (required, String)

    The ID of the workflow.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME

  • :revision_number (Integer)

    The number of the workflow revision to retrieve.

Returns:

#get_flow_template_revisions(options = {}) ⇒ Types::GetFlowTemplateRevisionsResponse

Gets revisions of the specified workflow. Only the last 100 revisions are stored. If the workflow has been deprecated, this action will return revisions that occurred before the deprecation. This action won't work for workflows that have been deleted.

Examples:

Request syntax with placeholder values


resp = client.get_flow_template_revisions({
  id: "Urn", # required
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.summaries #=> Array
resp.summaries[0].id #=> String
resp.summaries[0].arn #=> String
resp.summaries[0].revision_number #=> Integer
resp.summaries[0].created_at #=> Time
resp.next_token #=> String

Options Hash (options):

  • :id (required, String)

    The ID of the workflow.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

Returns:

#get_namespace_deletion_status(options = {}) ⇒ Types::GetNamespaceDeletionStatusResponse

Gets the status of a namespace deletion task.

Examples:

Request syntax with placeholder values


resp = client.get_namespace_deletion_status()

Response structure


resp.namespace_arn #=> String
resp.namespace_name #=> String
resp.status #=> String, one of "IN_PROGRESS", "SUCCEEDED", "FAILED"
resp.error_code #=> String, one of "VALIDATION_FAILED"
resp.error_message #=> String

Returns:

#get_system_instance(options = {}) ⇒ Types::GetSystemInstanceResponse

Gets a system instance.

Examples:

Request syntax with placeholder values


resp = client.get_system_instance({
  id: "Urn", # required
})

Response structure


resp.description.summary.id #=> String
resp.description.summary.arn #=> String
resp.description.summary.status #=> String, one of "NOT_DEPLOYED", "BOOTSTRAP", "DEPLOY_IN_PROGRESS", "DEPLOYED_IN_TARGET", "UNDEPLOY_IN_PROGRESS", "FAILED", "PENDING_DELETE", "DELETED_IN_TARGET"
resp.description.summary.target #=> String, one of "GREENGRASS", "CLOUD"
resp.description.summary.greengrass_group_name #=> String
resp.description.summary.created_at #=> Time
resp.description.summary.updated_at #=> Time
resp.description.summary.greengrass_group_id #=> String
resp.description.summary.greengrass_group_version_id #=> String
resp.description.definition.language #=> String, one of "GRAPHQL"
resp.description.definition.text #=> String
resp.description.s3_bucket_name #=> String
resp.description.metrics_configuration.cloud_metric_enabled #=> true/false
resp.description.metrics_configuration.metric_rule_role_arn #=> String
resp.description.validated_namespace_version #=> Integer
resp.description.validated_dependency_revisions #=> Array
resp.description.validated_dependency_revisions[0].id #=> String
resp.description.validated_dependency_revisions[0].revision_number #=> Integer
resp.description.flow_actions_role_arn #=> String

Options Hash (options):

  • :id (required, String)

    The ID of the system deployment instance. This value is returned by CreateSystemInstance.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME

Returns:

#get_system_template(options = {}) ⇒ Types::GetSystemTemplateResponse

Gets a system.

Examples:

Request syntax with placeholder values


resp = client.get_system_template({
  id: "Urn", # required
  revision_number: 1,
})

Response structure


resp.description.summary.id #=> String
resp.description.summary.arn #=> String
resp.description.summary.revision_number #=> Integer
resp.description.summary.created_at #=> Time
resp.description.definition.language #=> String, one of "GRAPHQL"
resp.description.definition.text #=> String
resp.description.validated_namespace_version #=> Integer

Options Hash (options):

  • :id (required, String)

    The ID of the system to get. This ID must be in the user\'s namespace.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME

  • :revision_number (Integer)

    The number that specifies the revision of the system to get.

Returns:

#get_system_template_revisions(options = {}) ⇒ Types::GetSystemTemplateRevisionsResponse

Gets revisions made to the specified system template. Only the previous 100 revisions are stored. If the system has been deprecated, this action will return the revisions that occurred before its deprecation. This action won't work with systems that have been deleted.

Examples:

Request syntax with placeholder values


resp = client.get_system_template_revisions({
  id: "Urn", # required
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.summaries #=> Array
resp.summaries[0].id #=> String
resp.summaries[0].arn #=> String
resp.summaries[0].revision_number #=> Integer
resp.summaries[0].created_at #=> Time
resp.next_token #=> String

Options Hash (options):

  • :id (required, String)

    The ID of the system template.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

Returns:

#get_upload_status(options = {}) ⇒ Types::GetUploadStatusResponse

Gets the status of the specified upload.

Examples:

Request syntax with placeholder values


resp = client.get_upload_status({
  upload_id: "UploadId", # required
})

Response structure


resp.upload_id #=> String
resp.upload_status #=> String, one of "IN_PROGRESS", "SUCCEEDED", "FAILED"
resp.namespace_arn #=> String
resp.namespace_name #=> String
resp.namespace_version #=> Integer
resp.failure_reason #=> Array
resp.failure_reason[0] #=> String
resp.created_date #=> Time

Options Hash (options):

  • :upload_id (required, String)

    The ID of the upload. This value is returned by the UploadEntityDefinitions action.

Returns:

#list_flow_execution_messages(options = {}) ⇒ Types::ListFlowExecutionMessagesResponse

Returns a list of objects that contain information about events in a flow execution.

Examples:

Request syntax with placeholder values


resp = client.list_flow_execution_messages({
  flow_execution_id: "FlowExecutionId", # required
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.messages #=> Array
resp.messages[0].message_id #=> String
resp.messages[0].event_type #=> String, one of "EXECUTION_STARTED", "EXECUTION_FAILED", "EXECUTION_ABORTED", "EXECUTION_SUCCEEDED", "STEP_STARTED", "STEP_FAILED", "STEP_SUCCEEDED", "ACTIVITY_SCHEDULED", "ACTIVITY_STARTED", "ACTIVITY_FAILED", "ACTIVITY_SUCCEEDED", "START_FLOW_EXECUTION_TASK", "SCHEDULE_NEXT_READY_STEPS_TASK", "THING_ACTION_TASK", "THING_ACTION_TASK_FAILED", "THING_ACTION_TASK_SUCCEEDED", "ACKNOWLEDGE_TASK_MESSAGE"
resp.messages[0].timestamp #=> Time
resp.messages[0].payload #=> String
resp.next_token #=> String

Options Hash (options):

  • :flow_execution_id (required, String)

    The ID of the flow execution.

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

Returns:

#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse

Lists all tags on an AWS IoT Things Graph resource.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  max_results: 1,
  resource_arn: "ResourceArn", # required
  next_token: "NextToken",
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    The maximum number of tags to return.

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource whose tags are to be returned.

  • :next_token (String)

    The token that specifies the next page of results to return.

Returns:

#search_entities(options = {}) ⇒ Types::SearchEntitiesResponse

Searches for entities of the specified type. You can search for entities in your namespace and the public namespace that you're tracking.

Examples:

Request syntax with placeholder values


resp = client.search_entities({
  entity_types: ["DEVICE"], # required, accepts DEVICE, SERVICE, DEVICE_MODEL, CAPABILITY, STATE, ACTION, EVENT, PROPERTY, MAPPING, ENUM
  filters: [
    {
      name: "NAME", # accepts NAME, NAMESPACE, SEMANTIC_TYPE_PATH, REFERENCED_ENTITY_ID
      value: ["EntityFilterValue"],
    },
  ],
  next_token: "NextToken",
  max_results: 1,
  namespace_version: 1,
})

Response structure


resp.descriptions #=> Array
resp.descriptions[0].id #=> String
resp.descriptions[0].arn #=> String
resp.descriptions[0].type #=> String, one of "DEVICE", "SERVICE", "DEVICE_MODEL", "CAPABILITY", "STATE", "ACTION", "EVENT", "PROPERTY", "MAPPING", "ENUM"
resp.descriptions[0].created_at #=> Time
resp.descriptions[0].definition.language #=> String, one of "GRAPHQL"
resp.descriptions[0].definition.text #=> String
resp.next_token #=> String

Options Hash (options):

  • :entity_types (required, Array<String>)

    The entity types for which to search.

  • :filters (Array<Types::EntityFilter>)

    Optional filter to apply to the search. Valid filters are NAME NAMESPACE, SEMANTIC_TYPE_PATH and REFERENCED_ENTITY_ID. REFERENCED_ENTITY_ID filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.

    Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

  • :namespace_version (Integer)

    The version of the user\'s namespace. Defaults to the latest version of the user\'s namespace.

Returns:

#search_flow_executions(options = {}) ⇒ Types::SearchFlowExecutionsResponse

Searches for AWS IoT Things Graph workflow execution instances.

Examples:

Request syntax with placeholder values


resp = client.search_flow_executions({
  system_instance_id: "Urn", # required
  flow_execution_id: "FlowExecutionId",
  start_time: Time.now,
  end_time: Time.now,
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.summaries #=> Array
resp.summaries[0].flow_execution_id #=> String
resp.summaries[0].status #=> String, one of "RUNNING", "ABORTED", "SUCCEEDED", "FAILED"
resp.summaries[0].system_instance_id #=> String
resp.summaries[0].flow_template_id #=> String
resp.summaries[0].created_at #=> Time
resp.summaries[0].updated_at #=> Time
resp.next_token #=> String

Options Hash (options):

  • :system_instance_id (required, String)

    The ID of the system instance that contains the flow.

  • :flow_execution_id (String)

    The ID of a flow execution.

  • :start_time (Time)

    The date and time of the earliest flow execution to return.

  • :end_time (Time)

    The date and time of the latest flow execution to return.

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

Returns:

#search_flow_templates(options = {}) ⇒ Types::SearchFlowTemplatesResponse

Searches for summary information about workflows.

Examples:

Request syntax with placeholder values


resp = client.search_flow_templates({
  filters: [
    {
      name: "DEVICE_MODEL_ID", # required, accepts DEVICE_MODEL_ID
      value: ["FlowTemplateFilterValue"], # required
    },
  ],
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.summaries #=> Array
resp.summaries[0].id #=> String
resp.summaries[0].arn #=> String
resp.summaries[0].revision_number #=> Integer
resp.summaries[0].created_at #=> Time
resp.next_token #=> String

Options Hash (options):

  • :filters (Array<Types::FlowTemplateFilter>)

    An array of objects that limit the result set. The only valid filter is DEVICE_MODEL_ID.

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

Returns:

#search_system_instances(options = {}) ⇒ Types::SearchSystemInstancesResponse

Searches for system instances in the user's account.

Examples:

Request syntax with placeholder values


resp = client.search_system_instances({
  filters: [
    {
      name: "SYSTEM_TEMPLATE_ID", # accepts SYSTEM_TEMPLATE_ID, STATUS, GREENGRASS_GROUP_NAME
      value: ["SystemInstanceFilterValue"],
    },
  ],
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.summaries #=> Array
resp.summaries[0].id #=> String
resp.summaries[0].arn #=> String
resp.summaries[0].status #=> String, one of "NOT_DEPLOYED", "BOOTSTRAP", "DEPLOY_IN_PROGRESS", "DEPLOYED_IN_TARGET", "UNDEPLOY_IN_PROGRESS", "FAILED", "PENDING_DELETE", "DELETED_IN_TARGET"
resp.summaries[0].target #=> String, one of "GREENGRASS", "CLOUD"
resp.summaries[0].greengrass_group_name #=> String
resp.summaries[0].created_at #=> Time
resp.summaries[0].updated_at #=> Time
resp.summaries[0].greengrass_group_id #=> String
resp.summaries[0].greengrass_group_version_id #=> String
resp.next_token #=> String

Options Hash (options):

  • :filters (Array<Types::SystemInstanceFilter>)

    Optional filter to apply to the search. Valid filters are SYSTEM_TEMPLATE_ID, STATUS, and GREENGRASS_GROUP_NAME.

    Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

Returns:

#search_system_templates(options = {}) ⇒ Types::SearchSystemTemplatesResponse

Searches for summary information about systems in the user's account. You can filter by the ID of a workflow to return only systems that use the specified workflow.

Examples:

Request syntax with placeholder values


resp = client.search_system_templates({
  filters: [
    {
      name: "FLOW_TEMPLATE_ID", # required, accepts FLOW_TEMPLATE_ID
      value: ["SystemTemplateFilterValue"], # required
    },
  ],
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.summaries #=> Array
resp.summaries[0].id #=> String
resp.summaries[0].arn #=> String
resp.summaries[0].revision_number #=> Integer
resp.summaries[0].created_at #=> Time
resp.next_token #=> String

Options Hash (options):

  • :filters (Array<Types::SystemTemplateFilter>)

    An array of filters that limit the result set. The only valid filter is FLOW_TEMPLATE_ID.

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

Returns:

#search_things(options = {}) ⇒ Types::SearchThingsResponse

Searches for things associated with the specified entity. You can search by both device and device model.

For example, if two different devices, camera1 and camera2, implement the camera device model, the user can associate thing1 to camera1 and thing2 to camera2. SearchThings(camera2) will return only thing2, but SearchThings(camera) will return both thing1 and thing2.

This action searches for exact matches and doesn't perform partial text matching.

Examples:

Request syntax with placeholder values


resp = client.search_things({
  entity_id: "Urn", # required
  next_token: "NextToken",
  max_results: 1,
  namespace_version: 1,
})

Response structure


resp.things #=> Array
resp.things[0].thing_arn #=> String
resp.things[0].thing_name #=> String
resp.next_token #=> String

Options Hash (options):

  • :entity_id (required, String)

    The ID of the entity to which the things are associated.

    The IDs should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME

  • :next_token (String)

    The string that specifies the next page of results. Use this when you\'re paginating results.

  • :max_results (Integer)

    The maximum number of results to return in the response.

  • :namespace_version (Integer)

    The version of the user\'s namespace. Defaults to the latest version of the user\'s namespace.

Returns:

#tag_resource(options = {}) ⇒ Struct

Creates a tag for the specified resource.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "ResourceArn", # required
  tags: [ # required
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource whose tags are returned.

  • :tags (required, Array<Types::Tag>)

    A list of tags to add to the resource.>

Returns:

  • (Struct)

    Returns an empty response.

#undeploy_system_instance(options = {}) ⇒ Types::UndeploySystemInstanceResponse

Removes a system instance from its target (Cloud or Greengrass).

Examples:

Request syntax with placeholder values


resp = client.undeploy_system_instance({
  id: "Urn",
})

Response structure


resp.summary.id #=> String
resp.summary.arn #=> String
resp.summary.status #=> String, one of "NOT_DEPLOYED", "BOOTSTRAP", "DEPLOY_IN_PROGRESS", "DEPLOYED_IN_TARGET", "UNDEPLOY_IN_PROGRESS", "FAILED", "PENDING_DELETE", "DELETED_IN_TARGET"
resp.summary.target #=> String, one of "GREENGRASS", "CLOUD"
resp.summary.greengrass_group_name #=> String
resp.summary.created_at #=> Time
resp.summary.updated_at #=> Time
resp.summary.greengrass_group_id #=> String
resp.summary.greengrass_group_version_id #=> String

Options Hash (options):

  • :id (String)

    The ID of the system instance to remove from its target.

Returns:

#untag_resource(options = {}) ⇒ Struct

Removes a tag from the specified resource.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "ResourceArn", # required
  tag_keys: ["TagKey"], # required
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource whose tags are to be removed.

  • :tag_keys (required, Array<String>)

    A list of tag key names to remove from the resource. You don\'t specify the value. Both the key and its associated value are removed.

    This parameter to the API requires a JSON text string argument. For information on how to format a JSON parameter for the various command line tool environments, see Using JSON for Parameters in the AWS CLI User Guide.

Returns:

  • (Struct)

    Returns an empty response.

#update_flow_template(options = {}) ⇒ Types::UpdateFlowTemplateResponse

Updates the specified workflow. All deployed systems and system instances that use the workflow will see the changes in the flow when it is redeployed. If you don't want this behavior, copy the workflow (creating a new workflow with a different ID), and update the copy. The workflow can contain only entities in the specified namespace.

Examples:

Request syntax with placeholder values


resp = client.update_flow_template({
  id: "Urn", # required
  definition: { # required
    language: "GRAPHQL", # required, accepts GRAPHQL
    text: "DefinitionText", # required
  },
  compatible_namespace_version: 1,
})

Response structure


resp.summary.id #=> String
resp.summary.arn #=> String
resp.summary.revision_number #=> Integer
resp.summary.created_at #=> Time

Options Hash (options):

  • :id (required, String)

    The ID of the workflow to be updated.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME

  • :definition (required, Types::DefinitionDocument)

    The DefinitionDocument that contains the updated workflow definition.

  • :compatible_namespace_version (Integer)

    The version of the user\'s namespace.

    If no value is specified, the latest version is used by default. Use the GetFlowTemplateRevisions if you want to find earlier revisions of the flow to update.

Returns:

#update_system_template(options = {}) ⇒ Types::UpdateSystemTemplateResponse

Updates the specified system. You don't need to run this action after updating a workflow. Any deployment that uses the system will see the changes in the system when it is redeployed.

Examples:

Request syntax with placeholder values


resp = client.update_system_template({
  id: "Urn", # required
  definition: { # required
    language: "GRAPHQL", # required, accepts GRAPHQL
    text: "DefinitionText", # required
  },
  compatible_namespace_version: 1,
})

Response structure


resp.summary.id #=> String
resp.summary.arn #=> String
resp.summary.revision_number #=> Integer
resp.summary.created_at #=> Time

Options Hash (options):

  • :id (required, String)

    The ID of the system to be updated.

    The ID should be in the following format.

    urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME

  • :definition (required, Types::DefinitionDocument)

    The DefinitionDocument that contains the updated system definition.

  • :compatible_namespace_version (Integer)

    The version of the user\'s namespace. Defaults to the latest version of the user\'s namespace.

    If no value is specified, the latest version is used by default.

Returns:

#upload_entity_definitions(options = {}) ⇒ Types::UploadEntityDefinitionsResponse

Asynchronously uploads one or more entity definitions to the user's namespace. The document parameter is required if syncWithPublicNamespace and deleteExistingEntites are false. If the syncWithPublicNamespace parameter is set to true, the user's namespace will synchronize with the latest version of the public namespace. If deprecateExistingEntities is set to true, all entities in the latest version will be deleted before the new DefinitionDocument is uploaded.

When a user uploads entity definitions for the first time, the service creates a new namespace for the user. The new namespace tracks the public namespace. Currently users can have only one namespace. The namespace version increments whenever a user uploads entity definitions that are backwards-incompatible and whenever a user sets the syncWithPublicNamespace parameter or the deprecateExistingEntities parameter to true.

The IDs for all of the entities should be in URN format. Each entity must be in the user's namespace. Users can't create entities in the public namespace, but entity definitions can refer to entities in the public namespace.

Valid entities are Device, DeviceModel, Service, Capability, State, Action, Event, Property, Mapping, Enum.

Examples:

Request syntax with placeholder values


resp = client.upload_entity_definitions({
  document: {
    language: "GRAPHQL", # required, accepts GRAPHQL
    text: "DefinitionText", # required
  },
  sync_with_public_namespace: false,
  deprecate_existing_entities: false,
})

Response structure


resp.upload_id #=> String

Options Hash (options):

  • :document (Types::DefinitionDocument)

    The DefinitionDocument that defines the updated entities.

  • :sync_with_public_namespace (Boolean)

    A Boolean that specifies whether to synchronize with the latest version of the public namespace. If set to true, the upload will create a new namespace version.

  • :deprecate_existing_entities (Boolean)

    A Boolean that specifies whether to deprecate all entities in the latest version before uploading the new DefinitionDocument. If set to true, the upload will create a new namespace version.

Returns:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

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

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.