A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/sdkforruby/api/Aws/IoTThingsGraph/Client.html below:

Client — AWS SDK for Ruby V2

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

Class: Aws::IoTThingsGraph::Client 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:

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

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:

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.

Attribute Summary collapse 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

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.

#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.

#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.

#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.

#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).

#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.

#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.

#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.

#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.

#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.

#deprecate_system_template(options = {}) ⇒ Struct

Deprecates the specified system.

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

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

#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.

#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.

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

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

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

#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.

#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.

#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.

#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.

#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.

#tag_resource(options = {}) ⇒ Struct

Creates a tag for the specified resource.

#untag_resource(options = {}) ⇒ Struct

Removes a tag from the specified resource.

#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.

#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.

#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.

#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
#waiter_names ⇒ Array<Symbol>

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

Waiter Name Client Method Default Delay: Default Max Attempts:

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4