// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 #include #include #include #include #include #include int main(int argc, char ** argv) { if (argc != 2) { std::cout << "Usage: start_gateway " << std::endl; return 1; } Aws::SDKOptions options; Aws::InitAPI(options); { Aws::String gateway_arn(argv[1]); Aws::StorageGateway::StorageGatewayClient storagegateway; Aws::StorageGateway::Model::StartGatewayRequest sg_req; sg_req.SetGatewayARN(gateway_arn); auto sg_out = storagegateway.StartGateway(sg_req); if (sg_out.IsSuccess()) { std::cout << "Successfully started gateway." << std::endl; } else { std::cout << "Error starting gateway." << sg_out.GetError().GetMessage() << std::endl; } } Aws::ShutdownAPI(options); return 0; }