Skip to content

Commit

Permalink
Generate account endpoint for DynamoDB requests when the account ID i…
Browse files Browse the repository at this point in the history
…s available

This release introduces support for the SageMaker Metrics BatchGetMetrics API.
Releasing new ErrorCodes for SysPrep failures during ImageImport and CreateImage process
Amazon SageMaker now supports using manifest files to specify the location of uncompressed model artifacts within Model Packages
Add v2 smoke tests and smithy smokeTests trait for SDK testing.
  • Loading branch information
aws-sdk-cpp-automation committed Sep 20, 2024
1 parent 8ab2e71 commit 9bbc424
Show file tree
Hide file tree
Showing 43 changed files with 4,713 additions and 331 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.409
1.11.410
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ namespace Aws
*/
Aws::Crt::Optional<bool>& enableEndpointDiscovery;

/**
* The AWS AccountId used for the request.
*/
Aws::String accountId;
/**
* The AccountId Endpoint Mode.
*/
Aws::String accountIdEndpointMode = "preferred";
private:
void LoadDynamoDBSpecificConfig(const Aws::String& profileName);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ void DynamoDBClientConfiguration::LoadDynamoDBSpecificConfig(const Aws::String&
if(!enableEndpointDiscovery) {
enableEndpointDiscovery = IsEndpointDiscoveryEnabled(this->endpointOverride, inputProfileName);
}
// accountId is intentionally not set here: AWS_ACCOUNT_ID env variable may not match the provided credentials.
// it must be set by an auth provider / identity resolver or by an SDK user.
static const char AWS_ACCOUNT_ID_ENDPOINT_MODE_ENVIRONMENT_VARIABLE[] = "AWS_ACCOUNT_ID_ENDPOINT_MODE";
static const char AWS_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_FILE_OPTION[] = "account_id_endpoint_mode";
accountIdEndpointMode = ClientConfiguration::LoadConfigFromEnvOrProfile(AWS_ACCOUNT_ID_ENDPOINT_MODE_ENVIRONMENT_VARIABLE,
inputProfileName,
AWS_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_FILE_OPTION,
{"required", "disabled", "preferred"}, /* allowed values */
"preferred" /* default value */);
}

DynamoDBClientConfiguration::DynamoDBClientConfiguration(const Client::ClientConfigurationInitValues &configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ namespace Endpoint
{
SetFromClientConfiguration(static_cast<const DynamoDBClientConfiguration::BaseClientConfigClass&>(config));

if(!config.accountId.empty()) {
SetStringParameter("AccountId", config.accountId);
}
if(!config.accountIdEndpointMode.empty()) {
SetStringParameter("AccountIdEndpointMode", config.accountIdEndpointMode);
}
}
} // namespace Endpoint
} // namespace DynamoDB
Expand Down
375 changes: 254 additions & 121 deletions generated/src/aws-cpp-sdk-dynamodb/source/DynamoDBEndpointRules.cpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,35 @@ namespace SageMakerMetrics
/* End of legacy constructors due deprecation */
virtual ~SageMakerMetricsClient();

/**
* <p>Used to retrieve training metrics from SageMaker.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-metrics-2022-09-30/BatchGetMetrics">AWS
* API Reference</a></p>
*/
virtual Model::BatchGetMetricsOutcome BatchGetMetrics(const Model::BatchGetMetricsRequest& request) const;

/**
* A Callable wrapper for BatchGetMetrics that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template<typename BatchGetMetricsRequestT = Model::BatchGetMetricsRequest>
Model::BatchGetMetricsOutcomeCallable BatchGetMetricsCallable(const BatchGetMetricsRequestT& request) const
{
return SubmitCallable(&SageMakerMetricsClient::BatchGetMetrics, request);
}

/**
* An Async wrapper for BatchGetMetrics that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template<typename BatchGetMetricsRequestT = Model::BatchGetMetricsRequest>
void BatchGetMetricsAsync(const BatchGetMetricsRequestT& request, const BatchGetMetricsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const
{
return SubmitAsync(&SageMakerMetricsClient::BatchGetMetrics, request, handler, context);
}

/**
* <p>Used to ingest training metrics into SageMaker. These metrics can be
* visualized in SageMaker Studio and retrieved with the <code>GetMetrics</code>
* API. </p><p><h3>See Also:</h3> <a
* visualized in SageMaker Studio. </p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-metrics-2022-09-30/BatchPutMetrics">AWS
* API Reference</a></p>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/* End of generic header includes */

/* Service model headers required in SageMakerMetricsClient header */
#include <aws/sagemaker-metrics/model/BatchGetMetricsResult.h>
#include <aws/sagemaker-metrics/model/BatchPutMetricsResult.h>
/* End of service model headers required in SageMakerMetricsClient header */

Expand Down Expand Up @@ -59,21 +60,25 @@ namespace Aws
namespace Model
{
/* Service model forward declarations required in SageMakerMetricsClient header */
class BatchGetMetricsRequest;
class BatchPutMetricsRequest;
/* End of service model forward declarations required in SageMakerMetricsClient header */

/* Service model Outcome class definitions */
typedef Aws::Utils::Outcome<BatchGetMetricsResult, SageMakerMetricsError> BatchGetMetricsOutcome;
typedef Aws::Utils::Outcome<BatchPutMetricsResult, SageMakerMetricsError> BatchPutMetricsOutcome;
/* End of service model Outcome class definitions */

/* Service model Outcome callable definitions */
typedef std::future<BatchGetMetricsOutcome> BatchGetMetricsOutcomeCallable;
typedef std::future<BatchPutMetricsOutcome> BatchPutMetricsOutcomeCallable;
/* End of service model Outcome callable definitions */
} // namespace Model

class SageMakerMetricsClient;

/* Service model async handlers definitions */
typedef std::function<void(const SageMakerMetricsClient*, const Model::BatchGetMetricsRequest&, const Model::BatchGetMetricsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > BatchGetMetricsResponseReceivedHandler;
typedef std::function<void(const SageMakerMetricsClient*, const Model::BatchPutMetricsRequest&, const Model::BatchPutMetricsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > BatchPutMetricsResponseReceivedHandler;
/* End of service model async handlers definitions */
} // namespace SageMakerMetrics
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/sagemaker-metrics/SageMakerMetrics_EXPORTS.h>
#include <aws/sagemaker-metrics/SageMakerMetricsRequest.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/sagemaker-metrics/model/MetricQuery.h>
#include <utility>

namespace Aws
{
namespace SageMakerMetrics
{
namespace Model
{

/**
*/
class BatchGetMetricsRequest : public SageMakerMetricsRequest
{
public:
AWS_SAGEMAKERMETRICS_API BatchGetMetricsRequest();

// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "BatchGetMetrics"; }

AWS_SAGEMAKERMETRICS_API Aws::String SerializePayload() const override;


///@{
/**
* <p>Queries made to retrieve training metrics from SageMaker.</p>
*/
inline const Aws::Vector<MetricQuery>& GetMetricQueries() const{ return m_metricQueries; }
inline bool MetricQueriesHasBeenSet() const { return m_metricQueriesHasBeenSet; }
inline void SetMetricQueries(const Aws::Vector<MetricQuery>& value) { m_metricQueriesHasBeenSet = true; m_metricQueries = value; }
inline void SetMetricQueries(Aws::Vector<MetricQuery>&& value) { m_metricQueriesHasBeenSet = true; m_metricQueries = std::move(value); }
inline BatchGetMetricsRequest& WithMetricQueries(const Aws::Vector<MetricQuery>& value) { SetMetricQueries(value); return *this;}
inline BatchGetMetricsRequest& WithMetricQueries(Aws::Vector<MetricQuery>&& value) { SetMetricQueries(std::move(value)); return *this;}
inline BatchGetMetricsRequest& AddMetricQueries(const MetricQuery& value) { m_metricQueriesHasBeenSet = true; m_metricQueries.push_back(value); return *this; }
inline BatchGetMetricsRequest& AddMetricQueries(MetricQuery&& value) { m_metricQueriesHasBeenSet = true; m_metricQueries.push_back(std::move(value)); return *this; }
///@}
private:

Aws::Vector<MetricQuery> m_metricQueries;
bool m_metricQueriesHasBeenSet = false;
};

} // namespace Model
} // namespace SageMakerMetrics
} // namespace Aws
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/sagemaker-metrics/SageMakerMetrics_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/sagemaker-metrics/model/MetricQueryResult.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace SageMakerMetrics
{
namespace Model
{
class BatchGetMetricsResult
{
public:
AWS_SAGEMAKERMETRICS_API BatchGetMetricsResult();
AWS_SAGEMAKERMETRICS_API BatchGetMetricsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
AWS_SAGEMAKERMETRICS_API BatchGetMetricsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);


///@{
/**
* <p>The results of a query to retrieve training metrics from SageMaker.</p>
*/
inline const Aws::Vector<MetricQueryResult>& GetMetricQueryResults() const{ return m_metricQueryResults; }
inline void SetMetricQueryResults(const Aws::Vector<MetricQueryResult>& value) { m_metricQueryResults = value; }
inline void SetMetricQueryResults(Aws::Vector<MetricQueryResult>&& value) { m_metricQueryResults = std::move(value); }
inline BatchGetMetricsResult& WithMetricQueryResults(const Aws::Vector<MetricQueryResult>& value) { SetMetricQueryResults(value); return *this;}
inline BatchGetMetricsResult& WithMetricQueryResults(Aws::Vector<MetricQueryResult>&& value) { SetMetricQueryResults(std::move(value)); return *this;}
inline BatchGetMetricsResult& AddMetricQueryResults(const MetricQueryResult& value) { m_metricQueryResults.push_back(value); return *this; }
inline BatchGetMetricsResult& AddMetricQueryResults(MetricQueryResult&& value) { m_metricQueryResults.push_back(std::move(value)); return *this; }
///@}

///@{

inline const Aws::String& GetRequestId() const{ return m_requestId; }
inline void SetRequestId(const Aws::String& value) { m_requestId = value; }
inline void SetRequestId(Aws::String&& value) { m_requestId = std::move(value); }
inline void SetRequestId(const char* value) { m_requestId.assign(value); }
inline BatchGetMetricsResult& WithRequestId(const Aws::String& value) { SetRequestId(value); return *this;}
inline BatchGetMetricsResult& WithRequestId(Aws::String&& value) { SetRequestId(std::move(value)); return *this;}
inline BatchGetMetricsResult& WithRequestId(const char* value) { SetRequestId(value); return *this;}
///@}
private:

Aws::Vector<MetricQueryResult> m_metricQueryResults;

Aws::String m_requestId;
};

} // namespace Model
} // namespace SageMakerMetrics
} // namespace Aws
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ namespace Model

///@{
/**
* <p>The name of the Trial Component to associate with the metrics.</p>
* <p>The name of the Trial Component to associate with the metrics. The Trial
* Component name must be entirely lowercase.</p>
*/
inline const Aws::String& GetTrialComponentName() const{ return m_trialComponentName; }
inline bool TrialComponentNameHasBeenSet() const { return m_trialComponentNameHasBeenSet; }
Expand Down
Loading

0 comments on commit 9bbc424

Please sign in to comment.