AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: Aws::GreengrassV2::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-greengrassv2/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.

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

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

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

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :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[:credentials]
    • The :access_key_id, :secret_access_key, and :session_token options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • ~/.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::InstanceProfileCredentails or Aws::ECSCredentials to enable retries and extended timeouts.
  • :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:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_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.

  • :disable_host_prefix_injection (Boolean) — default: false

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

  • :endpoint (String)

    The client endpoint is normally constructed from the :region option. You should only configure an :endpoint when connecting to test or custom endpoints. This should be a valid HTTP(S) URI.

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

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

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

  • :secret_access_key (String)
  • :session_token (String)
  • :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.

  • :validate_params (Boolean) — default: true

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

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_open_timeout (Float) — default: 15

    The number of seconds to wait when opening a HTTP session before raising a Timeout::Error.

  • :http_read_timeout (Integer) — default: 60

    The default number of seconds to wait for response data. 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_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_wire_trace (Boolean) — default: false

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

  • :ssl_verify_peer (Boolean) — default: true

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

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



324
325
326
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 324

def initialize(*args)
  super
end

Instance Method Details

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



356
357
358
359
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 356

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 AWS IoT Greengrass core devices. After you develop and test a component on your core device, you can use this operation to upload your component to AWS 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 AWS IoT Greengrass component recipe reference in the AWS 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 AWS Lambda function that runs on AWS 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 AWS IoT Greengrass V1 to AWS IoT Greengrass V2.

    This function only accepts Lambda functions that use the following runtimes:

    • Python 2.7 – python2.7

    • Python 3.7 – python3.7

    • Python 3.8 – python3.8

    • Java 8 – java8

    • Node.js 10 – nodejs10.x

    • Node.js 12 – nodejs12.x

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

Examples:

Request syntax with placeholder values


resp = client.create_component_version({
  inline_recipe: "data",
  lambda_function: {
    lambda_arn: "LambdaFunctionARNWithVersionNumber", # 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",
  },
})

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

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 AWS IoT Greengrass V2 Developer Guide.

Returns:

See Also:



523
524
525
526
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 523

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 AWS IoT 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, AWS 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. AWS 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. This operation returns the revision number of the new deployment when you create it.

For more information, see the Create deployments in the AWS IoT Greengrass V2 Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_deployment({
  target_arn: "TargetARN", # required
  deployment_name: "NonEmptyString",
  components: {
    "NonEmptyString" => {
      component_version: "ComponentVersionString",
      configuration_update: {
        merge: "ComponentConfigurationString",
        reset: ["ComponentConfigurationPath"],
      },
      run_with: {
        posix_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,
    },
  },
  tags: {
    "TagKey" => "TagValue",
  },
})

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 AWS IoT thing or thing group.

  • :deployment_name (String)

    The name of the deployment.

    You can create deployments without names. If you create a deployment without a name, the AWS IoT Greengrass V2 console shows the deployment name as <targetType>:<targetName>, where targetType and targetName are the type and name of the deployment target.

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

  • :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 AWS IoT Greengrass V2 Developer Guide.

Returns:

See Also:



662
663
664
665
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 662

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 AWS IoT Greengrass.

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.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :arn (required, String)

    The ARN of the component version.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



696
697
698
699
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 696

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

#delete_core_device(params = {}) ⇒ Struct

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

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 AWS IoT thing.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



727
728
729
730
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 727

def delete_core_device(params = {}, options = {})
  req = build_request(:delete_core_device, 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.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):

  • :arn (required, String)

    The ARN of the component version.

Returns:

See Also:



782
783
784
785
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 782

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

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

Gets the recipe for a version of a component. Core devices can call this operation to identify the artifacts and requirements to install 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):

  • :recipe_output_format (String)

    The format of the recipe.

  • :arn (required, String)

    The ARN of the component version.

Returns:

See Also:



825
826
827
828
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 825

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 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
})

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 component version.

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

Returns:

See Also:



874
875
876
877
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 874

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

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

Retrieves metadata for a AWS IoT Greengrass core device.

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 AWS IoT thing.

Returns:

See Also:



916
917
918
919
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 916

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 AWS IoT 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.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.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:



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

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

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

Retrieves a paginated list of all versions for a component.

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):

  • :arn (required, String)

    The ARN of the component version.

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



1035
1036
1037
1038
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1035

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:



1089
1090
1091
1092
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1089

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 AWS IoT 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_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 AWS IoT thing group by which to filter. If you specify this parameter, the list includes only core devices that are members of this thing group.

  • :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 AWS IoT Greengrass Core software and all components run on the core device without issue.

    • UNHEALTHY – The AWS 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:



1150
1151
1152
1153
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1150

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
  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.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :target_arn (String)

    The ARN of the target AWS IoT thing or thing group.

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

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



1213
1214
1215
1216
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1213

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 AWS IoT Greengrass sends to AWS IoT 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"
resp.effective_deployments[0].reason #=> String
resp.effective_deployments[0].creation_timestamp #=> Time
resp.effective_deployments[0].modified_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 AWS 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:



1265
1266
1267
1268
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1265

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 AWS IoT Greengrass core device runs.

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",
})

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



1312
1313
1314
1315
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1312

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 AWS 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):

  • :resource_arn (required, String)

    The ARN of the resource.

Returns:

See Also:



1345
1346
1347
1348
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1345

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. AWS IoT 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, AWS IoT Greengrass compares each component's digest from the core device with the component's digest in the AWS Cloud. If the digests don't match, then AWS IoT Greengrass specifies to use the version from the AWS Cloud.

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

Examples:

Request syntax with placeholder values


resp = client.resolve_component_candidates({
  platform: { # required
    name: "NonEmptyString",
    attributes: {
      "NonEmptyString" => "NonEmptyString",
    },
  },
  component_candidates: [ # required
    {
      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

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



1417
1418
1419
1420
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1417

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 AWS 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):

  • :resource_arn (required, String)

    The ARN of the resource to tag.

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

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1456
1457
1458
1459
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1456

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 AWS 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):

  • :resource_arn (required, String)

    The ARN of the resource to untag.

  • :tag_keys (required, Array<String>)

    A list of keys for tags to remove from the resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1486
1487
1488
1489
# File 'gems/aws-sdk-greengrassv2/lib/aws-sdk-greengrassv2/client.rb', line 1486

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