Class: Aws::GreengrassV2::Client

Inherits:
Seahorse::Client::Base
  • Object
show all
Includes:
ClientStubs
Defined in:
lib/aws-sdk-greengrassv2/client.rb

Overview

An API client for GreengrassV2. To construct a client, you need to configure a ‘:region` and `:credentials`.

client = Aws::GreengrassV2::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).

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

Class Attribute Summary collapse

API Operations collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :plugins (Array<Seahorse::Client::Plugin>) — default: []]

    A list of plugins to apply to the client. Each plugin is either a class name or an instance of a plugin class.

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • ‘Aws::Credentials` - Used for configuring static, non-refreshing credentials.

    • ‘Aws::SharedCredentials` - Used for loading static credentials from a shared file, such as `~/.aws/config`.

    • ‘Aws::AssumeRoleCredentials` - Used when you need to assume a role.

    • ‘Aws::AssumeRoleWebIdentityCredentials` - Used when you need to assume a role after providing credentials via the web.

    • ‘Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an access token generated from `aws login`.

    • ‘Aws::ProcessCredentials` - Used for loading credentials from a process that outputs to stdout.

    • ‘Aws::InstanceProfileCredentials` - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • ‘Aws::ECSCredentials` - Used for loading credentials from instances running in ECS.

    • ‘Aws::CognitoIdentityCredentials` - Used for loading credentials from the Cognito Identity service.

    When ‘:credentials` are not configured directly, the following locations will be searched for credentials:

    • Aws.config`

    • The ‘:access_key_id`, `:secret_access_key`, `:session_token`, and `:account_id` options.

    • ENV, ENV, ENV, and ENV

    • ‘~/.aws/credentials`

    • ‘~/.aws/config`

    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of ‘Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV to true.

  • :region (required, String)

    The AWS region to connect to. The configured ‘:region` is used to determine the service `:endpoint`. When not passed, a default `:region` is searched for in the following locations:

  • :access_key_id (String)
  • :account_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to ‘true`, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to `false`.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in ‘adaptive` retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a `RetryCapacityNotAvailableError` and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When ‘true`, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When ‘true`, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in ‘standard` and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :disable_request_compression (Boolean) — default: false

    When set to ‘true’ the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP)

    Normally you should not configure the ‘:endpoint` option directly. This is normally constructed from the `:region` option. Configuring `:endpoint` is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    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.

  • :endpoint_discovery (Boolean) — default: false

    When set to ‘true`, endpoint discovery will be enabled for operations when available.

  • :ignore_configured_endpoint_urls (Boolean)

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the ‘:logger` at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in ‘standard` and `adaptive` retry modes.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, ‘default’ is used.

  • :request_min_compression_size_bytes (Integer) — default: 10240

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the ‘legacy` retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the ‘legacy` retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the ‘legacy` retry mode.

    @see www.awsarchitectureblog.com/2015/03/backoff.html

  • :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, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the ‘legacy` retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the ‘legacy` retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • ‘legacy` - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • ‘standard` - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • ‘adaptive` - An experimental retry mode that includes all the functionality of `standard` mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :sdk_ua_app_id (String)

    A unique and opaque application ID that is appended to the User-Agent header as app/sdk_ua_app_id. It should have a maximum length of 50. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.

  • :secret_access_key (String)
  • :session_token (String)
  • :sigv4a_signing_region_set (Array)

    A list of regions that should be signed with SigV4a signing. When not passed, a default ‘:sigv4a_signing_region_set` is searched for in the following locations:

  • :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.

  • :telemetry_provider (Aws::Telemetry::TelemetryProviderBase) — default: Aws::Telemetry::NoOpTelemetryProvider

    Allows you to provide a telemetry provider, which is used to emit telemetry data. By default, uses ‘NoOpTelemetryProvider` which will not record or emit any telemetry data. The SDK supports the following telemetry providers:

    • OpenTelemetry (OTel) - To use the OTel provider, install and require the

    ‘opentelemetry-sdk` gem and then, pass in an instance of a `Aws::Telemetry::OTelProvider` for telemetry provider.

  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • ‘Aws::StaticTokenProvider` - Used for configuring static, non-refreshing tokens.

    • ‘Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an access token generated from `aws login`.

    When ‘:token_provider` is not configured directly, the `Aws::TokenProviderChain` will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to ‘true`, dualstack enabled endpoints (with `.aws` TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to ‘true`, fips compatible endpoints will be used if available. When a `fips` region is used, the region is normalized and this config is set to `true`.

  • :validate_params (Boolean) — default: true

    When ‘true`, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::GreengrassV2::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to ‘#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::GreengrassV2::EndpointParameters`.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has “Expect” header set to “100-continue”. Defaults to ‘nil` which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like ‘proxy.com:123’.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false

    When ‘true`, HTTP debug output will be sent to the `:logger`.

  • :on_chunk_received (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a ‘content-length`).

  • :on_chunk_sent (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true

    When ‘true`, response errors are raised.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass ‘:ssl_ca_bundle` or `:ssl_ca_directory` the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass ‘:ssl_ca_bundle` or `:ssl_ca_directory` the the system default will be used if available.

  • :ssl_ca_store (String)

    Sets the X509::Store to verify peer certificate.

  • :ssl_cert (OpenSSL::X509::Certificate)

    Sets a client certificate when creating http connections.

  • :ssl_key (OpenSSL::PKey)

    Sets a client key when creating http connections.

  • :ssl_timeout (Float)

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true

    When ‘true`, SSL peer certificates are verified when establishing a connection.



444
445
446
# File 'lib/aws-sdk-greengrassv2/client.rb', line 444

def initialize(*args)
  super
end

Class Attribute Details

.identifierObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



2193
2194
2195
# File 'lib/aws-sdk-greengrassv2/client.rb', line 2193

def identifier
  @identifier
end

Class Method Details

.errors_moduleObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



2196
2197
2198
# File 'lib/aws-sdk-greengrassv2/client.rb', line 2196

def errors_module
  Errors
end

Instance Method Details

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

Associates a Greengrass service role with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. IoT Greengrass uses this role to verify the identity of client devices and manage core device connectivity information. The role must include the

AWSGreengrassResourceAccessRolePolicy][1

managed policy or a custom

policy that defines equivalent permissions for the IoT Greengrass features that you use. For more information, see [Greengrass service role] in the *IoT Greengrass Version 2 Developer Guide*.

[1]: console.aws.amazon.com/iam/home#/policies/arn:awsiam::aws:policy/service-role/AWSGreengrassResourceAccessRolePolicy [2]: docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-service-role.html

Examples:

Request syntax with placeholder values


resp = client.({
  role_arn: "String", # required
})

Response structure


resp.associated_at #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :role_arn (required, String)

    The Amazon Resource Name (ARN) of the service role to associate with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

Returns:

See Also:



487
488
489
490
# File 'lib/aws-sdk-greengrassv2/client.rb', line 487

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

#batch_associate_client_device_with_core_device(params = {}) ⇒ Types::BatchAssociateClientDeviceWithCoreDeviceResponse

Associates a list of client devices with a core device. Use this API operation to specify which client devices can discover a core device through cloud discovery. With cloud discovery, client devices connect to IoT Greengrass to retrieve associated core devices’ connectivity information and certificates. For more information, see [Configure cloud discovery] in the *IoT Greengrass V2 Developer Guide*.

<note markdown=“1”> Client devices are local IoT devices that connect to and communicate with an IoT Greengrass core device over MQTT. You can connect client devices to a core device to sync MQTT messages and data to Amazon Web Services IoT Core and interact with client devices in Greengrass components. For more information, see [Interact with local IoT devices] in the *IoT Greengrass V2 Developer Guide*.

</note>

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/configure-cloud-discovery.html [2]: docs.aws.amazon.com/greengrass/v2/developerguide/interact-with-local-iot-devices.html

Examples:

Request syntax with placeholder values


resp = client.batch_associate_client_device_with_core_device({
  entries: [
    {
      thing_name: "IoTThingName", # required
    },
  ],
  core_device_thing_name: "IoTThingName", # required
})

Response structure


resp.error_entries #=> Array
resp.error_entries[0].thing_name #=> String
resp.error_entries[0].code #=> String
resp.error_entries[0].message #=> String

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



545
546
547
548
# File 'lib/aws-sdk-greengrassv2/client.rb', line 545

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

#batch_disassociate_client_device_from_core_device(params = {}) ⇒ Types::BatchDisassociateClientDeviceFromCoreDeviceResponse

Disassociates a list of client devices from a core device. After you disassociate a client device from a core device, the client device won’t be able to use cloud discovery to retrieve the core device’s connectivity information and certificates.

Examples:

Request syntax with placeholder values


resp = client.batch_disassociate_client_device_from_core_device({
  entries: [
    {
      thing_name: "IoTThingName", # required
    },
  ],
  core_device_thing_name: "IoTThingName", # required
})

Response structure


resp.error_entries #=> Array
resp.error_entries[0].thing_name #=> String
resp.error_entries[0].code #=> String
resp.error_entries[0].message #=> String

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



587
588
589
590
# File 'lib/aws-sdk-greengrassv2/client.rb', line 587

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

#build_request(operation_name, params = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

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


2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
# File 'lib/aws-sdk-greengrassv2/client.rb', line 2166

def build_request(operation_name, params = {})
  handlers = @handlers.for(operation_name)
  tracer = config.telemetry_provider.tracer_provider.tracer(
    Aws::Telemetry.module_to_tracer_name('Aws::GreengrassV2')
  )
  context = Seahorse::Client::RequestContext.new(
    operation_name: operation_name,
    operation: config.api.operation(operation_name),
    client: self,
    params: params,
    config: config,
    tracer: tracer
  )
  context[:gem_name] = 'aws-sdk-greengrassv2'
  context[:gem_version] = '1.49.0'
  Seahorse::Client::Request.new(handlers, context)
end

#cancel_deployment(params = {}) ⇒ Types::CancelDeploymentResponse

Cancels a deployment. This operation cancels the deployment for devices that haven’t yet received it. If a device already received the deployment, this operation doesn’t change anything for that device.

Examples:

Request syntax with placeholder values


resp = client.cancel_deployment({
  deployment_id: "NonEmptyString", # required
})

Response structure


resp.message #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :deployment_id (required, String)

    The ID of the deployment.

Returns:

See Also:



618
619
620
621
# File 'lib/aws-sdk-greengrassv2/client.rb', line 618

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

#create_component_version(params = {}) ⇒ Types::CreateComponentVersionResponse

Creates a component. Components are software that run on Greengrass core devices. After you develop and test a component on your core device, you can use this operation to upload your component to IoT Greengrass. Then, you can deploy the component to other core devices.

You can use this operation to do the following:

  • **Create components from recipes**

    Create a component from a recipe, which is a file that defines the component’s metadata, parameters, dependencies, lifecycle, artifacts, and platform capability. For more information, see [IoT Greengrass component recipe reference] in the *IoT Greengrass V2 Developer Guide*.

    To create a component from a recipe, specify ‘inlineRecipe` when you call this operation.

  • **Create components from Lambda functions**

    Create a component from an Lambda function that runs on IoT Greengrass. This creates a recipe and artifacts from the Lambda function’s deployment package. You can use this operation to migrate Lambda functions from IoT Greengrass V1 to IoT Greengrass V2.

    This function accepts Lambda functions in all supported versions of Python, Node.js, and Java runtimes. IoT Greengrass doesn’t apply any additional restrictions on deprecated Lambda runtime versions.

    To create a component from a Lambda function, specify ‘lambdaFunction` when you call this operation.

    <note markdown=“1”> IoT Greengrass currently supports Lambda functions on only Linux core devices.

    </note>
    

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html

Examples:

Request syntax with placeholder values


resp = client.create_component_version({
  inline_recipe: "data",
  lambda_function: {
    lambda_arn: "NonEmptyString", # required
    component_name: "ComponentNameString",
    component_version: "ComponentVersionString",
    component_platforms: [
      {
        name: "NonEmptyString",
        attributes: {
          "NonEmptyString" => "NonEmptyString",
        },
      },
    ],
    component_dependencies: {
      "NonEmptyString" => {
        version_requirement: "NonEmptyString",
        dependency_type: "HARD", # accepts HARD, SOFT
      },
    },
    component_lambda_parameters: {
      event_sources: [
        {
          topic: "TopicString", # required
          type: "PUB_SUB", # required, accepts PUB_SUB, IOT_CORE
        },
      ],
      max_queue_size: 1,
      max_instances_count: 1,
      max_idle_time_in_seconds: 1,
      timeout_in_seconds: 1,
      status_timeout_in_seconds: 1,
      pinned: false,
      input_payload_encoding_type: "json", # accepts json, binary
      exec_args: ["LambdaExecArg"],
      environment_variables: {
        "NonEmptyString" => "String",
      },
      linux_process_params: {
        isolation_mode: "GreengrassContainer", # accepts GreengrassContainer, NoContainer
        container_params: {
          memory_size_in_kb: 1,
          mount_ro_sysfs: false,
          volumes: [
            {
              source_path: "FileSystemPath", # required
              destination_path: "FileSystemPath", # required
              permission: "ro", # accepts ro, rw
              add_group_owner: false,
            },
          ],
          devices: [
            {
              path: "FileSystemPath", # required
              permission: "ro", # accepts ro, rw
              add_group_owner: false,
            },
          ],
        },
      },
    },
  },
  tags: {
    "TagKey" => "TagValue",
  },
  client_token: "ClientTokenString",
})

Response structure


resp.arn #=> String
resp.component_name #=> String
resp.component_version #=> String
resp.creation_timestamp #=> Time
resp.status.component_state #=> String, one of "REQUESTED", "INITIATED", "DEPLOYABLE", "FAILED", "DEPRECATED"
resp.status.message #=> String
resp.status.errors #=> Hash
resp.status.errors["NonEmptyString"] #=> String
resp.status.vendor_guidance #=> String, one of "ACTIVE", "DISCONTINUED", "DELETED"
resp.status.vendor_guidance_message #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :inline_recipe (String, StringIO, File)

    The recipe to use to create the component. The recipe defines the component’s metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.

    You must specify either ‘inlineRecipe` or `lambdaFunction`.

  • :lambda_function (Types::LambdaFunctionRecipeSource)

    The parameters to create a component from a Lambda function.

    You must specify either ‘inlineRecipe` or `lambdaFunction`.

  • :tags (Hash<String,String>)

    A list of key-value pairs that contain metadata for the resource. For more information, see [Tag your resources] in the *IoT Greengrass V2 Developer Guide*.

    [1]: docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html

  • :client_token (String)

    A unique, case-sensitive identifier that you can provide to ensure that the request is idempotent. Idempotency means that the request is successfully processed only once, even if you send the request multiple times. When a request succeeds, and you specify the same client token for subsequent successful requests, the IoT Greengrass V2 service returns the successful response that it caches from the previous request. IoT Greengrass V2 caches successful responses for idempotent requests for up to 8 hours.

    **A suitable default value is auto-generated.** You should normally not need to pass this option.**

Returns:

See Also:



794
795
796
797
# File 'lib/aws-sdk-greengrassv2/client.rb', line 794

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

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

Creates a continuous deployment for a target, which is a Greengrass core device or group of core devices. When you add a new core device to a group of core devices that has a deployment, IoT Greengrass deploys that group’s deployment to the new device.

You can define one deployment for each target. When you create a new deployment for a target that has an existing deployment, you replace the previous deployment. IoT Greengrass applies the new deployment to the target devices.

Every deployment has a revision number that indicates how many deployment revisions you define for a target. Use this operation to create a new revision of an existing deployment.

For more information, see the [Create deployments] in the *IoT Greengrass V2 Developer Guide*.

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/create-deployments.html

Examples:

Request syntax with placeholder values


resp = client.create_deployment({
  target_arn: "TargetARN", # required
  deployment_name: "DeploymentNameString",
  components: {
    "NonEmptyString" => {
      component_version: "ComponentVersionString", # required
      configuration_update: {
        merge: "ComponentConfigurationString",
        reset: ["ComponentConfigurationPath"],
      },
      run_with: {
        posix_user: "NonEmptyString",
        system_resource_limits: {
          memory: 1,
          cpus: 1.0,
        },
        windows_user: "NonEmptyString",
      },
    },
  },
  iot_job_configuration: {
    job_executions_rollout_config: {
      exponential_rate: {
        base_rate_per_minute: 1, # required
        increment_factor: 1.0, # required
        rate_increase_criteria: { # required
          number_of_notified_things: 1,
          number_of_succeeded_things: 1,
        },
      },
      maximum_per_minute: 1,
    },
    abort_config: {
      criteria_list: [ # required
        {
          failure_type: "FAILED", # required, accepts FAILED, REJECTED, TIMED_OUT, ALL
          action: "CANCEL", # required, accepts CANCEL
          threshold_percentage: 1.0, # required
          min_number_of_executed_things: 1, # required
        },
      ],
    },
    timeout_config: {
      in_progress_timeout_in_minutes: 1,
    },
  },
  deployment_policies: {
    failure_handling_policy: "ROLLBACK", # accepts ROLLBACK, DO_NOTHING
    component_update_policy: {
      timeout_in_seconds: 1,
      action: "NOTIFY_COMPONENTS", # accepts NOTIFY_COMPONENTS, SKIP_NOTIFY_COMPONENTS
    },
    configuration_validation_policy: {
      timeout_in_seconds: 1,
    },
  },
  parent_target_arn: "ThingGroupARN",
  tags: {
    "TagKey" => "TagValue",
  },
  client_token: "ClientTokenString",
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :target_arn (required, String)

    The [ARN] of the target IoT thing or thing group. When creating a subdeployment, the targetARN can only be a thing group.

    [1]: docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

  • :deployment_name (String)

    The name of the deployment.

  • :components (Hash<String,Types::ComponentDeploymentSpecification>)

    The components to deploy. This is a dictionary, where each key is the name of a component, and each key’s value is the version and configuration to deploy for that component.

  • :iot_job_configuration (Types::DeploymentIoTJobConfiguration)

    The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and stop configurations for the deployment configuration.

  • :deployment_policies (Types::DeploymentPolicies)

    The deployment policies for the deployment. These policies define how the deployment updates components and handles failure.

  • :parent_target_arn (String)

    The parent deployment’s target [ARN] within a subdeployment.

    [1]: docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

  • :tags (Hash<String,String>)

    A list of key-value pairs that contain metadata for the resource. For more information, see [Tag your resources] in the *IoT Greengrass V2 Developer Guide*.

    [1]: docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html

  • :client_token (String)

    A unique, case-sensitive identifier that you can provide to ensure that the request is idempotent. Idempotency means that the request is successfully processed only once, even if you send the request multiple times. When a request succeeds, and you specify the same client token for subsequent successful requests, the IoT Greengrass V2 service returns the successful response that it caches from the previous request. IoT Greengrass V2 caches successful responses for idempotent requests for up to 8 hours.

    **A suitable default value is auto-generated.** You should normally not need to pass this option.**

Returns:

See Also:



955
956
957
958
# File 'lib/aws-sdk-greengrassv2/client.rb', line 955

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

#delete_component(params = {}) ⇒ Struct

Deletes a version of a component from IoT Greengrass.

<note markdown=“1”> This operation deletes the component’s recipe and artifacts. As a result, deployments that refer to this component version will fail. If you have deployments that use this component version, you can remove the component from the deployment or update the deployment to use a valid version.

</note>

Examples:

Request syntax with placeholder values


resp = client.delete_component({
  arn: "ComponentVersionARN", # required
})

Parameters:

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

    ({})

Options Hash (params):

Returns:

  • (Struct)

    Returns an empty response.

See Also:



989
990
991
992
# File 'lib/aws-sdk-greengrassv2/client.rb', line 989

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

#delete_core_device(params = {}) ⇒ Struct

Deletes a Greengrass core device, which is an IoT thing. This operation removes the core device from the list of core devices. This operation doesn’t delete the IoT thing. For more information about how to delete the IoT thing, see [DeleteThing] in the *IoT API Reference*.

[1]: docs.aws.amazon.com/iot/latest/apireference/API_DeleteThing.html

Examples:

Request syntax with placeholder values


resp = client.delete_core_device({
  core_device_thing_name: "CoreDeviceThingName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :core_device_thing_name (required, String)

    The name of the core device. This is also the name of the IoT thing.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1019
1020
1021
1022
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1019

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

#delete_deployment(params = {}) ⇒ Struct

Deletes a deployment. To delete an active deployment, you must first cancel it. For more information, see [CancelDeployment].

Deleting a deployment doesn’t affect core devices that run that deployment, because core devices store the deployment’s configuration on the device. Additionally, core devices can roll back to a previous deployment that has been deleted.

[1]: docs.aws.amazon.com/iot/latest/apireference/API_CancelDeployment.html

Examples:

Request syntax with placeholder values


resp = client.delete_deployment({
  deployment_id: "NonEmptyString", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :deployment_id (required, String)

    The ID of the deployment.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1051
1052
1053
1054
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1051

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

#describe_component(params = {}) ⇒ Types::DescribeComponentResponse

Retrieves metadata for a version of a component.

Examples:

Request syntax with placeholder values


resp = client.describe_component({
  arn: "ComponentVersionARN", # required
})

Response structure


resp.arn #=> String
resp.component_name #=> String
resp.component_version #=> String
resp.creation_timestamp #=> Time
resp.publisher #=> String
resp.description #=> String
resp.status.component_state #=> String, one of "REQUESTED", "INITIATED", "DEPLOYABLE", "FAILED", "DEPRECATED"
resp.status.message #=> String
resp.status.errors #=> Hash
resp.status.errors["NonEmptyString"] #=> String
resp.status.vendor_guidance #=> String, one of "ACTIVE", "DISCONTINUED", "DELETED"
resp.status.vendor_guidance_message #=> String
resp.platforms #=> Array
resp.platforms[0].name #=> String
resp.platforms[0].attributes #=> Hash
resp.platforms[0].attributes["NonEmptyString"] #=> String
resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



1108
1109
1110
1111
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1108

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

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

Disassociates the Greengrass service role from IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. Without a service role, IoT Greengrass can’t verify the identity of client devices or manage core device connectivity information. For more information, see [Greengrass service role] in the *IoT Greengrass Version 2 Developer Guide*.

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-service-role.html

Examples:

Response structure


resp.disassociated_at #=> String

Parameters:

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

    ({})

Returns:

See Also:



1136
1137
1138
1139
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1136

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

#get_component(params = {}) ⇒ Types::GetComponentResponse

Gets the recipe for a version of a component.

Examples:

Request syntax with placeholder values


resp = client.get_component({
  recipe_output_format: "JSON", # accepts JSON, YAML
  arn: "ComponentVersionARN", # required
})

Response structure


resp.recipe_output_format #=> String, one of "JSON", "YAML"
resp.recipe #=> String
resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



1177
1178
1179
1180
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1177

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

#get_component_version_artifact(params = {}) ⇒ Types::GetComponentVersionArtifactResponse

Gets the pre-signed URL to download a public or a Lambda component artifact. Core devices call this operation to identify the URL that they can use to download an artifact to install.

Examples:

Request syntax with placeholder values


resp = client.get_component_version_artifact({
  arn: "ComponentVersionARN", # required
  artifact_name: "NonEmptyString", # required
  s3_endpoint_type: "REGIONAL", # accepts REGIONAL, GLOBAL
  iot_endpoint_type: "fips", # accepts fips, standard
})

Response structure


resp.pre_signed_url #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :arn (required, String)

    The [ARN] of the component version. Specify the ARN of a public or a Lambda component version.

    [1]: docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

  • :artifact_name (required, String)

    The name of the artifact.

    You can use the [GetComponent] operation to download the component recipe, which includes the URI of the artifact. The artifact name is the section of the URI after the scheme. For example, in the artifact URI ‘greengrass:SomeArtifact.zip`, the artifact name is `SomeArtifact.zip`.

    [1]: docs.aws.amazon.com/greengrass/v2/APIReference/API_GetComponent.html

  • :s3_endpoint_type (String)

    Specifies the endpoint to use when getting Amazon S3 pre-signed URLs.

    All Amazon Web Services Regions except US East (N. Virginia) use ‘REGIONAL` in all cases. In the US East (N. Virginia) Region the default is `GLOBAL`, but you can change it to `REGIONAL` with this parameter.

  • :iot_endpoint_type (String)

    Determines if the Amazon S3 URL returned is a FIPS pre-signed URL endpoint. Specify ‘fips` if you want the returned Amazon S3 pre-signed URL to point to an Amazon S3 FIPS endpoint. If you don’t specify a value, the default is ‘standard`.

Returns:

See Also:



1242
1243
1244
1245
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1242

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

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

Retrieves connectivity information for a Greengrass core device.

Connectivity information includes endpoints and ports where client devices can connect to an MQTT broker on the core device. When a client device calls the [IoT Greengrass discovery API], IoT Greengrass returns connectivity information for all of the core devices where the client device can connect. For more information, see

Connect client devices to core devices][2

in the *IoT Greengrass

Version 2 Developer Guide*.

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-discover-api.html [2]: docs.aws.amazon.com/greengrass/v2/developerguide/connect-client-devices.html

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the core device. This is also the name of the IoT thing.

Returns:

See Also:



1289
1290
1291
1292
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1289

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

#get_core_device(params = {}) ⇒ Types::GetCoreDeviceResponse

Retrieves metadata for a Greengrass core device.

<note markdown=“1”> IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core software isn’t running on the device, or if device isn’t connected to the Amazon Web Services Cloud, then the reported status of that device might not reflect its current status. The status timestamp indicates when the device status was last updated.

Core devices send status updates at the following times:

* When the IoT Greengrass Core software starts
  • When the core device receives a deployment from the Amazon Web Services Cloud

  • When the status of any component on the core device becomes ‘BROKEN`

  • At a [regular interval that you can configure], which defaults to 24 hours

  • For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and cloud deployment

</note>

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss

Examples:

Request syntax with placeholder values


resp = client.get_core_device({
  core_device_thing_name: "CoreDeviceThingName", # required
})

Response structure


resp.core_device_thing_name #=> String
resp.core_version #=> String
resp.platform #=> String
resp.architecture #=> String
resp.status #=> String, one of "HEALTHY", "UNHEALTHY"
resp.last_status_update_timestamp #=> Time
resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :core_device_thing_name (required, String)

    The name of the core device. This is also the name of the IoT thing.

Returns:

See Also:



1358
1359
1360
1361
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1358

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

#get_deployment(params = {}) ⇒ Types::GetDeploymentResponse

Gets a deployment. Deployments define the components that run on Greengrass core devices.

Examples:

Request syntax with placeholder values


resp = client.get_deployment({
  deployment_id: "NonEmptyString", # required
})

Response structure


resp.target_arn #=> String
resp.revision_id #=> String
resp.deployment_id #=> String
resp.deployment_name #=> String
resp.deployment_status #=> String, one of "ACTIVE", "COMPLETED", "CANCELED", "FAILED", "INACTIVE"
resp.iot_job_id #=> String
resp.iot_job_arn #=> String
resp.components #=> Hash
resp.components["NonEmptyString"].component_version #=> String
resp.components["NonEmptyString"].configuration_update.merge #=> String
resp.components["NonEmptyString"].configuration_update.reset #=> Array
resp.components["NonEmptyString"].configuration_update.reset[0] #=> String
resp.components["NonEmptyString"].run_with.posix_user #=> String
resp.components["NonEmptyString"].run_with.system_resource_limits.memory #=> Integer
resp.components["NonEmptyString"].run_with.system_resource_limits.cpus #=> Float
resp.components["NonEmptyString"].run_with.windows_user #=> String
resp.deployment_policies.failure_handling_policy #=> String, one of "ROLLBACK", "DO_NOTHING"
resp.deployment_policies.component_update_policy.timeout_in_seconds #=> Integer
resp.deployment_policies.component_update_policy.action #=> String, one of "NOTIFY_COMPONENTS", "SKIP_NOTIFY_COMPONENTS"
resp.deployment_policies.configuration_validation_policy.timeout_in_seconds #=> Integer
resp.iot_job_configuration.job_executions_rollout_config.exponential_rate.base_rate_per_minute #=> Integer
resp.iot_job_configuration.job_executions_rollout_config.exponential_rate.increment_factor #=> Float
resp.iot_job_configuration.job_executions_rollout_config.exponential_rate.rate_increase_criteria.number_of_notified_things #=> Integer
resp.iot_job_configuration.job_executions_rollout_config.exponential_rate.rate_increase_criteria.number_of_succeeded_things #=> Integer
resp.iot_job_configuration.job_executions_rollout_config.maximum_per_minute #=> Integer
resp.iot_job_configuration.abort_config.criteria_list #=> Array
resp.iot_job_configuration.abort_config.criteria_list[0].failure_type #=> String, one of "FAILED", "REJECTED", "TIMED_OUT", "ALL"
resp.iot_job_configuration.abort_config.criteria_list[0].action #=> String, one of "CANCEL"
resp.iot_job_configuration.abort_config.criteria_list[0].threshold_percentage #=> Float
resp.iot_job_configuration.abort_config.criteria_list[0].min_number_of_executed_things #=> Integer
resp.iot_job_configuration.timeout_config.in_progress_timeout_in_minutes #=> Integer
resp.creation_timestamp #=> Time
resp.is_latest_for_target #=> Boolean
resp.parent_target_arn #=> String
resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :deployment_id (required, String)

    The ID of the deployment.

Returns:

See Also:



1435
1436
1437
1438
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1435

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

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

Gets the service role associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. IoT Greengrass uses this role to verify the identity of client devices and manage core device connectivity information. For more information, see

Greengrass service role][1

in the *IoT Greengrass Version 2

Developer Guide*.

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-service-role.html

Examples:

Response structure


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

Parameters:

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

    ({})

Returns:

See Also:



1465
1466
1467
1468
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1465

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

#list_client_devices_associated_with_core_device(params = {}) ⇒ Types::ListClientDevicesAssociatedWithCoreDeviceResponse

Retrieves a paginated list of client devices that are associated with a core device.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_client_devices_associated_with_core_device({
  core_device_thing_name: "IoTThingName", # required
  max_results: 1,
  next_token: "NextTokenString",
})

Response structure


resp.associated_client_devices #=> Array
resp.associated_client_devices[0].thing_name #=> String
resp.associated_client_devices[0].association_timestamp #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :core_device_thing_name (required, String)

    The name of the core device. This is also the name of the IoT thing.

  • :max_results (Integer)

    The maximum number of results to be returned per paginated request.

  • :next_token (String)

    The token to be used for the next set of paginated results.

Returns:

See Also:



1508
1509
1510
1511
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1508

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

#list_component_versions(params = {}) ⇒ Types::ListComponentVersionsResponse

Retrieves a paginated list of all versions for a component. Greater versions are listed first.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_component_versions({
  arn: "ComponentARN", # required
  max_results: 1,
  next_token: "NextTokenString",
})

Response structure


resp.component_versions #=> Array
resp.component_versions[0].component_name #=> String
resp.component_versions[0].component_version #=> String
resp.component_versions[0].arn #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



1556
1557
1558
1559
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1556

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

#list_components(params = {}) ⇒ Types::ListComponentsResponse

Retrieves a paginated list of component summaries. This list includes components that you have permission to view.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_components({
  scope: "PRIVATE", # accepts PRIVATE, PUBLIC
  max_results: 1,
  next_token: "NextTokenString",
})

Response structure


resp.components #=> Array
resp.components[0].arn #=> String
resp.components[0].component_name #=> String
resp.components[0].latest_version.arn #=> String
resp.components[0].latest_version.component_version #=> String
resp.components[0].latest_version.creation_timestamp #=> Time
resp.components[0].latest_version.description #=> String
resp.components[0].latest_version.publisher #=> String
resp.components[0].latest_version.platforms #=> Array
resp.components[0].latest_version.platforms[0].name #=> String
resp.components[0].latest_version.platforms[0].attributes #=> Hash
resp.components[0].latest_version.platforms[0].attributes["NonEmptyString"] #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :scope (String)

    The scope of the components to list.

    Default: ‘PRIVATE`

  • :max_results (Integer)

    The maximum number of results to be returned per paginated request.

  • :next_token (String)

    The token to be used for the next set of paginated results.

Returns:

See Also:



1610
1611
1612
1613
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1610

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

#list_core_devices(params = {}) ⇒ Types::ListCoreDevicesResponse

Retrieves a paginated list of Greengrass core devices.

<note markdown=“1”> IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core software isn’t running on the device, or if device isn’t connected to the Amazon Web Services Cloud, then the reported status of that device might not reflect its current status. The status timestamp indicates when the device status was last updated.

Core devices send status updates at the following times:

* When the IoT Greengrass Core software starts
  • When the core device receives a deployment from the Amazon Web Services Cloud

  • When the status of any component on the core device becomes ‘BROKEN`

  • At a [regular interval that you can configure], which defaults to 24 hours

  • For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and cloud deployment

</note>

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_core_devices({
  thing_group_arn: "ThingGroupARN",
  status: "HEALTHY", # accepts HEALTHY, UNHEALTHY
  max_results: 1,
  next_token: "NextTokenString",
})

Response structure


resp.core_devices #=> Array
resp.core_devices[0].core_device_thing_name #=> String
resp.core_devices[0].status #=> String, one of "HEALTHY", "UNHEALTHY"
resp.core_devices[0].last_status_update_timestamp #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :thing_group_arn (String)

    The [ARN] of the IoT thing group by which to filter. If you specify this parameter, the list includes only core devices that have successfully deployed a deployment that targets the thing group. When you remove a core device from a thing group, the list continues to include that core device.

    [1]: docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

  • :status (String)

    The core device status by which to filter. If you specify this parameter, the list includes only core devices that have this status. Choose one of the following options:

    • ‘HEALTHY` – The IoT Greengrass Core software and all components run on the core device without issue.

    • ‘UNHEALTHY` – The IoT Greengrass Core software or a component is in a failed state on the core device.

  • :max_results (Integer)

    The maximum number of results to be returned per paginated request.

  • :next_token (String)

    The token to be used for the next set of paginated results.

Returns:

See Also:



1701
1702
1703
1704
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1701

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

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

Retrieves a paginated list of deployments.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_deployments({
  target_arn: "TargetARN",
  history_filter: "ALL", # accepts ALL, LATEST_ONLY
  parent_target_arn: "ThingGroupARN",
  max_results: 1,
  next_token: "NextTokenString",
})

Response structure


resp.deployments #=> Array
resp.deployments[0].target_arn #=> String
resp.deployments[0].revision_id #=> String
resp.deployments[0].deployment_id #=> String
resp.deployments[0].deployment_name #=> String
resp.deployments[0].creation_timestamp #=> Time
resp.deployments[0].deployment_status #=> String, one of "ACTIVE", "COMPLETED", "CANCELED", "FAILED", "INACTIVE"
resp.deployments[0].is_latest_for_target #=> Boolean
resp.deployments[0].parent_target_arn #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :target_arn (String)

    The [ARN] of the target IoT thing or thing group.

    [1]: docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

  • :history_filter (String)

    The filter for the list of deployments. Choose one of the following options:

    • ‘ALL` – The list includes all deployments.

    • ‘LATEST_ONLY` – The list includes only the latest revision of each deployment.

    Default: ‘LATEST_ONLY`

  • :parent_target_arn (String)

    The parent deployment’s target [ARN] within a subdeployment.

    [1]: docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

  • :max_results (Integer)

    The maximum number of results to be returned per paginated request.

    Default: ‘50`

  • :next_token (String)

    The token to be used for the next set of paginated results.

Returns:

See Also:



1775
1776
1777
1778
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1775

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

#list_effective_deployments(params = {}) ⇒ Types::ListEffectiveDeploymentsResponse

Retrieves a paginated list of deployment jobs that IoT Greengrass sends to Greengrass core devices.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_effective_deployments({
  core_device_thing_name: "CoreDeviceThingName", # required
  max_results: 1,
  next_token: "NextTokenString",
})

Response structure


resp.effective_deployments #=> Array
resp.effective_deployments[0].deployment_id #=> String
resp.effective_deployments[0].deployment_name #=> String
resp.effective_deployments[0].iot_job_id #=> String
resp.effective_deployments[0].iot_job_arn #=> String
resp.effective_deployments[0].description #=> String
resp.effective_deployments[0].target_arn #=> String
resp.effective_deployments[0].core_device_execution_status #=> String, one of "IN_PROGRESS", "QUEUED", "FAILED", "COMPLETED", "TIMED_OUT", "CANCELED", "REJECTED", "SUCCEEDED"
resp.effective_deployments[0].reason #=> String
resp.effective_deployments[0].creation_timestamp #=> Time
resp.effective_deployments[0].modified_timestamp #=> Time
resp.effective_deployments[0].status_details.error_stack #=> Array
resp.effective_deployments[0].status_details.error_stack[0] #=> String
resp.effective_deployments[0].status_details.error_types #=> Array
resp.effective_deployments[0].status_details.error_types[0] #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :core_device_thing_name (required, String)

    The name of the core device. This is also the name of the IoT thing.

  • :max_results (Integer)

    The maximum number of results to be returned per paginated request.

  • :next_token (String)

    The token to be used for the next set of paginated results.

Returns:

See Also:



1830
1831
1832
1833
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1830

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

#list_installed_components(params = {}) ⇒ Types::ListInstalledComponentsResponse

Retrieves a paginated list of the components that a Greengrass core device runs. By default, this list doesn’t include components that are deployed as dependencies of other components. To include dependencies in the response, set the ‘topologyFilter` parameter to `ALL`.

<note markdown=“1”> IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core software isn’t running on the device, or if device isn’t connected to the Amazon Web Services Cloud, then the reported status of that device might not reflect its current status. The status timestamp indicates when the device status was last updated.

Core devices send status updates at the following times:

* When the IoT Greengrass Core software starts
  • When the core device receives a deployment from the Amazon Web Services Cloud

  • When the status of any component on the core device becomes ‘BROKEN`

  • At a [regular interval that you can configure], which defaults to 24 hours

  • For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and cloud deployment

</note>

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_installed_components({
  core_device_thing_name: "CoreDeviceThingName", # required
  max_results: 1,
  next_token: "NextTokenString",
  topology_filter: "ALL", # accepts ALL, ROOT
})

Response structure


resp.installed_components #=> Array
resp.installed_components[0].component_name #=> String
resp.installed_components[0].component_version #=> String
resp.installed_components[0].lifecycle_state #=> String, one of "NEW", "INSTALLED", "STARTING", "RUNNING", "STOPPING", "ERRORED", "BROKEN", "FINISHED"
resp.installed_components[0].lifecycle_state_details #=> String
resp.installed_components[0].is_root #=> Boolean
resp.installed_components[0].last_status_change_timestamp #=> Time
resp.installed_components[0].last_reported_timestamp #=> Time
resp.installed_components[0].last_installation_source #=> String
resp.installed_components[0].lifecycle_status_codes #=> Array
resp.installed_components[0].lifecycle_status_codes[0] #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :core_device_thing_name (required, String)

    The name of the core device. This is also the name of the IoT thing.

  • :max_results (Integer)

    The maximum number of results to be returned per paginated request.

  • :next_token (String)

    The token to be used for the next set of paginated results.

  • :topology_filter (String)

    The filter for the list of components. Choose from the following options:

    • ‘ALL` – The list includes all components installed on the core device.

    • ‘ROOT` – The list includes only root components, which are components that you specify in a deployment. When you choose this option, the list doesn’t include components that the core device installs as dependencies of other components.

    Default: ‘ROOT`

Returns:

See Also:



1927
1928
1929
1930
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1927

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

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

Retrieves the list of tags for an IoT Greengrass resource.

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



1960
1961
1962
1963
# File 'lib/aws-sdk-greengrassv2/client.rb', line 1960

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

#resolve_component_candidates(params = {}) ⇒ Types::ResolveComponentCandidatesResponse

Retrieves a list of components that meet the component, version, and platform requirements of a deployment. Greengrass core devices call this operation when they receive a deployment to identify the components to install.

This operation identifies components that meet all dependency requirements for a deployment. If the requirements conflict, then this operation returns an error and the deployment fails. For example, this occurs if component ‘A` requires version `>2.0.0` and component `B` requires version `<2.0.0` of a component dependency.

When you specify the component candidates to resolve, IoT Greengrass compares each component’s digest from the core device with the component’s digest in the Amazon Web Services Cloud. If the digests don’t match, then IoT Greengrass specifies to use the version from the Amazon Web Services Cloud.

To use this operation, you must use the data plane API endpoint and authenticate with an IoT device certificate. For more information, see [IoT Greengrass endpoints and quotas].

[1]: docs.aws.amazon.com/general/latest/gr/greengrass.html

Examples:

Request syntax with placeholder values


resp = client.resolve_component_candidates({
  platform: {
    name: "NonEmptyString",
    attributes: {
      "NonEmptyString" => "NonEmptyString",
    },
  },
  component_candidates: [
    {
      component_name: "ComponentNameString",
      component_version: "ComponentVersionString",
      version_requirements: {
        "NonEmptyString" => "NonEmptyString",
      },
    },
  ],
})

Response structure


resp.resolved_component_versions #=> Array
resp.resolved_component_versions[0].arn #=> String
resp.resolved_component_versions[0].component_name #=> String
resp.resolved_component_versions[0].component_version #=> String
resp.resolved_component_versions[0].recipe #=> String
resp.resolved_component_versions[0].vendor_guidance #=> String, one of "ACTIVE", "DISCONTINUED", "DELETED"
resp.resolved_component_versions[0].message #=> String

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



2034
2035
2036
2037
# File 'lib/aws-sdk-greengrassv2/client.rb', line 2034

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

#tag_resource(params = {}) ⇒ Struct

Adds tags to an IoT Greengrass resource. If a tag already exists for the resource, this operation updates the tag’s value.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2073
2074
2075
2076
# File 'lib/aws-sdk-greengrassv2/client.rb', line 2073

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

#untag_resource(params = {}) ⇒ Struct

Removes a tag from an IoT Greengrass resource.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2103
2104
2105
2106
# File 'lib/aws-sdk-greengrassv2/client.rb', line 2103

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

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

Updates connectivity information for a Greengrass core device.

Connectivity information includes endpoints and ports where client devices can connect to an MQTT broker on the core device. When a client device calls the [IoT Greengrass discovery API], IoT Greengrass returns connectivity information for all of the core devices where the client device can connect. For more information, see

Connect client devices to core devices][2

in the *IoT Greengrass

Version 2 Developer Guide*.

[1]: docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-discover-api.html [2]: docs.aws.amazon.com/greengrass/v2/developerguide/connect-client-devices.html

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the core device. This is also the name of the IoT thing.

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

    The connectivity information for the core device.

Returns:

See Also:



2157
2158
2159
2160
# File 'lib/aws-sdk-greengrassv2/client.rb', line 2157

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

#waiter_namesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.


2186
2187
2188
# File 'lib/aws-sdk-greengrassv2/client.rb', line 2186

def waiter_names
  []
end