stopServer method

Future<void> stopServer({
  1. required String serverId,
})

Changes the state of a file transfer protocol-enabled server from ONLINE to OFFLINE. An OFFLINE server cannot accept and process file transfer jobs. Information tied to your server, such as server and user properties, are not affected by stopping your server. The state of STOPPING indicates that the server is in an intermediate state, either not fully able to respond, or not fully offline. The values of STOP_FAILED can indicate an error condition.

No response is returned from this call.

May throw ServiceUnavailableException. May throw InternalServiceError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter serverId : A system-assigned unique identifier for a server that you stopped.

Implementation

Future<void> stopServer({
  required String serverId,
}) async {
  ArgumentError.checkNotNull(serverId, 'serverId');
  _s.validateStringLength(
    'serverId',
    serverId,
    19,
    19,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'TransferService.StopServer'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ServerId': serverId,
    },
  );
}