Skip to content

Commit

Permalink
Added support for the CloudWatch Logs service.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremeamia committed Jul 8, 2014
1 parent c1bd95d commit ee302ac
Show file tree
Hide file tree
Showing 9 changed files with 1,314 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/index.rst
Expand Up @@ -31,6 +31,7 @@ AWS SDK for PHP
service-cloudsearchdomain
service-cloudtrail
service-cloudwatch
service-cloudwatchlogs
service-datapipeline
service-directconnect
service-dynamodb
Expand Down Expand Up @@ -129,6 +130,10 @@ Service-Specific Guides

.. indexlinks:: CloudWatch

* Amazon CloudWatch Logs

.. indexlinks:: CloudWatchLogs

* Amazon DynamoDB

.. indexlinks:: DynamoDb
Expand Down
3 changes: 3 additions & 0 deletions docs/service-cloudwatchlogs.rst
@@ -0,0 +1,3 @@
.. service:: CloudWatchLogs

.. apiref:: CloudWatchLogs
1 change: 1 addition & 0 deletions phpunit.xml.dist
Expand Up @@ -37,6 +37,7 @@
<directory suffix="Exception.php">./src/Aws/CloudSearchDomain/Exception</directory>
<directory suffix="Exception.php">./src/Aws/CloudTrail/Exception</directory>
<directory suffix="Exception.php">./src/Aws/CloudWatch/Exception</directory>
<directory suffix="Exception.php">./src/Aws/CloudWatchLogs/Exception</directory>
<directory suffix="Exception.php">./src/Aws/DataPipeline/Exception</directory>
<directory suffix="Exception.php">./src/Aws/DirectConnect/Exception</directory>
<directory suffix="Exception.php">./src/Aws/DynamoDb/Exception</directory>
Expand Down
59 changes: 59 additions & 0 deletions src/Aws/CloudWatchLogs/CloudWatchLogsClient.php
@@ -0,0 +1,59 @@
<?php

namespace Aws\CloudWatchLogs;

use Aws\Common\Client\AbstractClient;
use Aws\Common\Client\ClientBuilder;
use Aws\Common\Enum\ClientOptions as Options;
use Aws\Common\Exception\Parser\JsonQueryExceptionParser;
use Guzzle\Common\Collection;
use Guzzle\Service\Resource\Model;

/**
* Client to interact with Amazon CloudWatch Logs
*
* @method Model createLogGroup(array $args = array()) {@command CloudWatchLogs CreateLogGroup}
* @method Model createLogStream(array $args = array()) {@command CloudWatchLogs CreateLogStream}
* @method Model deleteLogGroup(array $args = array()) {@command CloudWatchLogs DeleteLogGroup}
* @method Model deleteLogStream(array $args = array()) {@command CloudWatchLogs DeleteLogStream}
* @method Model deleteMetricFilter(array $args = array()) {@command CloudWatchLogs DeleteMetricFilter}
* @method Model deleteRetentionPolicy(array $args = array()) {@command CloudWatchLogs DeleteRetentionPolicy}
* @method Model describeLogGroups(array $args = array()) {@command CloudWatchLogs DescribeLogGroups}
* @method Model describeLogStreams(array $args = array()) {@command CloudWatchLogs DescribeLogStreams}
* @method Model describeMetricFilters(array $args = array()) {@command CloudWatchLogs DescribeMetricFilters}
* @method Model getLogEvents(array $args = array()) {@command CloudWatchLogs GetLogEvents}
* @method Model putLogEvents(array $args = array()) {@command CloudWatchLogs PutLogEvents}
* @method Model putMetricFilter(array $args = array()) {@command CloudWatchLogs PutMetricFilter}
* @method Model putRetentionPolicy(array $args = array()) {@command CloudWatchLogs PutRetentionPolicy}
* @method Model setRetention(array $args = array()) {@command CloudWatchLogs SetRetention}
* @method Model testMetricFilter(array $args = array()) {@command CloudWatchLogs TestMetricFilter}
*
* @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-cloudwatchlogs.html User guide
* @link http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.CloudWatchLogs.CloudWatchLogsClient.html API docs
*/
class CloudWatchLogsClient extends AbstractClient
{
const LATEST_API_VERSION = '2014-03-28';

/**
* Factory method to create a new Amazon CloudWatch Logs client using an array of configuration options.
*
* See http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options
*
* @param array|Collection $config Client configuration data
*
* @return self
* @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options
*/
public static function factory($config = array())
{
return ClientBuilder::factory(__NAMESPACE__)
->setConfig($config)
->setConfigDefaults(array(
Options::VERSION => self::LATEST_API_VERSION,
Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudwatchlogs-%s.php'
))
->setExceptionParser(new JsonQueryExceptionParser())
->build();
}
}
10 changes: 10 additions & 0 deletions src/Aws/CloudWatchLogs/Exception/CloudWatchLogsException.php
@@ -0,0 +1,10 @@
<?php

namespace Aws\CloudWatchLogs\Exception;

use Aws\Common\Exception\ServiceResponseException;

/**
* Exception thrown by the CloudWatchLogs client.
*/
class CloudWatchLogsException extends ServiceResponseException {}

0 comments on commit ee302ac

Please sign in to comment.