com.amazonaws.services.greengrassv2.AWSGreengrassV2Client Maven / Gradle / Ivy
Show all versions of aws-java-sdk-greengrassv2 Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.greengrassv2;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import javax.annotation.Generated;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.client.builder.AdvancedConfig;
import com.amazonaws.services.greengrassv2.AWSGreengrassV2ClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.greengrassv2.model.*;
import com.amazonaws.services.greengrassv2.model.transform.*;
/**
* Client for accessing AWS GreengrassV2. All service calls made using this client are blocking, and will not return
* until the service call completes.
*
*
* IoT Greengrass brings local compute, messaging, data management, sync, and ML inference capabilities to edge devices.
* This enables devices to collect and analyze data closer to the source of information, react autonomously to local
* events, and communicate securely with each other on local networks. Local devices can also communicate securely with
* Amazon Web Services IoT Core and export IoT data to the Amazon Web Services Cloud. IoT Greengrass developers can use
* Lambda functions and components to create and deploy applications to fleets of edge devices for local operation.
*
*
* IoT Greengrass Version 2 provides a new major version of the IoT Greengrass Core software, new APIs, and a new
* console. Use this API reference to learn how to use the IoT Greengrass V2 API operations to manage components, manage
* deployments, and core devices.
*
*
* For more information, see What is IoT
* Greengrass? in the IoT Greengrass V2 Developer Guide.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSGreengrassV2Client extends AmazonWebServiceClient implements AWSGreengrassV2 {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AWSGreengrassV2.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "greengrass";
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final AdvancedConfig advancedConfig;
private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.1")
.withSupportsCbor(false)
.withSupportsIon(false)
.withContentTypeOverride("application/json")
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("RequestAlreadyInProgressException").withExceptionUnmarshaller(
com.amazonaws.services.greengrassv2.model.transform.RequestAlreadyInProgressExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller(
com.amazonaws.services.greengrassv2.model.transform.ThrottlingExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ServiceQuotaExceededException").withExceptionUnmarshaller(
com.amazonaws.services.greengrassv2.model.transform.ServiceQuotaExceededExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InternalServerException").withExceptionUnmarshaller(
com.amazonaws.services.greengrassv2.model.transform.InternalServerExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller(
com.amazonaws.services.greengrassv2.model.transform.AccessDeniedExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ConflictException").withExceptionUnmarshaller(
com.amazonaws.services.greengrassv2.model.transform.ConflictExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.greengrassv2.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller(
com.amazonaws.services.greengrassv2.model.transform.ValidationExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.greengrassv2.model.AWSGreengrassV2Exception.class));
public static AWSGreengrassV2ClientBuilder builder() {
return AWSGreengrassV2ClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on AWS GreengrassV2 using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSGreengrassV2Client(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on AWS GreengrassV2 using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSGreengrassV2Client(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("greengrass.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/greengrassv2/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/greengrassv2/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* 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 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.
*
*
* @param associateServiceRoleToAccountRequest
* @return Result of the AssociateServiceRoleToAccount operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.AssociateServiceRoleToAccount
* @see AWS API Documentation
*/
@Override
public AssociateServiceRoleToAccountResult associateServiceRoleToAccount(AssociateServiceRoleToAccountRequest request) {
request = beforeClientExecution(request);
return executeAssociateServiceRoleToAccount(request);
}
@SdkInternalApi
final AssociateServiceRoleToAccountResult executeAssociateServiceRoleToAccount(AssociateServiceRoleToAccountRequest associateServiceRoleToAccountRequest) {
ExecutionContext executionContext = createExecutionContext(associateServiceRoleToAccountRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateServiceRoleToAccountRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(associateServiceRoleToAccountRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateServiceRoleToAccount");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new AssociateServiceRoleToAccountResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
*
* 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.
*
*
*
* @param batchAssociateClientDeviceWithCoreDeviceRequest
* @return Result of the BatchAssociateClientDeviceWithCoreDevice operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.BatchAssociateClientDeviceWithCoreDevice
* @see AWS API Documentation
*/
@Override
public BatchAssociateClientDeviceWithCoreDeviceResult batchAssociateClientDeviceWithCoreDevice(BatchAssociateClientDeviceWithCoreDeviceRequest request) {
request = beforeClientExecution(request);
return executeBatchAssociateClientDeviceWithCoreDevice(request);
}
@SdkInternalApi
final BatchAssociateClientDeviceWithCoreDeviceResult executeBatchAssociateClientDeviceWithCoreDevice(
BatchAssociateClientDeviceWithCoreDeviceRequest batchAssociateClientDeviceWithCoreDeviceRequest) {
ExecutionContext executionContext = createExecutionContext(batchAssociateClientDeviceWithCoreDeviceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new BatchAssociateClientDeviceWithCoreDeviceRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(batchAssociateClientDeviceWithCoreDeviceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchAssociateClientDeviceWithCoreDevice");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new BatchAssociateClientDeviceWithCoreDeviceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
* @param batchDisassociateClientDeviceFromCoreDeviceRequest
* @return Result of the BatchDisassociateClientDeviceFromCoreDevice operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.BatchDisassociateClientDeviceFromCoreDevice
* @see AWS API Documentation
*/
@Override
public BatchDisassociateClientDeviceFromCoreDeviceResult batchDisassociateClientDeviceFromCoreDevice(
BatchDisassociateClientDeviceFromCoreDeviceRequest request) {
request = beforeClientExecution(request);
return executeBatchDisassociateClientDeviceFromCoreDevice(request);
}
@SdkInternalApi
final BatchDisassociateClientDeviceFromCoreDeviceResult executeBatchDisassociateClientDeviceFromCoreDevice(
BatchDisassociateClientDeviceFromCoreDeviceRequest batchDisassociateClientDeviceFromCoreDeviceRequest) {
ExecutionContext executionContext = createExecutionContext(batchDisassociateClientDeviceFromCoreDeviceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new BatchDisassociateClientDeviceFromCoreDeviceRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(batchDisassociateClientDeviceFromCoreDeviceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchDisassociateClientDeviceFromCoreDevice");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new BatchDisassociateClientDeviceFromCoreDeviceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
* @param cancelDeploymentRequest
* @return Result of the CancelDeployment operation returned by the service.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ConflictException
* Your request has conflicting operations. This can occur if you're trying to perform more than one
* operation on the same resource at the same time.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.CancelDeployment
* @see AWS
* API Documentation
*/
@Override
public CancelDeploymentResult cancelDeployment(CancelDeploymentRequest request) {
request = beforeClientExecution(request);
return executeCancelDeployment(request);
}
@SdkInternalApi
final CancelDeploymentResult executeCancelDeployment(CancelDeploymentRequest cancelDeploymentRequest) {
ExecutionContext executionContext = createExecutionContext(cancelDeploymentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelDeploymentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelDeployment");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CancelDeploymentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
*
* IoT Greengrass currently supports Lambda functions on only Linux core devices.
*
*
*
*
* @param createComponentVersionRequest
* @return Result of the CreateComponentVersion operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ServiceQuotaExceededException
* Your request exceeds a service quota. For example, you might have the maximum number of components that
* you can create.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ConflictException
* Your request has conflicting operations. This can occur if you're trying to perform more than one
* operation on the same resource at the same time.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws RequestAlreadyInProgressException
* The request is already in progress. This exception occurs when you use a client token for multiple
* requests while IoT Greengrass is still processing an earlier request that uses the same client token.
* @sample AWSGreengrassV2.CreateComponentVersion
* @see AWS API Documentation
*/
@Override
public CreateComponentVersionResult createComponentVersion(CreateComponentVersionRequest request) {
request = beforeClientExecution(request);
return executeCreateComponentVersion(request);
}
@SdkInternalApi
final CreateComponentVersionResult executeCreateComponentVersion(CreateComponentVersionRequest createComponentVersionRequest) {
ExecutionContext executionContext = createExecutionContext(createComponentVersionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateComponentVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createComponentVersionRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateComponentVersion");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new CreateComponentVersionResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
* @param createDeploymentRequest
* @return Result of the CreateDeployment operation returned by the service.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ConflictException
* Your request has conflicting operations. This can occur if you're trying to perform more than one
* operation on the same resource at the same time.
* @throws RequestAlreadyInProgressException
* The request is already in progress. This exception occurs when you use a client token for multiple
* requests while IoT Greengrass is still processing an earlier request that uses the same client token.
* @sample AWSGreengrassV2.CreateDeployment
* @see AWS
* API Documentation
*/
@Override
public CreateDeploymentResult createDeployment(CreateDeploymentRequest request) {
request = beforeClientExecution(request);
return executeCreateDeployment(request);
}
@SdkInternalApi
final CreateDeploymentResult executeCreateDeployment(CreateDeploymentRequest createDeploymentRequest) {
ExecutionContext executionContext = createExecutionContext(createDeploymentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDeploymentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDeployment");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDeploymentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes a version of a component from 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.
*
*
*
* @param deleteComponentRequest
* @return Result of the DeleteComponent operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ConflictException
* Your request has conflicting operations. This can occur if you're trying to perform more than one
* operation on the same resource at the same time.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.DeleteComponent
* @see AWS
* API Documentation
*/
@Override
public DeleteComponentResult deleteComponent(DeleteComponentRequest request) {
request = beforeClientExecution(request);
return executeDeleteComponent(request);
}
@SdkInternalApi
final DeleteComponentResult executeDeleteComponent(DeleteComponentRequest deleteComponentRequest) {
ExecutionContext executionContext = createExecutionContext(deleteComponentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteComponentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteComponent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteComponentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
* @param deleteCoreDeviceRequest
* @return Result of the DeleteCoreDevice operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws ConflictException
* Your request has conflicting operations. This can occur if you're trying to perform more than one
* operation on the same resource at the same time.
* @sample AWSGreengrassV2.DeleteCoreDevice
* @see AWS
* API Documentation
*/
@Override
public DeleteCoreDeviceResult deleteCoreDevice(DeleteCoreDeviceRequest request) {
request = beforeClientExecution(request);
return executeDeleteCoreDevice(request);
}
@SdkInternalApi
final DeleteCoreDeviceResult executeDeleteCoreDevice(DeleteCoreDeviceRequest deleteCoreDeviceRequest) {
ExecutionContext executionContext = createExecutionContext(deleteCoreDeviceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteCoreDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCoreDeviceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteCoreDevice");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCoreDeviceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
* @param deleteDeploymentRequest
* @return Result of the DeleteDeployment operation returned by the service.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ConflictException
* Your request has conflicting operations. This can occur if you're trying to perform more than one
* operation on the same resource at the same time.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.DeleteDeployment
* @see AWS
* API Documentation
*/
@Override
public DeleteDeploymentResult deleteDeployment(DeleteDeploymentRequest request) {
request = beforeClientExecution(request);
return executeDeleteDeployment(request);
}
@SdkInternalApi
final DeleteDeploymentResult executeDeleteDeployment(DeleteDeploymentRequest deleteDeploymentRequest) {
ExecutionContext executionContext = createExecutionContext(deleteDeploymentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDeploymentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDeployment");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDeploymentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves metadata for a version of a component.
*
*
* @param describeComponentRequest
* @return Result of the DescribeComponent operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.DescribeComponent
* @see AWS
* API Documentation
*/
@Override
public DescribeComponentResult describeComponent(DescribeComponentRequest request) {
request = beforeClientExecution(request);
return executeDescribeComponent(request);
}
@SdkInternalApi
final DescribeComponentResult executeDescribeComponent(DescribeComponentRequest describeComponentRequest) {
ExecutionContext executionContext = createExecutionContext(describeComponentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeComponentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeComponent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeComponentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
* @param disassociateServiceRoleFromAccountRequest
* @return Result of the DisassociateServiceRoleFromAccount operation returned by the service.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.DisassociateServiceRoleFromAccount
* @see AWS API Documentation
*/
@Override
public DisassociateServiceRoleFromAccountResult disassociateServiceRoleFromAccount(DisassociateServiceRoleFromAccountRequest request) {
request = beforeClientExecution(request);
return executeDisassociateServiceRoleFromAccount(request);
}
@SdkInternalApi
final DisassociateServiceRoleFromAccountResult executeDisassociateServiceRoleFromAccount(
DisassociateServiceRoleFromAccountRequest disassociateServiceRoleFromAccountRequest) {
ExecutionContext executionContext = createExecutionContext(disassociateServiceRoleFromAccountRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DisassociateServiceRoleFromAccountRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(disassociateServiceRoleFromAccountRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateServiceRoleFromAccount");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DisassociateServiceRoleFromAccountResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets the recipe for a version of a component.
*
*
* @param getComponentRequest
* @return Result of the GetComponent operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.GetComponent
* @see AWS API
* Documentation
*/
@Override
public GetComponentResult getComponent(GetComponentRequest request) {
request = beforeClientExecution(request);
return executeGetComponent(request);
}
@SdkInternalApi
final GetComponentResult executeGetComponent(GetComponentRequest getComponentRequest) {
ExecutionContext executionContext = createExecutionContext(getComponentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getComponentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetComponent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetComponentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
* @param getComponentVersionArtifactRequest
* @return Result of the GetComponentVersionArtifact operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.GetComponentVersionArtifact
* @see AWS API Documentation
*/
@Override
public GetComponentVersionArtifactResult getComponentVersionArtifact(GetComponentVersionArtifactRequest request) {
request = beforeClientExecution(request);
return executeGetComponentVersionArtifact(request);
}
@SdkInternalApi
final GetComponentVersionArtifactResult executeGetComponentVersionArtifact(GetComponentVersionArtifactRequest getComponentVersionArtifactRequest) {
ExecutionContext executionContext = createExecutionContext(getComponentVersionArtifactRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetComponentVersionArtifactRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(getComponentVersionArtifactRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetComponentVersionArtifact");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new GetComponentVersionArtifactResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 in the IoT Greengrass Version 2 Developer Guide.
*
*
* @param getConnectivityInfoRequest
* @return Result of the GetConnectivityInfo operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.GetConnectivityInfo
* @see AWS API Documentation
*/
@Override
public GetConnectivityInfoResult getConnectivityInfo(GetConnectivityInfoRequest request) {
request = beforeClientExecution(request);
return executeGetConnectivityInfo(request);
}
@SdkInternalApi
final GetConnectivityInfoResult executeGetConnectivityInfo(GetConnectivityInfoRequest getConnectivityInfoRequest) {
ExecutionContext executionContext = createExecutionContext(getConnectivityInfoRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetConnectivityInfoRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getConnectivityInfoRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetConnectivityInfo");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetConnectivityInfoResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves metadata for a Greengrass core device.
*
*
*
* 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
*
*
*
*
*
* @param getCoreDeviceRequest
* @return Result of the GetCoreDevice operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.GetCoreDevice
* @see AWS API
* Documentation
*/
@Override
public GetCoreDeviceResult getCoreDevice(GetCoreDeviceRequest request) {
request = beforeClientExecution(request);
return executeGetCoreDevice(request);
}
@SdkInternalApi
final GetCoreDeviceResult executeGetCoreDevice(GetCoreDeviceRequest getCoreDeviceRequest) {
ExecutionContext executionContext = createExecutionContext(getCoreDeviceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetCoreDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCoreDeviceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCoreDevice");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCoreDeviceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets a deployment. Deployments define the components that run on Greengrass core devices.
*
*
* @param getDeploymentRequest
* @return Result of the GetDeployment operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.GetDeployment
* @see AWS API
* Documentation
*/
@Override
public GetDeploymentResult getDeployment(GetDeploymentRequest request) {
request = beforeClientExecution(request);
return executeGetDeployment(request);
}
@SdkInternalApi
final GetDeploymentResult executeGetDeployment(GetDeploymentRequest getDeploymentRequest) {
ExecutionContext executionContext = createExecutionContext(getDeploymentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDeploymentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDeployment");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDeploymentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 in the IoT Greengrass Version 2 Developer Guide.
*
*
* @param getServiceRoleForAccountRequest
* @return Result of the GetServiceRoleForAccount operation returned by the service.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.GetServiceRoleForAccount
* @see AWS API Documentation
*/
@Override
public GetServiceRoleForAccountResult getServiceRoleForAccount(GetServiceRoleForAccountRequest request) {
request = beforeClientExecution(request);
return executeGetServiceRoleForAccount(request);
}
@SdkInternalApi
final GetServiceRoleForAccountResult executeGetServiceRoleForAccount(GetServiceRoleForAccountRequest getServiceRoleForAccountRequest) {
ExecutionContext executionContext = createExecutionContext(getServiceRoleForAccountRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetServiceRoleForAccountRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(getServiceRoleForAccountRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetServiceRoleForAccount");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new GetServiceRoleForAccountResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves a paginated list of client devices that are associated with a core device.
*
*
* @param listClientDevicesAssociatedWithCoreDeviceRequest
* @return Result of the ListClientDevicesAssociatedWithCoreDevice operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.ListClientDevicesAssociatedWithCoreDevice
* @see AWS API Documentation
*/
@Override
public ListClientDevicesAssociatedWithCoreDeviceResult listClientDevicesAssociatedWithCoreDevice(ListClientDevicesAssociatedWithCoreDeviceRequest request) {
request = beforeClientExecution(request);
return executeListClientDevicesAssociatedWithCoreDevice(request);
}
@SdkInternalApi
final ListClientDevicesAssociatedWithCoreDeviceResult executeListClientDevicesAssociatedWithCoreDevice(
ListClientDevicesAssociatedWithCoreDeviceRequest listClientDevicesAssociatedWithCoreDeviceRequest) {
ExecutionContext executionContext = createExecutionContext(listClientDevicesAssociatedWithCoreDeviceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListClientDevicesAssociatedWithCoreDeviceRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(listClientDevicesAssociatedWithCoreDeviceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListClientDevicesAssociatedWithCoreDevice");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListClientDevicesAssociatedWithCoreDeviceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves a paginated list of all versions for a component. Greater versions are listed first.
*
*
* @param listComponentVersionsRequest
* @return Result of the ListComponentVersions operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.ListComponentVersions
* @see AWS API Documentation
*/
@Override
public ListComponentVersionsResult listComponentVersions(ListComponentVersionsRequest request) {
request = beforeClientExecution(request);
return executeListComponentVersions(request);
}
@SdkInternalApi
final ListComponentVersionsResult executeListComponentVersions(ListComponentVersionsRequest listComponentVersionsRequest) {
ExecutionContext executionContext = createExecutionContext(listComponentVersionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListComponentVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listComponentVersionsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListComponentVersions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListComponentVersionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves a paginated list of component summaries. This list includes components that you have permission to
* view.
*
*
* @param listComponentsRequest
* @return Result of the ListComponents operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.ListComponents
* @see AWS
* API Documentation
*/
@Override
public ListComponentsResult listComponents(ListComponentsRequest request) {
request = beforeClientExecution(request);
return executeListComponents(request);
}
@SdkInternalApi
final ListComponentsResult executeListComponents(ListComponentsRequest listComponentsRequest) {
ExecutionContext executionContext = createExecutionContext(listComponentsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListComponentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listComponentsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListComponents");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListComponentsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves a paginated list of Greengrass core devices.
*
*
*
* 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
*
*
*
*
*
* @param listCoreDevicesRequest
* @return Result of the ListCoreDevices operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.ListCoreDevices
* @see AWS
* API Documentation
*/
@Override
public ListCoreDevicesResult listCoreDevices(ListCoreDevicesRequest request) {
request = beforeClientExecution(request);
return executeListCoreDevices(request);
}
@SdkInternalApi
final ListCoreDevicesResult executeListCoreDevices(ListCoreDevicesRequest listCoreDevicesRequest) {
ExecutionContext executionContext = createExecutionContext(listCoreDevicesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListCoreDevicesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCoreDevicesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListCoreDevices");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListCoreDevicesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves a paginated list of deployments.
*
*
* @param listDeploymentsRequest
* @return Result of the ListDeployments operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.ListDeployments
* @see AWS
* API Documentation
*/
@Override
public ListDeploymentsResult listDeployments(ListDeploymentsRequest request) {
request = beforeClientExecution(request);
return executeListDeployments(request);
}
@SdkInternalApi
final ListDeploymentsResult executeListDeployments(ListDeploymentsRequest listDeploymentsRequest) {
ExecutionContext executionContext = createExecutionContext(listDeploymentsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListDeploymentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDeploymentsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDeployments");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDeploymentsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves a paginated list of deployment jobs that IoT Greengrass sends to Greengrass core devices.
*
*
* @param listEffectiveDeploymentsRequest
* @return Result of the ListEffectiveDeployments operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.ListEffectiveDeployments
* @see AWS API Documentation
*/
@Override
public ListEffectiveDeploymentsResult listEffectiveDeployments(ListEffectiveDeploymentsRequest request) {
request = beforeClientExecution(request);
return executeListEffectiveDeployments(request);
}
@SdkInternalApi
final ListEffectiveDeploymentsResult executeListEffectiveDeployments(ListEffectiveDeploymentsRequest listEffectiveDeploymentsRequest) {
ExecutionContext executionContext = createExecutionContext(listEffectiveDeploymentsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListEffectiveDeploymentsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(listEffectiveDeploymentsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListEffectiveDeployments");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListEffectiveDeploymentsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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
.
*
*
*
* 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
*
*
*
*
*
* @param listInstalledComponentsRequest
* @return Result of the ListInstalledComponents operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @sample AWSGreengrassV2.ListInstalledComponents
* @see AWS API Documentation
*/
@Override
public ListInstalledComponentsResult listInstalledComponents(ListInstalledComponentsRequest request) {
request = beforeClientExecution(request);
return executeListInstalledComponents(request);
}
@SdkInternalApi
final ListInstalledComponentsResult executeListInstalledComponents(ListInstalledComponentsRequest listInstalledComponentsRequest) {
ExecutionContext executionContext = createExecutionContext(listInstalledComponentsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListInstalledComponentsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(listInstalledComponentsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListInstalledComponents");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListInstalledComponentsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves the list of tags for an IoT Greengrass resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @sample AWSGreengrassV2.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) {
request = beforeClientExecution(request);
return executeListTagsForResource(request);
}
@SdkInternalApi
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {
ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
*
*
*
* @param resolveComponentCandidatesRequest
* @return Result of the ResolveComponentCandidates operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws AccessDeniedException
* You don't have permission to perform the action.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @throws ConflictException
* Your request has conflicting operations. This can occur if you're trying to perform more than one
* operation on the same resource at the same time.
* @throws ThrottlingException
* Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that
* you can retrieve device or deployment status per second.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.ResolveComponentCandidates
* @see AWS API Documentation
*/
@Override
public ResolveComponentCandidatesResult resolveComponentCandidates(ResolveComponentCandidatesRequest request) {
request = beforeClientExecution(request);
return executeResolveComponentCandidates(request);
}
@SdkInternalApi
final ResolveComponentCandidatesResult executeResolveComponentCandidates(ResolveComponentCandidatesRequest resolveComponentCandidatesRequest) {
ExecutionContext executionContext = createExecutionContext(resolveComponentCandidatesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ResolveComponentCandidatesRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(resolveComponentCandidatesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ResolveComponentCandidates");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ResolveComponentCandidatesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Adds tags to an IoT Greengrass resource. If a tag already exists for the resource, this operation updates the
* tag's value.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @sample AWSGreengrassV2.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResult tagResource(TagResourceRequest request) {
request = beforeClientExecution(request);
return executeTagResource(request);
}
@SdkInternalApi
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {
ExecutionContext executionContext = createExecutionContext(tagResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Removes a tag from an IoT Greengrass resource.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws ResourceNotFoundException
* The requested resource can't be found.
* @sample AWSGreengrassV2.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResult untagResource(UntagResourceRequest request) {
request = beforeClientExecution(request);
return executeUntagResource(request);
}
@SdkInternalApi
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {
ExecutionContext executionContext = createExecutionContext(untagResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 in the IoT Greengrass Version 2 Developer Guide.
*
*
* @param updateConnectivityInfoRequest
* @return Result of the UpdateConnectivityInfo operation returned by the service.
* @throws ValidationException
* The request isn't valid. This can occur if your request contains malformed JSON or unsupported
* characters.
* @throws InternalServerException
* IoT Greengrass can't process your request right now. Try again later.
* @sample AWSGreengrassV2.UpdateConnectivityInfo
* @see AWS API Documentation
*/
@Override
public UpdateConnectivityInfoResult updateConnectivityInfo(UpdateConnectivityInfoRequest request) {
request = beforeClientExecution(request);
return executeUpdateConnectivityInfo(request);
}
@SdkInternalApi
final UpdateConnectivityInfoResult executeUpdateConnectivityInfo(UpdateConnectivityInfoRequest updateConnectivityInfoRequest) {
ExecutionContext executionContext = createExecutionContext(updateConnectivityInfoRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateConnectivityInfoRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateConnectivityInfoRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateConnectivityInfo");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new UpdateConnectivityInfoResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns additional metadata for a previously executed successful, request, typically used for debugging issues
* where a service isn't acting as expected. This data isn't considered part of the result data returned by an
* operation, so it's available through this separate, diagnostic interface.
*
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
return invoke(request, responseHandler, executionContext, null, null);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {
executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);
}
/**
* Invoke with no authentication. Credentials are not required and any credentials set on the client or request will
* be ignored for this operation.
**/
private Response anonymousInvoke(Request request,
HttpResponseHandler> responseHandler, ExecutionContext executionContext) {
return doInvoke(request, responseHandler, executionContext, null, null);
}
/**
* Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
* ExecutionContext beforehand.
**/
private Response doInvoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
if (discoveredEndpoint != null) {
request.setEndpoint(discoveredEndpoint);
request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
} else if (uriFromEndpointTrait != null) {
request.setEndpoint(uriFromEndpointTrait);
} else {
request.setEndpoint(endpoint);
}
request.setTimeOffset(timeOffset);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}
@com.amazonaws.annotation.SdkInternalApi
static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() {
return protocolFactory;
}
@Override
public void shutdown() {
super.shutdown();
}
}