Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-3223525
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
cloud-3223525
Commits
b47fe5bd
Commit
b47fe5bd
authored
8 years ago
by
Yas Naoi
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a typo "DescribeAddresses"
parent
0fe8e662
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/cloud_service_providers/aws_cloud/src/Controller/Ec2/ApiController.php
+13
-4
13 additions, 4 deletions
..._providers/aws_cloud/src/Controller/Ec2/ApiController.php
with
13 additions
and
4 deletions
modules/cloud_service_providers/aws_cloud/src/Controller/Ec2/ApiController.php
+
13
−
4
View file @
b47fe5bd
...
...
@@ -62,7 +62,8 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
/**
* {@inheritdoc}
*/
private
$is_dryrun
=
true
;
// true || false, _NOT_ TRUE or FALSE
//private $is_dryrun = true; // true || false, _NOT_ TRUE or FALSE
private
$is_dryrun
=
false
;
// true || false, _NOT_ TRUE or FALSE
/**
* {@inheritdoc}
...
...
@@ -382,6 +383,7 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
if
(
!
isset
(
$cloud_context
)
&&
!
$config
->
get
(
'aws_cloud_test_mode'
))
{
return
NULL
;
}
...
...
@@ -397,7 +399,8 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
// $mock = new MockHandler(array($this->getMockhandlerResult()));
$ec2_config
=
$config
->
get
(
'aws_cloud_test_mode'
)
?
array
(
// test mode
// test mode
?
array
(
'credentials'
=>
array
(
'key'
=>
bin2hex
(
openssl_random_pseudo_bytes
(
8
)),
'secret'
=>
bin2hex
(
openssl_random_pseudo_bytes
(
10
)),
...
...
@@ -406,6 +409,7 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
'version'
=>
'latest'
,
// 'handler' => $mock,
)
// Actual Client
:
array
(
'credentials'
=>
array
(
'key'
=>
$cloud_context
->
aws_access_key
(),
...
...
@@ -416,7 +420,10 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
'endpoint'
=>
$cloud_context
->
endpoint
(),
);
// @FIXME
// You may want to restart Apache2 (sytemctl restart apache2)
// if you encounter the error like: "Error: Class 'Aws\\Ec2\\Ec2Client' not found in
// /var/www/html/.../modules/cloud/modules/cloud_service_providers/aws_cloud/src/Controller/Ec2/ApiController.php
// on line 4xx.
$ec2_clients
=
Ec2Client
::
factory
(
$ec2_config
);
}
// until here
...
...
@@ -424,6 +431,8 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
}
// catch (UnresolvedApiException $e) {
catch
(
\Exception
$e
)
{
// @FIXME
// Handle exception properly
print
"passed: Exception:
$e
"
;
// var_dump($e);
exit
;
...
...
@@ -890,7 +899,7 @@ exit;
public
function
updateElasticIpList
(
ConfigInterface
$cloud_context
)
{
$entity_type
=
$entity_type
;
$operation
=
'DescribeAdd
e
rsses'
;
$operation
=
'DescribeAddr
e
sses'
;
$params
=
array
(
'DryRun'
=>
$this
->
is_dryrun
,
// true || false,
// 'AllocationIds' => array('<string>', ...),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment