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

Class: Aws::Greengrass::Client

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

Overview

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

greengrass = Aws::Greengrass::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::Greengrass::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::Greengrass::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.

  • :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_role_to_group(options = {}) ⇒ Types::AssociateRoleToGroupResponse

Associates a role with a group. Your Greengrass core will use the role to access AWS cloud services. The role's permissions should allow Greengrass core Lambda functions to perform actions against the cloud.

Examples:

Request syntax with placeholder values


resp = client.associate_role_to_group({
  group_id: "__string", # required
  role_arn: "__string",
})

Response structure


resp.associated_at #=> String

Options Hash (options):

  • :group_id (required, String)
  • :role_arn (String)

    The ARN of the role you wish to associate with this group.

Returns:

See Also:

#associate_service_role_to_account(options = {}) ⇒ Types::AssociateServiceRoleToAccountResponse

Associates a role with your account. AWS IoT Greengrass will use the role to access your Lambda functions and AWS IoT resources. This is necessary for deployments to succeed. The role must have at least minimum permissions in the policy ''AWSGreengrassResourceAccessRolePolicy''.

Examples:

Request syntax with placeholder values


resp = client.({
  role_arn: "__string",
})

Response structure


resp.associated_at #=> String

Options Hash (options):

  • :role_arn (String)

    The ARN of the service role you wish to associate with your account.

Returns:

See Also:

#create_connector_definition(options = {}) ⇒ Types::CreateConnectorDefinitionResponse

Creates a connector definition. You may provide the initial version of the connector definition now or use ''CreateConnectorDefinitionVersion'' at a later time.

Examples:

Request syntax with placeholder values


resp = client.create_connector_definition({
  amzn_client_token: "__string",
  initial_version: {
    connectors: [
      {
        connector_arn: "__string",
        id: "__string",
        parameters: {
          "__string" => "__string",
        },
      },
    ],
  },
  name: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :initial_version (Types::ConnectorDefinitionVersion)

    Information about the connector definition version, which is a container for connectors.

  • :name (String)
  • :tags (Hash<String,String>)

Returns:

See Also:

#create_connector_definition_version(options = {}) ⇒ Types::CreateConnectorDefinitionVersionResponse

Creates a version of a connector definition which has already been defined.

Examples:

Request syntax with placeholder values


resp = client.create_connector_definition_version({
  amzn_client_token: "__string",
  connector_definition_id: "__string", # required
  connectors: [
    {
      connector_arn: "__string",
      id: "__string",
      parameters: {
        "__string" => "__string",
      },
    },
  ],
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :connector_definition_id (required, String)
  • :connectors (Array<Types::Connector>)

Returns:

See Also:

#create_core_definition(options = {}) ⇒ Types::CreateCoreDefinitionResponse

Creates a core definition. You may provide the initial version of the core definition now or use ''CreateCoreDefinitionVersion'' at a later time. Greengrass groups must each contain exactly one Greengrass core.

Examples:

Request syntax with placeholder values


resp = client.create_core_definition({
  amzn_client_token: "__string",
  initial_version: {
    cores: [
      {
        certificate_arn: "__string",
        id: "__string",
        sync_shadow: false,
        thing_arn: "__string",
      },
    ],
  },
  name: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :initial_version (Types::CoreDefinitionVersion)

    Information about a core definition version.

  • :name (String)
  • :tags (Hash<String,String>)

Returns:

See Also:

#create_core_definition_version(options = {}) ⇒ Types::CreateCoreDefinitionVersionResponse

Creates a version of a core definition that has already been defined. Greengrass groups must each contain exactly one Greengrass core.

Examples:

Request syntax with placeholder values


resp = client.create_core_definition_version({
  amzn_client_token: "__string",
  core_definition_id: "__string", # required
  cores: [
    {
      certificate_arn: "__string",
      id: "__string",
      sync_shadow: false,
      thing_arn: "__string",
    },
  ],
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :core_definition_id (required, String)
  • :cores (Array<Types::Core>)

Returns:

See Also:

#create_deployment(options = {}) ⇒ Types::CreateDeploymentResponse

Creates a deployment. ''CreateDeployment'' requests are idempotent with respect to the ''X-Amzn-Client-Token'' token and the request parameters.

Examples:

Request syntax with placeholder values


resp = client.create_deployment({
  amzn_client_token: "__string",
  deployment_id: "__string",
  deployment_type: "NewDeployment", # accepts NewDeployment, Redeployment, ResetDeployment, ForceResetDeployment
  group_id: "__string", # required
  group_version_id: "__string",
})

Response structure


resp.deployment_arn #=> String
resp.deployment_id #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :deployment_id (String)

    The ID of the deployment if you wish to redeploy a previous deployment.

  • :deployment_type (String)

    The type of deployment. When used for \'\'CreateDeployment\'\', only \'\'NewDeployment\'\' and \'\'Redeployment\'\' are valid.

  • :group_id (required, String)
  • :group_version_id (String)

    The ID of the group version to be deployed.

Returns:

See Also:

#create_device_definition(options = {}) ⇒ Types::CreateDeviceDefinitionResponse

Creates a device definition. You may provide the initial version of the device definition now or use ''CreateDeviceDefinitionVersion'' at a later time.

Examples:

Request syntax with placeholder values


resp = client.create_device_definition({
  amzn_client_token: "__string",
  initial_version: {
    devices: [
      {
        certificate_arn: "__string",
        id: "__string",
        sync_shadow: false,
        thing_arn: "__string",
      },
    ],
  },
  name: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :initial_version (Types::DeviceDefinitionVersion)

    Information about a device definition version.

  • :name (String)
  • :tags (Hash<String,String>)

Returns:

See Also:

#create_device_definition_version(options = {}) ⇒ Types::CreateDeviceDefinitionVersionResponse

Creates a version of a device definition that has already been defined.

Examples:

Request syntax with placeholder values


resp = client.create_device_definition_version({
  amzn_client_token: "__string",
  device_definition_id: "__string", # required
  devices: [
    {
      certificate_arn: "__string",
      id: "__string",
      sync_shadow: false,
      thing_arn: "__string",
    },
  ],
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :device_definition_id (required, String)
  • :devices (Array<Types::Device>)

Returns:

See Also:

#create_function_definition(options = {}) ⇒ Types::CreateFunctionDefinitionResponse

Creates a Lambda function definition which contains a list of Lambda functions and their configurations to be used in a group. You can create an initial version of the definition by providing a list of Lambda functions and their configurations now, or use ''CreateFunctionDefinitionVersion'' later.

Examples:

Request syntax with placeholder values


resp = client.create_function_definition({
  amzn_client_token: "__string",
  initial_version: {
    default_config: {
      execution: {
        isolation_mode: "GreengrassContainer", # accepts GreengrassContainer, NoContainer
        run_as: {
          gid: 1,
          uid: 1,
        },
      },
    },
    functions: [
      {
        function_arn: "__string",
        function_configuration: {
          encoding_type: "binary", # accepts binary, json
          environment: {
            access_sysfs: false,
            execution: {
              isolation_mode: "GreengrassContainer", # accepts GreengrassContainer, NoContainer
              run_as: {
                gid: 1,
                uid: 1,
              },
            },
            resource_access_policies: [
              {
                permission: "ro", # accepts ro, rw
                resource_id: "__string",
              },
            ],
            variables: {
              "__string" => "__string",
            },
          },
          exec_args: "__string",
          executable: "__string",
          memory_size: 1,
          pinned: false,
          timeout: 1,
        },
        id: "__string",
      },
    ],
  },
  name: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :initial_version (Types::FunctionDefinitionVersion)

    Information about a function definition version.

  • :name (String)
  • :tags (Hash<String,String>)

Returns:

See Also:

#create_function_definition_version(options = {}) ⇒ Types::CreateFunctionDefinitionVersionResponse

Creates a version of a Lambda function definition that has already been defined.

Examples:

Request syntax with placeholder values


resp = client.create_function_definition_version({
  amzn_client_token: "__string",
  default_config: {
    execution: {
      isolation_mode: "GreengrassContainer", # accepts GreengrassContainer, NoContainer
      run_as: {
        gid: 1,
        uid: 1,
      },
    },
  },
  function_definition_id: "__string", # required
  functions: [
    {
      function_arn: "__string",
      function_configuration: {
        encoding_type: "binary", # accepts binary, json
        environment: {
          access_sysfs: false,
          execution: {
            isolation_mode: "GreengrassContainer", # accepts GreengrassContainer, NoContainer
            run_as: {
              gid: 1,
              uid: 1,
            },
          },
          resource_access_policies: [
            {
              permission: "ro", # accepts ro, rw
              resource_id: "__string",
            },
          ],
          variables: {
            "__string" => "__string",
          },
        },
        exec_args: "__string",
        executable: "__string",
        memory_size: 1,
        pinned: false,
        timeout: 1,
      },
      id: "__string",
    },
  ],
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :default_config (Types::FunctionDefaultConfig)

    The default configuration that applies to all Lambda functions in the group. Individual Lambda functions can override these settings.

  • :function_definition_id (required, String)
  • :functions (Array<Types::Function>)

Returns:

See Also:

#create_group(options = {}) ⇒ Types::CreateGroupResponse

Creates a group. You may provide the initial version of the group or use ''CreateGroupVersion'' at a later time. Tip: You can use the ''gg_group_setup'' package (https://github.com/awslabs/aws-greengrass-group-setup) as a library or command-line application to create and deploy Greengrass groups.

Examples:

Request syntax with placeholder values


resp = client.create_group({
  amzn_client_token: "__string",
  initial_version: {
    connector_definition_version_arn: "__string",
    core_definition_version_arn: "__string",
    device_definition_version_arn: "__string",
    function_definition_version_arn: "__string",
    logger_definition_version_arn: "__string",
    resource_definition_version_arn: "__string",
    subscription_definition_version_arn: "__string",
  },
  name: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :initial_version (Types::GroupVersion)

    Information about a group version.

  • :name (String)
  • :tags (Hash<String,String>)

Returns:

See Also:

#create_group_certificate_authority(options = {}) ⇒ Types::CreateGroupCertificateAuthorityResponse

Creates a CA for the group. If a CA already exists, it will rotate the existing CA.

Examples:

Request syntax with placeholder values


resp = client.create_group_certificate_authority({
  amzn_client_token: "__string",
  group_id: "__string", # required
})

Response structure


resp.group_certificate_authority_arn #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :group_id (required, String)

Returns:

See Also:

#create_group_version(options = {}) ⇒ Types::CreateGroupVersionResponse

Creates a version of a group which has already been defined.

Examples:

Request syntax with placeholder values


resp = client.create_group_version({
  amzn_client_token: "__string",
  connector_definition_version_arn: "__string",
  core_definition_version_arn: "__string",
  device_definition_version_arn: "__string",
  function_definition_version_arn: "__string",
  group_id: "__string", # required
  logger_definition_version_arn: "__string",
  resource_definition_version_arn: "__string",
  subscription_definition_version_arn: "__string",
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :connector_definition_version_arn (String)
  • :core_definition_version_arn (String)
  • :device_definition_version_arn (String)
  • :function_definition_version_arn (String)
  • :group_id (required, String)
  • :logger_definition_version_arn (String)
  • :resource_definition_version_arn (String)
  • :subscription_definition_version_arn (String)

Returns:

See Also:

#create_logger_definition(options = {}) ⇒ Types::CreateLoggerDefinitionResponse

Creates a logger definition. You may provide the initial version of the logger definition now or use ''CreateLoggerDefinitionVersion'' at a later time.

Examples:

Request syntax with placeholder values


resp = client.create_logger_definition({
  amzn_client_token: "__string",
  initial_version: {
    loggers: [
      {
        component: "GreengrassSystem", # accepts GreengrassSystem, Lambda
        id: "__string",
        level: "DEBUG", # accepts DEBUG, INFO, WARN, ERROR, FATAL
        space: 1,
        type: "FileSystem", # accepts FileSystem, AWSCloudWatch
      },
    ],
  },
  name: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :initial_version (Types::LoggerDefinitionVersion)

    Information about a logger definition version.

  • :name (String)
  • :tags (Hash<String,String>)

Returns:

See Also:

#create_logger_definition_version(options = {}) ⇒ Types::CreateLoggerDefinitionVersionResponse

Creates a version of a logger definition that has already been defined.

Examples:

Request syntax with placeholder values


resp = client.create_logger_definition_version({
  amzn_client_token: "__string",
  logger_definition_id: "__string", # required
  loggers: [
    {
      component: "GreengrassSystem", # accepts GreengrassSystem, Lambda
      id: "__string",
      level: "DEBUG", # accepts DEBUG, INFO, WARN, ERROR, FATAL
      space: 1,
      type: "FileSystem", # accepts FileSystem, AWSCloudWatch
    },
  ],
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :logger_definition_id (required, String)
  • :loggers (Array<Types::Logger>)

Returns:

See Also:

#create_resource_definition(options = {}) ⇒ Types::CreateResourceDefinitionResponse

Creates a resource definition which contains a list of resources to be used in a group. You can create an initial version of the definition by providing a list of resources now, or use ''CreateResourceDefinitionVersion'' later.

Examples:

Request syntax with placeholder values


resp = client.create_resource_definition({
  amzn_client_token: "__string",
  initial_version: {
    resources: [
      {
        id: "__string",
        name: "__string",
        resource_data_container: {
          local_device_resource_data: {
            group_owner_setting: {
              auto_add_group_owner: false,
              group_owner: "__string",
            },
            source_path: "__string",
          },
          local_volume_resource_data: {
            destination_path: "__string",
            group_owner_setting: {
              auto_add_group_owner: false,
              group_owner: "__string",
            },
            source_path: "__string",
          },
          s3_machine_learning_model_resource_data: {
            destination_path: "__string",
            s3_uri: "__string",
          },
          sage_maker_machine_learning_model_resource_data: {
            destination_path: "__string",
            sage_maker_job_arn: "__string",
          },
          secrets_manager_secret_resource_data: {
            arn: "__string",
            additional_staging_labels_to_download: ["__string"],
          },
        },
      },
    ],
  },
  name: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :initial_version (Types::ResourceDefinitionVersion)

    Information about a resource definition version.

  • :name (String)
  • :tags (Hash<String,String>)

Returns:

See Also:

#create_resource_definition_version(options = {}) ⇒ Types::CreateResourceDefinitionVersionResponse

Creates a version of a resource definition that has already been defined.

Examples:

Request syntax with placeholder values


resp = client.create_resource_definition_version({
  amzn_client_token: "__string",
  resource_definition_id: "__string", # required
  resources: [
    {
      id: "__string",
      name: "__string",
      resource_data_container: {
        local_device_resource_data: {
          group_owner_setting: {
            auto_add_group_owner: false,
            group_owner: "__string",
          },
          source_path: "__string",
        },
        local_volume_resource_data: {
          destination_path: "__string",
          group_owner_setting: {
            auto_add_group_owner: false,
            group_owner: "__string",
          },
          source_path: "__string",
        },
        s3_machine_learning_model_resource_data: {
          destination_path: "__string",
          s3_uri: "__string",
        },
        sage_maker_machine_learning_model_resource_data: {
          destination_path: "__string",
          sage_maker_job_arn: "__string",
        },
        secrets_manager_secret_resource_data: {
          arn: "__string",
          additional_staging_labels_to_download: ["__string"],
        },
      },
    },
  ],
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :resource_definition_id (required, String)
  • :resources (Array<Types::Resource>)

Returns:

See Also:

#create_software_update_job(options = {}) ⇒ Types::CreateSoftwareUpdateJobResponse

Creates a software update for a core or group of cores (specified as an IoT thing group.) Use this to update the OTA Agent as well as the Greengrass core software. It makes use of the IoT Jobs feature which provides additional commands to manage a Greengrass core software update job.

Examples:

Request syntax with placeholder values


resp = client.create_software_update_job({
  amzn_client_token: "__string",
  s3_url_signer_role: "S3UrlSignerRole",
  software_to_update: "core", # accepts core, ota_agent
  update_agent_log_level: "NONE", # accepts NONE, TRACE, DEBUG, VERBOSE, INFO, WARN, ERROR, FATAL
  update_targets: ["__string"],
  update_targets_architecture: "armv7l", # accepts armv7l, x86_64, aarch64
  update_targets_operating_system: "ubuntu", # accepts ubuntu, raspbian, amazon_linux
})

Response structure


resp.iot_job_arn #=> String
resp.iot_job_id #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :s3_url_signer_role (String)

    The IAM Role that Greengrass will use to create pre-signed URLs pointing towards the update artifact.

  • :software_to_update (String)

    The piece of software on the Greengrass core that will be updated.

  • :update_agent_log_level (String)

    The minimum level of log statements that should be logged by the OTA Agent during an update.

  • :update_targets (Array<String>)

    The ARNs of the targets (IoT things or IoT thing groups) that this update will be applied to.

  • :update_targets_architecture (String)

    The architecture of the cores which are the targets of an update.

  • :update_targets_operating_system (String)

    The operating system of the cores which are the targets of an update.

Returns:

See Also:

#create_subscription_definition(options = {}) ⇒ Types::CreateSubscriptionDefinitionResponse

Creates a subscription definition. You may provide the initial version of the subscription definition now or use ''CreateSubscriptionDefinitionVersion'' at a later time.

Examples:

Request syntax with placeholder values


resp = client.create_subscription_definition({
  amzn_client_token: "__string",
  initial_version: {
    subscriptions: [
      {
        id: "__string",
        source: "__string",
        subject: "__string",
        target: "__string",
      },
    ],
  },
  name: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :initial_version (Types::SubscriptionDefinitionVersion)

    Information about a subscription definition version.

  • :name (String)
  • :tags (Hash<String,String>)

Returns:

See Also:

#create_subscription_definition_version(options = {}) ⇒ Types::CreateSubscriptionDefinitionVersionResponse

Creates a version of a subscription definition which has already been defined.

Examples:

Request syntax with placeholder values


resp = client.create_subscription_definition_version({
  amzn_client_token: "__string",
  subscription_definition_id: "__string", # required
  subscriptions: [
    {
      id: "__string",
      source: "__string",
      subject: "__string",
      target: "__string",
    },
  ],
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :subscription_definition_id (required, String)
  • :subscriptions (Array<Types::Subscription>)

Returns:

See Also:

#delete_connector_definition(options = {}) ⇒ Struct

Deletes a connector definition.

Examples:

Request syntax with placeholder values


resp = client.delete_connector_definition({
  connector_definition_id: "__string", # required
})

Options Hash (options):

  • :connector_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_core_definition(options = {}) ⇒ Struct

Deletes a core definition.

Examples:

Request syntax with placeholder values


resp = client.delete_core_definition({
  core_definition_id: "__string", # required
})

Options Hash (options):

  • :core_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_device_definition(options = {}) ⇒ Struct

Deletes a device definition.

Examples:

Request syntax with placeholder values


resp = client.delete_device_definition({
  device_definition_id: "__string", # required
})

Options Hash (options):

  • :device_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_function_definition(options = {}) ⇒ Struct

Deletes a Lambda function definition.

Examples:

Request syntax with placeholder values


resp = client.delete_function_definition({
  function_definition_id: "__string", # required
})

Options Hash (options):

  • :function_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_group(options = {}) ⇒ Struct

Deletes a group.

Examples:

Request syntax with placeholder values


resp = client.delete_group({
  group_id: "__string", # required
})

Options Hash (options):

  • :group_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_logger_definition(options = {}) ⇒ Struct

Deletes a logger definition.

Examples:

Request syntax with placeholder values


resp = client.delete_logger_definition({
  logger_definition_id: "__string", # required
})

Options Hash (options):

  • :logger_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_resource_definition(options = {}) ⇒ Struct

Deletes a resource definition.

Examples:

Request syntax with placeholder values


resp = client.delete_resource_definition({
  resource_definition_id: "__string", # required
})

Options Hash (options):

  • :resource_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_subscription_definition(options = {}) ⇒ Struct

Deletes a subscription definition.

Examples:

Request syntax with placeholder values


resp = client.delete_subscription_definition({
  subscription_definition_id: "__string", # required
})

Options Hash (options):

  • :subscription_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#disassociate_role_from_group(options = {}) ⇒ Types::DisassociateRoleFromGroupResponse

Disassociates the role from a group.

Examples:

Request syntax with placeholder values


resp = client.disassociate_role_from_group({
  group_id: "__string", # required
})

Response structure


resp.disassociated_at #=> String

Options Hash (options):

  • :group_id (required, String)

Returns:

See Also:

#disassociate_service_role_from_account(options = {}) ⇒ Types::DisassociateServiceRoleFromAccountResponse

Disassociates the service role from your account. Without a service role, deployments will not work.

Examples:

Request syntax with placeholder values


resp = client.()

Response structure


resp.disassociated_at #=> String

Returns:

See Also:

#get_associated_role(options = {}) ⇒ Types::GetAssociatedRoleResponse

Retrieves the role associated with a particular group.

Examples:

Request syntax with placeholder values


resp = client.get_associated_role({
  group_id: "__string", # required
})

Response structure


resp.associated_at #=> String
resp.role_arn #=> String

Options Hash (options):

  • :group_id (required, String)

Returns:

See Also:

#get_bulk_deployment_status(options = {}) ⇒ Types::GetBulkDeploymentStatusResponse

Returns the status of a bulk deployment.

Examples:

Request syntax with placeholder values


resp = client.get_bulk_deployment_status({
  bulk_deployment_id: "__string", # required
})

Response structure


resp.bulk_deployment_metrics.invalid_input_records #=> Integer
resp.bulk_deployment_metrics.records_processed #=> Integer
resp.bulk_deployment_metrics.retry_attempts #=> Integer
resp.bulk_deployment_status #=> String, one of "Initializing", "Running", "Completed", "Stopping", "Stopped", "Failed"
resp.created_at #=> String
resp.error_details #=> Array
resp.error_details[0].detailed_error_code #=> String
resp.error_details[0].detailed_error_message #=> String
resp.error_message #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :bulk_deployment_id (required, String)

Returns:

See Also:

#get_connectivity_info(options = {}) ⇒ Types::GetConnectivityInfoResponse

Retrieves the connectivity information for a core.

Examples:

Request syntax with placeholder values


resp = client.get_connectivity_info({
  thing_name: "__string", # required
})

Response structure


resp.connectivity_info #=> Array
resp.connectivity_info[0].host_address #=> String
resp.connectivity_info[0].id #=> String
resp.connectivity_info[0]. #=> String
resp.connectivity_info[0].port_number #=> Integer
resp.message #=> String

Options Hash (options):

  • :thing_name (required, String)

Returns:

See Also:

#get_connector_definition(options = {}) ⇒ Types::GetConnectorDefinitionResponse

Retrieves information about a connector definition.

Examples:

Request syntax with placeholder values


resp = client.get_connector_definition({
  connector_definition_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :connector_definition_id (required, String)

Returns:

See Also:

#get_connector_definition_version(options = {}) ⇒ Types::GetConnectorDefinitionVersionResponse

Retrieves information about a connector definition version, including the connectors that the version contains. Connectors are prebuilt modules that interact with local infrastructure, device protocols, AWS, and other cloud services.

Examples:

Request syntax with placeholder values


resp = client.get_connector_definition_version({
  connector_definition_id: "__string", # required
  connector_definition_version_id: "__string", # required
  next_token: "__string",
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.definition.connectors #=> Array
resp.definition.connectors[0].connector_arn #=> String
resp.definition.connectors[0].id #=> String
resp.definition.connectors[0].parameters #=> Hash
resp.definition.connectors[0].parameters["__string"] #=> String
resp.id #=> String
resp.next_token #=> String
resp.version #=> String

Options Hash (options):

  • :connector_definition_id (required, String)
  • :connector_definition_version_id (required, String)
  • :next_token (String)

Returns:

See Also:

#get_core_definition(options = {}) ⇒ Types::GetCoreDefinitionResponse

Retrieves information about a core definition version.

Examples:

Request syntax with placeholder values


resp = client.get_core_definition({
  core_definition_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :core_definition_id (required, String)

Returns:

See Also:

#get_core_definition_version(options = {}) ⇒ Types::GetCoreDefinitionVersionResponse

Retrieves information about a core definition version.

Examples:

Request syntax with placeholder values


resp = client.get_core_definition_version({
  core_definition_id: "__string", # required
  core_definition_version_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.definition.cores #=> Array
resp.definition.cores[0].certificate_arn #=> String
resp.definition.cores[0].id #=> String
resp.definition.cores[0].sync_shadow #=> true/false
resp.definition.cores[0].thing_arn #=> String
resp.id #=> String
resp.next_token #=> String
resp.version #=> String

Options Hash (options):

  • :core_definition_id (required, String)
  • :core_definition_version_id (required, String)

Returns:

See Also:

#get_deployment_status(options = {}) ⇒ Types::GetDeploymentStatusResponse

Returns the status of a deployment.

Examples:

Request syntax with placeholder values


resp = client.get_deployment_status({
  deployment_id: "__string", # required
  group_id: "__string", # required
})

Response structure


resp.deployment_status #=> String
resp.deployment_type #=> String, one of "NewDeployment", "Redeployment", "ResetDeployment", "ForceResetDeployment"
resp.error_details #=> Array
resp.error_details[0].detailed_error_code #=> String
resp.error_details[0].detailed_error_message #=> String
resp.error_message #=> String
resp.updated_at #=> String

Options Hash (options):

  • :deployment_id (required, String)
  • :group_id (required, String)

Returns:

See Also:

#get_device_definition(options = {}) ⇒ Types::GetDeviceDefinitionResponse

Retrieves information about a device definition.

Examples:

Request syntax with placeholder values


resp = client.get_device_definition({
  device_definition_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :device_definition_id (required, String)

Returns:

See Also:

#get_device_definition_version(options = {}) ⇒ Types::GetDeviceDefinitionVersionResponse

Retrieves information about a device definition version.

Examples:

Request syntax with placeholder values


resp = client.get_device_definition_version({
  device_definition_id: "__string", # required
  device_definition_version_id: "__string", # required
  next_token: "__string",
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.definition.devices #=> Array
resp.definition.devices[0].certificate_arn #=> String
resp.definition.devices[0].id #=> String
resp.definition.devices[0].sync_shadow #=> true/false
resp.definition.devices[0].thing_arn #=> String
resp.id #=> String
resp.next_token #=> String
resp.version #=> String

Options Hash (options):

  • :device_definition_id (required, String)
  • :device_definition_version_id (required, String)
  • :next_token (String)

Returns:

See Also:

#get_function_definition(options = {}) ⇒ Types::GetFunctionDefinitionResponse

Retrieves information about a Lambda function definition, including its creation time and latest version.

Examples:

Request syntax with placeholder values


resp = client.get_function_definition({
  function_definition_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :function_definition_id (required, String)

Returns:

See Also:

#get_function_definition_version(options = {}) ⇒ Types::GetFunctionDefinitionVersionResponse

Retrieves information about a Lambda function definition version, including which Lambda functions are included in the version and their configurations.

Examples:

Request syntax with placeholder values


resp = client.get_function_definition_version({
  function_definition_id: "__string", # required
  function_definition_version_id: "__string", # required
  next_token: "__string",
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.definition.default_config.execution.isolation_mode #=> String, one of "GreengrassContainer", "NoContainer"
resp.definition.default_config.execution.run_as.gid #=> Integer
resp.definition.default_config.execution.run_as.uid #=> Integer
resp.definition.functions #=> Array
resp.definition.functions[0].function_arn #=> String
resp.definition.functions[0].function_configuration.encoding_type #=> String, one of "binary", "json"
resp.definition.functions[0].function_configuration.environment.access_sysfs #=> true/false
resp.definition.functions[0].function_configuration.environment.execution.isolation_mode #=> String, one of "GreengrassContainer", "NoContainer"
resp.definition.functions[0].function_configuration.environment.execution.run_as.gid #=> Integer
resp.definition.functions[0].function_configuration.environment.execution.run_as.uid #=> Integer
resp.definition.functions[0].function_configuration.environment.resource_access_policies #=> Array
resp.definition.functions[0].function_configuration.environment.resource_access_policies[0].permission #=> String, one of "ro", "rw"
resp.definition.functions[0].function_configuration.environment.resource_access_policies[0].resource_id #=> String
resp.definition.functions[0].function_configuration.environment.variables #=> Hash
resp.definition.functions[0].function_configuration.environment.variables["__string"] #=> String
resp.definition.functions[0].function_configuration.exec_args #=> String
resp.definition.functions[0].function_configuration.executable #=> String
resp.definition.functions[0].function_configuration.memory_size #=> Integer
resp.definition.functions[0].function_configuration.pinned #=> true/false
resp.definition.functions[0].function_configuration.timeout #=> Integer
resp.definition.functions[0].id #=> String
resp.id #=> String
resp.next_token #=> String
resp.version #=> String

Options Hash (options):

  • :function_definition_id (required, String)
  • :function_definition_version_id (required, String)
  • :next_token (String)

Returns:

See Also:

#get_group(options = {}) ⇒ Types::GetGroupResponse

Retrieves information about a group.

Examples:

Request syntax with placeholder values


resp = client.get_group({
  group_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :group_id (required, String)

Returns:

See Also:

#get_group_certificate_authority(options = {}) ⇒ Types::GetGroupCertificateAuthorityResponse

Retreives the CA associated with a group. Returns the public key of the CA.

Examples:

Request syntax with placeholder values


resp = client.get_group_certificate_authority({
  certificate_authority_id: "__string", # required
  group_id: "__string", # required
})

Response structure


resp.group_certificate_authority_arn #=> String
resp.group_certificate_authority_id #=> String
resp.pem_encoded_certificate #=> String

Options Hash (options):

  • :certificate_authority_id (required, String)
  • :group_id (required, String)

Returns:

See Also:

#get_group_certificate_configuration(options = {}) ⇒ Types::GetGroupCertificateConfigurationResponse

Retrieves the current configuration for the CA used by the group.

Examples:

Request syntax with placeholder values


resp = client.get_group_certificate_configuration({
  group_id: "__string", # required
})

Response structure


resp.certificate_authority_expiry_in_milliseconds #=> String
resp.certificate_expiry_in_milliseconds #=> String
resp.group_id #=> String

Options Hash (options):

  • :group_id (required, String)

Returns:

See Also:

#get_group_version(options = {}) ⇒ Types::GetGroupVersionResponse

Retrieves information about a group version.

Examples:

Request syntax with placeholder values


resp = client.get_group_version({
  group_id: "__string", # required
  group_version_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.definition.connector_definition_version_arn #=> String
resp.definition.core_definition_version_arn #=> String
resp.definition.device_definition_version_arn #=> String
resp.definition.function_definition_version_arn #=> String
resp.definition.logger_definition_version_arn #=> String
resp.definition.resource_definition_version_arn #=> String
resp.definition.subscription_definition_version_arn #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :group_id (required, String)
  • :group_version_id (required, String)

Returns:

See Also:

#get_logger_definition(options = {}) ⇒ Types::GetLoggerDefinitionResponse

Retrieves information about a logger definition.

Examples:

Request syntax with placeholder values


resp = client.get_logger_definition({
  logger_definition_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :logger_definition_id (required, String)

Returns:

See Also:

#get_logger_definition_version(options = {}) ⇒ Types::GetLoggerDefinitionVersionResponse

Retrieves information about a logger definition version.

Examples:

Request syntax with placeholder values


resp = client.get_logger_definition_version({
  logger_definition_id: "__string", # required
  logger_definition_version_id: "__string", # required
  next_token: "__string",
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.definition.loggers #=> Array
resp.definition.loggers[0].component #=> String, one of "GreengrassSystem", "Lambda"
resp.definition.loggers[0].id #=> String
resp.definition.loggers[0].level #=> String, one of "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.definition.loggers[0].space #=> Integer
resp.definition.loggers[0].type #=> String, one of "FileSystem", "AWSCloudWatch"
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :logger_definition_id (required, String)
  • :logger_definition_version_id (required, String)
  • :next_token (String)

Returns:

See Also:

#get_resource_definition(options = {}) ⇒ Types::GetResourceDefinitionResponse

Retrieves information about a resource definition, including its creation time and latest version.

Examples:

Request syntax with placeholder values


resp = client.get_resource_definition({
  resource_definition_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :resource_definition_id (required, String)

Returns:

See Also:

#get_resource_definition_version(options = {}) ⇒ Types::GetResourceDefinitionVersionResponse

Retrieves information about a resource definition version, including which resources are included in the version.

Examples:

Request syntax with placeholder values


resp = client.get_resource_definition_version({
  resource_definition_id: "__string", # required
  resource_definition_version_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.definition.resources #=> Array
resp.definition.resources[0].id #=> String
resp.definition.resources[0].name #=> String
resp.definition.resources[0].resource_data_container.local_device_resource_data.group_owner_setting.auto_add_group_owner #=> true/false
resp.definition.resources[0].resource_data_container.local_device_resource_data.group_owner_setting.group_owner #=> String
resp.definition.resources[0].resource_data_container.local_device_resource_data.source_path #=> String
resp.definition.resources[0].resource_data_container.local_volume_resource_data.destination_path #=> String
resp.definition.resources[0].resource_data_container.local_volume_resource_data.group_owner_setting.auto_add_group_owner #=> true/false
resp.definition.resources[0].resource_data_container.local_volume_resource_data.group_owner_setting.group_owner #=> String
resp.definition.resources[0].resource_data_container.local_volume_resource_data.source_path #=> String
resp.definition.resources[0].resource_data_container.s3_machine_learning_model_resource_data.destination_path #=> String
resp.definition.resources[0].resource_data_container.s3_machine_learning_model_resource_data.s3_uri #=> String
resp.definition.resources[0].resource_data_container.sage_maker_machine_learning_model_resource_data.destination_path #=> String
resp.definition.resources[0].resource_data_container.sage_maker_machine_learning_model_resource_data.sage_maker_job_arn #=> String
resp.definition.resources[0].resource_data_container.secrets_manager_secret_resource_data.arn #=> String
resp.definition.resources[0].resource_data_container.secrets_manager_secret_resource_data.additional_staging_labels_to_download #=> Array
resp.definition.resources[0].resource_data_container.secrets_manager_secret_resource_data.additional_staging_labels_to_download[0] #=> String
resp.id #=> String
resp.version #=> String

Options Hash (options):

  • :resource_definition_id (required, String)
  • :resource_definition_version_id (required, String)

Returns:

See Also:

#get_service_role_for_account(options = {}) ⇒ Types::GetServiceRoleForAccountResponse

Retrieves the service role that is attached to your account.

Examples:

Request syntax with placeholder values


resp = client.()

Response structure


resp.associated_at #=> String
resp.role_arn #=> String

Returns:

See Also:

#get_subscription_definition(options = {}) ⇒ Types::GetSubscriptionDefinitionResponse

Retrieves information about a subscription definition.

Examples:

Request syntax with placeholder values


resp = client.get_subscription_definition({
  subscription_definition_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.id #=> String
resp.last_updated_timestamp #=> String
resp.latest_version #=> String
resp.latest_version_arn #=> String
resp.name #=> String
resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :subscription_definition_id (required, String)

Returns:

See Also:

#get_subscription_definition_version(options = {}) ⇒ Types::GetSubscriptionDefinitionVersionResponse

Retrieves information about a subscription definition version.

Examples:

Request syntax with placeholder values


resp = client.get_subscription_definition_version({
  next_token: "__string",
  subscription_definition_id: "__string", # required
  subscription_definition_version_id: "__string", # required
})

Response structure


resp.arn #=> String
resp.creation_timestamp #=> String
resp.definition.subscriptions #=> Array
resp.definition.subscriptions[0].id #=> String
resp.definition.subscriptions[0].source #=> String
resp.definition.subscriptions[0].subject #=> String
resp.definition.subscriptions[0].target #=> String
resp.id #=> String
resp.next_token #=> String
resp.version #=> String

Options Hash (options):

  • :next_token (String)
  • :subscription_definition_id (required, String)
  • :subscription_definition_version_id (required, String)

Returns:

See Also:

#list_bulk_deployment_detailed_reports(options = {}) ⇒ Types::ListBulkDeploymentDetailedReportsResponse

Gets a paginated list of the deployments that have been started in a bulk deployment operation, and their current deployment status.

Examples:

Request syntax with placeholder values


resp = client.list_bulk_deployment_detailed_reports({
  bulk_deployment_id: "__string", # required
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.deployments #=> Array
resp.deployments[0].created_at #=> String
resp.deployments[0].deployment_arn #=> String
resp.deployments[0].deployment_id #=> String
resp.deployments[0].deployment_status #=> String
resp.deployments[0].deployment_type #=> String, one of "NewDeployment", "Redeployment", "ResetDeployment", "ForceResetDeployment"
resp.deployments[0].error_details #=> Array
resp.deployments[0].error_details[0].detailed_error_code #=> String
resp.deployments[0].error_details[0].detailed_error_message #=> String
resp.deployments[0].error_message #=> String
resp.deployments[0].group_arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :bulk_deployment_id (required, String)
  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_bulk_deployments(options = {}) ⇒ Types::ListBulkDeploymentsResponse

Returns a list of bulk deployments.

Examples:

Request syntax with placeholder values


resp = client.list_bulk_deployments({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.bulk_deployments #=> Array
resp.bulk_deployments[0].bulk_deployment_arn #=> String
resp.bulk_deployments[0].bulk_deployment_id #=> String
resp.bulk_deployments[0].created_at #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_connector_definition_versions(options = {}) ⇒ Types::ListConnectorDefinitionVersionsResponse

Lists the versions of a connector definition, which are containers for connectors. Connectors run on the Greengrass core and contain built-in integration with local infrastructure, device protocols, AWS, and other cloud services.

Examples:

Request syntax with placeholder values


resp = client.list_connector_definition_versions({
  connector_definition_id: "__string", # required
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.next_token #=> String
resp.versions #=> Array
resp.versions[0].arn #=> String
resp.versions[0].creation_timestamp #=> String
resp.versions[0].id #=> String
resp.versions[0].version #=> String

Options Hash (options):

  • :connector_definition_id (required, String)
  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_connector_definitions(options = {}) ⇒ Types::ListConnectorDefinitionsResponse

Retrieves a list of connector definitions.

Examples:

Request syntax with placeholder values


resp = client.list_connector_definitions({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.definitions #=> Array
resp.definitions[0].arn #=> String
resp.definitions[0].creation_timestamp #=> String
resp.definitions[0].id #=> String
resp.definitions[0].last_updated_timestamp #=> String
resp.definitions[0].latest_version #=> String
resp.definitions[0].latest_version_arn #=> String
resp.definitions[0].name #=> String
resp.definitions[0].tags #=> Hash
resp.definitions[0].tags["__string"] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_core_definition_versions(options = {}) ⇒ Types::ListCoreDefinitionVersionsResponse

Lists the versions of a core definition.

Examples:

Request syntax with placeholder values


resp = client.list_core_definition_versions({
  core_definition_id: "__string", # required
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.next_token #=> String
resp.versions #=> Array
resp.versions[0].arn #=> String
resp.versions[0].creation_timestamp #=> String
resp.versions[0].id #=> String
resp.versions[0].version #=> String

Options Hash (options):

  • :core_definition_id (required, String)
  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_core_definitions(options = {}) ⇒ Types::ListCoreDefinitionsResponse

Retrieves a list of core definitions.

Examples:

Request syntax with placeholder values


resp = client.list_core_definitions({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.definitions #=> Array
resp.definitions[0].arn #=> String
resp.definitions[0].creation_timestamp #=> String
resp.definitions[0].id #=> String
resp.definitions[0].last_updated_timestamp #=> String
resp.definitions[0].latest_version #=> String
resp.definitions[0].latest_version_arn #=> String
resp.definitions[0].name #=> String
resp.definitions[0].tags #=> Hash
resp.definitions[0].tags["__string"] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_deployments(options = {}) ⇒ Types::ListDeploymentsResponse

Returns a history of deployments for the group.

Examples:

Request syntax with placeholder values


resp = client.list_deployments({
  group_id: "__string", # required
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.deployments #=> Array
resp.deployments[0].created_at #=> String
resp.deployments[0].deployment_arn #=> String
resp.deployments[0].deployment_id #=> String
resp.deployments[0].deployment_type #=> String, one of "NewDeployment", "Redeployment", "ResetDeployment", "ForceResetDeployment"
resp.deployments[0].group_arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :group_id (required, String)
  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_device_definition_versions(options = {}) ⇒ Types::ListDeviceDefinitionVersionsResponse

Lists the versions of a device definition.

Examples:

Request syntax with placeholder values


resp = client.list_device_definition_versions({
  device_definition_id: "__string", # required
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.next_token #=> String
resp.versions #=> Array
resp.versions[0].arn #=> String
resp.versions[0].creation_timestamp #=> String
resp.versions[0].id #=> String
resp.versions[0].version #=> String

Options Hash (options):

  • :device_definition_id (required, String)
  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_device_definitions(options = {}) ⇒ Types::ListDeviceDefinitionsResponse

Retrieves a list of device definitions.

Examples:

Request syntax with placeholder values


resp = client.list_device_definitions({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.definitions #=> Array
resp.definitions[0].arn #=> String
resp.definitions[0].creation_timestamp #=> String
resp.definitions[0].id #=> String
resp.definitions[0].last_updated_timestamp #=> String
resp.definitions[0].latest_version #=> String
resp.definitions[0].latest_version_arn #=> String
resp.definitions[0].name #=> String
resp.definitions[0].tags #=> Hash
resp.definitions[0].tags["__string"] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_function_definition_versions(options = {}) ⇒ Types::ListFunctionDefinitionVersionsResponse

Lists the versions of a Lambda function definition.

Examples:

Request syntax with placeholder values


resp = client.list_function_definition_versions({
  function_definition_id: "__string", # required
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.next_token #=> String
resp.versions #=> Array
resp.versions[0].arn #=> String
resp.versions[0].creation_timestamp #=> String
resp.versions[0].id #=> String
resp.versions[0].version #=> String

Options Hash (options):

  • :function_definition_id (required, String)
  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_function_definitions(options = {}) ⇒ Types::ListFunctionDefinitionsResponse

Retrieves a list of Lambda function definitions.

Examples:

Request syntax with placeholder values


resp = client.list_function_definitions({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.definitions #=> Array
resp.definitions[0].arn #=> String
resp.definitions[0].creation_timestamp #=> String
resp.definitions[0].id #=> String
resp.definitions[0].last_updated_timestamp #=> String
resp.definitions[0].latest_version #=> String
resp.definitions[0].latest_version_arn #=> String
resp.definitions[0].name #=> String
resp.definitions[0].tags #=> Hash
resp.definitions[0].tags["__string"] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_group_certificate_authorities(options = {}) ⇒ Types::ListGroupCertificateAuthoritiesResponse

Retrieves the current CAs for a group.

Examples:

Request syntax with placeholder values


resp = client.list_group_certificate_authorities({
  group_id: "__string", # required
})

Response structure


resp.group_certificate_authorities #=> Array
resp.group_certificate_authorities[0].group_certificate_authority_arn #=> String
resp.group_certificate_authorities[0].group_certificate_authority_id #=> String

Options Hash (options):

  • :group_id (required, String)

Returns:

See Also:

#list_group_versions(options = {}) ⇒ Types::ListGroupVersionsResponse

Lists the versions of a group.

Examples:

Request syntax with placeholder values


resp = client.list_group_versions({
  group_id: "__string", # required
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.next_token #=> String
resp.versions #=> Array
resp.versions[0].arn #=> String
resp.versions[0].creation_timestamp #=> String
resp.versions[0].id #=> String
resp.versions[0].version #=> String

Options Hash (options):

  • :group_id (required, String)
  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_groups(options = {}) ⇒ Types::ListGroupsResponse

Retrieves a list of groups.

Examples:

Request syntax with placeholder values


resp = client.list_groups({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.groups #=> Array
resp.groups[0].arn #=> String
resp.groups[0].creation_timestamp #=> String
resp.groups[0].id #=> String
resp.groups[0].last_updated_timestamp #=> String
resp.groups[0].latest_version #=> String
resp.groups[0].latest_version_arn #=> String
resp.groups[0].name #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_logger_definition_versions(options = {}) ⇒ Types::ListLoggerDefinitionVersionsResponse

Lists the versions of a logger definition.

Examples:

Request syntax with placeholder values


resp = client.list_logger_definition_versions({
  logger_definition_id: "__string", # required
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.next_token #=> String
resp.versions #=> Array
resp.versions[0].arn #=> String
resp.versions[0].creation_timestamp #=> String
resp.versions[0].id #=> String
resp.versions[0].version #=> String

Options Hash (options):

  • :logger_definition_id (required, String)
  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_logger_definitions(options = {}) ⇒ Types::ListLoggerDefinitionsResponse

Retrieves a list of logger definitions.

Examples:

Request syntax with placeholder values


resp = client.list_logger_definitions({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.definitions #=> Array
resp.definitions[0].arn #=> String
resp.definitions[0].creation_timestamp #=> String
resp.definitions[0].id #=> String
resp.definitions[0].last_updated_timestamp #=> String
resp.definitions[0].latest_version #=> String
resp.definitions[0].latest_version_arn #=> String
resp.definitions[0].name #=> String
resp.definitions[0].tags #=> Hash
resp.definitions[0].tags["__string"] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_resource_definition_versions(options = {}) ⇒ Types::ListResourceDefinitionVersionsResponse

Lists the versions of a resource definition.

Examples:

Request syntax with placeholder values


resp = client.list_resource_definition_versions({
  max_results: "__string",
  next_token: "__string",
  resource_definition_id: "__string", # required
})

Response structure


resp.next_token #=> String
resp.versions #=> Array
resp.versions[0].arn #=> String
resp.versions[0].creation_timestamp #=> String
resp.versions[0].id #=> String
resp.versions[0].version #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)
  • :resource_definition_id (required, String)

Returns:

See Also:

#list_resource_definitions(options = {}) ⇒ Types::ListResourceDefinitionsResponse

Retrieves a list of resource definitions.

Examples:

Request syntax with placeholder values


resp = client.list_resource_definitions({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.definitions #=> Array
resp.definitions[0].arn #=> String
resp.definitions[0].creation_timestamp #=> String
resp.definitions[0].id #=> String
resp.definitions[0].last_updated_timestamp #=> String
resp.definitions[0].latest_version #=> String
resp.definitions[0].latest_version_arn #=> String
resp.definitions[0].name #=> String
resp.definitions[0].tags #=> Hash
resp.definitions[0].tags["__string"] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

#list_subscription_definition_versions(options = {}) ⇒ Types::ListSubscriptionDefinitionVersionsResponse

Lists the versions of a subscription definition.

Examples:

Request syntax with placeholder values


resp = client.list_subscription_definition_versions({
  max_results: "__string",
  next_token: "__string",
  subscription_definition_id: "__string", # required
})

Response structure


resp.next_token #=> String
resp.versions #=> Array
resp.versions[0].arn #=> String
resp.versions[0].creation_timestamp #=> String
resp.versions[0].id #=> String
resp.versions[0].version #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)
  • :subscription_definition_id (required, String)

Returns:

See Also:

#list_subscription_definitions(options = {}) ⇒ Types::ListSubscriptionDefinitionsResponse

Retrieves a list of subscription definitions.

Examples:

Request syntax with placeholder values


resp = client.list_subscription_definitions({
  max_results: "__string",
  next_token: "__string",
})

Response structure


resp.definitions #=> Array
resp.definitions[0].arn #=> String
resp.definitions[0].creation_timestamp #=> String
resp.definitions[0].id #=> String
resp.definitions[0].last_updated_timestamp #=> String
resp.definitions[0].latest_version #=> String
resp.definitions[0].latest_version_arn #=> String
resp.definitions[0].name #=> String
resp.definitions[0].tags #=> Hash
resp.definitions[0].tags["__string"] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (String)
  • :next_token (String)

Returns:

See Also:

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

Retrieves a list of resource tags for a resource arn.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "__string", # required
})

Response structure


resp.tags #=> Hash
resp.tags["__string"] #=> String

Options Hash (options):

  • :resource_arn (required, String)

Returns:

See Also:

#reset_deployments(options = {}) ⇒ Types::ResetDeploymentsResponse

Resets a group's deployments.

Examples:

Request syntax with placeholder values


resp = client.reset_deployments({
  amzn_client_token: "__string",
  force: false,
  group_id: "__string", # required
})

Response structure


resp.deployment_arn #=> String
resp.deployment_id #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :force (Boolean)

    If true, performs a best-effort only core reset.

  • :group_id (required, String)

Returns:

See Also:

#start_bulk_deployment(options = {}) ⇒ Types::StartBulkDeploymentResponse

Deploys multiple groups in one operation. This action starts the bulk deployment of a specified set of group versions. Each group version deployment will be triggered with an adaptive rate that has a fixed upper limit. We recommend that you include an ''X-Amzn-Client-Token'' token in every ''StartBulkDeployment'' request. These requests are idempotent with respect to the token and the request parameters.

Examples:

Request syntax with placeholder values


resp = client.start_bulk_deployment({
  amzn_client_token: "__string",
  execution_role_arn: "__string",
  input_file_uri: "__string",
  tags: {
    "__string" => "__string",
  },
})

Response structure


resp.bulk_deployment_arn #=> String
resp.bulk_deployment_id #=> String

Options Hash (options):

  • :amzn_client_token (String)
  • :execution_role_arn (String)

    The ARN of the execution role to associate with the bulk deployment operation. This IAM role must allow the \'\'greengrass:CreateDeployment\'\' action for all group versions that are listed in the input file. This IAM role must have access to the S3 bucket containing the input file.

  • :input_file_uri (String)

    The URI of the input file contained in the S3 bucket. The execution role must have \'\'getObject\'\' permissions on this bucket to access the input file. The input file is a JSON-serialized, line delimited file with UTF-8 encoding that provides a list of group and version IDs and the deployment type. This file must be less than 100 MB. Currently, AWS IoT Greengrass supports only \'\'NewDeployment\'\' deployment types.

  • :tags (Hash<String,String>)

Returns:

See Also:

#stop_bulk_deployment(options = {}) ⇒ Struct

Stops the execution of a bulk deployment. This action returns a status of ''Stopping'' until the deployment is stopped. You cannot start a new bulk deployment while a previous deployment is in the ''Stopping'' state. This action doesn't rollback completed deployments or cancel pending deployments.

Examples:

Request syntax with placeholder values


resp = client.stop_bulk_deployment({
  bulk_deployment_id: "__string", # required
})

Options Hash (options):

  • :bulk_deployment_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#tag_resource(options = {}) ⇒ Struct

Add resource tags to a Greengrass Resource. Valid resources are Group, Connector, Core, Device, Function, Logger, Subscription, and Resource Defintions, and also BulkDeploymentIds.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "__string", # required
  tags: { # required
    "__string" => "__string",
  },
})

Options Hash (options):

  • :resource_arn (required, String)
  • :tags (required, Hash<String,String>)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#untag_resource(options = {}) ⇒ Struct

Remove resource tags from a Greengrass Resource.

Examples:

Request syntax with placeholder values


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

Options Hash (options):

  • :resource_arn (required, String)
  • :tag_keys (required, Array<String>)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_connectivity_info(options = {}) ⇒ Types::UpdateConnectivityInfoResponse

Updates the connectivity information for the core. Any devices that belong to the group which has this core will receive this information in order to find the location of the core and connect to it.

Examples:

Request syntax with placeholder values


resp = client.update_connectivity_info({
  connectivity_info: [
    {
      host_address: "__string",
      id: "__string",
      metadata: "__string",
      port_number: 1,
    },
  ],
  thing_name: "__string", # required
})

Response structure


resp.message #=> String
resp.version #=> String

Options Hash (options):

  • :connectivity_info (Array<Types::ConnectivityInfo>)

    A list of connectivity info.

  • :thing_name (required, String)

Returns:

See Also:

#update_connector_definition(options = {}) ⇒ Struct

Updates a connector definition.

Examples:

Request syntax with placeholder values


resp = client.update_connector_definition({
  connector_definition_id: "__string", # required
  name: "__string",
})

Options Hash (options):

  • :connector_definition_id (required, String)
  • :name (String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_core_definition(options = {}) ⇒ Struct

Updates a core definition.

Examples:

Request syntax with placeholder values


resp = client.update_core_definition({
  core_definition_id: "__string", # required
  name: "__string",
})

Options Hash (options):

  • :core_definition_id (required, String)
  • :name (String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_device_definition(options = {}) ⇒ Struct

Updates a device definition.

Examples:

Request syntax with placeholder values


resp = client.update_device_definition({
  device_definition_id: "__string", # required
  name: "__string",
})

Options Hash (options):

  • :device_definition_id (required, String)
  • :name (String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_function_definition(options = {}) ⇒ Struct

Updates a Lambda function definition.

Examples:

Request syntax with placeholder values


resp = client.update_function_definition({
  function_definition_id: "__string", # required
  name: "__string",
})

Options Hash (options):

  • :function_definition_id (required, String)
  • :name (String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_group(options = {}) ⇒ Struct

Updates a group.

Examples:

Request syntax with placeholder values


resp = client.update_group({
  group_id: "__string", # required
  name: "__string",
})

Options Hash (options):

  • :group_id (required, String)
  • :name (String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_group_certificate_configuration(options = {}) ⇒ Types::UpdateGroupCertificateConfigurationResponse

Updates the Certificate expiry time for a group.

Examples:

Request syntax with placeholder values


resp = client.update_group_certificate_configuration({
  certificate_expiry_in_milliseconds: "__string",
  group_id: "__string", # required
})

Response structure


resp.certificate_authority_expiry_in_milliseconds #=> String
resp.certificate_expiry_in_milliseconds #=> String
resp.group_id #=> String

Options Hash (options):

  • :certificate_expiry_in_milliseconds (String)

    The amount of time remaining before the certificate expires, in milliseconds.

  • :group_id (required, String)

Returns:

See Also:

#update_logger_definition(options = {}) ⇒ Struct

Updates a logger definition.

Examples:

Request syntax with placeholder values


resp = client.update_logger_definition({
  logger_definition_id: "__string", # required
  name: "__string",
})

Options Hash (options):

  • :logger_definition_id (required, String)
  • :name (String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_resource_definition(options = {}) ⇒ Struct

Updates a resource definition.

Examples:

Request syntax with placeholder values


resp = client.update_resource_definition({
  name: "__string",
  resource_definition_id: "__string", # required
})

Options Hash (options):

  • :name (String)
  • :resource_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_subscription_definition(options = {}) ⇒ Struct

Updates a subscription definition.

Examples:

Request syntax with placeholder values


resp = client.update_subscription_definition({
  name: "__string",
  subscription_definition_id: "__string", # required
})

Options Hash (options):

  • :name (String)
  • :subscription_definition_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

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