Skip to content

Commit

Permalink
Add support for CloudWatch Vended Logs which allows for delivery of c…
Browse files Browse the repository at this point in the history
…ustomer logs to CloudWatch Logs, S3, or Firehose.
  • Loading branch information
aws-sdk-cpp-automation committed Feb 3, 2025
1 parent 9c57f5b commit 918b5a9
Show file tree
Hide file tree
Showing 17 changed files with 1,076 additions and 826 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.497
1.11.498
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ namespace Model

///@{
/**
* <p>For ads that have media files with streaming delivery, indicates what
* transcoding action MediaTailor it first receives these ads from the ADS.
* <code>TRANSCODE</code> indicates that MediaTailor must transcode the ads.
* <code>NONE</code> indicates that you have already transcoded the ads outside of
* MediaTailor and don't need them transcoded as part of the ad insertion workflow.
* For more information about ad conditioning see <a
* <p>For ads that have media files with streaming delivery and supported file
* extensions, indicates what transcoding action MediaTailor takes when it first
* receives these ads from the ADS. <code>TRANSCODE</code> indicates that
* MediaTailor must transcode the ads. <code>NONE</code> indicates that you have
* already transcoded the ads outside of MediaTailor and don't need them transcoded
* as part of the ad insertion workflow. For more information about ad conditioning
* see <a
* href="https://docs.aws.amazon.com/precondition-ads.html">https://docs.aws.amazon.com/precondition-ads.html</a>.</p>
*/
inline const StreamingMediaFileConditioning& GetStreamingMediaFileConditioning() const{ return m_streamingMediaFileConditioning; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <aws/mediatailor/MediaTailor_EXPORTS.h>
#include <aws/mediatailor/MediaTailorRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/mediatailor/model/LoggingStrategy.h>
#include <utility>

namespace Aws
Expand Down Expand Up @@ -66,13 +68,40 @@ namespace Model
inline ConfigureLogsForPlaybackConfigurationRequest& WithPlaybackConfigurationName(Aws::String&& value) { SetPlaybackConfigurationName(std::move(value)); return *this;}
inline ConfigureLogsForPlaybackConfigurationRequest& WithPlaybackConfigurationName(const char* value) { SetPlaybackConfigurationName(value); return *this;}
///@}

///@{
/**
* <p>The method used for collecting logs from AWS Elemental MediaTailor. To
* configure MediaTailor to send logs directly to Amazon CloudWatch Logs, choose
* <code>LEGACY_CLOUDWATCH</code>. To configure MediaTailor to send logs to
* CloudWatch, which then vends the logs to your destination of choice, choose
* <code>VENDED_LOGS</code>. Supported destinations are CloudWatch Logs log group,
* Amazon S3 bucket, and Amazon Data Firehose stream.</p> <p>To use vended logs,
* you must configure the delivery destination in Amazon CloudWatch, as described
* in <a
* href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions-V2">Enable
* logging from AWS services, Logging that requires additional permissions
* [V2]</a>.</p>
*/
inline const Aws::Vector<LoggingStrategy>& GetEnabledLoggingStrategies() const{ return m_enabledLoggingStrategies; }
inline bool EnabledLoggingStrategiesHasBeenSet() const { return m_enabledLoggingStrategiesHasBeenSet; }
inline void SetEnabledLoggingStrategies(const Aws::Vector<LoggingStrategy>& value) { m_enabledLoggingStrategiesHasBeenSet = true; m_enabledLoggingStrategies = value; }
inline void SetEnabledLoggingStrategies(Aws::Vector<LoggingStrategy>&& value) { m_enabledLoggingStrategiesHasBeenSet = true; m_enabledLoggingStrategies = std::move(value); }
inline ConfigureLogsForPlaybackConfigurationRequest& WithEnabledLoggingStrategies(const Aws::Vector<LoggingStrategy>& value) { SetEnabledLoggingStrategies(value); return *this;}
inline ConfigureLogsForPlaybackConfigurationRequest& WithEnabledLoggingStrategies(Aws::Vector<LoggingStrategy>&& value) { SetEnabledLoggingStrategies(std::move(value)); return *this;}
inline ConfigureLogsForPlaybackConfigurationRequest& AddEnabledLoggingStrategies(const LoggingStrategy& value) { m_enabledLoggingStrategiesHasBeenSet = true; m_enabledLoggingStrategies.push_back(value); return *this; }
inline ConfigureLogsForPlaybackConfigurationRequest& AddEnabledLoggingStrategies(LoggingStrategy&& value) { m_enabledLoggingStrategiesHasBeenSet = true; m_enabledLoggingStrategies.push_back(std::move(value)); return *this; }
///@}
private:

int m_percentEnabled;
bool m_percentEnabledHasBeenSet = false;

Aws::String m_playbackConfigurationName;
bool m_playbackConfigurationNameHasBeenSet = false;

Aws::Vector<LoggingStrategy> m_enabledLoggingStrategies;
bool m_enabledLoggingStrategiesHasBeenSet = false;
};

} // namespace Model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#pragma once
#include <aws/mediatailor/MediaTailor_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/mediatailor/model/LoggingStrategy.h>
#include <utility>

namespace Aws
Expand Down Expand Up @@ -55,6 +57,24 @@ namespace Model
inline ConfigureLogsForPlaybackConfigurationResult& WithPlaybackConfigurationName(const char* value) { SetPlaybackConfigurationName(value); return *this;}
///@}

///@{
/**
* <p>The method used for collecting logs from AWS Elemental MediaTailor.
* <code>LEGACY_CLOUDWATCH</code> indicates that MediaTailor is sending logs
* directly to Amazon CloudWatch Logs. <code>VENDED_LOGS</code> indicates that
* MediaTailor is sending logs to CloudWatch, which then vends the logs to your
* destination of choice. Supported destinations are CloudWatch Logs log group,
* Amazon S3 bucket, and Amazon Data Firehose stream. </p>
*/
inline const Aws::Vector<LoggingStrategy>& GetEnabledLoggingStrategies() const{ return m_enabledLoggingStrategies; }
inline void SetEnabledLoggingStrategies(const Aws::Vector<LoggingStrategy>& value) { m_enabledLoggingStrategies = value; }
inline void SetEnabledLoggingStrategies(Aws::Vector<LoggingStrategy>&& value) { m_enabledLoggingStrategies = std::move(value); }
inline ConfigureLogsForPlaybackConfigurationResult& WithEnabledLoggingStrategies(const Aws::Vector<LoggingStrategy>& value) { SetEnabledLoggingStrategies(value); return *this;}
inline ConfigureLogsForPlaybackConfigurationResult& WithEnabledLoggingStrategies(Aws::Vector<LoggingStrategy>&& value) { SetEnabledLoggingStrategies(std::move(value)); return *this;}
inline ConfigureLogsForPlaybackConfigurationResult& AddEnabledLoggingStrategies(const LoggingStrategy& value) { m_enabledLoggingStrategies.push_back(value); return *this; }
inline ConfigureLogsForPlaybackConfigurationResult& AddEnabledLoggingStrategies(LoggingStrategy&& value) { m_enabledLoggingStrategies.push_back(std::move(value)); return *this; }
///@}

///@{

inline const Aws::String& GetRequestId() const{ return m_requestId; }
Expand All @@ -71,6 +91,8 @@ namespace Model

Aws::String m_playbackConfigurationName;

Aws::Vector<LoggingStrategy> m_enabledLoggingStrategies;

Aws::String m_requestId;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ namespace Model
///@{
/**
* <p>The setting that indicates what conditioning MediaTailor will perform on ads
* that the ad decision server (ADS) returns. </p>
* that the ad decision server (ADS) returns, and what priority MediaTailor uses
* when inserting ads. </p>
*/
inline const AdConditioningConfiguration& GetAdConditioningConfiguration() const{ return m_adConditioningConfiguration; }
inline void SetAdConditioningConfiguration(const AdConditioningConfiguration& value) { m_adConditioningConfiguration = value; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

#pragma once
#include <aws/mediatailor/MediaTailor_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/mediatailor/model/LoggingStrategy.h>
#include <utility>

namespace Aws
{
Expand Down Expand Up @@ -52,10 +55,32 @@ namespace Model
inline void SetPercentEnabled(int value) { m_percentEnabledHasBeenSet = true; m_percentEnabled = value; }
inline LogConfiguration& WithPercentEnabled(int value) { SetPercentEnabled(value); return *this;}
///@}

///@{
/**
* <p>The method used for collecting logs from AWS Elemental MediaTailor.
* <code>LEGACY_CLOUDWATCH</code> indicates that MediaTailor is sending logs
* directly to Amazon CloudWatch Logs. <code>VENDED_LOGS</code> indicates that
* MediaTailor is sending logs to CloudWatch, which then vends the logs to your
* destination of choice. Supported destinations are CloudWatch Logs log group,
* Amazon S3 bucket, and Amazon Data Firehose stream. </p>
*/
inline const Aws::Vector<LoggingStrategy>& GetEnabledLoggingStrategies() const{ return m_enabledLoggingStrategies; }
inline bool EnabledLoggingStrategiesHasBeenSet() const { return m_enabledLoggingStrategiesHasBeenSet; }
inline void SetEnabledLoggingStrategies(const Aws::Vector<LoggingStrategy>& value) { m_enabledLoggingStrategiesHasBeenSet = true; m_enabledLoggingStrategies = value; }
inline void SetEnabledLoggingStrategies(Aws::Vector<LoggingStrategy>&& value) { m_enabledLoggingStrategiesHasBeenSet = true; m_enabledLoggingStrategies = std::move(value); }
inline LogConfiguration& WithEnabledLoggingStrategies(const Aws::Vector<LoggingStrategy>& value) { SetEnabledLoggingStrategies(value); return *this;}
inline LogConfiguration& WithEnabledLoggingStrategies(Aws::Vector<LoggingStrategy>&& value) { SetEnabledLoggingStrategies(std::move(value)); return *this;}
inline LogConfiguration& AddEnabledLoggingStrategies(const LoggingStrategy& value) { m_enabledLoggingStrategiesHasBeenSet = true; m_enabledLoggingStrategies.push_back(value); return *this; }
inline LogConfiguration& AddEnabledLoggingStrategies(LoggingStrategy&& value) { m_enabledLoggingStrategiesHasBeenSet = true; m_enabledLoggingStrategies.push_back(std::move(value)); return *this; }
///@}
private:

int m_percentEnabled;
bool m_percentEnabledHasBeenSet = false;

Aws::Vector<LoggingStrategy> m_enabledLoggingStrategies;
bool m_enabledLoggingStrategiesHasBeenSet = false;
};

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

#pragma once
#include <aws/mediatailor/MediaTailor_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace MediaTailor
{
namespace Model
{
enum class LoggingStrategy
{
NOT_SET,
VENDED_LOGS,
LEGACY_CLOUDWATCH
};

namespace LoggingStrategyMapper
{
AWS_MEDIATAILOR_API LoggingStrategy GetLoggingStrategyForName(const Aws::String& name);

AWS_MEDIATAILOR_API Aws::String GetNameForLoggingStrategy(LoggingStrategy value);
} // namespace LoggingStrategyMapper
} // namespace Model
} // namespace MediaTailor
} // namespace Aws
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ namespace Model
///@{
/**
* <p>The setting that indicates what conditioning MediaTailor will perform on ads
* that the ad decision server (ADS) returns.</p>
* that the ad decision server (ADS) returns, and what priority MediaTailor uses
* when inserting ads.</p>
*/
inline const AdConditioningConfiguration& GetAdConditioningConfiguration() const{ return m_adConditioningConfiguration; }
inline bool AdConditioningConfigurationHasBeenSet() const { return m_adConditioningConfigurationHasBeenSet; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ namespace Model
///@{
/**
* <p>The setting that indicates what conditioning MediaTailor will perform on ads
* that the ad decision server (ADS) returns.</p>
* that the ad decision server (ADS) returns, and what priority MediaTailor uses
* when inserting ads. </p>
*/
inline const AdConditioningConfiguration& GetAdConditioningConfiguration() const{ return m_adConditioningConfiguration; }
inline bool AdConditioningConfigurationHasBeenSet() const { return m_adConditioningConfigurationHasBeenSet; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ namespace Model
///@{
/**
* <p>The setting that indicates what conditioning MediaTailor will perform on ads
* that the ad decision server (ADS) returns.</p>
* that the ad decision server (ADS) returns, and what priority MediaTailor uses
* when inserting ads. </p>
*/
inline const AdConditioningConfiguration& GetAdConditioningConfiguration() const{ return m_adConditioningConfiguration; }
inline void SetAdConditioningConfiguration(const AdConditioningConfiguration& value) { m_adConditioningConfiguration = value; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ using namespace Aws::Utils;
ConfigureLogsForPlaybackConfigurationRequest::ConfigureLogsForPlaybackConfigurationRequest() :
m_percentEnabled(0),
m_percentEnabledHasBeenSet(false),
m_playbackConfigurationNameHasBeenSet(false)
m_playbackConfigurationNameHasBeenSet(false),
m_enabledLoggingStrategiesHasBeenSet(false)
{
}

Expand All @@ -35,6 +36,17 @@ Aws::String ConfigureLogsForPlaybackConfigurationRequest::SerializePayload() con

}

if(m_enabledLoggingStrategiesHasBeenSet)
{
Aws::Utils::Array<JsonValue> enabledLoggingStrategiesJsonList(m_enabledLoggingStrategies.size());
for(unsigned enabledLoggingStrategiesIndex = 0; enabledLoggingStrategiesIndex < enabledLoggingStrategiesJsonList.GetLength(); ++enabledLoggingStrategiesIndex)
{
enabledLoggingStrategiesJsonList[enabledLoggingStrategiesIndex].AsString(LoggingStrategyMapper::GetNameForLoggingStrategy(m_enabledLoggingStrategies[enabledLoggingStrategiesIndex]));
}
payload.WithArray("EnabledLoggingStrategies", std::move(enabledLoggingStrategiesJsonList));

}

return payload.View().WriteReadable();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ ConfigureLogsForPlaybackConfigurationResult& ConfigureLogsForPlaybackConfigurati

}

if(jsonValue.ValueExists("EnabledLoggingStrategies"))
{
Aws::Utils::Array<JsonView> enabledLoggingStrategiesJsonList = jsonValue.GetArray("EnabledLoggingStrategies");
for(unsigned enabledLoggingStrategiesIndex = 0; enabledLoggingStrategiesIndex < enabledLoggingStrategiesJsonList.GetLength(); ++enabledLoggingStrategiesIndex)
{
m_enabledLoggingStrategies.push_back(LoggingStrategyMapper::GetLoggingStrategyForName(enabledLoggingStrategiesJsonList[enabledLoggingStrategiesIndex].AsString()));
}
}


const auto& headers = result.GetHeaderValueCollection();
const auto& requestIdIter = headers.find("x-amzn-requestid");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ namespace Model

LogConfiguration::LogConfiguration() :
m_percentEnabled(0),
m_percentEnabledHasBeenSet(false)
m_percentEnabledHasBeenSet(false),
m_enabledLoggingStrategiesHasBeenSet(false)
{
}

Expand All @@ -39,6 +40,16 @@ LogConfiguration& LogConfiguration::operator =(JsonView jsonValue)
m_percentEnabledHasBeenSet = true;
}

if(jsonValue.ValueExists("EnabledLoggingStrategies"))
{
Aws::Utils::Array<JsonView> enabledLoggingStrategiesJsonList = jsonValue.GetArray("EnabledLoggingStrategies");
for(unsigned enabledLoggingStrategiesIndex = 0; enabledLoggingStrategiesIndex < enabledLoggingStrategiesJsonList.GetLength(); ++enabledLoggingStrategiesIndex)
{
m_enabledLoggingStrategies.push_back(LoggingStrategyMapper::GetLoggingStrategyForName(enabledLoggingStrategiesJsonList[enabledLoggingStrategiesIndex].AsString()));
}
m_enabledLoggingStrategiesHasBeenSet = true;
}

return *this;
}

Expand All @@ -52,6 +63,17 @@ JsonValue LogConfiguration::Jsonize() const

}

if(m_enabledLoggingStrategiesHasBeenSet)
{
Aws::Utils::Array<JsonValue> enabledLoggingStrategiesJsonList(m_enabledLoggingStrategies.size());
for(unsigned enabledLoggingStrategiesIndex = 0; enabledLoggingStrategiesIndex < enabledLoggingStrategiesJsonList.GetLength(); ++enabledLoggingStrategiesIndex)
{
enabledLoggingStrategiesJsonList[enabledLoggingStrategiesIndex].AsString(LoggingStrategyMapper::GetNameForLoggingStrategy(m_enabledLoggingStrategies[enabledLoggingStrategiesIndex]));
}
payload.WithArray("EnabledLoggingStrategies", std::move(enabledLoggingStrategiesJsonList));

}

return payload;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#include <aws/mediatailor/model/LoggingStrategy.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;


namespace Aws
{
namespace MediaTailor
{
namespace Model
{
namespace LoggingStrategyMapper
{

static const int VENDED_LOGS_HASH = HashingUtils::HashString("VENDED_LOGS");
static const int LEGACY_CLOUDWATCH_HASH = HashingUtils::HashString("LEGACY_CLOUDWATCH");


LoggingStrategy GetLoggingStrategyForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == VENDED_LOGS_HASH)
{
return LoggingStrategy::VENDED_LOGS;
}
else if (hashCode == LEGACY_CLOUDWATCH_HASH)
{
return LoggingStrategy::LEGACY_CLOUDWATCH;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<LoggingStrategy>(hashCode);
}

return LoggingStrategy::NOT_SET;
}

Aws::String GetNameForLoggingStrategy(LoggingStrategy enumValue)
{
switch(enumValue)
{
case LoggingStrategy::NOT_SET:
return {};
case LoggingStrategy::VENDED_LOGS:
return "VENDED_LOGS";
case LoggingStrategy::LEGACY_CLOUDWATCH:
return "LEGACY_CLOUDWATCH";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}

return {};
}
}

} // namespace LoggingStrategyMapper
} // namespace Model
} // namespace MediaTailor
} // namespace Aws
Loading

0 comments on commit 918b5a9

Please sign in to comment.