CreateOncallSchedule

Updated at:

Creates an on-call schedule.

Operation description

Creates an on-call schedule.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:CreateOncallSchedule

create

*OncallSchedule

acs:cms:{#regionId}:{#accountId}:oncallschedule/*

None None

Request syntax

POST /oncallschedule HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body parameters.

rotations

array<object>

No

The list of shifts.

object

No

The shift.

activeDays

array

Yes

The days of the week when the shift is active.

integer

No

The days of the week when the shift is active.

Valid values:

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

1

contacts

array

Yes

The list of contacts.

string

No

The ID of the contact.

testContactId

rotationEndTime

string

Yes

The end time of the shift. Format: HH:mm.

24:00

rotationName

string

Yes

The name of the shift.

testRotationName

rotationStartTime

string

Yes

The start time of the shift. Format: HH:mm.

00:00

shiftRecurrenceFrequency

string

Yes

The unit of the shift rotation cycle. Used in conjunction with shiftLength. For example, rotate to the next on-call person every week.

Valid values:

  • WEEKLY
  • DAILY

WEEKLY

startDate

string

Yes

The start date of the shift. Format: yyyy-MM-dd.

2024-08-14

timeZone

string

Yes

The name of the time zone. The IANA Time Zone Database standard is used. Example: Asia/Shanghai.

Asia/Shanghai

shiftLength

integer

No

The length of the shift rotation cycle. Used in conjunction with shiftRecurrenceFrequency. For example, rotate to the next on-call person every 3 days.

1

shiftRobotId

string

No

The ID of the shift reminder chatbot.

testRobotId

oncallScheduleId

string

No

The unique identifier of the on-call schedule.

testOncallScheduleId

oncallScheduleName

string

No

The name of the on-call schedule.

testOncallScheduleName

substitudes

array<object>

No

The list of substitution rules.

object

No

contactId

string

No

The ID of the contact who acts as the substitute.

testId

replacedContactId

string

No

The ID of the contact who is being replaced.

testId

startTime

string

No

The start time of the substitution. Format: YYYY-MM-DD HH:mm.

2024-10-10 09:00

endTime

string

No

The end time of the substitution. Format: YYYY-MM-DD HH:mm.

2024-10-15 18:00

workspace

string

No

The name of the workspace.

default-cms-5884500827389836-cn-hangzhou

Response elements

Element

Type

Description

Example

object

oncallScheduleId

string

The unique identifier of the on-call schedule.

testOncallScheduleId

requestId

string

The ID of the request.

3B311FD9-A60B-55E0-A896-A0C73*********

Examples

Success response

JSON format

{
  "oncallScheduleId": "testOncallScheduleId",
  "requestId": "3B311FD9-A60B-55E0-A896-A0C73*********"
}

Error codes

HTTP status code

Error code

Error message

Description

400 ResourceExist Resource already exist . The resource already exists.
400 InvalidParameter The parameter is missing or invalid. %s
400 InvalidParameterValue Invalid request: %s
500 InternalUnknownError The request processing has failed due to some unknown error. A service runtime error occurred.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.