AWS Code Sample
Catalog

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

UpdateJobPriority.java

UpdateJobPriority.java demonstrates how to update the job priority (a higher number indicates a higher execution priority).

/** * Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * <p> * This file is 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 * <p> * http://aws.amazon.com/apache2.0/ * <p> * 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 aws.example.s3control; import com.amazonaws.AmazonServiceException; import com.amazonaws.SdkClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.services.s3control.AWSS3Control; import com.amazonaws.services.s3control.AWSS3ControlClient; import com.amazonaws.services.s3control.model.UpdateJobPriorityRequest; import static com.amazonaws.regions.Regions.US_WEST_2; public class UpdateJobPriority { public static void main(String[] args) { String accountId = "Account ID"; String jobId = "00e123a4-c0d8-41f4-a0eb-b46f9ba5b07c"; try { AWSS3Control s3ControlClient = AWSS3ControlClient.builder() .withCredentials(new ProfileCredentialsProvider()) .withRegion(US_WEST_2) .build(); s3ControlClient.updateJobPriority(new UpdateJobPriorityRequest() .withAccountId(accountId) .withJobId(jobId) .withPriority(98)); } catch (AmazonServiceException e) { // The call was transmitted successfully, but Amazon S3 couldn't process // it and returned an error response. e.printStackTrace(); } catch (SdkClientException e) { // Amazon S3 couldn't be contacted for a response, or the client // couldn't parse the response from Amazon S3. e.printStackTrace(); } } }

Sample Details

Service: s3

Last tested: 2019-04-30

Author: jschwarzwalder (AWS)

Type: full-example

On this page: