Skip to content

Commit

Permalink
Whitespace/formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nVitius committed May 12, 2014
1 parent 4005fe7 commit b0c3a73
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 35 deletions.
3 changes: 2 additions & 1 deletion Aws/AutoScalingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class AutoScalingCommand extends AbstractAwsCommand
*
* @return AutoScalingClient
*/
protected function getClient() {
protected function getClient()
{
$credentials = $this->getCredentials();

$client = AutoScalingClient::factory(array(
Expand Down
2 changes: 1 addition & 1 deletion Aws/Ec2Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* Authenticates with AWS for use with EC2 commands
*
* @author Mauricio Walters <mwalters@undergroundelephant.com>
* @author Mauricio Walters <mwalters@undergroundelephant.com>
*/
class Ec2Command extends AbstractAwsCommand
{
Expand Down
90 changes: 58 additions & 32 deletions Command/Aws/Ec2/CreateImageCommand.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?php

/**
* Copyright 2014 Underground Elephant
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package aws-cli-bundle
* @copyright (c) 2014 Underground Elephant
* @license Apache License, Version 2.0
*/
* Copyright 2014 Underground Elephant
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package aws-cli-bundle
* @copyright (c) 2014 Underground Elephant
* @license Apache License, Version 2.0
*/

namespace Uecode\Bundle\AwsCliBundle\Command\Aws\Ec2;

Expand All @@ -30,9 +30,9 @@

/**
* Create Image command
*
* @link http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.Ec2.Ec2Client.html#_createImage
* @author Mauricio Walters <mwalters@undergroundelephant.com>
*
* @link http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.Ec2.Ec2Client.html#_createImage
* @author Mauricio Walters <mwalters@undergroundelephant.com>
*/
class CreateImageCommand extends Ec2Command
{
Expand All @@ -43,14 +43,41 @@ protected function configure()
{
$this
->setName('uecode:aws:ec2:createimage')
->setDescription('Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.')
->addArgument('Name', InputArgument::REQUIRED, 'A name for the new image.')
->addArgument('InstanceId', InputArgument::REQUIRED, 'The ID of the instance')
->addArgument('Description', InputArgument::OPTIONAL, 'A description for the new image.')
->addOption('BlockDeviceMappings', 'mappings', InputOption::VALUE_OPTIONAL, 'Information about one or more block device mappings. Takes JSON.')
->addOption('NoReboot', 'noreboot', InputOption::VALUE_NONE, 'Amazon EC2 will not shut down the instance before creating the image. Filesystem integrity is not guaranteed.')
->addOption('DryRun', 'dryrun', InputOption::VALUE_NONE, null)
;
->setDescription('Creates an Amazon EBS-backed AMI from an EBS-backed instance.')
->addArgument(
'Name',
InputArgument::REQUIRED,
'A name for the new image.'
)
->addArgument(
'InstanceId',
InputArgument::REQUIRED,
'The ID of the instance'
)
->addArgument(
'Description',
InputArgument::OPTIONAL,
'A description for the new image.'
)
->addOption(
'BlockDeviceMappings',
'mappings',
InputOption::VALUE_OPTIONAL,
'Information about one or more block device mappings. Takes JSON.'
)
->addOption(
'NoReboot',
'noreboot',
InputOption::VALUE_NONE,
'Amazon EC2 will not shut down the instance before creating the image.
Filesystem integrity is not guaranteed.'
)
->addOption(
'DryRun',
'dryrun',
InputOption::VALUE_NONE,
null
);
}

/**
Expand All @@ -62,9 +89,8 @@ protected function execute(InputInterface $input, OutputInterface $output)

$options['BlockDeviceMappings'] = json_decode($options['BlockDeviceMappings']);

$client = $this->getClient();
$result = $client->createImage($options);
$output->writeln('AMI Image created with id '.$result->get('ImageId'));
$result = $this->getClient()->createImage($options);
$output->writeln('AMI Image created with id ' . $result->get('ImageId'));

return self::COMMAND_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion Command/Aws/Ec2/DeregisterImageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Deregister Image command
*
* @link http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.Ec2.Ec2Client.html#_deregisterImage
* @author Mauricio Walters <mwalters@undergroundelephant.com>
* @author Mauricio Walters <mwalters@undergroundelephant.com>
*/
class DeregisterImageCommand extends Ec2Command
{
Expand Down

0 comments on commit b0c3a73

Please sign in to comment.