startServer method

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

Changes the state of a file transfer protocol-enabled server from OFFLINE to ONLINE. It has no impact on a server that is already ONLINE. An ONLINE server can accept and process file transfer jobs.

The state of STARTING indicates that the server is in an intermediate state, either not fully able to respond, or not fully online. The values of START_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 start.

Implementation

Future<void> startServer({
  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.StartServer'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ServerId': serverId,
    },
  );
}