Swap Current Time Server

The Swap Current Time Server operation changes the role of the CPC object designated by {cpc-id} to the Current Time Server (CTS). This operation is supported using the BCPii interface.

HTTP method and URI

POST /api/cpcs/{cpc-id}/operations/swap-cts

In this request, the URI variable {cpc-id} is the object ID of the target CPC object.

Request body contents

The request body is expected to contain a JSON object with the following fields:

Field name Type Rqd/Opt Description
stp-id String (1-8) Required Identifies the STP. Can contain 0-9, a-z, A-Z, underline (_) and dash (-).

Description

This operation changes the role of the CPC object designated by {cpc-id} to the Current Time Server (CTS).

On success, HTTP status code 204 (No Content) is returned.

Authorization requirements

This operation has the following authorization requirements:
  • For the web services interface:
    • Object-access permission to the CPC object designated by {cpc-id}
    • Action/task permission to the Manage System Time and Modify Assigned Server Roles tasks.
  • For the BCPii interface the source partition must have receive BCPii security controls permissions for the CPC object.

HTTP status and reason codes

On success, HTTP status code 204 (No Content) is returned and no response body is provided.

The following HTTP status codes are returned for the indicated errors, and the response body is a standard error response body providing the reason code indicated and associated error message.

HTTP error status code Reason code Description
400 (Bad Request) Various Errors were detected during common request validation. See Common request validation reason codes for a list of the possible reason codes.
285 The CPC targeted by this operation is already the Preferred Time Server.
286 The operation was rejected for one of the following reasons:
  • The stp-id field value does not match the current CTN identifier
  • The operation is not permitted for a mixed CTN.
403 (Forbidden) 0 The request used the BCPii interface and the source partition does not have receive BCPii security controls permission for the CPC object.
1 The API user does not have the required permission for this operation.
404 (Not Found) 1 The object ID in the URI ({cpc-id}) does not designate an existing CPC object, or the API user does not have object-access permission to the object.
409 (Conflict) 1 The requested operation cannot be performed, due to the state of the object:
  • Server Time Protocol is not enabled on this CPC
  • an ETR reverse migration is in progress
  • no alternate is active
  • this CPC is not the backup time server
329 The operation cannot be performed because the CPC designated by the request URI is an unmanaged CPC, which is not supported by this operation.
500 (Server Error) 272 An unexpected error occurred during the operation.
503 (Service Unavailable) 1 The request could not be processed because the HMC is not communicating with the SE needed to perform the requested operation.

Additional standard status and reason codes can be returned, as described in Invoking API operations.