选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

UpdateJobQueue - AWS Batch
此页面尚未翻译为您的语言。 请求翻译

UpdateJobQueue

Updates a job queue.

Request Syntax

POST /v1/updatejobqueue HTTP/1.1 Content-type: application/json { "computeEnvironmentOrder": [ { "computeEnvironment": "string", "order": number } ], "jobQueue": "string", "jobStateTimeLimitActions": [ { "action": "string", "maxTimeSeconds": number, "reason": "string", "state": "string" } ], "priority": number, "schedulingPolicyArn": "string", "state": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

computeEnvironmentOrder

Details the set of compute environments mapped to a job queue and their order relative to each other. This is one of the parameters used by the job scheduler to determine which compute environment runs a given job. Compute environments must be in the VALID state before you can associate them with a job queue. All of the compute environments must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or FARGATE_SPOT). EC2 and Fargate compute environments can't be mixed.

Note

All compute environments that are associated with a job queue must share the same architecture. AWS Batch doesn't support mixing compute environment architecture types in a single job queue.

Type: Array of ComputeEnvironmentOrder objects

Required: No

jobQueue

The name or the Amazon Resource Name (ARN) of the job queue.

Type: String

Required: Yes

jobStateTimeLimitActions

The set of actions that AWS Batch perform on jobs that remain at the head of the job queue in the specified state longer than specified times. AWS Batch will perform each action after maxTimeSeconds has passed. (Note: The minimum value for maxTimeSeconds is 600 (10 minutes) and its maximum value is 86,400 (24 hours).)

Type: Array of JobStateTimeLimitAction objects

Required: No

priority

The priority of the job queue. Job queues with a higher priority (or a higher integer value for the priority parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of 10 is given scheduling preference over a job queue with a priority value of 1. All of the compute environments must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or FARGATE_SPOT). EC2 and Fargate compute environments can't be mixed.

Type: Integer

Required: No

schedulingPolicyArn

Amazon Resource Name (ARN) of the fair-share scheduling policy. Once a job queue is created, the fair-share scheduling policy can be replaced but not removed. The format is aws:Partition:batch:Region:Account:scheduling-policy/Name . For example, aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy.

Type: String

Required: No

state

Describes the queue's ability to accept new jobs. If the job queue state is ENABLED, it can accept jobs. If the job queue state is DISABLED, new jobs can't be added to the queue, but jobs already in the queue can finish.

Type: String

Valid Values: ENABLED | DISABLED

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "jobQueueArn": "string", "jobQueueName": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

jobQueueArn

The Amazon Resource Name (ARN) of the job queue.

Type: String

jobQueueName

The name of the job queue.

Type: String

Errors

ClientException

These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.

HTTP Status Code: 400

ServerException

These errors are usually caused by a server issue.

HTTP Status Code: 500

Examples

In the following example or examples, the Authorization header contents ( [authorization-params] ) must be replaced with an AWS Signature Version 4 signature. For more information about creating these signatures, see Signature Version 4 Signing Process in the AWS General Reference.

You only need to learn how to sign HTTP requests if you intend to manually create them. When you use the AWS Command Line Interface (AWS CLI) or one of the AWS SDKs to make requests to AWS, these tools automatically sign the requests for you with the access key that you specify when you configure the tools. When you use these tools, you don't need to learn how to sign requests yourself.

Example

This example disables a job queue so that it can be deleted.

Sample Request

POST /v1/updatejobqueue HTTP/1.1 Host: batch.us-east-1.amazonaws.com Accept-Encoding: identity Content-Length: [content-length] Authorization: [authorization-params] X-Amz-Date: 20161128T201802Z User-Agent: aws-cli/1.11.21 Python/2.7.12 Darwin/16.1.0 botocore/1.4.78 { "state": "DISABLED", "jobQueue": "GPGPU" }

Sample Response

HTTP/1.1 200 OK Date: Mon, 28 Nov 2016 20:18:03 GMT Content-Type: application/json Content-Length: [content-length] Connection: keep-alive x-amzn-RequestId: [request-id] X-Amzn-Trace-Id: [trace-id] X-Cache: Miss from cloudfront Via: 1.1 17de248e6d780f737234d37cc490dbe3.cloudfront.net (CloudFront) X-Amz-Cf-Id: aVju0hE8eLpjSFl8Y3fOuxgOZXdigQlLcDMwO0plxnynw0dEsOsEgw== { "jobQueueName": "GPGPU", "jobQueueArn": "arn:aws:batch:us-east-1:123456789012:job-queue/GPGPU" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。