Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 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.simplesystemsmanagement;
  
  import java.net.*;
  import java.util.*;
  
  
  import com.amazonaws.*;
  
Client for accessing AWSSimpleSystemsManagement. All service calls made using this client are blocking, and will not return until the service call completes.

AWS Simple Systems Management enables you to configure and manage your EC2 instances. You can create a configuration document and then associate it with one or more running instances.

You can use a configuration document to automate the following tasks for your Windows instances:

  • Install, repair, or uninstall software using an MSI package

  • Run PowerShell scripts

  • Join an AWS Directory

  • Configure CloudWatch Logs to monitor applications and systems

Note that configuration documents are not supported on Linux instances.

  
  public class AWSSimpleSystemsManagementClient extends AmazonWebServiceClient implements AWSSimpleSystemsManagement {

    
Provider for AWS credentials.
  
  
      private static final Log log = LogFactory.getLog(AWSSimpleSystemsManagement.class);

    
List of exception unmarshallers for all AWSSimpleSystemsManagement exceptions.
  
      protected List<JsonErrorUnmarshallerjsonErrorUnmarshallers;

    
Constructs a new client to invoke service methods on AWSSimpleSystemsManagement. A credentials provider chain will be used that searches for credentials in this order:
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • Instance profile credentials delivered through the Amazon EC2 metadata service

All service calls made using this new client object are blocking, and will not return until the service call completes.

 
         this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());
     }

    
Constructs a new client to invoke service methods on AWSSimpleSystemsManagement. A credentials provider chain will be used that searches for credentials in this order:
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • Instance profile credentials delivered through the Amazon EC2 metadata service

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
clientConfiguration The client configuration options controlling how this client connects to AWSSimpleSystemsManagement (ex: proxy settings, retry counts, etc.).
See also:
com.amazonaws.auth.DefaultAWSCredentialsProviderChain
 
     public AWSSimpleSystemsManagementClient(ClientConfiguration clientConfiguration) {
         this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
     }

    
Constructs a new client to invoke service methods on AWSSimpleSystemsManagement using the specified AWS account credentials.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
 
     public AWSSimpleSystemsManagementClient(AWSCredentials awsCredentials) {
         this(awsCredentialsnew ClientConfiguration());
     }

    
Constructs a new client to invoke service methods on AWSSimpleSystemsManagement using the specified AWS account credentials and client configuration options.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSSimpleSystemsManagement (ex: proxy settings, retry counts, etc.).
 
     public AWSSimpleSystemsManagementClient(AWSCredentials awsCredentialsClientConfiguration clientConfiguration) {
         super(adjustClientConfiguration(clientConfiguration));
         
         this. = new StaticCredentialsProvider(awsCredentials);
         
         init();
     }

    
Constructs a new client to invoke service methods on AWSSimpleSystemsManagement using the specified AWS account credentials provider.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
 
     public AWSSimpleSystemsManagementClient(AWSCredentialsProvider awsCredentialsProvider) {
         this(awsCredentialsProvidernew ClientConfiguration());
     }

    
Constructs a new client to invoke service methods on AWSSimpleSystemsManagement using the specified AWS account credentials provider and client configuration options.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSSimpleSystemsManagement (ex: proxy settings, retry counts, etc.).
 
     public AWSSimpleSystemsManagementClient(AWSCredentialsProvider awsCredentialsProviderClientConfiguration clientConfiguration) {
         this(awsCredentialsProviderclientConfigurationnull);
     }

    
Constructs a new client to invoke service methods on AWSSimpleSystemsManagement using the specified AWS account credentials provider, client configuration options and request metric collector.

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration The client configuration options controlling how this client connects to AWSSimpleSystemsManagement (ex: proxy settings, retry counts, etc.).
requestMetricCollector optional request metric collector
 
     public AWSSimpleSystemsManagementClient(AWSCredentialsProvider awsCredentialsProvider,
             ClientConfiguration clientConfiguration,
             RequestMetricCollector requestMetricCollector) {
         super(adjustClientConfiguration(clientConfiguration), requestMetricCollector);
         
         this. = awsCredentialsProvider;
         
         init();
     }
 
     private void init() {
         
         
         // calling this.setEndPoint(...) will also modify the signer accordingly
         this.setEndpoint("ssm.us-east-1.amazonaws.com/");
         
         HandlerChainFactory chainFactory = new HandlerChainFactory();
         .addAll(chainFactory.newRequestHandlerChain(
                 "/com/amazonaws/services/simplesystemsmanagement/request.handlers"));
         .addAll(chainFactory.newRequestHandler2Chain(
                 "/com/amazonaws/services/simplesystemsmanagement/request.handler2s"));
     }
 
         ClientConfiguration config = orig;
         
         return config;
     }

    

Deletes the specified configuration document.

You must use DeleteAssociation to disassociate all instances that are associated with the configuration document before you can delete it.

Parameters:
deleteDocumentRequest Container for the necessary parameters to execute the DeleteDocument service method on AWSSimpleSystemsManagement.
Returns:
The response from the DeleteDocument service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.AssociatedInstancesException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public DeleteDocumentResult deleteDocument(DeleteDocumentRequest deleteDocumentRequest) {
         ExecutionContext executionContext = createExecutionContext(deleteDocumentRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DeleteDocumentRequestrequest = null;
         Response<DeleteDocumentResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DeleteDocumentRequestMarshaller().marshall(super.beforeMarshalling(deleteDocumentRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DeleteDocumentResultJsonUnmarshallerContextunmarshaller =
                 new DeleteDocumentResultJsonUnmarshaller();
             JsonResponseHandler<DeleteDocumentResultresponseHandler =
                 new JsonResponseHandler<DeleteDocumentResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Describes the associations for the specified configuration document or instance.

Parameters:
describeAssociationRequest Container for the necessary parameters to execute the DescribeAssociation service method on AWSSimpleSystemsManagement.
Returns:
The response from the DescribeAssociation service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidInstanceIdException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentException
com.amazonaws.services.simplesystemsmanagement.model.AssociationDoesNotExistException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public DescribeAssociationResult describeAssociation(DescribeAssociationRequest describeAssociationRequest) {
         ExecutionContext executionContext = createExecutionContext(describeAssociationRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeAssociationRequestrequest = null;
         Response<DescribeAssociationResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeAssociationRequestMarshaller().marshall(super.beforeMarshalling(describeAssociationRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DescribeAssociationResultJsonUnmarshallerContextunmarshaller =
                 new DescribeAssociationResultJsonUnmarshaller();
             JsonResponseHandler<DescribeAssociationResultresponseHandler =
                 new JsonResponseHandler<DescribeAssociationResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Associates the specified configuration document with the specified instance.

When you associate a configuration document with an instance, the configuration agent on the instance processes the configuration document and configures the instance as specified.

If you associate a configuration document with an instance that already has an associated configuration document, we replace the current configuration document with the new configuration document.

Parameters:
createAssociationRequest Container for the necessary parameters to execute the CreateAssociation service method on AWSSimpleSystemsManagement.
Returns:
The response from the CreateAssociation service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.AssociationLimitExceededException
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidInstanceIdException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentException
com.amazonaws.services.simplesystemsmanagement.model.AssociationAlreadyExistsException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public CreateAssociationResult createAssociation(CreateAssociationRequest createAssociationRequest) {
         ExecutionContext executionContext = createExecutionContext(createAssociationRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateAssociationRequestrequest = null;
         Response<CreateAssociationResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateAssociationRequestMarshaller().marshall(super.beforeMarshalling(createAssociationRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<CreateAssociationResultJsonUnmarshallerContextunmarshaller =
                 new CreateAssociationResultJsonUnmarshaller();
             JsonResponseHandler<CreateAssociationResultresponseHandler =
                 new JsonResponseHandler<CreateAssociationResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Associates the specified configuration documents with the specified instances.

When you associate a configuration document with an instance, the configuration agent on the instance processes the configuration document and configures the instance as specified.

If you associate a configuration document with an instance that already has an associated configuration document, we replace the current configuration document with the new configuration document.

Parameters:
createAssociationBatchRequest Container for the necessary parameters to execute the CreateAssociationBatch service method on AWSSimpleSystemsManagement.
Returns:
The response from the CreateAssociationBatch service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.DuplicateInstanceIdException
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.AssociationLimitExceededException
com.amazonaws.services.simplesystemsmanagement.model.InvalidInstanceIdException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public CreateAssociationBatchResult createAssociationBatch(CreateAssociationBatchRequest createAssociationBatchRequest) {
         ExecutionContext executionContext = createExecutionContext(createAssociationBatchRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateAssociationBatchRequestrequest = null;
         Response<CreateAssociationBatchResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateAssociationBatchRequestMarshaller().marshall(super.beforeMarshalling(createAssociationBatchRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<CreateAssociationBatchResultJsonUnmarshallerContextunmarshaller =
                 new CreateAssociationBatchResultJsonUnmarshaller();
             JsonResponseHandler<CreateAssociationBatchResultresponseHandler =
                 new JsonResponseHandler<CreateAssociationBatchResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Describes the specified configuration document.

Parameters:
describeDocumentRequest Container for the necessary parameters to execute the DescribeDocument service method on AWSSimpleSystemsManagement.
Returns:
The response from the DescribeDocument service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public DescribeDocumentResult describeDocument(DescribeDocumentRequest describeDocumentRequest) {
         ExecutionContext executionContext = createExecutionContext(describeDocumentRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DescribeDocumentRequestrequest = null;
         Response<DescribeDocumentResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DescribeDocumentRequestMarshaller().marshall(super.beforeMarshalling(describeDocumentRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DescribeDocumentResultJsonUnmarshallerContextunmarshaller =
                 new DescribeDocumentResultJsonUnmarshaller();
             JsonResponseHandler<DescribeDocumentResultresponseHandler =
                 new JsonResponseHandler<DescribeDocumentResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Updates the status of the configuration document associated with the specified instance.

Parameters:
updateAssociationStatusRequest Container for the necessary parameters to execute the UpdateAssociationStatus service method on AWSSimpleSystemsManagement.
Returns:
The response from the UpdateAssociationStatus service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidInstanceIdException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentException
com.amazonaws.services.simplesystemsmanagement.model.StatusUnchangedException
com.amazonaws.services.simplesystemsmanagement.model.TooManyUpdatesException
com.amazonaws.services.simplesystemsmanagement.model.AssociationDoesNotExistException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public UpdateAssociationStatusResult updateAssociationStatus(UpdateAssociationStatusRequest updateAssociationStatusRequest) {
         ExecutionContext executionContext = createExecutionContext(updateAssociationStatusRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<UpdateAssociationStatusRequestrequest = null;
         Response<UpdateAssociationStatusResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new UpdateAssociationStatusRequestMarshaller().marshall(super.beforeMarshalling(updateAssociationStatusRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<UpdateAssociationStatusResultJsonUnmarshallerContextunmarshaller =
                 new UpdateAssociationStatusResultJsonUnmarshaller();
             JsonResponseHandler<UpdateAssociationStatusResultresponseHandler =
                 new JsonResponseHandler<UpdateAssociationStatusResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Lists the associations for the specified configuration document or instance.

Parameters:
listAssociationsRequest Container for the necessary parameters to execute the ListAssociations service method on AWSSimpleSystemsManagement.
Returns:
The response from the ListAssociations service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidNextTokenException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public ListAssociationsResult listAssociations(ListAssociationsRequest listAssociationsRequest) {
         ExecutionContext executionContext = createExecutionContext(listAssociationsRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<ListAssociationsRequestrequest = null;
         Response<ListAssociationsResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new ListAssociationsRequestMarshaller().marshall(super.beforeMarshalling(listAssociationsRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<ListAssociationsResultJsonUnmarshallerContextunmarshaller =
                 new ListAssociationsResultJsonUnmarshaller();
             JsonResponseHandler<ListAssociationsResultresponseHandler =
                 new JsonResponseHandler<ListAssociationsResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Describes one or more of your configuration documents.

Parameters:
listDocumentsRequest Container for the necessary parameters to execute the ListDocuments service method on AWSSimpleSystemsManagement.
Returns:
The response from the ListDocuments service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidNextTokenException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public ListDocumentsResult listDocuments(ListDocumentsRequest listDocumentsRequest) {
         ExecutionContext executionContext = createExecutionContext(listDocumentsRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<ListDocumentsRequestrequest = null;
         Response<ListDocumentsResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new ListDocumentsRequestMarshaller().marshall(super.beforeMarshalling(listDocumentsRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<ListDocumentsResultJsonUnmarshallerContextunmarshaller =
                 new ListDocumentsResultJsonUnmarshaller();
             JsonResponseHandler<ListDocumentsResultresponseHandler =
                 new JsonResponseHandler<ListDocumentsResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Disassociates the specified configuration document from the specified instance.

When you disassociate a configuration document from an instance, it does not change the configuration of the instance. To change the configuration state of an instance after you disassociate a configuration document, you must create a new configuration document with the desired configuration and associate it with the instance.

Parameters:
deleteAssociationRequest Container for the necessary parameters to execute the DeleteAssociation service method on AWSSimpleSystemsManagement.
Returns:
The response from the DeleteAssociation service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidInstanceIdException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentException
com.amazonaws.services.simplesystemsmanagement.model.TooManyUpdatesException
com.amazonaws.services.simplesystemsmanagement.model.AssociationDoesNotExistException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public DeleteAssociationResult deleteAssociation(DeleteAssociationRequest deleteAssociationRequest) {
         ExecutionContext executionContext = createExecutionContext(deleteAssociationRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<DeleteAssociationRequestrequest = null;
         Response<DeleteAssociationResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new DeleteAssociationRequestMarshaller().marshall(super.beforeMarshalling(deleteAssociationRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<DeleteAssociationResultJsonUnmarshallerContextunmarshaller =
                 new DeleteAssociationResultJsonUnmarshaller();
             JsonResponseHandler<DeleteAssociationResultresponseHandler =
                 new JsonResponseHandler<DeleteAssociationResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Creates a configuration document.

After you create a configuration document, you can use CreateAssociation to associate it with one or more running instances.

Parameters:
createDocumentRequest Container for the necessary parameters to execute the CreateDocument service method on AWSSimpleSystemsManagement.
Returns:
The response from the CreateDocument service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.DocumentAlreadyExistsException
com.amazonaws.services.simplesystemsmanagement.model.MaxDocumentSizeExceededException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentContentException
com.amazonaws.services.simplesystemsmanagement.model.DocumentLimitExceededException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public CreateDocumentResult createDocument(CreateDocumentRequest createDocumentRequest) {
         ExecutionContext executionContext = createExecutionContext(createDocumentRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<CreateDocumentRequestrequest = null;
         Response<CreateDocumentResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new CreateDocumentRequestMarshaller().marshall(super.beforeMarshalling(createDocumentRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<CreateDocumentResultJsonUnmarshallerContextunmarshaller =
                 new CreateDocumentResultJsonUnmarshaller();
             JsonResponseHandler<CreateDocumentResultresponseHandler =
                 new JsonResponseHandler<CreateDocumentResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Gets the contents of the specified configuration document.

Parameters:
getDocumentRequest Container for the necessary parameters to execute the GetDocument service method on AWSSimpleSystemsManagement.
Returns:
The response from the GetDocument service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidDocumentException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
     public GetDocumentResult getDocument(GetDocumentRequest getDocumentRequest) {
         ExecutionContext executionContext = createExecutionContext(getDocumentRequest);
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         awsRequestMetrics.startEvent(.);
         Request<GetDocumentRequestrequest = null;
         Response<GetDocumentResultresponse = null;
         
         try {
             awsRequestMetrics.startEvent(.);
             try {
                 request = new GetDocumentRequestMarshaller().marshall(super.beforeMarshalling(getDocumentRequest));
                 // Binds the request metrics to the current request.
                 request.setAWSRequestMetrics(awsRequestMetrics);
             } finally {
                 awsRequestMetrics.endEvent(.);
             }
 
             Unmarshaller<GetDocumentResultJsonUnmarshallerContextunmarshaller =
                 new GetDocumentResultJsonUnmarshaller();
             JsonResponseHandler<GetDocumentResultresponseHandler =
                 new JsonResponseHandler<GetDocumentResult>(unmarshaller);
 
             response = invoke(requestresponseHandlerexecutionContext);
 
             return response.getAwsResponse();
         } finally {
             
             endClientExecution(awsRequestMetricsrequestresponse);
         }
     }

    

Describes one or more of your configuration documents.

Returns:
The response from the ListDocuments service method, as returned by AWSSimpleSystemsManagement.
Throws:
com.amazonaws.services.simplesystemsmanagement.model.InternalServerErrorException
com.amazonaws.services.simplesystemsmanagement.model.InvalidNextTokenException
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSSimpleSystemsManagement indicating either a problem with the data in the request, or a server side issue.
 
         return listDocuments(new ListDocumentsRequest());
     }
 
     @Override
     public void setEndpoint(String endpoint) {
         super.setEndpoint(endpoint);
     }
 
     @Override
     public void setEndpoint(String endpointString serviceNameString regionIdthrows IllegalArgumentException {
         super.setEndpoint(endpointserviceNameregionId);
     }

    
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.

Parameters:
request The originally executed request
Returns:
The response metadata for the specified request, or null if none is available.
 
         return .getResponseMetadataForRequest(request);
     }
 
     private <X, Y extends AmazonWebServiceRequestResponse<X> invoke(Request<Y> request,
             HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
             ExecutionContext executionContext) {
         request.setEndpoint();
         request.setTimeOffset();
 
         AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
         AWSCredentials credentials;
         awsRequestMetrics.startEvent(.);
         try {
             credentials = .getCredentials();
         } finally {
             awsRequestMetrics.endEvent(.);
         }
 
         AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
         if (originalRequest != null && originalRequest.getRequestCredentials() != null) {
             credentials = originalRequest.getRequestCredentials();
         }
 
         executionContext.setCredentials(credentials);
         JsonErrorResponseHandler errorResponseHandler = new JsonErrorResponseHandler();
         Response<X> result = .execute(requestresponseHandler,
                 errorResponseHandlerexecutionContext);
        return result;
    }
}
        
New to GrepCode? Check out our FAQ X